diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2017-08-18 15:23:25 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2017-08-18 16:07:17 +0300 |
commit | 2018df9939d302dc6ebec0f4eb61e6d50bee07c2 (patch) | |
tree | f3b352b944221ec3ae185ea0300cde6a17c41d02 /source/blender/draw/engines/eevee/shaders/effect_minmaxz_frag.glsl | |
parent | 91ab64f38f354664f714fe2dab0a3a3bff2b7e9e (diff) |
Eevee: MinmaxZ: Avoid unecessary conversions.
Diffstat (limited to 'source/blender/draw/engines/eevee/shaders/effect_minmaxz_frag.glsl')
-rw-r--r-- | source/blender/draw/engines/eevee/shaders/effect_minmaxz_frag.glsl | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/source/blender/draw/engines/eevee/shaders/effect_minmaxz_frag.glsl b/source/blender/draw/engines/eevee/shaders/effect_minmaxz_frag.glsl index 71e249e1599..ce6f3568cdf 100644 --- a/source/blender/draw/engines/eevee/shaders/effect_minmaxz_frag.glsl +++ b/source/blender/draw/engines/eevee/shaders/effect_minmaxz_frag.glsl @@ -42,9 +42,9 @@ void main() val = minmax(val, val4); /* if we are reducing an odd-width texture then fetch the edge texels */ - if (((mipsize.x & 1) != 0) && (int(gl_FragCoord.x)*2 == mipsize.x-3)) { + if (((mipsize.x & 1) != 0) && (texelPos.x == mipsize.x - 3)) { /* if both edges are odd, fetch the top-left corner texel */ - if (((mipsize.y & 1) != 0) && (int(gl_FragCoord.y)*2 == mipsize.y-3)) { + if (((mipsize.y & 1) != 0) && (texelPos.y == mipsize.y - 3)) { val = minmax(val, sampleLowerMip(texelPos + ivec2(2, 2))); } float val2 = sampleLowerMip(texelPos + ivec2(2, 0)); @@ -53,7 +53,7 @@ void main() val = minmax(val, val3); } /* if we are reducing an odd-height texture then fetch the edge texels */ - if (((mipsize.y & 1) != 0) && (int(gl_FragCoord.y)*2 == mipsize.y-3)) { + if (((mipsize.y & 1) != 0) && (texelPos.y == mipsize.y - 3)) { float val2 = sampleLowerMip(texelPos + ivec2(0, 2)); float val3 = sampleLowerMip(texelPos + ivec2(1, 2)); val = minmax(val, val2); |