-
Notifications
You must be signed in to change notification settings - Fork 575
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
Fix volatile helper invocation in non-main functions #2360
Fix volatile helper invocation in non-main functions #2360
Conversation
@@ -8,18 +10,24 @@ struct main0_out | |||
float FragColor [[color(0)]]; | |||
}; | |||
|
|||
static inline __attribute__((always_inline)) | |||
void func(thread float& FragColor, volatile thread bool& gl_HelperInvocation) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
volatile thread seems like it's asking for trouble with spilling. volatile thread is somewhat meaningless. I know this comes up because in later SPIR-V discard + helper lane is done through volatile StorageClassInput.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think we should just avoid volatile
on thread
variables in general?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nits.
228d148
to
467ba39
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems okay.
One of our tests only passed because it operated out of the entry point and would fail if you tried to do the same thing from any other function. This makes it work no matter where it is.
Note: I couldn't think of any better names for the new variable than just adding an underscore. If anyone else has a better name, please use it.