gsdx-ogl: add a new level for accurate blending

The updated medium level will run for all sprites. It helps sotc blooming effect and it remains
fast enough to be enabled by default (at least on 3D games)
The new high level will run for all sprites + color clipping
This commit is contained in:
Gregory Hainaut 2015-07-19 21:40:41 +02:00
parent 95c374bbcc
commit caadc73e1b
4 changed files with 19 additions and 9 deletions

View File

@ -487,8 +487,14 @@ void GSRendererOGL::DrawPrims(GSTexture* rt, GSTexture* ds, GSTextureCache::Sour
}
bool impossible_blend = m_sw_blending && (blend_flag & A_MAX);
bool all_blend_sw = (m_sw_blending >= ACC_BLEND_ULTRA)
|| (m_sw_blending >= ACC_BLEND_FULL && !( (ALPHA.A == ALPHA.B) || (ALPHA.C == 2 && afix <= 1.002f) ));
bool all_blend_sw;
switch (m_sw_blending) {
case ACC_BLEND_ULTRA: all_blend_sw = true; break;
case ACC_BLEND_FULL: all_blend_sw = !( (ALPHA.A == ALPHA.B) || (ALPHA.C == 2 && afix <= 1.002f) ); break;
case ACC_BLEND_CCLIP:
case ACC_BLEND_SPRITE: all_blend_sw = m_vt.m_primclass == GS_SPRITE_CLASS; break;
default: all_blend_sw = false; break;
}
bool sw_blending = free_blend // Free case
|| impossible_blend || all_blend_sw // Impossible blend or all

View File

@ -38,9 +38,10 @@ class GSRendererOGL : public GSRendererHW
enum ACC_BLEND {
ACC_BLEND_NONE = 0,
ACC_BLEND_FREE = 1,
ACC_BLEND_CCLIP = 2,
ACC_BLEND_FULL = 3,
ACC_BLEND_ULTRA = 4
ACC_BLEND_SPRITE = 2,
ACC_BLEND_CCLIP = 3,
ACC_BLEND_FULL = 4,
ACC_BLEND_ULTRA = 5
};
private:

View File

@ -127,7 +127,9 @@ const char* dialog_message(int ID, bool* updateText) {
"------------------------------------------------------------------\n"
"Basic\t: Emulate correctly most of the effects with a limited speed penality. It is the recommended setting.\n"
"------------------------------------------------------------------\n"
"Medium\t: Add full emulation of color wrapping. It helps Castlevania games. Be aware that it will half your FPS.\n"
"Medium\t: Add emulation of all sprites. Performance impact remains reasonable in 3D game.\n"
"------------------------------------------------------------------\n"
"High\t: Add full emulation of color wrapping. It helps Castlevania games. Be aware that it will half your FPS.\n"
"------------------------------------------------------------------\n"
"Full\t\t: Except few cases, the blending unit will be fully emulated by the shader. It is very slow! It is intended for debug\n"
"------------------------------------------------------------------\n"

View File

@ -188,9 +188,10 @@ GSdxApp::GSdxApp()
m_gs_acc_blend_level.push_back(GSSetting(0, "None", "Fastest"));
m_gs_acc_blend_level.push_back(GSSetting(1, "Basic", "Recommended"));
m_gs_acc_blend_level.push_back(GSSetting(2, "Medium", "Slow"));
m_gs_acc_blend_level.push_back(GSSetting(3, "Full", "Very Slow"));
m_gs_acc_blend_level.push_back(GSSetting(4, "Ultra", "Ultra Slow"));
m_gs_acc_blend_level.push_back(GSSetting(2, "Medium", ""));
m_gs_acc_blend_level.push_back(GSSetting(3, "High", "Slow"));
m_gs_acc_blend_level.push_back(GSSetting(4, "Full", "Very Slow"));
m_gs_acc_blend_level.push_back(GSSetting(5, "Ultra", "Ultra Slow"));
m_gpu_renderers.push_back(GSSetting(0, "Direct3D9 (Software)", ""));
m_gpu_renderers.push_back(GSSetting(1, "Direct3D11 (Software)", ""));