diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2020-08-30 14:08:59 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2020-08-30 14:35:25 +0300 |
commit | dee665b462f795c7927d55ebfa495e5531d82d60 (patch) | |
tree | 96bf9891ba7e52ed1823afd5b8bbfb4c329c2abc /source/blender/gpu/opengl/gl_shader.cc | |
parent | ad5d5d3f3bb2765a97cfc07202d00d8112701fea (diff) |
GPUShader: Improve shader compilation log
- Print shader type (fragment, vertex, geom)
- Support for Apple + intel error format.
- Handle formatting a bit more gracefully.
Diffstat (limited to 'source/blender/gpu/opengl/gl_shader.cc')
-rw-r--r-- | source/blender/gpu/opengl/gl_shader.cc | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/source/blender/gpu/opengl/gl_shader.cc b/source/blender/gpu/opengl/gl_shader.cc index 3ec818b53a6..17058a6a5a7 100644 --- a/source/blender/gpu/opengl/gl_shader.cc +++ b/source/blender/gpu/opengl/gl_shader.cc @@ -146,7 +146,17 @@ GLuint GLShader::create_shader_stage(GLenum gl_stage, MutableSpan<const char *> char log[5000] = ""; glGetShaderInfoLog(shader, sizeof(log), NULL, log); if (log[0] != '\0') { - this->print_errors(sources, log); + switch (gl_stage) { + case GL_VERTEX_SHADER: + this->print_errors(sources, log, "VertShader"); + break; + case GL_GEOMETRY_SHADER: + this->print_errors(sources, log, "GeomShader"); + break; + case GL_FRAGMENT_SHADER: + this->print_errors(sources, log, "FragShader"); + break; + } } } if (!status) { |