Adjust clip-space for Metal

This commit is contained in:
Polona Caserman 2017-01-03 14:51:25 +01:00 committed by Robert Konrad
parent 20d2b59c8d
commit a496a40f98
2 changed files with 5 additions and 4 deletions

View File

@ -1176,9 +1176,10 @@ void CompilerMSL::emit_fixup()
{ {
if (options.vertex.fixup_clipspace) 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, 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) if (msl_config.flip_vert_y)

View File

@ -28,8 +28,8 @@ namespace spirv_cross
struct MSLConfiguration struct MSLConfiguration
{ {
uint32_t vtx_attr_stage_in_binding = 0; uint32_t vtx_attr_stage_in_binding = 0;
bool flip_vert_y = true; bool flip_vert_y = false;
bool flip_frag_y = true; bool flip_frag_y = false;
bool is_rendering_points = false; bool is_rendering_points = false;
}; };