Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/KhronosGroup/SPIRV-Cross.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans-Kristian Arntzen <post@arntzen-software.no>2022-11-02 15:41:32 +0300
committerHans-Kristian Arntzen <post@arntzen-software.no>2022-11-02 15:41:32 +0300
commitb606e4f7525acf63e8f3eb041bf9a4863ac688b7 (patch)
tree5237896ea791ea3fe3febc4ac83ec7728f738bc2
parentebf779dcfbeca9f6609fb825cda342621f0c7607 (diff)
HLSL: Fix test for non-block per-primitive IO.
Force gl_in_out path for HLSL as well when mesh shaders are used.
-rw-r--r--reference/shaders-hlsl-no-opt/asm/mesh/mesh-shader-plain-builtin-outputs.spv14.asm.vk.nocompat.mesh14
-rw-r--r--spirv_hlsl.cpp1
2 files changed, 8 insertions, 7 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
index 2f4e548d..8fbd2915 100644
--- 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
@@ -30,10 +30,10 @@ void mesh_main(inout gl_MeshPerVertexEXT gl_MeshVerticesEXT[24], _12 _11, inout
_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];
+ gl_MeshVerticesEXT[gl_LocalInvocationIndex].gl_Position.x = _9[gl_LocalInvocationIndex];
+ gl_MeshVerticesEXT[gl_LocalInvocationIndex].gl_Position.y = _9[gl_LocalInvocationIndex];
+ gl_MeshVerticesEXT[gl_LocalInvocationIndex].gl_Position.z = _9[gl_LocalInvocationIndex];
+ gl_MeshVerticesEXT[gl_LocalInvocationIndex].gl_Position.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;
@@ -43,9 +43,9 @@ void mesh_main(inout gl_MeshPerVertexEXT gl_MeshVerticesEXT[24], _12 _11, inout
{
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);
+ gl_MeshPrimitivesEXT[gl_LocalInvocationIndex].gl_CullPrimitiveEXT = (gl_LocalInvocationIndex & 1u) != 0u;
+ gl_MeshPrimitivesEXT[gl_LocalInvocationIndex].gl_PrimitiveID = int(gl_LocalInvocationIndex);
+ gl_MeshPrimitivesEXT[gl_LocalInvocationIndex].gl_Layer = int(gl_LocalInvocationIndex);
uint _81 = gl_LocalInvocationIndex ^ 2u;
gl_MeshPrimitivesEXT[gl_LocalInvocationIndex].C.x = _9[_81];
gl_MeshPrimitivesEXT[gl_LocalInvocationIndex].C.y = _9[_81];
diff --git a/spirv_hlsl.cpp b/spirv_hlsl.cpp
index f06fb47e..48aabef4 100644
--- a/spirv_hlsl.cpp
+++ b/spirv_hlsl.cpp
@@ -6550,6 +6550,7 @@ string CompilerHLSL::compile()
backend.nonuniform_qualifier = "NonUniformResourceIndex";
backend.support_case_fallthrough = false;
backend.force_merged_mesh_block = get_execution_model() == ExecutionModelMeshEXT;
+ backend.force_gl_in_out_block = backend.force_merged_mesh_block;
// SM 4.1 does not support precise for some reason.
backend.support_precise_qualifier = hlsl_options.shader_model >= 50 || hlsl_options.shader_model == 40;