KhronosGroup / KhronosGroup/glslang
Doesn't support GL_EXT_shader_framebuffer_fetch
- Dominant language
- C++
- Stars
- 3.6k
- Forks
- 989
- Avg merge
- 1d 2h
- Merged PRs (30d)
- 31
Description
```
#version 300 es
#extension GL_EXT_shader_framebuffer_fetch : require
precision mediump float;
uniform sampler2D ContentTexture;
in vec2 vTextureCoordinate0;
inout lowp vec4 fragmentColor;
float blendMultiply(float colorBackdrop, float colorSource)
{
return colorBackdrop * colorSource;
}
float blendScreen(float colorBackdrop, float colorSource)
{
return 1.0 - (1.0 - colorBackdrop) * (1.0 - colorSource);
}
float blendHardLight(float colorBackdrop, float colorSource)
{
if (colorSource <= 0.5)
{
return blendMultiply(colorBackdrop, 2.0 * colorSource);
}
else
{
return blendScreen(colorBackdrop, 2.0 * colorSource - 1.0);
}
}
float blendOverlay(float colorBackdrop, float colorSource)
{
return blendHardLight(colorSource, colorBackdrop);
}
void main()
{
vec4 colorBackdrop = fragmentColor;
vec4 colorSource = texture2D(ContentTexture, vTextureCoordinate0);
colorBackdrop.rgb /= colorBackdrop.a;
colorSource.rgb /= colorSource.a;
fragmentColor = vec4(
blendOverlay(colorBackdrop.r, colorSource.r),
blendOverlay(colorBackdrop.g, colorSource.g),
blendOverlay(colorBackdrop.b, colorSource.b),
colorSource.a);
fragmentColor.rgb *= fragmentColor.a;
}
```
results in
```
ERROR: 0:2: '#extension' : extension not supported: GL_EXT_shader_framebuffer_fetch
ERROR: 0:2: '#extension' : extra tokens -- expected newline
ERROR: 2 compilation errors. No code generated.
ERROR: 0:2: '#extension' : extension not supported: GL_EXT_shader_framebuffer_fetch
ERROR: 0:2: '#extension' : extra tokens -- expected newline
ERROR: 0:2: '' : compilation terminated
ERROR: 3 compilation errors. No code generated.
```
Without the extension declaration the output is this:
```
ERROR: 0:7: '' : cannot use 'inout' at global scope
ERROR: 0:7: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
```
The same happens on ES2 syntax of the extension, where gl_LastFragData is not recognized.
Contributor guide
Research direction
Use the supplied ES 3 shader and the ES2 form as reproducers, starting with glslang's ESSL extension handling and the reported inout and gl_LastFragData diagnostics. Done means GL_EXT_shader_framebuffer_fetch is recognized in the relevant syntax and the example compiles without those errors.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100