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

Add is_helper_invocation, and cleanup arch & asm functions #612

Merged
merged 1 commit into from
May 4, 2021

Conversation

XAMPPRocky
Copy link
Member

Cleaning up and removing all the asm uses of OpCapability, and also added is_helper_invocation, also made demote_to_helper_invocation unsafe, as using it has side effects that make variables undefined.

@XAMPPRocky XAMPPRocky requested review from eddyb and khyperia May 4, 2021 07:54
@XAMPPRocky XAMPPRocky force-pushed the cleanup branch 2 times, most recently from 41809a4 to eda58b4 Compare May 4, 2021 07:55
/// non-uniform) and does not terminate the block.
///
/// - **Required Capabilities** `DemoteToHelperInvocationEXT`
/// - **Required Extensions** `SPV_EXT_demote_to_helper_invocation`
Copy link
Contributor

@khyperia khyperia May 4, 2021

Choose a reason for hiding this comment

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

Turning these into #[cfg] on the method would be nice and is something we should do eventually, but not required right now. (Same thing on derivatives, etc.)

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, and I think we'd want to do more than #[cfg], as when it's cfg'ed out, the error will just be "demote_to_helper_invocation not found", when ideally the error message would tell you, you need those capabilities and extensions.

Copy link
Contributor

Choose a reason for hiding this comment

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

... as in, doing a custom cfg attribute? we already decided against that in our discussions though, I'm confused

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm not sure how it would be exactly, but I meant more like a macro which just expands to two versions of the function containing the cfg and a better message similar to gpu_only.

crates/spirv-std/src/arch.rs Show resolved Hide resolved
@XAMPPRocky XAMPPRocky enabled auto-merge (squash) May 4, 2021 10:47
@XAMPPRocky XAMPPRocky merged commit 9c19414 into main May 4, 2021
@XAMPPRocky XAMPPRocky deleted the cleanup branch May 4, 2021 10:51
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.

2 participants