PDA

View Full Version : Disappointed with GLSlang/GLSLValidate



JoshKlint
03-08-2014, 09:02 AM
When Khronos names GLSlang as the official reference compiler for GLSL, I thought this was a major step in the right direction. I thought I would add shader validation into my shader editor today and started testing out the GLSLValidate tool.

Modern OpenGL not supported
When I use version "400" in my shaders, the following warning is given:

Warning, version 400 is not yet complete; some version-specific features are pre
sent, but many are missing.

The OpenGL 4.0 specification was released four years ago (http://en.wikipedia.org/wiki/OpenGL#OpenGL_4.0). How much more time do they need?

Linking apparently not supported
I passed two files in my command line. Below are the contents of each.

shader.vert:

#version 400

void main()
{
gl_Position = vec4(0.0);
}

shader.frag:

#version 400

in vec4 myval;

out vec4 fragData0;

void main()
{
fragData0 = myval;
}

As you can see, this should cause a linking error since the fragment shader reads from a variable the vertex shader does not write to. However, no linking error occurs. As far as I can tell, the tool is not even attempting to link the two files.

Am I using this tool incorrectly, or is it really this limited?

Aleksandar
03-09-2014, 05:35 AM
When Khronos names GLSlang as the official reference compiler for GLSL, I thought this was a major step in the right direction. I thought I would add shader validation into my shader editor today and started testing out the GLSLValidate tool.
Thank you for pointing out, I haven't been aware that something like that even exists.



Modern OpenGL not supported
When I use version "400" in my shaders, the following warning is given:
The OpenGL 4.0 specification was released four years ago (http://en.wikipedia.org/wiki/OpenGL#OpenGL_4.0). How much more time do they need?

glslangValidator returns the same message for all GLSL version form 130 up to 440. So, don't vary, only the last six years are not fully supported. ;)


Am I using this tool incorrectly, or is it really this limited?
The usage is quite simple and you cannot make a mistake. The tool is simply not finished and totally useless.
Fortunately, the code is published through SVN, so it is likely it will gain functionality in some foreseeable future.

cepheus
03-10-2014, 10:26 AM
Note that glslangValidator is complete for compilation for current OpenGL ES, and still being finished for desktop GL and linking. It does have quite a bit of 4.x functionality, despite the warning. It currently supports:

OpenGL 3.x geometry shaders
OpenGL 4.0 tessellation shaders and texture gather
OpenGL 4.1 separate shader objects
OpenGL 4.2 partial 420pack features
OpenGL 4.4 enhanced layouts

Google OpenGL ES Reference Compiler for more detail, including that LunarG is accepting code contributions from developers that need specific functionality.