Skip to content

Commit 3ba8d71

Browse files
committed
Try to limit repetitive logging
1 parent da0276c commit 3ba8d71

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/Externals/spire/es-render/comp/Texture.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,11 @@ namespace shaders = spire;
3737

3838
namespace ren {
3939

40+
static std::map<int, std::map<std::string, bool>> textureUniformLogged;
41+
4042
void Texture::checkUniform(GLuint shaderID)
4143
{
42-
if (isSetUp() == false)
44+
if (!isSetUp())
4345
{
4446
bool boundUniform = false;
4547
std::vector<shaders::ShaderUniform> uniforms =
@@ -55,10 +57,11 @@ void Texture::checkUniform(GLuint shaderID)
5557
}
5658
}
5759

58-
if (boundUniform == false)
60+
if (!boundUniform && textureUniformLogged[shaderID].find(uniformName) == textureUniformLogged[shaderID].end())
5961
{
6062
std::cerr << "Unable to find uniform with name: " << uniformName <<
6163
" in shader with ID: " << shaderID << std::endl;
64+
textureUniformLogged[shaderID][uniformName] = true;
6265
}
6366
}
6467
}

0 commit comments

Comments
 (0)