-
Notifications
You must be signed in to change notification settings - Fork 573
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
False positive validation for combined image sampler with comparison #5781
Comments
@alan-baker I think it's this commit: 70ad4da. There is no reference to spec language in this commit. This is breaking glslang output which has been used since day 1, which is a good indication this commit should be reverted. |
The description of OpSampledImage says:
https://registry.khronos.org/SPIR-V/specs/unified1/SPIRV.html#OpSampledImage In this case, the image type changes because they have different depth:
|
Filed an internal spec issue to relax this. Trying to validate for different Depth is the problem here, and "no-one" follows that rule, for good reason. Breaking the shader ecosystem this late is not ideal. |
SPIR WG discussed this in the 2024-09-04 telecon. Decision was to relax the specific to allow the depth operand to mismatch due to the large existing corpus of shaders in violation of this rule. Two steps for SPIRV-Tools:
|
Fixes KhronosGroup#5781 * Requires all image operands to match except for depth between operand and result
Fixes KhronosGroup#5781 * Requires all image operands to match except for depth between operand and result
Fixes #5781 * Requires all image operands to match except for depth between operand and result
…Group#5785) This reverts commit 70ad4da. Contributes to KhronosGroup#5781 SPIR WG 2024-09-04: decision to relax validation requirement in the spec.
Fixes KhronosGroup#5781 * Requires all image operands to match except for depth between operand and result
I'm trying to rev toolchain dependencies in SPIRV-Cross, and ran into a weird validation error that started appearing since last time I revved the toolchain.
GLSL:
ASM:
spirv-val commit
b21dda0ee7a3ea4e0192a7b2b09db1df1de9d5e7
:The problem happens in
sampler2DShadow(tex, samp)
where we now know the combined image sampler is a depth texture. I can't find any wording in the SPIR-V or Vulkan specs which state that the image type for OpTypeCombinedSampler must match the type of the image exactly.Where in the spec does it say this? If so, that is a problem because otherwise, separate image samplers are not really possible to implement since an image can be used both as comparison sampler and non-comparison sampler in the same shader. Also, array of descriptors has to be considered where index 0 may be a depth texture and index 1 is not.
The text was updated successfully, but these errors were encountered: