diff --git a/rpcs3/Emu/RSX/GL/GLVertexProgram.cpp b/rpcs3/Emu/RSX/GL/GLVertexProgram.cpp index 598929466d..3c70181e30 100644 --- a/rpcs3/Emu/RSX/GL/GLVertexProgram.cpp +++ b/rpcs3/Emu/RSX/GL/GLVertexProgram.cpp @@ -120,15 +120,15 @@ static const vertex_reg_info reg_table[] = { "gl_ClipDistance[3]", false, "dst_reg6", ".y * userClipFactor[0].w", false, "userClipEnabled[0].w > 0", "0.5", "", true, CELL_GCM_ATTRIB_OUTPUT_MASK_UC3 | CELL_GCM_ATTRIB_OUTPUT_MASK_UC4 | CELL_GCM_ATTRIB_OUTPUT_MASK_UC5 }, { "gl_ClipDistance[4]", false, "dst_reg6", ".z * userClipFactor[1].x", false, "userClipEnabled[1].x > 0", "0.5", "", true, CELL_GCM_ATTRIB_OUTPUT_MASK_UC3 | CELL_GCM_ATTRIB_OUTPUT_MASK_UC4 | CELL_GCM_ATTRIB_OUTPUT_MASK_UC5 }, { "gl_ClipDistance[5]", false, "dst_reg6", ".w * userClipFactor[1].y", false, "userClipEnabled[1].y > 0", "0.5", "", true, CELL_GCM_ATTRIB_OUTPUT_MASK_UC3 | CELL_GCM_ATTRIB_OUTPUT_MASK_UC4 | CELL_GCM_ATTRIB_OUTPUT_MASK_UC5 }, - { "tc0", true, "dst_reg7", "", false }, - { "tc1", true, "dst_reg8", "", false }, - { "tc2", true, "dst_reg9", "", false }, - { "tc3", true, "dst_reg10", "", false }, - { "tc4", true, "dst_reg11", "", false }, - { "tc5", true, "dst_reg12", "", false }, - { "tc6", true, "dst_reg13", "", false }, - { "tc7", true, "dst_reg14", "", false }, - { "tc8", true, "dst_reg15", "", false }, + { "tc0", true, "dst_reg7", "", false, "", "", "", false, CELL_GCM_ATTRIB_OUTPUT_MASK_TEX0 }, + { "tc1", true, "dst_reg8", "", false, "", "", "", false, CELL_GCM_ATTRIB_OUTPUT_MASK_TEX1 }, + { "tc2", true, "dst_reg9", "", false, "", "", "", false, CELL_GCM_ATTRIB_OUTPUT_MASK_TEX2 }, + { "tc3", true, "dst_reg10", "", false, "", "", "", false, CELL_GCM_ATTRIB_OUTPUT_MASK_TEX3 }, + { "tc4", true, "dst_reg11", "", false, "", "", "", false, CELL_GCM_ATTRIB_OUTPUT_MASK_TEX4 }, + { "tc5", true, "dst_reg12", "", false, "", "", "", false, CELL_GCM_ATTRIB_OUTPUT_MASK_TEX5 }, + { "tc6", true, "dst_reg13", "", false, "", "", "", false, CELL_GCM_ATTRIB_OUTPUT_MASK_TEX6 }, + { "tc7", true, "dst_reg14", "", false, "", "", "", false, CELL_GCM_ATTRIB_OUTPUT_MASK_TEX7 }, + { "tc8", true, "dst_reg15", "", false, "", "", "", false, CELL_GCM_ATTRIB_OUTPUT_MASK_TEX8 }, { "tc9", true, "dst_reg6", "", false, "", "", "", true, CELL_GCM_ATTRIB_OUTPUT_MASK_TEX9 } // In this line, dst_reg6 is correct since dst_reg goes from 0 to 15. }; @@ -166,6 +166,15 @@ void GLVertexDecompilerThread::insertOutputs(std::stringstream & OS, const std:: OS << "out vec4 " << name << ";" << std::endl; } + else + { + //Mesa drivers are very strict on shader-stage matching + //Force some outputs to be declared even if unused + if (i.need_declare && (rsx_vertex_program.output_mask & i.check_mask_value) > 0) + { + OS << "out vec4 " << i.name << ";" << std::endl; + } + } } if (insert_back_diffuse && insert_front_diffuse) @@ -218,7 +227,7 @@ void add_input(std::stringstream & OS, const ParamItem &PI, const std::vector