Workaround for a strange GLSL bug
It seems like GLSL compiler is incorrectly inlining 'texelFetch(int index, ...)' and thus implicitly casting sampler2D to int
This commit is contained in:
parent
178d486b6f
commit
0ede28b03d
2 changed files with 6 additions and 1 deletions
|
|
@ -43,7 +43,7 @@ void main()
|
|||
{
|
||||
if (USE_DEPTHFADETHRESHOLD)
|
||||
{
|
||||
float behindFragmentDepth = texelFetch(LinearDepth, uViewOffset + ivec2(gl_FragCoord.xy), 0).r;
|
||||
float behindFragmentDepth = texelFetchSampler2D(LinearDepth, uViewOffset + ivec2(gl_FragCoord.xy), 0).r;
|
||||
material.Base.a *= clamp((behindFragmentDepth - pixelpos.w) / uDepthFadeThreshold, 0.0, 1.0);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -121,3 +121,8 @@ vec4 texelFetch(int index, ivec2 P, int lod)
|
|||
{
|
||||
return texelFetch(textures[nonuniformEXT(uTextureIndex + index)], P, lod);
|
||||
}
|
||||
|
||||
vec4 texelFetchSampler2D(sampler2D s, ivec2 P, int lod)
|
||||
{
|
||||
return texelFetch(s, P, lod);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue