Generate reflect::is_xxx() helpers directly in the spirv header
#269
+208
−110
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.
We've had a lot of bugs surfacing from the fact that the manual
rspirv::grammar::reflectmodule required hand-adding variousspirvops tomatchstatements to let the code behave, despite being able to very trivially autogenerate this based on the SPIR-V grammar. By doing so we find quite a few instructions that weren't handled by the hand-written table. Foris_type()those are:OpTypePipeStorageOpTypeNamedBarrierOpTypeUntypedPointerKHROpTypeNodePayloadArrayAMDXOpTypeHitObjectNVOpTypeCooperativeVectorNVOpTypeCooperativeMatrixNVOpTypeTensorLayoutNVOpTypeTensorViewNVOpTypeBufferSurfaceINTELOpTypeStructContinuedINTELFor
is_constant():OpConstantCompositeReplicateEXTOpSpecConstantCompositeReplicateEXTFor
is_annotation():OpDecorateIdFor
is_debug()(viais_nonlocation_debug()):OpModuleProcessedUnfortunately classes only convey the
Control-Flowmarker which doesn't provide enough detail to distinguish between returns, aborts or branches (or anything not specified). Even if our crates only ever callis_block_terminator()which is a composite of all those checks, not allControl-Flowopcodes are supposed to be treated as a terminator.