Browse Source

Import GL shader resources on static builds unconditionally.

It's faster that way because it doesn't involve a linear lookup, if the
resource is already imported it's a constant-time check and it becomes a
no-op.
pull/680/head
Vladimír Vondruš 8 months ago
parent
commit
507e8845d3
  1. 2
      src/Magnum/DebugTools/TextureImage.cpp
  2. 2
      src/Magnum/Shaders/DistanceFieldVectorGL.cpp
  3. 2
      src/Magnum/Shaders/FlatGL.cpp
  4. 2
      src/Magnum/Shaders/LineGL.cpp
  5. 2
      src/Magnum/Shaders/MeshVisualizerGL.cpp
  6. 2
      src/Magnum/Shaders/PhongGL.cpp
  7. 2
      src/Magnum/Shaders/VectorGL.cpp
  8. 2
      src/Magnum/Shaders/VertexColorGL.cpp
  9. 2
      src/Magnum/TextureTools/DistanceFieldGL.cpp

2
src/Magnum/DebugTools/TextureImage.cpp

@ -81,8 +81,6 @@ class FloatReinterpretShader: public GL::AbstractShaderProgram {
FloatReinterpretShader::FloatReinterpretShader() {
#ifdef MAGNUM_BUILD_STATIC
/* Import resources on static build, if not already */
if(!Utility::Resource::hasGroup("MagnumDebugTools"_s))
importDebugToolsResources();
#endif
Utility::Resource rs{"MagnumDebugTools"};

2
src/Magnum/Shaders/DistanceFieldVectorGL.cpp

@ -117,8 +117,6 @@ template<UnsignedInt dimensions> typename DistanceFieldVectorGL<dimensions>::Com
#endif
#ifdef MAGNUM_BUILD_STATIC
/* Import resources on static build, if not already */
if(!Utility::Resource::hasGroup("MagnumShadersGL"_s))
importShaderResources();
#endif
Utility::Resource rs("MagnumShadersGL"_s);

2
src/Magnum/Shaders/FlatGL.cpp

@ -155,8 +155,6 @@ template<UnsignedInt dimensions> typename FlatGL<dimensions>::CompileState FlatG
#endif
#ifdef MAGNUM_BUILD_STATIC
/* Import resources on static build, if not already */
if(!Utility::Resource::hasGroup("MagnumShadersGL"_s))
importShaderResources();
#endif
Utility::Resource rs("MagnumShadersGL"_s);

2
src/Magnum/Shaders/LineGL.cpp

@ -108,8 +108,6 @@ template<UnsignedInt dimensions> typename LineGL<dimensions>::CompileState LineG
}
#ifdef MAGNUM_BUILD_STATIC
/* Import resources on static build, if not already */
if(!Utility::Resource::hasGroup("MagnumShadersGL"_s))
importShaderResources();
#endif
Utility::Resource rs{"MagnumShadersGL"_s};

2
src/Magnum/Shaders/MeshVisualizerGL.cpp

@ -160,8 +160,6 @@ void MeshVisualizerGLBase::assertExtensions(const FlagsBase flags) {
#endif
#ifdef MAGNUM_BUILD_STATIC
/* Import resources on static build, if not already */
if(!Utility::Resource::hasGroup("MagnumShadersGL"_s))
importShaderResources();
#endif
}

2
src/Magnum/Shaders/PhongGL.cpp

@ -173,8 +173,6 @@ PhongGL::CompileState PhongGL::compile(const Configuration& configuration) {
#endif
#ifdef MAGNUM_BUILD_STATIC
/* Import resources on static build, if not already */
if(!Utility::Resource::hasGroup("MagnumShadersGL"_s))
importShaderResources();
#endif
Utility::Resource rs("MagnumShadersGL"_s);

2
src/Magnum/Shaders/VectorGL.cpp

@ -117,8 +117,6 @@ template<UnsignedInt dimensions> typename VectorGL<dimensions>::CompileState Vec
#endif
#ifdef MAGNUM_BUILD_STATIC
/* Import resources on static build, if not already */
if(!Utility::Resource::hasGroup("MagnumShadersGL"_s))
importShaderResources();
#endif
Utility::Resource rs("MagnumShadersGL"_s);

2
src/Magnum/Shaders/VertexColorGL.cpp

@ -104,8 +104,6 @@ template<UnsignedInt dimensions> typename VertexColorGL<dimensions>::CompileStat
#endif
#ifdef MAGNUM_BUILD_STATIC
/* Import resources on static build, if not already */
if(!Utility::Resource::hasGroup("MagnumShadersGL"_s))
importShaderResources();
#endif
Utility::Resource rs("MagnumShadersGL"_s);

2
src/Magnum/TextureTools/DistanceFieldGL.cpp

@ -82,8 +82,6 @@ class DistanceFieldShader: public GL::AbstractShaderProgram {
DistanceFieldShader::DistanceFieldShader(const UnsignedInt radius) {
#ifdef MAGNUM_BUILD_STATIC
/* Import resources on static build, if not already */
if(!Utility::Resource::hasGroup("MagnumTextureTools"_s))
importTextureToolResources();
#endif
Utility::Resource rs("MagnumTextureTools"_s);

Loading…
Cancel
Save