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
This commit is contained in:
kd-11 2017-05-14 11:50:24 +03:00 committed by GitHub
parent e93c4c42b6
commit c26607de08
1 changed files with 4 additions and 2 deletions

View File

@ -107,10 +107,12 @@ void GLVertexDecompilerThread::insertConstants(std::stringstream & OS, const std
static const vertex_reg_info reg_table[] = static const vertex_reg_info reg_table[] =
{ {
{ "gl_Position", false, "dst_reg0", "", false }, { "gl_Position", false, "dst_reg0", "", false },
{ "diff_color", true, "dst_reg1", "", false }, { "diff_color", true, "dst_reg1", "", false, "", "", "", false, CELL_GCM_ATTRIB_OUTPUT_MASK_FRONTDIFFUSE },
{ "spec_color", true, "dst_reg2", "", false }, { "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_diff_color", true, "dst_reg3", "", false },
{ "front_spec_color", true, "dst_reg4", "", 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 }, { "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 //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 }, { "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 },