KhronosGroup / KhronosGroup/glslang
[GLSL ES 1.0.17] extension directives must occur before any non-preprocessor tokens
- Dominant language
- C++
- Stars
- 3.6k
- Forks
- 989
- Avg merge
- 1d 2h
- Merged PRs (30d)
- 31
Description
In page 15 of the GLSL ES 1.0.17 specification, it states "extension directives must occur before any non-preprocessor tokens".
The following shader should cause a compiler error:
```
#version 100
uniform mediump vec4 colour;
#extension GL_OES_standard_derivatives : enable
void main() {
gl_FragColor = colour;
}
```
In Glslang Version: 3.0.790 15-Oct-2015, an error isn't generated.
Contributor guide
Research direction
Use the supplied GLSL ES shader as the reproducer and compare the compiler's diagnostics with the specification's ordering rule. Done means the compiler rejects the shader because the #extension directive follows a uniform declaration; add regression coverage wherever the existing compiler tests cover this validation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100