mirror of https://github.com/PCSX2/pcsx2.git
gsdx ogl: terminator 3 supports sampling from the depth
This commit is contained in:
parent
43a1c48f75
commit
564bf8a089
|
@ -347,10 +347,16 @@ vec4 fetch_rgb()
|
|||
|
||||
vec4 fetch_gXbY()
|
||||
{
|
||||
#if PS_DEPTH_FMT == 1 || PS_DEPTH_FMT == 2
|
||||
int depth = fetch_raw_depth();
|
||||
int bg = (depth >> (8 + ChannelShuffle.w)) & 0xFF;
|
||||
return vec4(bg);
|
||||
#else
|
||||
ivec4 rt = ivec4(fetch_raw_color() * 255.0f);
|
||||
int green = (rt.g >> ChannelShuffle.w) & ChannelShuffle.z;
|
||||
int blue = (rt.b << ChannelShuffle.y) & ChannelShuffle.x;
|
||||
return vec4(green | blue);
|
||||
#endif
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
|
|
@ -1192,10 +1192,16 @@ static const char* const tfx_fs_all_glsl =
|
|||
"\n"
|
||||
"vec4 fetch_gXbY()\n"
|
||||
"{\n"
|
||||
"#if PS_DEPTH_FMT == 1 || PS_DEPTH_FMT == 2\n"
|
||||
" int depth = fetch_raw_depth();\n"
|
||||
" int bg = (depth >> (8 + ChannelShuffle.w)) & 0xFF;\n"
|
||||
" return vec4(bg);\n"
|
||||
"#else\n"
|
||||
" ivec4 rt = ivec4(fetch_raw_color() * 255.0f);\n"
|
||||
" int green = (rt.g >> ChannelShuffle.w) & ChannelShuffle.z;\n"
|
||||
" int blue = (rt.b << ChannelShuffle.y) & ChannelShuffle.x;\n"
|
||||
" return vec4(green | blue);\n"
|
||||
"#endif\n"
|
||||
"}\n"
|
||||
"\n"
|
||||
"//////////////////////////////////////////////////////////////////////\n"
|
||||
|
|
Loading…
Reference in New Issue