mirror of https://github.com/PCSX2/pcsx2.git
GSdx-d3d: tfx.fx correct texture shuffle shaders.
Some values were incorrect, now I'm no expert but looking at the code and behavior seemed a bit wrong compared to gl. Improves d3d rendering on Sonic Unleashed, the purple screen is gone matching it with gl visuals.
This commit is contained in:
parent
7433ee7fc1
commit
728fa2c1a4
|
@ -815,36 +815,31 @@ PS_OUTPUT ps_main(PS_INPUT input)
|
|||
|
||||
PS_OUTPUT output;
|
||||
|
||||
if (PS_SHUFFLE){
|
||||
if (PS_SHUFFLE)
|
||||
{
|
||||
uint4 denorm_c = uint4(c * 255.0f + 0.5f);
|
||||
uint2 denorm_TA = uint2(float2(TA.xy) * 255.0f + 0.5f);
|
||||
|
||||
// Mask will take care of the correct destination
|
||||
if (PS_READ_BA){
|
||||
if (PS_READ_BA)
|
||||
c.rb = c.bb;
|
||||
}
|
||||
else {
|
||||
else
|
||||
c.rb = c.rr;
|
||||
}
|
||||
c.g = c.a;
|
||||
if (PS_READ_BA){
|
||||
if (denorm_c.a & 0x80)
|
||||
c.a = float((denorm_c.a & 0x7Fu) | (denorm_TA.y & 0x80u)) / 255.0f;
|
||||
else
|
||||
c.a = float((denorm_c.a & 0x7Fu) | (denorm_TA.x & 0x80u)) / 255.0f;
|
||||
|
||||
//c.g = c.a;
|
||||
}
|
||||
else {
|
||||
if (denorm_c.g & 0x80)
|
||||
c.a = float((denorm_c.g & 0x7Fu) | (denorm_TA.y & 0x80u)) / 255.0f;
|
||||
if (PS_READ_BA)
|
||||
{
|
||||
if (denorm_c.a & 0x80u)
|
||||
c.ga = (float2)(float((denorm_c.a & 0x7Fu) | (denorm_TA.y & 0x80u)) / 255.0f);
|
||||
else
|
||||
c.a = float((denorm_c.g & 0x7Fu) | (denorm_TA.x & 0x80u)) / 255.0f;
|
||||
|
||||
//c.g = c.a;
|
||||
c.ga = (float2)(float((denorm_c.a & 0x7Fu) | (denorm_TA.x & 0x80u)) / 255.0f);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (denorm_c.g & 0x80u)
|
||||
c.ga = (float2)(float((denorm_c.g & 0x7Fu) | (denorm_TA.y & 0x80u)) / 255.0f);
|
||||
else
|
||||
c.ga = (float2)(float((denorm_c.g & 0x7Fu) | (denorm_TA.x & 0x80u)) / 255.0f);
|
||||
}
|
||||
//Probably not right :/
|
||||
//c.g = c.b;
|
||||
}
|
||||
|
||||
output.c1 = c.a * 2; // used for alpha blending
|
||||
|
|
Loading…
Reference in New Issue