You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The generated code is invalid (breaks VUID-RuntimeSpirv-OpImageWrite-07112)
OpImageWrite to any Image whose Image Format is not Unknown must have the Texel operand contain at least as many components as the corresponding [VkFormat](https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VkFormat.html) as given in the [SPIR-V Image Format compatibility table](https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#spirvenv-image-formats)
Reason is we default the image format to RGBA32F instead of unknown.
A quick inspection in DXC showed we set it to unknown at first, but then the information is ignored when the type is lowered, and the image format is selected depending on the sampled type (float3), hence RGBA32F, since RGB32F doesn't exists.
Since we emit programs with the shader capability, we could enable StorageImageReadWithoutFormat and keep the format as unknown.
The text was updated successfully, but these errors were encountered:
This commit aim to fixmicrosoft#4773. In SPIR-V, image type must be specified,
and GLSL has the syntax for it. In HLSL, we don't, until microsoft#3395.
When this attribute is not specified, we decided to guess the type, not
using Unknown anymore.
But the type guessing was a bit too optimistic, and thus allowed a 3
component layout to be upgraded to 4 component layout.
Changing the guessing function to either give a close type, or return
Unknown, adding the capability on load/store to the variable.
This commit aim to fix#4773. In SPIR-V, image type must be specified,
and GLSL has the syntax for it. In HLSL, we don't, until #3395.
When this attribute is not specified, we decided to guess the type, not
using Unknown anymore.
But the type guessing was a bit too optimistic, and thus allowed a 3
component layout to be upgraded to 4 component layout.
Changing the guessing function to either give a close type, or return
Unknown, adding the capability on load/store to the variable.
Issue derived from (#4772)
HLSL has attributes to specify the texture format (https://github.com/microsoft/DirectXShaderCompiler/blob/main/docs/SPIR-V.rst#textures).
When not specified, the fallback is Rgba32f (first type of the list).
Given this sample:
and this command:
The generated code is invalid (breaks VUID-RuntimeSpirv-OpImageWrite-07112)
Reason is we default the image format to RGBA32F instead of unknown.
A quick inspection in DXC showed we set it to unknown at first, but then the information is ignored when the type is lowered, and the image format is selected depending on the sampled type (float3), hence RGBA32F, since RGB32F doesn't exists.
Since we emit programs with the
shader
capability, we could enableStorageImageReadWithoutFormat
and keep the format asunknown
.The text was updated successfully, but these errors were encountered: