From 659969783542a18325ab8794126f96e62e4c1d6a Mon Sep 17 00:00:00 2001 From: Sasha Szpakowski Date: Fri, 25 Nov 2022 23:27:04 -0400 Subject: [PATCH] opengl: Fix love_PixelCoord and love_ScreenSize in shaders. Fixes #1866. --- src/modules/graphics/Shader.cpp | 2 +- src/modules/graphics/opengl/Shader.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/modules/graphics/Shader.cpp b/src/modules/graphics/Shader.cpp index 168846d72..17b4932af 100644 --- a/src/modules/graphics/Shader.cpp +++ b/src/modules/graphics/Shader.cpp @@ -551,7 +551,7 @@ std::string Shader::createShaderStageCode(Graphics *gfx, ShaderStageType stage, // Note: backends are expected to handle this situation if highp is ever // conditional in that backend. if (!gfx->getCapabilities().features[Graphics::FEATURE_PIXEL_SHADER_HIGHP]) - ss << "#define LOVE_SPLIT_UNIFORMS_PER_DRAW 1"; + ss << "#define LOVE_SPLIT_UNIFORMS_PER_DRAW 1\n"; for (const auto &def : options.defines) ss << "#define " + def.first + " " + def.second + "\n"; diff --git a/src/modules/graphics/opengl/Shader.cpp b/src/modules/graphics/opengl/Shader.cpp index 08d65c4bb..a9fda6eca 100644 --- a/src/modules/graphics/opengl/Shader.cpp +++ b/src/modules/graphics/opengl/Shader.cpp @@ -469,7 +469,7 @@ bool Shader::loadVolatile() // love::graphics::Shader sets up the shader code-side of this. auto gfx = Module::getInstance(Module::M_GRAPHICS); if (gfx != nullptr) - splitUniformsPerDraw = gfx->getCapabilities().features[Graphics::FEATURE_PIXEL_SHADER_HIGHP]; + splitUniformsPerDraw = !gfx->getCapabilities().features[Graphics::FEATURE_PIXEL_SHADER_HIGHP]; // zero out active texture list textureUnits.clear();