Permalink
Browse files

glsl, fx: Update point sampler comment.

  • Loading branch information...
lightningterror committed Oct 9, 2018
1 parent b1ca6ba commit b360c0725307d19d369a47a447b433568b10f6ab
Showing with 4 additions and 2 deletions.
  1. +2 −1 plugins/GSdx/res/glsl/tfx_fs.glsl
  2. +2 −1 plugins/GSdx/res/tfx.fx
@@ -83,11 +83,12 @@ vec4 sample_c(vec2 uv)
#else
#if PS_POINT_SAMPLER
// Weird issue with ATI cards (happens on at least HD 4xxx and 5xxx),
// Weird issue with ATI/AMD cards,
// it looks like they add 127/128 of a texel to sampling coordinates
// occasionally causing point sampling to erroneously round up.
// I'm manually adjusting coordinates to the centre of texels here,
// though the centre is just paranoia, the top left corner works fine.
// As of 2018 this issue is still present.
uv = (trunc(uv * WH.zw) + vec2(0.5, 0.5)) / WH.zw;
#endif
View
@@ -115,11 +115,12 @@ float4 sample_c(float2 uv)
{
if (PS_POINT_SAMPLER)
{
// Weird issue with ATI cards (happens on at least HD 4xxx and 5xxx),
// Weird issue with ATI/AMD cards,
// it looks like they add 127/128 of a texel to sampling coordinates
// occasionally causing point sampling to erroneously round up.
// I'm manually adjusting coordinates to the centre of texels here,
// though the centre is just paranoia, the top left corner works fine.
// As of 2018 this issue is still present.
uv = (trunc(uv * WH.zw) + float2(0.5, 0.5)) / WH.zw;
}
return Texture.Sample(TextureSampler, uv);

0 comments on commit b360c07

Please sign in to comment.