diff --git a/rpcs3/Emu/RSX/GL/GLFragmentProgram.cpp b/rpcs3/Emu/RSX/GL/GLFragmentProgram.cpp index 3764fafe6c..b97d0cdac7 100644 --- a/rpcs3/Emu/RSX/GL/GLFragmentProgram.cpp +++ b/rpcs3/Emu/RSX/GL/GLFragmentProgram.cpp @@ -43,7 +43,13 @@ void GLFragmentDecompilerThread::insertIntputs(std::stringstream & OS) for (const ParamType& PT : m_parr.params[PF_PARAM_IN]) { for (const ParamItem& PI : PT.items) - OS << "in " << PT.type << " " << PI.name << ";" << std::endl; + { + //Rename fogc to fog_c to differentiate the input register from the variable + if (PI.name == "fogc") + OS << "in vec4 fog_c;" << std::endl; + else + OS << "in " << PT.type << " " << PI.name << ";" << std::endl; + } } } @@ -116,22 +122,22 @@ namespace switch (mode) { case rsx::fog_mode::linear: - OS << " vec4 fogc = fog_param1 * fogc + (fog_param0 - 1.);\n"; + OS << " vec4 fogc = fog_param1 * fog_c + (fog_param0 - 1.);\n"; return; case rsx::fog_mode::exponential: - OS << " vec4 fogc = exp(11.084 * (fog_param1 * fogc + fog_param0 - 1.5));\n"; + OS << " vec4 fogc = exp(11.084 * (fog_param1 * fog_c + fog_param0 - 1.5));\n"; return; case rsx::fog_mode::exponential2: - OS << " vec4 fogc = exp(-pow(4.709 * (fog_param1 * fogc + fog_param0 - 1.5)), 2.);\n"; + OS << " vec4 fogc = exp(-pow(4.709 * (fog_param1 * fog_c + fog_param0 - 1.5)), 2.);\n"; return; case rsx::fog_mode::linear_abs: - OS << " vec4 fogc = fog_param1 * abs(fogc) + (fog_param0 - 1.);\n"; + OS << " vec4 fogc = fog_param1 * abs(fog_c) + (fog_param0 - 1.);\n"; return; case rsx::fog_mode::exponential_abs: - OS << " vec4 fogc = exp(11.084 * (fog_param1 * abs(fogc) + fog_param0 - 1.5));\n"; + OS << " vec4 fogc = exp(11.084 * (fog_param1 * abs(fog_c) + fog_param0 - 1.5));\n"; return; case rsx::fog_mode::exponential2_abs: - OS << " vec4 fogc = exp(-pow(4.709 * (fog_param1 * abs(fogc) + fog_param0 - 1.5)), 2.);\n"; + OS << " vec4 fogc = exp(-pow(4.709 * (fog_param1 * abs(fog_c) + fog_param0 - 1.5)), 2.);\n"; return; } } diff --git a/rpcs3/Emu/RSX/GL/GLVertexProgram.cpp b/rpcs3/Emu/RSX/GL/GLVertexProgram.cpp index d36fa5db58..698aba27f1 100644 --- a/rpcs3/Emu/RSX/GL/GLVertexProgram.cpp +++ b/rpcs3/Emu/RSX/GL/GLVertexProgram.cpp @@ -92,7 +92,7 @@ static const reg_info reg_table[] = { "spec_color", true, "dst_reg2", "", false }, { "front_diff_color", true, "dst_reg3", "", false }, { "front_spec_color", true, "dst_reg4", "", false }, - { "fogc", true, "dst_reg5", ".x", true }, + { "fog_c", true, "dst_reg5", ".xxxx", true }, { "gl_ClipDistance[0]", false, "dst_reg5", ".y", false }, { "gl_ClipDistance[1]", false, "dst_reg5", ".z", false }, { "gl_ClipDistance[2]", false, "dst_reg5", ".w", false }, @@ -118,10 +118,7 @@ void GLVertexDecompilerThread::insertOutputs(std::stringstream & OS, const std:: { if (m_parr.HasParam(PF_PARAM_NONE, "vec4", i.src_reg) && i.need_declare) { - if (i.name == "fogc") - OS << "out float " << i.name << ";" << std::endl; - else - OS << "out vec4 " << i.name << ";" << std::endl; + OS << "out vec4 " << i.name << ";" << std::endl; } } }