diff --git a/reference/opt/shaders-msl/desktop-only/tese/triangle.desktop.sso.domain.tese b/reference/opt/shaders-msl/desktop-only/tese/triangle.desktop.sso.domain.tese deleted file mode 100644 index f2123f2f..00000000 --- a/reference/opt/shaders-msl/desktop-only/tese/triangle.desktop.sso.domain.tese +++ /dev/null @@ -1,28 +0,0 @@ -#include -#include - -using namespace metal; - -struct main0_out -{ - float4 gl_Position [[position]]; -}; - -struct main0_in -{ - float4 gl_Position [[attribute(0)]]; -}; - -struct main0_patchIn -{ - patch_control_point gl_in; -}; - -[[ patch(triangle, 0) ]] vertex main0_out main0(main0_patchIn patchIn [[stage_in]], float3 gl_TessCoord [[position_in_patch]]) -{ - main0_out out = {}; - gl_TessCoord.yz = float2(gl_TessCoord.y - gl_TessCoord.x, 1.0 - gl_TessCoord.y); - out.gl_Position = ((patchIn.gl_in[0].gl_Position * gl_TessCoord.x) + (patchIn.gl_in[1].gl_Position * gl_TessCoord.y)) + (patchIn.gl_in[2].gl_Position * gl_TessCoord.z); - return out; -} - diff --git a/reference/shaders-msl/desktop-only/tese/triangle.desktop.sso.domain.tese b/reference/shaders-msl/desktop-only/tese/triangle.desktop.sso.domain.tese deleted file mode 100644 index f2123f2f..00000000 --- a/reference/shaders-msl/desktop-only/tese/triangle.desktop.sso.domain.tese +++ /dev/null @@ -1,28 +0,0 @@ -#include -#include - -using namespace metal; - -struct main0_out -{ - float4 gl_Position [[position]]; -}; - -struct main0_in -{ - float4 gl_Position [[attribute(0)]]; -}; - -struct main0_patchIn -{ - patch_control_point gl_in; -}; - -[[ patch(triangle, 0) ]] vertex main0_out main0(main0_patchIn patchIn [[stage_in]], float3 gl_TessCoord [[position_in_patch]]) -{ - main0_out out = {}; - gl_TessCoord.yz = float2(gl_TessCoord.y - gl_TessCoord.x, 1.0 - gl_TessCoord.y); - out.gl_Position = ((patchIn.gl_in[0].gl_Position * gl_TessCoord.x) + (patchIn.gl_in[1].gl_Position * gl_TessCoord.y)) + (patchIn.gl_in[2].gl_Position * gl_TessCoord.z); - return out; -} - diff --git a/shaders-msl/desktop-only/tese/triangle.desktop.sso.domain.tese b/shaders-msl/desktop-only/tese/triangle.desktop.sso.domain.tese deleted file mode 100644 index c964fbe2..00000000 --- a/shaders-msl/desktop-only/tese/triangle.desktop.sso.domain.tese +++ /dev/null @@ -1,22 +0,0 @@ -#version 450 - -layout(cw, triangles, fractional_even_spacing) in; - -in gl_PerVertex -{ - vec4 gl_Position; -} gl_in[gl_MaxPatchVertices]; - -out gl_PerVertex -{ - vec4 gl_Position; -}; - -void main() -{ - gl_Position = - gl_in[0].gl_Position * gl_TessCoord.x + - gl_in[1].gl_Position * gl_TessCoord.y + - gl_in[2].gl_Position * gl_TessCoord.z; -} - diff --git a/spirv_msl.cpp b/spirv_msl.cpp index c2b37987..f75fb0c3 100644 --- a/spirv_msl.cpp +++ b/spirv_msl.cpp @@ -5587,20 +5587,12 @@ void CompilerMSL::fix_up_shader_inputs_outputs() }); break; case BuiltInTessCoord: - // Emit a fixup to account for the shifted domain. The fixup for triangles can be derived - // thus: - // u' = u - // w' = 1 - v - // v' = 1 - u' - w' = 1 - u - (1 - v) = v - u - // v and w are swapped because the winding must be reversed in lower-left mode. - if (msl_options.tess_domain_origin_lower_left) + // Emit a fixup to account for the shifted domain. Don't do this for triangles; + // MoltenVK will just reverse the winding order instead. + if (msl_options.tess_domain_origin_lower_left && !get_entry_point().flags.get(ExecutionModeTriangles)) { string tc = to_expression(var_id); - if (get_entry_point().flags.get(ExecutionModeTriangles)) - entry_func.fixup_hooks_in.push_back( - [=]() { statement(tc, ".yz = float2(", tc, ".y - ", tc, ".x, 1.0 - ", tc, ".y);"); }); - else - entry_func.fixup_hooks_in.push_back([=]() { statement(tc, ".y = 1.0 - ", tc, ".y;"); }); + entry_func.fixup_hooks_in.push_back([=]() { statement(tc, ".y = 1.0 - ", tc, ".y;"); }); } break; default: