KhronosGroup / KhronosGroup/glslang

GL_ARB_ES3_1_compatibility extension not supported

Open
#4,098 2 comments 0 reactions 0 assignees View on GitHub
enhancement GLSL/ESSL
Dominant language
C++
Stars
3.6k
Forks
989
Avg merge
1d 2h
Merged PRs (30d)
31

Description

For `gl_HelperInvocation` in desktop GLSL this was added in [GL_ARB_ES3_1_compatibility ](https://registry.khronos.org/OpenGL/extensions/ARB/ARB_ES3_1_compatibility.txt) which became core in GLSL version 450. The extension though is written against GL 4.4 and so should be usable in a GLSL version 440 shader with the appropriate `#extension`.

It looks like glslang currently doesn't allow this extension: https://godbolt.org/z/j49Po3oW8

```
#version 440 core

#extension GL_ARB_ES3_1_compatibility : require

layout(binding = 0) uniform foo
{
vec4 data;
} bar;

layout(location = 0) out vec4 col;

void main() {
col = gl_HelperInvocation ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1);
}
```

As this produces an error:

```

:3: '#extension' : extension not supported: GL_ARB_ES3_1_compatibility
:3: '#extension' : extra tokens -- expected newline
:3: '' : compilation terminated
3 compilation errors. No code generated.
```

Hopefully I've understood the track of these extensions correctly and this should be allowed.

Contributor guide

Open the contributing guide

Research direction

Reproduce the shader from the issue in the linked Godbolt example using glslang. Trace how glslang handles #extension declarations and GLSL version compatibility, then verify that GL_ARB_ES3_1_compatibility is accepted for #version 440 and that the shader compiles without the reported errors.

Written by the indexing model from the issue text.

Assessment

Domain
compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.