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

spirv-val: Disallow stores according to VUID 06924 #5368

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

svenvh
Copy link
Member

@svenvh svenvh commented Aug 9, 2023

Ensure that the validator rejects stores to objects of types
OpTypeSampledImage and OpTypeAccelerationStructureKHR, according
to VUID-StandaloneSpirv-OpTypeImage-06924.

Stores to objects of types OpTypeImage and OpTypeSampler should be
rejected too, but HLSL-to-SPIR-V translation by glslang and shaderc
seems to result in some violations; so leave validation of those as
future work.

Contributes to #4796

@svenvh
Copy link
Member Author

svenvh commented Aug 9, 2023

If I understand the CI failures correctly, HLSL-to-SPIR-V translation by glslang and shaderc seems to result in some violations of this VUID, as HLSL allows the construct. Any suggestions what to do here?

@alan-baker
Copy link
Contributor

What does glslang do in the GLSL path when you have a local acceleration structure variable?

@svenvh
Copy link
Member Author

svenvh commented Aug 10, 2023

GLSL allows acceleration structures (and images/samplers) only as uniforms or function parameters, and glslang diagnoses incorrect uses:

ERROR: 0:10: 'accelerationStructureNV' : accelerationStructureNV can only be used in uniform variables or function parameters

@alan-baker
Copy link
Contributor

Does DXC handle this? I expect this is a case where glslang is missing some legalization optimizations.

@spencer-lunarg
Copy link
Contributor

Does this check cases where there is a OpImageWrite through an OpLoad or and Atomic instructions?

@svenvh
Copy link
Member Author

svenvh commented Sep 25, 2023

Does this check cases where there is a OpImageWrite through an OpLoad or and Atomic instructions?

OpImageWrite is checked elsewhere (in ValidateImageWrite) as far as I can tell.

Ensure that the validator rejects stores to objects of types
`OpTypeSampledImage` and `OpTypeAccelerationStructureKHR`, according
to `VUID-StandaloneSpirv-OpTypeImage-06924`.

Stores to objects of types `OpTypeImage` and `OpTypeSampler` should be
rejected too, but HLSL-to-SPIR-V translation by glslang and shaderc
seems to result in some violations; so leave validation of those as
future work.

Contributes to KhronosGroup#4796

Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
@svenvh
Copy link
Member Author

svenvh commented Apr 19, 2024

To progress on this, I've excluded validation of stores to objects of types OpTypeImage and OpTypeSampler.

@svenvh svenvh marked this pull request as ready for review April 19, 2024 13:25
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.

None yet

3 participants