remove has_capability() checks#531
Open
Firestar99 wants to merge 2 commits into
Open
Conversation
c38ccd4 to
784c8c8
Compare
784c8c8 to
ddbc0c2
Compare
ddbc0c2 to
3874f69
Compare
eddyb
requested changes
Jul 10, 2026
Comment on lines
-53
to
+56
| if self.builder.has_capability(Capability::ShaderNonUniform) { | ||
| // apply NonUniform to the operation and the index | ||
| self.emit() | ||
| .decorate(ptr.def(self), Decoration::NonUniform, []); | ||
| self.emit() | ||
| .decorate(actual_index, Decoration::NonUniform, []); | ||
| } | ||
| // apply NonUniform to the operation and the index | ||
| self.emit() | ||
| .decorate(ptr.def(self), Decoration::NonUniform, []); | ||
| self.emit() | ||
| .decorate(actual_index, Decoration::NonUniform, []); |
Member
There was a problem hiding this comment.
Can you add a test using this feature, but not enabling ShaderNonUniform?
It should trigger a validation error from the new SPIR-T-based validation pass, if I'm not mistaken.
Comment on lines
571
to
+575
| fn zombie_ptr_equal(&self, def: Word, inst: &str) { | ||
| if !self.builder.has_capability(Capability::VariablePointers) { | ||
| self.zombie( | ||
| def, | ||
| &format!("{inst} without OpCapability VariablePointers"), | ||
| ); | ||
| } | ||
| self.zombie( | ||
| def, | ||
| &format!("{inst} without OpCapability VariablePointers"), | ||
| ); |
Member
There was a problem hiding this comment.
This one is weird. I would almost want to say that the instruction is not yet supported, rather than claiming any connection to VariablePointers (which doesn't give you pointer equality in general, just in very narrow cases).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
BuilderSpirv::has_capability(&self, capability: Capability) -> bool, you can no longer check whether some capability is enabled. Progress towards RFC: link-time capabilities #388has_capabilitycheck)