Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SPIR-V] Fix bad OpLoad on loaded texture #6985

Merged
merged 1 commit into from
Oct 28, 2024
Merged

Conversation

Keenuts
Copy link
Collaborator

@Keenuts Keenuts commented Oct 24, 2024

This code path always added an OpLoad since it expected either an OpAccessChain or a variable.
This is wrong if we get the texture from a called function.

There is one thing I do find weird is the OpAccessChain result is considered to be an L-value. But I'd expect this to be an r-value.

Fixes #4136

This code path always added an OpLoad since it expected either
an OpAccessChain or a variable.
This is wrong if we get the texture from a called function.

There is one thing I do find weird is the OpAccessChain result
is considered to be an L-value. But I'd expect this to be an r-value.

Fixes microsoft#4136

Signed-off-by: Nathan Gauër <[email protected]>
@Keenuts Keenuts requested a review from a team as a code owner October 24, 2024 14:24
Copy link
Collaborator

@cassiebeckley cassiebeckley left a comment

Choose a reason for hiding this comment

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

It makes sense to me that the OpAccessChain result is treated as an l-value – OpAccessChain always returns a pointer, which can be assigned to.

@s-perron s-perron merged commit ee1f013 into microsoft:main Oct 28, 2024
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

[SPIR-V] Invalid SPIR-V generated when using RW resource returned from function
3 participants