gsdx ogl: terminator 3 supports sampling from the depth

This commit is contained in:
Gregory Hainaut 2016-05-30 19:39:52 +02:00
parent 43a1c48f75
commit 564bf8a089
2 changed files with 12 additions and 0 deletions

View File

@ -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
}
//////////////////////////////////////////////////////////////////////

View File

@ -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"