Skip to content

MSL: Treat pointer to vector as scalar type when bitcasting#2452

Merged
HansKristian-Work merged 1 commit intoKhronosGroup:mainfrom
dboyan:fix-2451
Mar 10, 2025
Merged

MSL: Treat pointer to vector as scalar type when bitcasting#2452
HansKristian-Work merged 1 commit intoKhronosGroup:mainfrom
dboyan:fix-2451

Conversation

@dboyan
Copy link
Copy Markdown
Contributor

@dboyan dboyan commented Mar 3, 2025

Otherwise, they will be misregarded as vectors and can be used in as_type, which does not support pointer type as destination.

Fixes #2451

Copy link
Copy Markdown
Contributor

@cdavis5e cdavis5e left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change itself looks good, but needs a test case.

@squidbus
Copy link
Copy Markdown
Contributor

squidbus commented Mar 3, 2025

Can confirm this fixes the shader issue I had, thanks!

Otherwise, they will be misregarded as vectors and can be used in
as_type, which does not support pointer type as destination.
@dboyan
Copy link
Copy Markdown
Contributor Author

dboyan commented Mar 4, 2025

I added a test case taken from the original bug report. It's a little bit long but glslang doesn't generate the spirv I want and I'm not proficient enough to edit raw spirv assembly.

@dboyan dboyan requested a review from cdavis5e March 4, 2025 04:34
Copy link
Copy Markdown
Contributor

@cdavis5e cdavis5e left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, FWIW. But, I lack authority to merge changes to this repo. H-K tends to be away from this project for long periods. You'll have to wait till he gets back--and he may have feedback of his own.

@HansKristian-Work
Copy link
Copy Markdown
Contributor

Seems correct, but it's using the wrong way to check for is_pointer. It's also done "wrong" in the surrounding code, so I'll just fix that as a follow-up.

@HansKristian-Work HansKristian-Work merged commit a8834b0 into KhronosGroup:main Mar 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MSL: Accessing buffer address as vector pointer not compiling

4 participants