GS-ogl: Sample depth on green channel.

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

View File

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

View File

@ -369,6 +369,17 @@ vec4 fetch_red()
return sample_p(rt.r) * 255.0f; return sample_p(rt.r) * 255.0f;
} }
vec4 fetch_green()
{
#if PS_DEPTH_FMT == 1 || PS_DEPTH_FMT == 2
int depth = (fetch_raw_depth() >> 8) & 0xFF;
vec4 rt = vec4(depth) / 255.0f;
#else
vec4 rt = fetch_raw_color();
#endif
return sample_p(rt.g) * 255.0f;
}
vec4 fetch_blue() vec4 fetch_blue()
{ {
#if PS_DEPTH_FMT == 1 || PS_DEPTH_FMT == 2 #if PS_DEPTH_FMT == 1 || PS_DEPTH_FMT == 2
@ -380,12 +391,6 @@ vec4 fetch_blue()
return sample_p(rt.b) * 255.0f; return sample_p(rt.b) * 255.0f;
} }
vec4 fetch_green()
{
vec4 rt = fetch_raw_color();
return sample_p(rt.g) * 255.0f;
}
vec4 fetch_alpha() vec4 fetch_alpha()
{ {
vec4 rt = fetch_raw_color(); vec4 rt = fetch_raw_color();