-
Notifications
You must be signed in to change notification settings - Fork 844
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
RuntimeArray within a RuntimeArray generated from HLSL #2439
RuntimeArray within a RuntimeArray generated from HLSL #2439
Comments
@greg-lunarg Do you have any comments on this? |
ping. anybody take a look? |
Hi. Sorry missed your first ping. Yes, I will take a look. |
ping |
Very sorry for the delayed response. This shader is not a valid Vulkan shader. It violates the following rule from the Vulkan spec:
The OutputStruct type (%17) violates this rule ie. it contains a runtime array but it does not have a BufferBlock decoration. When compiling for Vulkan, this should raise an error from glslang. So this is a bug with glslang and should be fixed ie. an error message needs to be generated when compiling for Vulkan. Additionally, the CTS test is invalid and should have an issue raised. In addition, spirv-val does not catch this condition and should have an issue raised. Final note to developer: when compiling for Vulkan1.2 (post-SPIRV1.3), should use Block decoration on Output type (%19) instead of BufferBlock which is deprecated after SPIRV1.3. |
Note on last note: SPIRV1.4 can be used with Vulkan1.1 and 1.0, so the SPIR-V version (> 1.3) should be the only determinant on using the Block decoration. |
Partially fixes KhronosGroup/glslang#2439 * When OpTypeStruct is used in Vulkan env and its last member is a RuntimeArray, check if the struct is decorated with Block or BufferBlock, as required by VUID-...-04680.
Partially fixes KhronosGroup/glslang#2439 * When OpTypeStruct is used in Vulkan env and its last member is a RuntimeArray, check if the struct is decorated with Block or BufferBlock, as required by VUID-...-04680.
Partially fixes KhronosGroup/glslang#2439 * When OpTypeStruct is used in Vulkan env and its last member is a RuntimeArray, check if the struct is decorated with Block or BufferBlock, as required by VUID-...-04680.
Fixes KhronosGroup#2439 When decorating a struct for Vulkan, add [Buffer]Block decoration if the struct has a RuntimeArray member, as required by VUID-...-04680.
Fixes #2439 When decorating a struct for Vulkan, add [Buffer]Block decoration if the struct has a RuntimeArray member, as required by VUID-...-04680.
Contributes to KhronosGroup/glslang#2439 * When OpTypeStruct is used in Vulkan env and its last member is a RuntimeArray, check if the struct is decorated with Block or BufferBlock, as required by VUID-...-04680.
Fixes KhronosGroup#2439 When decorating a struct for Vulkan, add [Buffer]Block decoration if the struct has a RuntimeArray member, as required by VUID-...-04680.
I am investigating an issue when running vulkancts.
https://github.com/KhronosGroup/VK-GL-CTS/blob/master/external/vulkancts/modules/vulkan/tessellation/vktTessellationFractionalSpacingTests.cpp#L498
The tessellation evaluation shader is written in hlsl:
I compiled with
./glslangValidator -e main -V 1.tese.hlsl -o 1.spv; spirv-dis --raw-id 1.spv -o -
The compiled spv is below:
The problematic piece is:
This means that the RWStructuredBuffer
Output
was translated asOpTypeRuntimeArray
, astessCoord
is also translated asOpTypeRuntimeArray
. This causes a situation that a run-time array was included in another run-time array, on which our compiler has some issue. I am not sure is this expected behaviour? In fact, theOutput
is only referenced byOutput[0]
, so I think we can just treat it as an array with length 1?The text was updated successfully, but these errors were encountered: