GS-d3d11: Sample depth on green channel.

This commit is contained in:
lightningterror 2021-12-05 05:55:57 +01:00
parent bb55c320c1
commit 464ce1c3cd
2 changed files with 18 additions and 7 deletions

View File

@ -375,7 +375,7 @@ void GSRendererDX11::EmulateChannelShuffle(GSTexture** rt, const GSTextureCache:
case 0xE0: blue_shift = 5; break;
case 0xC0: blue_shift = 6; break;
case 0x80: blue_shift = 7; break;
default: ASSERT(0); break;
default: break;
}
const int green_shift = 8 - blue_shift;

View File

@ -410,6 +410,23 @@ float4 fetch_red(int2 xy)
return sample_p(rt.r) * 255.0f;
}
float4 fetch_green(int2 xy)
{
float4 rt;
if ((PS_DEPTH_FMT == 1) || (PS_DEPTH_FMT == 2))
{
int depth = (fetch_raw_depth(xy) >> 8) & 0xFF;
rt = (float4)(depth) / 255.0f;
}
else
{
rt = fetch_raw_color(xy);
}
return sample_p(rt.g) * 255.0f;
}
float4 fetch_blue(int2 xy)
{
float4 rt;
@ -427,12 +444,6 @@ float4 fetch_blue(int2 xy)
return sample_p(rt.b) * 255.0f;
}
float4 fetch_green(int2 xy)
{
float4 rt = fetch_raw_color(xy);
return sample_p(rt.g) * 255.0f;
}
float4 fetch_alpha(int2 xy)
{
float4 rt = fetch_raw_color(xy);