mirror of https://github.com/PCSX2/pcsx2.git
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:
parent
4f79c4d1cb
commit
1711a26bbb
|
@ -109,7 +109,7 @@ float4 sample_c(float2 uv)
|
||||||
|
|
||||||
float4 sample_p(float u)
|
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)
|
float4 sample_rt(float2 uv)
|
||||||
|
@ -338,7 +338,7 @@ float4 sample_4a(float4 uv)
|
||||||
if(PS_RT) c *= 128.0f / 255;
|
if(PS_RT) c *= 128.0f / 255;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return c;
|
return c * 255./256 + 0.5/256;
|
||||||
}
|
}
|
||||||
|
|
||||||
float4x4 sample_4p(float4 u)
|
float4x4 sample_4p(float4 u)
|
||||||
|
@ -394,14 +394,10 @@ float4 sample(float2 st, float q)
|
||||||
{
|
{
|
||||||
c = sample_4p(sample_4a(uv));
|
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));
|
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)
|
else if(PS_FMT == FMT_8)
|
||||||
{
|
{
|
||||||
c = sample_4p(sample_4a(uv));
|
c = sample_4p(sample_4a(uv));
|
||||||
|
|
Loading…
Reference in New Issue