From 7aed9c3f135abd30e63b6e20fdab37cdddbe3374 Mon Sep 17 00:00:00 2001 From: kd-11 Date: Sun, 29 Sep 2019 12:55:44 +0300 Subject: [PATCH] gl: Add missing input declarations for 2-sided lighting --- rpcs3/Emu/RSX/GL/GLFragmentProgram.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/rpcs3/Emu/RSX/GL/GLFragmentProgram.cpp b/rpcs3/Emu/RSX/GL/GLFragmentProgram.cpp index 29a33c982b..efaa4d4beb 100644 --- a/rpcs3/Emu/RSX/GL/GLFragmentProgram.cpp +++ b/rpcs3/Emu/RSX/GL/GLFragmentProgram.cpp @@ -79,6 +79,19 @@ void GLFragmentDecompilerThread::insertInputs(std::stringstream & OS) OS << "layout(location=" << reg_location << ") in vec4 " << var_name << ";\n"; } } + + if (m_prog.two_sided_lighting) + { + if (properties.in_register_mask & in_diff_color) + { + OS << "layout(location=" << gl::get_varying_register_location("diff_color1") << ") in vec4 diff_color1;\n"; + } + + if (properties.in_register_mask & in_spec_color) + { + OS << "layout(location=" << gl::get_varying_register_location("spec_color1") << ") in vec4 spec_color1;\n"; + } + } } void GLFragmentDecompilerThread::insertOutputs(std::stringstream & OS)