Closed einarf closed 4 years ago
Can be very useful in dev mode
E mgl.Error: GLSL Compiler failed
E
E vertex_shader
E =============
E [error] compiling vertex shader...
E
E 0001
E 0002 #version 330
E 0003
E 0004 uniform vec2 pos;
E 0005 uniform float scale;
E 0006
E 0007 in vec2 vert;
E 0008 out vec2 v_vert;
E 0009
E 0010 toto;
E
E error C0000: syntax error, unexpected ';', expecting "::" at token ";"
E
E 0011
E 0012 void main() {
E 0013 gl_Position = vec4(pos + vert * scale, 0.0, 1.0);
E 0014 v_vert = vert + ;
E
E error C0000: syntax error, unexpected ';', expecting "::" at token ";"
E
E 0015 }
E 0016
Begins to look good ;-)
I have to perform more (unit) tests and refactoring/cleaning the source code. I will PR in ModernGL repo and link with this issue.
Awesome! 💯
It totally makes sense doing this in moderngl. From this project we can use the #line
directive to make sure the output is sane. Some tweaks are often needed when adding preprocessors and when implementing the #include
directive.
https://www.khronos.org/opengl/wiki/Core_Language_(GLSL)#Preprocessor_directives
moving this to moderngl-window
Right now we simply show the default error message from moderngl. We should consider improving this feedback possibly adding some of the actual source in stdout and make the file name clearly visible.