From c26607de08cff21994a9142cf86545a3e3ed6769 Mon Sep 17 00:00:00 2001 From: kd-11 Date: Sun, 14 May 2017 11:50:24 +0300 Subject: [PATCH] gl: Strict export of diff_color and spec_color for mesa compatibility (#2779) * gl: Strict export of diff_color and spec_color for mesa compatibility * gl: Relax the front_diff/spec rules a little --- rpcs3/Emu/RSX/GL/GLVertexProgram.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/rpcs3/Emu/RSX/GL/GLVertexProgram.cpp b/rpcs3/Emu/RSX/GL/GLVertexProgram.cpp index 3c70181e3..24c0aace0 100644 --- a/rpcs3/Emu/RSX/GL/GLVertexProgram.cpp +++ b/rpcs3/Emu/RSX/GL/GLVertexProgram.cpp @@ -107,10 +107,12 @@ void GLVertexDecompilerThread::insertConstants(std::stringstream & OS, const std static const vertex_reg_info reg_table[] = { { "gl_Position", false, "dst_reg0", "", false }, - { "diff_color", true, "dst_reg1", "", false }, - { "spec_color", true, "dst_reg2", "", false }, + { "diff_color", true, "dst_reg1", "", false, "", "", "", false, CELL_GCM_ATTRIB_OUTPUT_MASK_FRONTDIFFUSE }, + { "spec_color", true, "dst_reg2", "", false, "", "", "", false, CELL_GCM_ATTRIB_OUTPUT_MASK_FRONTSPECULAR }, + //These are only present when back variants are specified, otherwise the default diff/spec color vars are for both front and back { "front_diff_color", true, "dst_reg3", "", false }, { "front_spec_color", true, "dst_reg4", "", false }, + //Fog output shares a data source register with clip planes 0-2 so only declare when specified { "fog_c", true, "dst_reg5", ".xxxx", true, "", "", "", true, CELL_GCM_ATTRIB_OUTPUT_MASK_FOG }, //Warning: Always define all 3 clip plane groups together to avoid flickering with openGL { "gl_ClipDistance[0]", false, "dst_reg5", ".y * userClipFactor[0].x", false, "userClipEnabled[0].x > 0", "0.5", "", true, CELL_GCM_ATTRIB_OUTPUT_MASK_UC0 | CELL_GCM_ATTRIB_OUTPUT_MASK_UC1 | CELL_GCM_ATTRIB_OUTPUT_MASK_UC2 },