diff --git a/spirv_msl.cpp b/spirv_msl.cpp index da61f2c3..4cc3aa25 100644 --- a/spirv_msl.cpp +++ b/spirv_msl.cpp @@ -1176,9 +1176,10 @@ void CompilerMSL::emit_fixup() { if (options.vertex.fixup_clipspace) { - const char *suffix = backend.float_literal_suffix ? "f" : ""; + /*const char *suffix = backend.float_literal_suffix ? "f" : ""; statement(qual_pos_var_name, ".z = 2.0", suffix, " * ", qual_pos_var_name, ".z - ", qual_pos_var_name, - ".w;", " // Adjust clip-space for Metal"); + ".w;", " // Adjust clip-space for Metal");*/ + statement(qual_pos_var_name, ".z = (", qual_pos_var_name, ".z + ", qual_pos_var_name, ".w) * 0.5; // Adjust clip-space for Metal"); } if (msl_config.flip_vert_y) diff --git a/spirv_msl.hpp b/spirv_msl.hpp index 0dd8c36d..bdc55173 100644 --- a/spirv_msl.hpp +++ b/spirv_msl.hpp @@ -28,8 +28,8 @@ namespace spirv_cross struct MSLConfiguration { uint32_t vtx_attr_stage_in_binding = 0; - bool flip_vert_y = true; - bool flip_frag_y = true; + bool flip_vert_y = false; + bool flip_frag_y = false; bool is_rendering_points = false; };