Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClément Foucault <foucault.clem@gmail.com>2020-08-30 14:08:59 +0300
committerClément Foucault <foucault.clem@gmail.com>2020-08-30 14:35:25 +0300
commitdee665b462f795c7927d55ebfa495e5531d82d60 (patch)
tree96bf9891ba7e52ed1823afd5b8bbfb4c329c2abc /source/blender/gpu/opengl
parentad5d5d3f3bb2765a97cfc07202d00d8112701fea (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')
-rw-r--r--source/blender/gpu/opengl/gl_shader.cc12
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) {