diff options
author | Hans-Kristian Arntzen <post@arntzen-software.no> | 2022-11-02 15:07:32 +0300 |
---|---|---|
committer | Hans-Kristian Arntzen <post@arntzen-software.no> | 2022-11-02 15:07:32 +0300 |
commit | 3a066cd73394b1cb2f869da2822bb6a80dafe8d7 (patch) | |
tree | ea64790753f91447d191dd4aa070b5a9e0271650 /reference | |
parent | f5ef0a74fbf1b7b07192c554b8e30fe18f79c35c (diff) |
HLSL: Handle case where PerVertex block is not used.
Diffstat (limited to 'reference')
-rw-r--r-- | reference/shaders-hlsl-no-opt/asm/mesh/mesh-shader-plain-builtin-outputs.spv14.asm.vk.nocompat.mesh | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/reference/shaders-hlsl-no-opt/asm/mesh/mesh-shader-plain-builtin-outputs.spv14.asm.vk.nocompat.mesh b/reference/shaders-hlsl-no-opt/asm/mesh/mesh-shader-plain-builtin-outputs.spv14.asm.vk.nocompat.mesh new file mode 100644 index 00000000..2f4e548d --- /dev/null +++ b/reference/shaders-hlsl-no-opt/asm/mesh/mesh-shader-plain-builtin-outputs.spv14.asm.vk.nocompat.mesh @@ -0,0 +1,63 @@ +struct _12 +{ + float _m0; +}; + +static uint gl_LocalInvocationIndex; +struct SPIRV_Cross_Input +{ + uint gl_LocalInvocationIndex : SV_GroupIndex; +}; + +struct gl_MeshPerVertexEXT +{ + float4 B : TEXCOORD1; + float4 gl_Position : SV_Position; +}; + +struct gl_MeshPerPrimitiveEXT +{ + float4 C : TEXCOORD3; + uint gl_PrimitiveID : SV_PrimitiveID; + uint gl_Layer : SV_RenderTargetArrayIndex; + bool gl_CullPrimitiveEXT : SV_CullPrimitive; +}; + +groupshared float _9[64]; + +void mesh_main(inout gl_MeshPerVertexEXT gl_MeshVerticesEXT[24], _12 _11, inout uint3 gl_PrimitiveTriangleIndicesEXT[8], inout gl_MeshPerPrimitiveEXT gl_MeshPrimitivesEXT[8]) +{ + _9[gl_LocalInvocationIndex] = float(gl_LocalInvocationIndex); + GroupMemoryBarrierWithGroupSync(); + SetMeshOutputCounts(24u, 8u); + gl_Position[gl_LocalInvocationIndex].x = _9[gl_LocalInvocationIndex]; + gl_Position[gl_LocalInvocationIndex].y = _9[gl_LocalInvocationIndex]; + gl_Position[gl_LocalInvocationIndex].z = _9[gl_LocalInvocationIndex]; + gl_Position[gl_LocalInvocationIndex].w = _9[gl_LocalInvocationIndex]; + float _63 = _11._m0 + _9[gl_LocalInvocationIndex ^ 1u]; + gl_MeshVerticesEXT[gl_LocalInvocationIndex].B.x = _63; + gl_MeshVerticesEXT[gl_LocalInvocationIndex].B.y = _63; + gl_MeshVerticesEXT[gl_LocalInvocationIndex].B.z = _63; + gl_MeshVerticesEXT[gl_LocalInvocationIndex].B.w = _63; + if (gl_LocalInvocationIndex < 8u) + { + uint _71 = gl_LocalInvocationIndex * 3u; + gl_PrimitiveTriangleIndicesEXT[gl_LocalInvocationIndex] = uint3(_71, _71 + 1u, _71 + 2u); + gl_CullPrimitiveEXT[gl_LocalInvocationIndex] = (gl_LocalInvocationIndex & 1u) != 0u; + gl_PrimitiveID[gl_LocalInvocationIndex] = int(gl_LocalInvocationIndex); + gl_Layer[gl_LocalInvocationIndex] = int(gl_LocalInvocationIndex); + uint _81 = gl_LocalInvocationIndex ^ 2u; + gl_MeshPrimitivesEXT[gl_LocalInvocationIndex].C.x = _9[_81]; + gl_MeshPrimitivesEXT[gl_LocalInvocationIndex].C.y = _9[_81]; + gl_MeshPrimitivesEXT[gl_LocalInvocationIndex].C.z = _9[_81]; + gl_MeshPrimitivesEXT[gl_LocalInvocationIndex].C.w = _9[_81]; + } +} + +[outputtopology("triangle")] +[numthreads(2, 3, 4)] +void main(SPIRV_Cross_Input stage_input, out vertices gl_MeshPerVertexEXT gl_MeshVerticesEXT[24], in payload _12 _11, out indices uint3 gl_PrimitiveTriangleIndicesEXT[8], out primitives gl_MeshPerPrimitiveEXT gl_MeshPrimitivesEXT[8]) +{ + gl_LocalInvocationIndex = stage_input.gl_LocalInvocationIndex; + mesh_main(gl_MeshVerticesEXT, _11, gl_PrimitiveTriangleIndicesEXT, gl_MeshPrimitivesEXT); +} |