gsdx-ogl: Small colclip improvements.

1. Allow hrd colclip to also run on the unsupported
cases which should be pretty rare.

2. Remove colclip from high sw blending.

3. Disable the hdr colclip shader which may not be
actually required to run.

Idea by Gregory
This commit is contained in:
lightningterror 2019-01-15 06:42:16 +01:00 committed by Gregory Hainaut
parent b5f0959e6d
commit dabc99f466
2 changed files with 8 additions and 7 deletions

View File

@ -561,7 +561,7 @@ void GSRendererOGL::EmulateBlending(bool DATE_GL42)
sw_blending |= (ALPHA.A != ALPHA.B) && sw_blending |= (ALPHA.A != ALPHA.B) &&
((ALPHA.C == 0 && m_vt.m_alpha.max > 128) || (ALPHA.C == 2 && ALPHA.FIX > 128u)); ((ALPHA.C == 0 && m_vt.m_alpha.max > 128) || (ALPHA.C == 2 && ALPHA.FIX > 128u));
// fall through // fall through
case ACC_BLEND_CCLIP_DALPHA: sw_blending |= (ALPHA.C == 1) || (m_env.COLCLAMP.CLAMP == 0); case ACC_BLEND_CCLIP_DALPHA: sw_blending |= (ALPHA.C == 1);
// Initial idea was to enable accurate blending for sprite rendering to handle // Initial idea was to enable accurate blending for sprite rendering to handle
// correctly post-processing effect. Some games (ZoE) use tons of sprites as particles. // correctly post-processing effect. Some games (ZoE) use tons of sprites as particles.
// In order to keep it fast, let's limit it to smaller draw call. // In order to keep it fast, let's limit it to smaller draw call.
@ -598,7 +598,8 @@ void GSRendererOGL::EmulateBlending(bool DATE_GL42)
m_ps_sel.colclip = 1; m_ps_sel.colclip = 1;
} else { } else {
// Speed hack skip previous slow algo // Speed hack skip previous slow algo
GL_INS("Sorry colclip isn't supported"); GL_INS("COLCLIP HDR Rare case ENABLED");
m_ps_sel.hdr = 1;
} }
} }

View File

@ -837,15 +837,15 @@ void ps_main()
ps_fbmask(C); ps_fbmask(C);
#if PS_HDR == 1 // #if PS_HDR == 1
// Use negative value to avoid overflow of the texture (in accumulation mode) // Use negative value to avoid overflow of the texture (in accumulation mode)
// Note: code were initially done for an Half-Float texture. Due to overflow // Note: code were initially done for an Half-Float texture. Due to overflow
// the texture was upgraded to a full float. Maybe this code is useless now! // the texture was upgraded to a full float. Maybe this code is useless now!
// Good testcase is castlevania // Good testcase is castlevania
if (any(greaterThan(C.rgb, vec3(128.0f)))) { // if (any(greaterThan(C.rgb, vec3(128.0f)))) {
C.rgb = (C.rgb - 256.0f); // C.rgb = (C.rgb - 256.0f);
} // }
#endif // #endif
SV_Target0 = C / 255.0f; SV_Target0 = C / 255.0f;
SV_Target1 = vec4(alpha_blend); SV_Target1 = vec4(alpha_blend);
} }