diff --git a/src/Magnum/Shaders/DistanceFieldVector.cpp b/src/Magnum/Shaders/DistanceFieldVector.cpp index 6faef96f9..b8964e70f 100644 --- a/src/Magnum/Shaders/DistanceFieldVector.cpp +++ b/src/Magnum/Shaders/DistanceFieldVector.cpp @@ -50,8 +50,8 @@ template DistanceFieldVector::DistanceFieldV const Version version = Context::current()->supportedVersion({Version::GLES300, Version::GLES200}); #endif - Shader frag = Implementation::createCompatibilityShader(version, Shader::Type::Vertex); - Shader vert = Implementation::createCompatibilityShader(version, Shader::Type::Fragment); + Shader frag = Implementation::createCompatibilityShader(rs, version, Shader::Type::Vertex); + Shader vert = Implementation::createCompatibilityShader(rs, version, Shader::Type::Fragment); frag.addSource(rs.get("generic.glsl")) .addSource(rs.get(vertexShaderName())); diff --git a/src/Magnum/Shaders/Flat.cpp b/src/Magnum/Shaders/Flat.cpp index b75bf4d53..dbd142ab2 100644 --- a/src/Magnum/Shaders/Flat.cpp +++ b/src/Magnum/Shaders/Flat.cpp @@ -53,8 +53,8 @@ template Flat::Flat(const Flags flags): tran const Version version = Context::current()->supportedVersion({Version::GLES300, Version::GLES200}); #endif - Shader vert = Implementation::createCompatibilityShader(version, Shader::Type::Vertex); - Shader frag = Implementation::createCompatibilityShader(version, Shader::Type::Fragment); + Shader vert = Implementation::createCompatibilityShader(rs, version, Shader::Type::Vertex); + Shader frag = Implementation::createCompatibilityShader(rs, version, Shader::Type::Fragment); vert.addSource(flags & Flag::Textured ? "#define TEXTURED\n" : "") .addSource(rs.get("generic.glsl")) diff --git a/src/Magnum/Shaders/Implementation/CreateCompatibilityShader.h b/src/Magnum/Shaders/Implementation/CreateCompatibilityShader.h index b3cd0322f..5fa3fabd2 100644 --- a/src/Magnum/Shaders/Implementation/CreateCompatibilityShader.h +++ b/src/Magnum/Shaders/Implementation/CreateCompatibilityShader.h @@ -33,7 +33,7 @@ namespace Magnum { namespace Shaders { namespace Implementation { -inline Shader createCompatibilityShader(Version version, Shader::Type type) { +inline Shader createCompatibilityShader(const Utility::Resource& rs, Version version, Shader::Type type) { Shader shader(version, type); #ifndef MAGNUM_TARGET_GLES @@ -52,7 +52,7 @@ inline Shader createCompatibilityShader(Version version, Shader::Type type) { shader.addSource("#ifndef GL_ES\n#define GL_ES 1\n#endif\n"); #endif - shader.addSource(Utility::Resource("MagnumShaders").get("compatibility.glsl")); + shader.addSource(rs.get("compatibility.glsl")); return shader; } diff --git a/src/Magnum/Shaders/MeshVisualizer.cpp b/src/Magnum/Shaders/MeshVisualizer.cpp index d5c78e570..2ef15334d 100644 --- a/src/Magnum/Shaders/MeshVisualizer.cpp +++ b/src/Magnum/Shaders/MeshVisualizer.cpp @@ -56,8 +56,8 @@ MeshVisualizer::MeshVisualizer(const Flags flags): flags(flags), transformationP const Version version = Context::current()->supportedVersion({Version::GLES300, Version::GLES200}); #endif - Shader vert = Implementation::createCompatibilityShader(version, Shader::Type::Vertex); - Shader frag = Implementation::createCompatibilityShader(version, Shader::Type::Fragment); + Shader vert = Implementation::createCompatibilityShader(rs, version, Shader::Type::Vertex); + Shader frag = Implementation::createCompatibilityShader(rs, version, Shader::Type::Fragment); vert.addSource(flags & Flag::Wireframe ? "#define WIREFRAME_RENDERING\n" : "") .addSource(flags & Flag::NoGeometryShader ? "#define NO_GEOMETRY_SHADER\n" : "") @@ -76,7 +76,7 @@ MeshVisualizer::MeshVisualizer(const Flags flags): flags(flags), transformationP #ifndef MAGNUM_TARGET_GLES std::optional geom; if(flags & Flag::Wireframe && !(flags & Flag::NoGeometryShader)) { - geom = Implementation::createCompatibilityShader(version, Shader::Type::Geometry); + geom = Implementation::createCompatibilityShader(rs, version, Shader::Type::Geometry); geom->addSource(rs.get("MeshVisualizer.geom")); } #endif diff --git a/src/Magnum/Shaders/Phong.cpp b/src/Magnum/Shaders/Phong.cpp index 5ae33d71c..24e0b89fb 100644 --- a/src/Magnum/Shaders/Phong.cpp +++ b/src/Magnum/Shaders/Phong.cpp @@ -53,8 +53,8 @@ Phong::Phong(const Flags flags): transformationMatrixUniform(0), projectionMatri const Version version = Context::current()->supportedVersion({Version::GLES300, Version::GLES200}); #endif - Shader vert = Implementation::createCompatibilityShader(version, Shader::Type::Vertex); - Shader frag = Implementation::createCompatibilityShader(version, Shader::Type::Fragment); + Shader vert = Implementation::createCompatibilityShader(rs, version, Shader::Type::Vertex); + Shader frag = Implementation::createCompatibilityShader(rs, version, Shader::Type::Fragment); vert.addSource(flags ? "#define TEXTURED\n" : "") .addSource(rs.get("generic.glsl")) diff --git a/src/Magnum/Shaders/Vector.cpp b/src/Magnum/Shaders/Vector.cpp index c3e855487..4a1709cb5 100644 --- a/src/Magnum/Shaders/Vector.cpp +++ b/src/Magnum/Shaders/Vector.cpp @@ -50,8 +50,8 @@ template Vector::Vector(): transformationPro const Version version = Context::current()->supportedVersion({Version::GLES300, Version::GLES200}); #endif - Shader vert = Implementation::createCompatibilityShader(version, Shader::Type::Vertex); - Shader frag = Implementation::createCompatibilityShader(version, Shader::Type::Fragment); + Shader vert = Implementation::createCompatibilityShader(rs, version, Shader::Type::Vertex); + Shader frag = Implementation::createCompatibilityShader(rs, version, Shader::Type::Fragment); vert.addSource(rs.get("generic.glsl")) .addSource(rs.get(vertexShaderName())); diff --git a/src/Magnum/Shaders/VertexColor.cpp b/src/Magnum/Shaders/VertexColor.cpp index f72450d4d..748eb7c55 100644 --- a/src/Magnum/Shaders/VertexColor.cpp +++ b/src/Magnum/Shaders/VertexColor.cpp @@ -50,8 +50,8 @@ template VertexColor::VertexColor(): transfo const Version version = Context::current()->supportedVersion({Version::GLES300, Version::GLES200}); #endif - Shader vert = Implementation::createCompatibilityShader(version, Shader::Type::Vertex); - Shader frag = Implementation::createCompatibilityShader(version, Shader::Type::Fragment); + Shader vert = Implementation::createCompatibilityShader(rs, version, Shader::Type::Vertex); + Shader frag = Implementation::createCompatibilityShader(rs, version, Shader::Type::Fragment); vert.addSource(rs.get("generic.glsl")) .addSource(rs.get(vertexShaderName())); diff --git a/src/Magnum/TextureTools/DistanceField.cpp b/src/Magnum/TextureTools/DistanceField.cpp index 42aadc390..d1ec0fac7 100644 --- a/src/Magnum/TextureTools/DistanceField.cpp +++ b/src/Magnum/TextureTools/DistanceField.cpp @@ -85,8 +85,8 @@ DistanceFieldShader::DistanceFieldShader(): radiusUniform(0), scalingUniform(1) const Version v = Context::current()->supportedVersion({Version::GLES300, Version::GLES200}); #endif - Shader vert = Shaders::Implementation::createCompatibilityShader(v, Shader::Type::Vertex); - Shader frag = Shaders::Implementation::createCompatibilityShader(v, Shader::Type::Fragment); + Shader vert = Shaders::Implementation::createCompatibilityShader(rs, v, Shader::Type::Vertex); + Shader frag = Shaders::Implementation::createCompatibilityShader(rs, v, Shader::Type::Fragment); vert.addSource(rs.get("FullScreenTriangle.glsl")) .addSource(rs.get("DistanceFieldShader.vert"));