first pass at preventing repeated compileShader error prints

This commit is contained in:
SamGondelman 2016-06-17 17:49:27 -07:00
parent d8d4eb65ec
commit c30c2b64b2
2 changed files with 13 additions and 0 deletions

View file

@ -24,8 +24,15 @@ GLPipeline* GLPipeline::sync(const Pipeline& pipeline) {
// No object allocated yet, let's see if it's worth it...
ShaderPointer shader = pipeline.getProgram();
// If this pipeline's shader has already failed to compile, don't try again
if (shader->compilationHasFailed()) {
return nullptr;
}
GLShader* programObject = GLShader::sync(*shader);
if (programObject == nullptr) {
shader->setCompilationHasFailed(true);
return nullptr;
}

View file

@ -120,6 +120,9 @@ public:
bool isProgram() const { return getType() > NUM_DOMAINS; }
bool isDomain() const { return getType() < NUM_DOMAINS; }
void setCompilationHasFailed(bool compilationHasFailed) { _compilationHasFailed = compilationHasFailed; }
bool compilationHasFailed() const { return _compilationHasFailed; }
const Source& getSource() const { return _source; }
const Shaders& getShaders() const { return _shaders; }
@ -180,6 +183,9 @@ protected:
// The type of the shader, the master key
Type _type;
// Whether or not the shader compilation failed
mutable bool _compilationHasFailed { false };
};
typedef Shader::Pointer ShaderPointer;