cherry picking Tony's fix for shader compilation time not taking soo long and adding better feedback from shader compilation

This commit is contained in:
samcake 2018-01-30 13:07:20 -08:00
parent 2dcedf9f39
commit d5e52834ef
4 changed files with 5 additions and 8 deletions

View file

@ -22,7 +22,7 @@ namespace gl {
bool compileShader(GLenum shaderDomain, const std::string& shaderSource, const std::string& defines, GLuint &shaderObject, std::string& message); bool compileShader(GLenum shaderDomain, const std::string& shaderSource, const std::string& defines, GLuint &shaderObject, std::string& message);
#endif #endif
GLuint compileProgram(const std::vector<GLuint>& glshaders, std::string& message, , std::vector<GLchar>& binary); GLuint compileProgram(const std::vector<GLuint>& glshaders, std::string& message, std::vector<GLchar>& binary);
} }

View file

@ -68,8 +68,8 @@ GLBackend& getBackend() {
return *INSTANCE; return *INSTANCE;
} }
bool GLBackend::makeProgram(Shader& shader, const Shader::BindingSet& slotBindings) { bool GLBackend::makeProgram(Shader& shader, const Shader::BindingSet& slotBindings, Shader::CompilationHandler handler) {
return GLShader::makeProgram(getBackend(), shader, slotBindings); return GLShader::makeProgram(getBackend(), shader, slotBindings, handler);
} }
GLBackend::CommandCall GLBackend::_commandCalls[Batch::NUM_COMMANDS] = GLBackend::CommandCall GLBackend::_commandCalls[Batch::NUM_COMMANDS] =

View file

@ -61,8 +61,8 @@ GLBackend& getBackend() {
return *INSTANCE; return *INSTANCE;
} }
bool GLBackend::makeProgram(Shader& shader, const Shader::BindingSet& slotBindings) { bool GLBackend::makeProgram(Shader& shader, const Shader::BindingSet& slotBindings, Shader::CompilationHandler handler) {
return GLShader::makeProgram(getBackend(), shader, slotBindings); return GLShader::makeProgram(getBackend(), shader, slotBindings, handler);
} }

View file

@ -138,9 +138,6 @@ public:
bool isProgram() const { return getType() > NUM_DOMAINS; } bool isProgram() const { return getType() > NUM_DOMAINS; }
bool isDomain() 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 Source& getSource() const { return _source; }
const Shaders& getShaders() const { return _shaders; } const Shaders& getShaders() const { return _shaders; }