mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-09 21:32:31 +02:00
first pass at preventing repeated compileShader error prints
This commit is contained in:
parent
d8d4eb65ec
commit
c30c2b64b2
2 changed files with 13 additions and 0 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue