GSDX: put all paletted texture samples through the same transformation from the UNORM 0-1 256 step mapping to a 0.5/256-255.5/256 mapping after seeing potential bugs with FMT_4HL and changed FMT_4HH because it seemed to be completely wrong. Nothing but 8 bit textures tested because I can't find a single game which uses 4 bit textures.

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5281 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
sudonim1@gmail.com 2012-06-10 16:04:47 +00:00
parent 4f79c4d1cb
commit 1711a26bbb
1 changed files with 3 additions and 7 deletions

View File

@ -109,7 +109,7 @@ float4 sample_c(float2 uv)
float4 sample_p(float u)
{
return Palette.Sample(PaletteSampler, u * 255./256 + 0.5/256);
return Palette.Sample(PaletteSampler, u);
}
float4 sample_rt(float2 uv)
@ -338,7 +338,7 @@ float4 sample_4a(float4 uv)
if(PS_RT) c *= 128.0f / 255;
#endif
return c;
return c * 255./256 + 0.5/256;
}
float4x4 sample_4p(float4 u)
@ -394,14 +394,10 @@ float4 sample(float2 st, float q)
{
c = sample_4p(sample_4a(uv));
}
else if(PS_FMT == FMT_4HL)
else if(PS_FMT == FMT_4HL || PS_FMT == FMT_4HH)
{
c = sample_4p(fmod(sample_4a(uv), 1.0f / 16));
}
else if(PS_FMT == FMT_4HH)
{
c = sample_4p(fmod(sample_4a(uv) * 16, 1.0f / 16));
}
else if(PS_FMT == FMT_8)
{
c = sample_4p(sample_4a(uv));