diff --git a/src/graphics/shaders.cpp b/src/graphics/shaders.cpp index e8c71ea05..ad02bf0c7 100644 --- a/src/graphics/shaders.cpp +++ b/src/graphics/shaders.cpp @@ -598,6 +598,11 @@ void glUniform1fWrapper(GLuint a, float b) glUniform1f(a, b); } +bool needsUBO() +{ + return irr_driver->needUBOWorkaround(); +} + namespace MeshShader { // Solid Normal and depth pass shaders diff --git a/src/graphics/shaders.hpp b/src/graphics/shaders.hpp index f16028c5f..2a6ccf60d 100644 --- a/src/graphics/shaders.hpp +++ b/src/graphics/shaders.hpp @@ -53,6 +53,7 @@ void glUniformMatrix4fvWraper(GLuint, size_t, unsigned, const float *mat); void glUniform3fWraper(GLuint, float, float, float); void glUniform2fWraper(GLuint a, float b, float c); void glUniform1fWrapper(GLuint, float); +bool needsUBO(); struct UniformHelper { @@ -128,7 +129,7 @@ public: void setUniforms(const Args & ... args) const { - if (irr_driver->needUBOWorkaround()) + if (needsUBO()) bypassUBO(Program); UniformHelper::setUniformsHelper(uniforms, args...); } @@ -158,7 +159,7 @@ public: void setUniforms(const Args & ... args) const { - if (irr_driver->needUBOWorkaround()) + if (needsUBO()) bypassUBO(Program); UniformHelper::setUniformsHelper(uniforms, args...); }