glsl, fx: Update point sampler comment.

This commit is contained in:
lightningterror 2018-10-09 09:07:45 +02:00
parent b1ca6ba528
commit b360c07253
2 changed files with 4 additions and 2 deletions

View File

@ -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 File

@ -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);