KhronosGroup/SPIRV-Tools

Regression: a valid interface block in mesh/task shader is considered invalid

zeux opened this issue · 0 comments

zeux commented

I think this is a regression since #3308.

Attached are the mesh & task shaders from niagara (https://github.com/zeux/niagara). Part of the shader is the following interface block that is required to pass data between task & mesh shaders:

in taskNV block
{
	uint meshletIndices[32];
};

Compiling the shaders as follows:

glslangValidator shader.glsl -V --target-env vulkan1.2 -o shader.spv

And validating them with --target-env vulkan1.2 produces the following errors:

C:\work\niagara\src\shaders>C:\VulkanSDK\1.2.148.0\Bin\spirv-val.exe --target-env vulkan1.2 meshlet.mesh.spv
error: line 225: Member index 0 is missing a location assignment
  %block = OpTypeStruct %_arr_uint_uint_32

C:\work\niagara\src\shaders>C:\VulkanSDK\1.2.148.0\Bin\spirv-val.exe --target-env vulkan1.2 meshlet.task.spv
error: line 207: Member index 0 is missing a location assignment
  %block = OpTypeStruct %_arr_uint_uint_32

The problem is that these blocks have to have no location assignments - trying to add one causes glslang to emit the following error:

'location' : cannot apply to taskNV in/out blocks

meshlet.zip