From 4a6e8899745a46490b850600ec4b5325f2e67c91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=91=D1=80=D0=B0=D0=BD=D0=B8=D0=BC=D0=B8=D1=80=20=D0=9A?= =?UTF-8?q?=D0=B0=D1=80=D0=B0=D1=9F=D0=B8=D1=9B?= Date: Sat, 20 Apr 2019 15:48:41 -0700 Subject: [PATCH] Updated spirv-cross. --- ...s-fixed-input-array-builtin-array.invalid.asm.tesc | 2 +- .../shaders-msl/asm/tesc/tess-level-overrun.asm.tesc | 2 +- .../desktop-only/tesc/arrayed-output.desktop.sso.tesc | 2 +- .../desktop-only/tesc/basic.desktop.sso.tesc | 2 +- .../desktop-only/tesc/struct-copy.desktop.sso.tesc | 2 +- .../reference/opt/shaders-msl/tesc/basic.tesc | 2 +- .../reference/opt/shaders-msl/tesc/water_tess.tesc | 2 +- ...s-fixed-input-array-builtin-array.invalid.asm.tesc | 2 +- .../shaders-msl/asm/tesc/tess-level-overrun.asm.tesc | 2 +- .../desktop-only/tesc/arrayed-output.desktop.sso.tesc | 2 +- .../desktop-only/tesc/basic.desktop.sso.tesc | 2 +- .../desktop-only/tesc/struct-copy.desktop.sso.tesc | 2 +- .../spirv-cross/reference/shaders-msl/tesc/basic.tesc | 2 +- .../reference/shaders-msl/tesc/water_tess.tesc | 2 +- 3rdparty/spirv-cross/spirv_msl.cpp | 11 +++++++++-- 15 files changed, 23 insertions(+), 16 deletions(-) diff --git a/3rdparty/spirv-cross/reference/opt/shaders-msl/asm/tesc/tess-fixed-input-array-builtin-array.invalid.asm.tesc b/3rdparty/spirv-cross/reference/opt/shaders-msl/asm/tesc/tess-fixed-input-array-builtin-array.invalid.asm.tesc index 0a2bb6bfd..bbda7be5b 100644 --- a/3rdparty/spirv-cross/reference/opt/shaders-msl/asm/tesc/tess-fixed-input-array-builtin-array.invalid.asm.tesc +++ b/3rdparty/spirv-cross/reference/opt/shaders-msl/asm/tesc/tess-fixed-input-array-builtin-array.invalid.asm.tesc @@ -46,7 +46,7 @@ void spvArrayCopyFromConstant1(thread T (&dst)[N], constant T (&src)[N]) for (uint i = 0; i < N; dst[i] = src[i], i++); } -kernel void main0(main0_in in [[stage_in]], uint gl_InvocationID [[thread_index_in_threadgroup]], uint gl_PrimitiveID [[threadgroup_position_in_grid]], device main0_out* spvOut [[buffer(28)]], device uint* spvIndirectParams [[buffer(29)]], device MTLTriangleTessellationFactorsHalf* spvTessLevel [[buffer(26)]], threadgroup main0_in* gl_in [[threadgroup(0)]]) +kernel void main0(main0_in in [[stage_in]], uint gl_InvocationID [[thread_index_in_threadgroup]], uint gl_PrimitiveID [[threadgroup_position_in_grid]], device main0_out* spvOut [[buffer(28)]], constant uint* spvIndirectParams [[buffer(29)]], device MTLTriangleTessellationFactorsHalf* spvTessLevel [[buffer(26)]], threadgroup main0_in* gl_in [[threadgroup(0)]]) { device main0_out* gl_out = &spvOut[gl_PrimitiveID * 3]; if (gl_InvocationID < spvIndirectParams[0]) diff --git a/3rdparty/spirv-cross/reference/opt/shaders-msl/asm/tesc/tess-level-overrun.asm.tesc b/3rdparty/spirv-cross/reference/opt/shaders-msl/asm/tesc/tess-level-overrun.asm.tesc index ac15a1fa8..6c9903e02 100644 --- a/3rdparty/spirv-cross/reference/opt/shaders-msl/asm/tesc/tess-level-overrun.asm.tesc +++ b/3rdparty/spirv-cross/reference/opt/shaders-msl/asm/tesc/tess-level-overrun.asm.tesc @@ -13,7 +13,7 @@ struct TessLevels float outer3; }; -kernel void main0(const device TessLevels& sb_levels [[buffer(0)]], uint gl_InvocationID [[thread_index_in_threadgroup]], uint gl_PrimitiveID [[threadgroup_position_in_grid]], device uint* spvIndirectParams [[buffer(29)]], device MTLTriangleTessellationFactorsHalf* spvTessLevel [[buffer(26)]]) +kernel void main0(const device TessLevels& sb_levels [[buffer(0)]], uint gl_InvocationID [[thread_index_in_threadgroup]], uint gl_PrimitiveID [[threadgroup_position_in_grid]], constant uint* spvIndirectParams [[buffer(29)]], device MTLTriangleTessellationFactorsHalf* spvTessLevel [[buffer(26)]]) { spvTessLevel[gl_PrimitiveID].insideTessellationFactor = half(sb_levels.inner0); spvTessLevel[gl_PrimitiveID].edgeTessellationFactor[0] = half(sb_levels.outer0); diff --git a/3rdparty/spirv-cross/reference/opt/shaders-msl/desktop-only/tesc/arrayed-output.desktop.sso.tesc b/3rdparty/spirv-cross/reference/opt/shaders-msl/desktop-only/tesc/arrayed-output.desktop.sso.tesc index 699493613..a5e30b6de 100644 --- a/3rdparty/spirv-cross/reference/opt/shaders-msl/desktop-only/tesc/arrayed-output.desktop.sso.tesc +++ b/3rdparty/spirv-cross/reference/opt/shaders-msl/desktop-only/tesc/arrayed-output.desktop.sso.tesc @@ -18,7 +18,7 @@ struct main0_in float3 vInput [[attribute(0)]]; }; -kernel void main0(main0_in in [[stage_in]], uint gl_InvocationID [[thread_index_in_threadgroup]], uint gl_PrimitiveID [[threadgroup_position_in_grid]], device main0_out* spvOut [[buffer(28)]], device uint* spvIndirectParams [[buffer(29)]], device main0_patchOut* spvPatchOut [[buffer(27)]], device MTLQuadTessellationFactorsHalf* spvTessLevel [[buffer(26)]], threadgroup main0_in* gl_in [[threadgroup(0)]]) +kernel void main0(main0_in in [[stage_in]], uint gl_InvocationID [[thread_index_in_threadgroup]], uint gl_PrimitiveID [[threadgroup_position_in_grid]], device main0_out* spvOut [[buffer(28)]], constant uint* spvIndirectParams [[buffer(29)]], device main0_patchOut* spvPatchOut [[buffer(27)]], device MTLQuadTessellationFactorsHalf* spvTessLevel [[buffer(26)]], threadgroup main0_in* gl_in [[threadgroup(0)]]) { device main0_out* gl_out = &spvOut[gl_PrimitiveID * 4]; device main0_patchOut& patchOut = spvPatchOut[gl_PrimitiveID]; diff --git a/3rdparty/spirv-cross/reference/opt/shaders-msl/desktop-only/tesc/basic.desktop.sso.tesc b/3rdparty/spirv-cross/reference/opt/shaders-msl/desktop-only/tesc/basic.desktop.sso.tesc index 530938484..727638432 100644 --- a/3rdparty/spirv-cross/reference/opt/shaders-msl/desktop-only/tesc/basic.desktop.sso.tesc +++ b/3rdparty/spirv-cross/reference/opt/shaders-msl/desktop-only/tesc/basic.desktop.sso.tesc @@ -18,7 +18,7 @@ struct main0_in float4 gl_Position [[attribute(0)]]; }; -kernel void main0(main0_in in [[stage_in]], uint gl_InvocationID [[thread_index_in_threadgroup]], uint gl_PrimitiveID [[threadgroup_position_in_grid]], device main0_out* spvOut [[buffer(28)]], device uint* spvIndirectParams [[buffer(29)]], device main0_patchOut* spvPatchOut [[buffer(27)]], device MTLQuadTessellationFactorsHalf* spvTessLevel [[buffer(26)]], threadgroup main0_in* gl_in [[threadgroup(0)]]) +kernel void main0(main0_in in [[stage_in]], uint gl_InvocationID [[thread_index_in_threadgroup]], uint gl_PrimitiveID [[threadgroup_position_in_grid]], device main0_out* spvOut [[buffer(28)]], constant uint* spvIndirectParams [[buffer(29)]], device main0_patchOut* spvPatchOut [[buffer(27)]], device MTLQuadTessellationFactorsHalf* spvTessLevel [[buffer(26)]], threadgroup main0_in* gl_in [[threadgroup(0)]]) { device main0_out* gl_out = &spvOut[gl_PrimitiveID * 1]; device main0_patchOut& patchOut = spvPatchOut[gl_PrimitiveID]; diff --git a/3rdparty/spirv-cross/reference/opt/shaders-msl/desktop-only/tesc/struct-copy.desktop.sso.tesc b/3rdparty/spirv-cross/reference/opt/shaders-msl/desktop-only/tesc/struct-copy.desktop.sso.tesc index 2e63aee1e..cd4d8d80e 100644 --- a/3rdparty/spirv-cross/reference/opt/shaders-msl/desktop-only/tesc/struct-copy.desktop.sso.tesc +++ b/3rdparty/spirv-cross/reference/opt/shaders-msl/desktop-only/tesc/struct-copy.desktop.sso.tesc @@ -20,7 +20,7 @@ struct main0_in float3 Boo_b [[attribute(1)]]; }; -kernel void main0(main0_in in [[stage_in]], uint gl_InvocationID [[thread_index_in_threadgroup]], uint gl_PrimitiveID [[threadgroup_position_in_grid]], device main0_out* spvOut [[buffer(28)]], device uint* spvIndirectParams [[buffer(29)]], device MTLQuadTessellationFactorsHalf* spvTessLevel [[buffer(26)]], threadgroup main0_in* gl_in [[threadgroup(0)]]) +kernel void main0(main0_in in [[stage_in]], uint gl_InvocationID [[thread_index_in_threadgroup]], uint gl_PrimitiveID [[threadgroup_position_in_grid]], device main0_out* spvOut [[buffer(28)]], constant uint* spvIndirectParams [[buffer(29)]], device MTLQuadTessellationFactorsHalf* spvTessLevel [[buffer(26)]], threadgroup main0_in* gl_in [[threadgroup(0)]]) { device main0_out* gl_out = &spvOut[gl_PrimitiveID * 4]; if (gl_InvocationID < spvIndirectParams[0]) diff --git a/3rdparty/spirv-cross/reference/opt/shaders-msl/tesc/basic.tesc b/3rdparty/spirv-cross/reference/opt/shaders-msl/tesc/basic.tesc index 832582f85..a9ff5b37e 100644 --- a/3rdparty/spirv-cross/reference/opt/shaders-msl/tesc/basic.tesc +++ b/3rdparty/spirv-cross/reference/opt/shaders-msl/tesc/basic.tesc @@ -8,7 +8,7 @@ struct main0_patchOut float3 vFoo; }; -kernel void main0(uint gl_InvocationID [[thread_index_in_threadgroup]], uint gl_PrimitiveID [[threadgroup_position_in_grid]], device uint* spvIndirectParams [[buffer(29)]], device main0_patchOut* spvPatchOut [[buffer(27)]], device MTLQuadTessellationFactorsHalf* spvTessLevel [[buffer(26)]]) +kernel void main0(uint gl_InvocationID [[thread_index_in_threadgroup]], uint gl_PrimitiveID [[threadgroup_position_in_grid]], constant uint* spvIndirectParams [[buffer(29)]], device main0_patchOut* spvPatchOut [[buffer(27)]], device MTLQuadTessellationFactorsHalf* spvTessLevel [[buffer(26)]]) { device main0_patchOut& patchOut = spvPatchOut[gl_PrimitiveID]; spvTessLevel[gl_PrimitiveID].insideTessellationFactor[0] = half(8.8999996185302734375); diff --git a/3rdparty/spirv-cross/reference/opt/shaders-msl/tesc/water_tess.tesc b/3rdparty/spirv-cross/reference/opt/shaders-msl/tesc/water_tess.tesc index b67ae2766..9a75f05b4 100644 --- a/3rdparty/spirv-cross/reference/opt/shaders-msl/tesc/water_tess.tesc +++ b/3rdparty/spirv-cross/reference/opt/shaders-msl/tesc/water_tess.tesc @@ -24,7 +24,7 @@ struct main0_in float2 vPatchPosBase [[attribute(0)]]; }; -kernel void main0(main0_in in [[stage_in]], constant UBO& _41 [[buffer(0)]], uint gl_InvocationID [[thread_index_in_threadgroup]], uint gl_PrimitiveID [[threadgroup_position_in_grid]], device uint* spvIndirectParams [[buffer(29)]], device main0_patchOut* spvPatchOut [[buffer(27)]], device MTLQuadTessellationFactorsHalf* spvTessLevel [[buffer(26)]], threadgroup main0_in* gl_in [[threadgroup(0)]]) +kernel void main0(main0_in in [[stage_in]], constant UBO& _41 [[buffer(0)]], uint gl_InvocationID [[thread_index_in_threadgroup]], uint gl_PrimitiveID [[threadgroup_position_in_grid]], constant uint* spvIndirectParams [[buffer(29)]], device main0_patchOut* spvPatchOut [[buffer(27)]], device MTLQuadTessellationFactorsHalf* spvTessLevel [[buffer(26)]], threadgroup main0_in* gl_in [[threadgroup(0)]]) { device main0_patchOut& patchOut = spvPatchOut[gl_PrimitiveID]; if (gl_InvocationID < spvIndirectParams[0]) diff --git a/3rdparty/spirv-cross/reference/shaders-msl/asm/tesc/tess-fixed-input-array-builtin-array.invalid.asm.tesc b/3rdparty/spirv-cross/reference/shaders-msl/asm/tesc/tess-fixed-input-array-builtin-array.invalid.asm.tesc index a8e3af263..6a765117e 100644 --- a/3rdparty/spirv-cross/reference/shaders-msl/asm/tesc/tess-fixed-input-array-builtin-array.invalid.asm.tesc +++ b/3rdparty/spirv-cross/reference/shaders-msl/asm/tesc/tess-fixed-input-array-builtin-array.invalid.asm.tesc @@ -76,7 +76,7 @@ HSConstantOut PatchHS(thread const VertexOutput (&_patch)[3]) return _output; } -kernel void main0(main0_in in [[stage_in]], uint gl_InvocationID [[thread_index_in_threadgroup]], uint gl_PrimitiveID [[threadgroup_position_in_grid]], device main0_out* spvOut [[buffer(28)]], device uint* spvIndirectParams [[buffer(29)]], device MTLTriangleTessellationFactorsHalf* spvTessLevel [[buffer(26)]], threadgroup main0_in* gl_in [[threadgroup(0)]]) +kernel void main0(main0_in in [[stage_in]], uint gl_InvocationID [[thread_index_in_threadgroup]], uint gl_PrimitiveID [[threadgroup_position_in_grid]], device main0_out* spvOut [[buffer(28)]], constant uint* spvIndirectParams [[buffer(29)]], device MTLTriangleTessellationFactorsHalf* spvTessLevel [[buffer(26)]], threadgroup main0_in* gl_in [[threadgroup(0)]]) { device main0_out* gl_out = &spvOut[gl_PrimitiveID * 3]; if (gl_InvocationID < spvIndirectParams[0]) diff --git a/3rdparty/spirv-cross/reference/shaders-msl/asm/tesc/tess-level-overrun.asm.tesc b/3rdparty/spirv-cross/reference/shaders-msl/asm/tesc/tess-level-overrun.asm.tesc index ac15a1fa8..6c9903e02 100644 --- a/3rdparty/spirv-cross/reference/shaders-msl/asm/tesc/tess-level-overrun.asm.tesc +++ b/3rdparty/spirv-cross/reference/shaders-msl/asm/tesc/tess-level-overrun.asm.tesc @@ -13,7 +13,7 @@ struct TessLevels float outer3; }; -kernel void main0(const device TessLevels& sb_levels [[buffer(0)]], uint gl_InvocationID [[thread_index_in_threadgroup]], uint gl_PrimitiveID [[threadgroup_position_in_grid]], device uint* spvIndirectParams [[buffer(29)]], device MTLTriangleTessellationFactorsHalf* spvTessLevel [[buffer(26)]]) +kernel void main0(const device TessLevels& sb_levels [[buffer(0)]], uint gl_InvocationID [[thread_index_in_threadgroup]], uint gl_PrimitiveID [[threadgroup_position_in_grid]], constant uint* spvIndirectParams [[buffer(29)]], device MTLTriangleTessellationFactorsHalf* spvTessLevel [[buffer(26)]]) { spvTessLevel[gl_PrimitiveID].insideTessellationFactor = half(sb_levels.inner0); spvTessLevel[gl_PrimitiveID].edgeTessellationFactor[0] = half(sb_levels.outer0); diff --git a/3rdparty/spirv-cross/reference/shaders-msl/desktop-only/tesc/arrayed-output.desktop.sso.tesc b/3rdparty/spirv-cross/reference/shaders-msl/desktop-only/tesc/arrayed-output.desktop.sso.tesc index 699493613..a5e30b6de 100644 --- a/3rdparty/spirv-cross/reference/shaders-msl/desktop-only/tesc/arrayed-output.desktop.sso.tesc +++ b/3rdparty/spirv-cross/reference/shaders-msl/desktop-only/tesc/arrayed-output.desktop.sso.tesc @@ -18,7 +18,7 @@ struct main0_in float3 vInput [[attribute(0)]]; }; -kernel void main0(main0_in in [[stage_in]], uint gl_InvocationID [[thread_index_in_threadgroup]], uint gl_PrimitiveID [[threadgroup_position_in_grid]], device main0_out* spvOut [[buffer(28)]], device uint* spvIndirectParams [[buffer(29)]], device main0_patchOut* spvPatchOut [[buffer(27)]], device MTLQuadTessellationFactorsHalf* spvTessLevel [[buffer(26)]], threadgroup main0_in* gl_in [[threadgroup(0)]]) +kernel void main0(main0_in in [[stage_in]], uint gl_InvocationID [[thread_index_in_threadgroup]], uint gl_PrimitiveID [[threadgroup_position_in_grid]], device main0_out* spvOut [[buffer(28)]], constant uint* spvIndirectParams [[buffer(29)]], device main0_patchOut* spvPatchOut [[buffer(27)]], device MTLQuadTessellationFactorsHalf* spvTessLevel [[buffer(26)]], threadgroup main0_in* gl_in [[threadgroup(0)]]) { device main0_out* gl_out = &spvOut[gl_PrimitiveID * 4]; device main0_patchOut& patchOut = spvPatchOut[gl_PrimitiveID]; diff --git a/3rdparty/spirv-cross/reference/shaders-msl/desktop-only/tesc/basic.desktop.sso.tesc b/3rdparty/spirv-cross/reference/shaders-msl/desktop-only/tesc/basic.desktop.sso.tesc index eacb34285..9acece62c 100644 --- a/3rdparty/spirv-cross/reference/shaders-msl/desktop-only/tesc/basic.desktop.sso.tesc +++ b/3rdparty/spirv-cross/reference/shaders-msl/desktop-only/tesc/basic.desktop.sso.tesc @@ -25,7 +25,7 @@ void set_position(device main0_out* thread & gl_out, thread uint& gl_InvocationI gl_out[gl_InvocationID].gl_Position = gl_in[0].gl_Position + gl_in[1].gl_Position; } -kernel void main0(main0_in in [[stage_in]], uint gl_InvocationID [[thread_index_in_threadgroup]], uint gl_PrimitiveID [[threadgroup_position_in_grid]], device main0_out* spvOut [[buffer(28)]], device uint* spvIndirectParams [[buffer(29)]], device main0_patchOut* spvPatchOut [[buffer(27)]], device MTLQuadTessellationFactorsHalf* spvTessLevel [[buffer(26)]], threadgroup main0_in* gl_in [[threadgroup(0)]]) +kernel void main0(main0_in in [[stage_in]], uint gl_InvocationID [[thread_index_in_threadgroup]], uint gl_PrimitiveID [[threadgroup_position_in_grid]], device main0_out* spvOut [[buffer(28)]], constant uint* spvIndirectParams [[buffer(29)]], device main0_patchOut* spvPatchOut [[buffer(27)]], device MTLQuadTessellationFactorsHalf* spvTessLevel [[buffer(26)]], threadgroup main0_in* gl_in [[threadgroup(0)]]) { device main0_out* gl_out = &spvOut[gl_PrimitiveID * 1]; device main0_patchOut& patchOut = spvPatchOut[gl_PrimitiveID]; diff --git a/3rdparty/spirv-cross/reference/shaders-msl/desktop-only/tesc/struct-copy.desktop.sso.tesc b/3rdparty/spirv-cross/reference/shaders-msl/desktop-only/tesc/struct-copy.desktop.sso.tesc index 2e63aee1e..cd4d8d80e 100644 --- a/3rdparty/spirv-cross/reference/shaders-msl/desktop-only/tesc/struct-copy.desktop.sso.tesc +++ b/3rdparty/spirv-cross/reference/shaders-msl/desktop-only/tesc/struct-copy.desktop.sso.tesc @@ -20,7 +20,7 @@ struct main0_in float3 Boo_b [[attribute(1)]]; }; -kernel void main0(main0_in in [[stage_in]], uint gl_InvocationID [[thread_index_in_threadgroup]], uint gl_PrimitiveID [[threadgroup_position_in_grid]], device main0_out* spvOut [[buffer(28)]], device uint* spvIndirectParams [[buffer(29)]], device MTLQuadTessellationFactorsHalf* spvTessLevel [[buffer(26)]], threadgroup main0_in* gl_in [[threadgroup(0)]]) +kernel void main0(main0_in in [[stage_in]], uint gl_InvocationID [[thread_index_in_threadgroup]], uint gl_PrimitiveID [[threadgroup_position_in_grid]], device main0_out* spvOut [[buffer(28)]], constant uint* spvIndirectParams [[buffer(29)]], device MTLQuadTessellationFactorsHalf* spvTessLevel [[buffer(26)]], threadgroup main0_in* gl_in [[threadgroup(0)]]) { device main0_out* gl_out = &spvOut[gl_PrimitiveID * 4]; if (gl_InvocationID < spvIndirectParams[0]) diff --git a/3rdparty/spirv-cross/reference/shaders-msl/tesc/basic.tesc b/3rdparty/spirv-cross/reference/shaders-msl/tesc/basic.tesc index 832582f85..a9ff5b37e 100644 --- a/3rdparty/spirv-cross/reference/shaders-msl/tesc/basic.tesc +++ b/3rdparty/spirv-cross/reference/shaders-msl/tesc/basic.tesc @@ -8,7 +8,7 @@ struct main0_patchOut float3 vFoo; }; -kernel void main0(uint gl_InvocationID [[thread_index_in_threadgroup]], uint gl_PrimitiveID [[threadgroup_position_in_grid]], device uint* spvIndirectParams [[buffer(29)]], device main0_patchOut* spvPatchOut [[buffer(27)]], device MTLQuadTessellationFactorsHalf* spvTessLevel [[buffer(26)]]) +kernel void main0(uint gl_InvocationID [[thread_index_in_threadgroup]], uint gl_PrimitiveID [[threadgroup_position_in_grid]], constant uint* spvIndirectParams [[buffer(29)]], device main0_patchOut* spvPatchOut [[buffer(27)]], device MTLQuadTessellationFactorsHalf* spvTessLevel [[buffer(26)]]) { device main0_patchOut& patchOut = spvPatchOut[gl_PrimitiveID]; spvTessLevel[gl_PrimitiveID].insideTessellationFactor[0] = half(8.8999996185302734375); diff --git a/3rdparty/spirv-cross/reference/shaders-msl/tesc/water_tess.tesc b/3rdparty/spirv-cross/reference/shaders-msl/tesc/water_tess.tesc index 53eab0a11..ccd59bbdf 100644 --- a/3rdparty/spirv-cross/reference/shaders-msl/tesc/water_tess.tesc +++ b/3rdparty/spirv-cross/reference/shaders-msl/tesc/water_tess.tesc @@ -106,7 +106,7 @@ void compute_tess_levels(thread const float2& p0, constant UBO& v_41, device flo gl_TessLevelInner[1] = half(inner); } -kernel void main0(main0_in in [[stage_in]], constant UBO& v_41 [[buffer(0)]], uint gl_InvocationID [[thread_index_in_threadgroup]], uint gl_PrimitiveID [[threadgroup_position_in_grid]], device uint* spvIndirectParams [[buffer(29)]], device main0_patchOut* spvPatchOut [[buffer(27)]], device MTLQuadTessellationFactorsHalf* spvTessLevel [[buffer(26)]], threadgroup main0_in* gl_in [[threadgroup(0)]]) +kernel void main0(main0_in in [[stage_in]], constant UBO& v_41 [[buffer(0)]], uint gl_InvocationID [[thread_index_in_threadgroup]], uint gl_PrimitiveID [[threadgroup_position_in_grid]], constant uint* spvIndirectParams [[buffer(29)]], device main0_patchOut* spvPatchOut [[buffer(27)]], device MTLQuadTessellationFactorsHalf* spvTessLevel [[buffer(26)]], threadgroup main0_in* gl_in [[threadgroup(0)]]) { device main0_patchOut& patchOut = spvPatchOut[gl_PrimitiveID]; if (gl_InvocationID < spvIndirectParams[0]) diff --git a/3rdparty/spirv-cross/spirv_msl.cpp b/3rdparty/spirv-cross/spirv_msl.cpp index 9babb3bdd..a215b91b0 100644 --- a/3rdparty/spirv-cross/spirv_msl.cpp +++ b/3rdparty/spirv-cross/spirv_msl.cpp @@ -5608,12 +5608,19 @@ void CompilerMSL::entry_point_args_builtin(string &ep_args) " [[buffer(", msl_options.shader_output_buffer_index, ")]]"); } - if (stage_out_var_id || get_execution_model() == ExecutionModelTessellationControl) + if (get_execution_model() == ExecutionModelTessellationControl) { if (!ep_args.empty()) ep_args += ", "; ep_args += - join("device uint* spvIndirectParams [[buffer(", msl_options.indirect_params_buffer_index, ")]]"); + join("constant uint* spvIndirectParams [[buffer(", msl_options.indirect_params_buffer_index, ")]]"); + } + else if (stage_out_var_id) + { + if (!ep_args.empty()) + ep_args += ", "; + ep_args += + join("device uint* spvIndirectParams [[buffer(", msl_options.indirect_params_buffer_index, ")]]"); } // Tessellation control shaders get three additional parameters: