gsdx ogl: add an HLE brightness/contrast shader for GT series.

It works and it is very fast. But it relies on CRC

Others effect need to be tested as well
This commit is contained in:
Gregory Hainaut 2016-05-06 15:18:22 +02:00
parent 91c164ecca
commit 70ee8c5bc4
3 changed files with 24 additions and 1 deletions

View File

@ -673,7 +673,12 @@ void GSRendererOGL::DrawPrims(GSTexture* rt, GSTexture* ds, GSTextureCache::Sour
//
// First let's check we really have a channel shuffle effect
if (m_channel_shuffle) {
if (m_context->CLAMP.WMS == 3 && ((m_context->CLAMP.MAXU & 0x8) == 8)) {
if (m_game.title == CRC::GT4 || m_game.title == CRC::GT3 || m_game.title == CRC::GTConcept) {
GL_INS("Gran Turismo RGB Channel");
ps_sel.channel = 7;
m_context->TEX0.TFX = TFX_DECAL;
rt = tex->m_from_target;
} else if (m_context->CLAMP.WMS == 3 && ((m_context->CLAMP.MAXU & 0x8) == 8)) {
// Read either blue or Alpha. Let's go for Blue ;)
// MGS3/Kill Zone
GL_INS("Blue channel");

View File

@ -331,6 +331,13 @@ vec4 fetch_alpha()
return sample_p(rt.a) * 255.0f;
}
vec4 fetch_rgb()
{
vec4 rt = fetch_raw_color();
vec4 c = vec4(sample_p(rt.r).r, sample_p(rt.g).g, sample_p(rt.b).b, 1.0f);
return c * 255.0f;
}
//////////////////////////////////////////////////////////////////////
vec4 sample_color(vec2 st)
@ -500,6 +507,8 @@ vec4 ps_color()
vec4 T = fetch_blue();
#elif PS_CHANNEL_FETCH == 4
vec4 T = fetch_alpha();
#elif PS_CHANNEL_FETCH == 7
vec4 T = fetch_rgb();
#elif PS_DEPTH_FMT > 0
// Integral coordinate
vec4 T = sample_depth(PSin.t_int.zw);

View File

@ -1175,6 +1175,13 @@ static const char* const tfx_fs_all_glsl =
" return sample_p(rt.a) * 255.0f;\n"
"}\n"
"\n"
"vec4 fetch_rgb()\n"
"{\n"
" vec4 rt = fetch_raw_color();\n"
" vec4 c = vec4(sample_p(rt.r).r, sample_p(rt.g).g, sample_p(rt.b).b, 1.0f);\n"
" return c * 255.0f;\n"
"}\n"
"\n"
"//////////////////////////////////////////////////////////////////////\n"
"\n"
"vec4 sample_color(vec2 st)\n"
@ -1344,6 +1351,8 @@ static const char* const tfx_fs_all_glsl =
" vec4 T = fetch_blue();\n"
"#elif PS_CHANNEL_FETCH == 4\n"
" vec4 T = fetch_alpha();\n"
"#elif PS_CHANNEL_FETCH == 7\n"
" vec4 T = fetch_rgb();\n"
"#elif PS_DEPTH_FMT > 0\n"
" // Integral coordinate\n"
" vec4 T = sample_depth(PSin.t_int.zw);\n"