Begin validating some SPIR-V extensions/capabilities (esp. IntN
/FloatN
) on SPIR-T.
#332
+738
−139
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.
(Each commit should be reviewed separately)
Quick preview (from the diff of the last commit):
This is the start of the strategy I was describing back in:
(this also describes what "zombies" are - oh, and, did the issue migration bot break??)
What made me go back to this was looking at this PR:
And realizing that the
check_type_capabilities
it added was closer to the SPIR-T-based error reporting (which isn't really used yet, unless a SPIR-T pass emits a diagnostic, or ifRUSTGPU_CODEGEN_ARGS=--no-early-report-zombies
is used, which turns off the old zombie reporting logic and lets them be treated like SPIR-T diagnostics).However, there's two issues with the kind of ad-hoc reporting that
check_type_capabilities
does:spirv-val
errors are just as bad (another reason to prefer SPIR-T-based validation)main
, but my local branch runs into e.g. requiringInt8
because of pointer arithmetic thatqptr
completely rewrites awayCapability is required unexpectedly for constant cast #300
(I haven't tested it yet but the
reduce
pass w/ const-folding might already do that!)In the interest of completeness/uniformity, I did add a few more SPIR-V extension/capability checks, which may impact some users, so this may need a bit more testing.
(Though, worst case, it will force you to add an extension/capability that is redundant with another, or with a SPIR-V version that is recent enough to have already incorporated an extension, or part thereof, etc.)