From 683e22c3b33c3a0ce82299b1fc0c45f802a196d1 Mon Sep 17 00:00:00 2001 From: Sergey Lipskiy Date: Tue, 7 Feb 2017 11:50:00 +0700 Subject: [PATCH] Correct shaders generation when hw light is enabled. --- .../OpenGLContext/GLSL/glsl_CombinerProgramBuilder.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Graphics/OpenGLContext/GLSL/glsl_CombinerProgramBuilder.cpp b/src/Graphics/OpenGLContext/GLSL/glsl_CombinerProgramBuilder.cpp index e135dc9b..813db9b8 100644 --- a/src/Graphics/OpenGLContext/GLSL/glsl_CombinerProgramBuilder.cpp +++ b/src/Graphics/OpenGLContext/GLSL/glsl_CombinerProgramBuilder.cpp @@ -1764,7 +1764,8 @@ graphics::CombinerProgram * CombinerProgramBuilder::buildCombinerProgram(Combine const bool bUseLod = combinerInputs.usesLOD(); const bool bUseTextures = combinerInputs.usesTexture(); - const bool bUseHWLight = g_cycleType <= G_CYC_2CYCLE && // Rects not use lighting + const bool bIsRect = _key.isRectKey(); + const bool bUseHWLight = !bIsRect && // Rects not use lighting config.generalEmulation.enableHWLighting != 0 && GBI.isHWLSupported() && combinerInputs.usesShadeColor(); @@ -1876,7 +1877,6 @@ graphics::CombinerProgram * CombinerProgramBuilder::buildCombinerProgram(Combine Utils::logErrorShader(GL_FRAGMENT_SHADER, strFragmentShader); GLuint program = glCreateProgram(); - const bool bIsRect = _key.isRectKey(); Utils::locateAttributes(program, bIsRect, bUseTextures); if (bIsRect) glAttachShader(program, bUseTextures ? m_vertexShaderTexturedRect : m_vertexShaderRect);