KhronosGroup / KhronosGroup/glslang
README.md is misleading
- Dominant language
- C++
- Stars
- 3.6k
- Forks
- 989
- Avg merge
- 1d 2h
- Merged PRs (30d)
- 31
Description
unless I misunderstood it completely,
[here](https://github.com/KhronosGroup/glslang?tab=readme-ov-file#reference-validator-and-glslessl---ast-front-end) it says that "translation of GLSL/ESSL into an internal abstract syntax tree (AST)" is "Virtually complete"
and [here](https://github.com/KhronosGroup/glslang?tab=readme-ov-file#ast---spir-v-back-end) it says that translating "glslang's AST to the Khronos-specified SPIR-V intermediate language" is "Virtually complete"
however, this is far from truth. as detailed in this [issue](https://github.com/KhronosGroup/SPIRV-Cross/issues/2516), for the following shader that "works":
```
#version 150
in uvec4 attr_face;
in uint attr_vertex;
uniform vec3 transform[3];
uniform vec4 camera_pos;
uniform vec3 normal_table[32];
uniform mat4x4 model_view;
flat out uvec4 facedata;
out vec3 voxelspace_pos;
out vec3 vnormal;
out float texlerp;
out float amb_occ;
void main()
{
facedata = attr_face;
vec3 offset;
offset.x = float( (attr_vertex ) & 127u );
offset.y = float( (attr_vertex >> 7u) & 127u );
offset.z = float( (attr_vertex >> 14u) & 511u );
amb_occ = float( (attr_vertex >> 23u) & 63u ) / 63.0;
texlerp = float( (attr_vertex >> 29u) ) / 7.0;
vnormal = normal_table[(facedata.w>>2u) & 31u];
voxelspace_pos = offset * transform[0];
vec3 position = voxelspace_pos + transform[1];
gl_Position = model_view * vec4(position,1.0);
}
```
the following error is emitted:
```
$ glslangValidator.exe -G stb_voxel_render.vert
stb_voxel_render.vert
ERROR: #version: Desktop shaders for OpenGL SPIR-V require version 330 or higher
ERROR: stb_voxel_render.vert:2: 'location' : SPIR-V requires location for user input/output
ERROR: 2 compilation errors. No code generated.
ERROR: Linking vertex stage: Missing entry point: Each stage requires one entry point
SPIR-V is not generated for failed compile or link
```
hence, the README.md is misleading in saying that these components are "Virtually complete", when desktop GLSL versions 110, 120, 130, 140 and 150 are unsupported. you should update your README.md explicitly stating which versions are supported to avoid confusion. furthermore, I'd appreciate to know how many years it will take to support any of such versions, if ever.
Contributor guide
Research direction
Read the README.md sections titled “Reference Validator and glslang — AST Front End” and “AST — SPIR-V Back End,” then run the reported glslangValidator command against the shader example. Confirm which desktop GLSL versions are supported and update README.md to state the supported versions explicitly; done means the documentation no longer implies unsupported versions are complete.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- compilers, documentation
- Issue type
- Documentation
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100