From 4f79c4d1cbe417b36d3b5e314a1c43e5e681a1bf Mon Sep 17 00:00:00 2001 From: "sudonim1@gmail.com" Date: Sat, 9 Jun 2012 08:03:27 +0000 Subject: [PATCH] GSDX: Fixed my inability to remember or look up (I swear that page was hiding) coordinate systems in r5279 and assumed that it was a rounding error instead. The symptom was that palette indices above around 250 were being rounded up to the next palette entry causing visible glitches (only in D3D10 for some reason). Changed the code to keep the fractional part after multiplication by 256 around 0.5 and the steps around 1.0. Should be very safe against small errors. git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5280 96395faa-99c1-11dd-bbfe-3dabce05a288 --- plugins/GSdx/res/tfx.fx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/GSdx/res/tfx.fx b/plugins/GSdx/res/tfx.fx index 0650982c34..47a8114fbc 100644 --- a/plugins/GSdx/res/tfx.fx +++ b/plugins/GSdx/res/tfx.fx @@ -109,7 +109,7 @@ float4 sample_c(float2 uv) float4 sample_p(float u) { - return Palette.Sample(PaletteSampler, u * 255./256); + return Palette.Sample(PaletteSampler, u * 255./256 + 0.5/256); } float4 sample_rt(float2 uv) @@ -199,7 +199,7 @@ float4 sample_c(float2 uv) float4 sample_p(float u) { - return tex2D(Palette, u * 255./256 + 1./512); + return tex2D(Palette, u * 255./256 + 0.5/256); } float4 sample_rt(float2 uv)