From a1d3f734d6ab4e494ba180cc4f38710bcf20866e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sun, 14 Apr 2019 22:16:30 +0200 Subject: [PATCH] Shaders: generate textured Phong VS only if textures are actually used. Previously this got enabled also when AlphaMask was enabled, but no texture. That's a strange case but nevertheless, let's be precise. --- src/Magnum/Shaders/Phong.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Magnum/Shaders/Phong.cpp b/src/Magnum/Shaders/Phong.cpp index 204d29ed6..b128afc91 100644 --- a/src/Magnum/Shaders/Phong.cpp +++ b/src/Magnum/Shaders/Phong.cpp @@ -87,7 +87,7 @@ Phong::Phong(const Flags flags, const UnsignedInt lightCount): _flags{flags}, _l lightInitializer.resize(lightInitializer.size() - 1); #endif - vert.addSource(flags ? "#define TEXTURED\n" : "") + vert.addSource(flags & (Flag::AmbientTexture|Flag::DiffuseTexture|Flag::SpecularTexture) ? "#define TEXTURED\n" : "") .addSource(Utility::formatString("#define LIGHT_COUNT {}\n", lightCount)) .addSource(rs.get("generic.glsl")) .addSource(rs.get("Phong.vert"));