gsdx-ogl: Hit unsafe instead of safe path for sw fbmask when there is no alpha blending. (#3100)

So far notable performance improvement show Spiderman 3 and Scarface of 1-2 fps when using basic blending. Full list of known affected games at #3100
This commit is contained in:
lightningterror 2019-10-03 15:50:19 +02:00 committed by GitHub
parent 1c66851344
commit f2a9b59aae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 6 deletions

View File

@ -295,7 +295,7 @@ void GSRendererDX11::EmulateTextureShuffleAndFbmask()
if (m_ps_sel.fbmask && enable_fbmask_emulation)
{
// fprintf(stderr, "%d: FBMASK SW emulated fb_mask:%x on tex shuffle\n", s_n, fbmask);
// fprintf(stderr, "%d: FBMASK Unsafe SW emulated fb_mask:%x on tex shuffle\n", s_n, fbmask);
ps_cb.FbMask.r = rg_mask;
ps_cb.FbMask.g = rg_mask;
ps_cb.FbMask.b = ba_mask;
@ -329,7 +329,7 @@ void GSRendererDX11::EmulateTextureShuffleAndFbmask()
// it will work. Masked bit will be constant and normally the same everywhere
// RT/FS output/Cached value.
/*fprintf(stderr, "%d: FBMASK SW emulated fb_mask:%x on %d bits format\n", s_n, m_context->FRAME.FBMSK,
/*fprintf(stderr, "%d: FBMASK Unsafe SW emulated fb_mask:%x on %d bits format\n", s_n, m_context->FRAME.FBMSK,
(GSLocalMemory::m_psm[m_context->FRAME.PSM].fmt == 2) ? 16 : 32);*/
m_bind_rtsample = true;
}

View File

@ -261,12 +261,19 @@ void GSRendererOGL::EmulateTextureShuffleAndFbmask()
}
if (m_ps_sel.fbmask && m_sw_blending) {
GL_INS("FBMASK SW emulated fb_mask:%x on tex shuffle", fbmask);
ps_cb.FbMask.r = rg_mask;
ps_cb.FbMask.g = rg_mask;
ps_cb.FbMask.b = ba_mask;
ps_cb.FbMask.a = ba_mask;
m_require_full_barrier = true;
// No blending so hit unsafe path.
if (!PRIM->ABE) {
GL_INS("FBMASK Unsafe SW emulated fb_mask:%x on tex shuffle", fbmask);
m_require_one_barrier = true;
} else {
GL_INS("FBMASK SW emulated fb_mask:%x on tex shuffle", fbmask);
m_require_full_barrier = true;
}
} else {
m_ps_sel.fbmask = 0;
}
@ -303,8 +310,8 @@ void GSRendererOGL::EmulateTextureShuffleAndFbmask()
TextureBarrier() will guarantee that writes have completed and caches
have been invalidated before subsequent Draws are executed.
*/
// Safe option was removed. Likely nobody never use it. Keep the code commented if it becomes useful one day
if (!(~ff_fbmask & ~zero_fbmask & 0x7) /*&& !UserHacks_safe_fbmask*/) {
// No blending so hit unsafe path.
if (!PRIM->ABE || !(~ff_fbmask & ~zero_fbmask & 0x7)) {
GL_INS("FBMASK Unsafe SW emulated fb_mask:%x on %d bits format", m_context->FRAME.FBMSK,
(GSLocalMemory::m_psm[m_context->FRAME.PSM].fmt == 2) ? 16 : 32);
m_require_one_barrier = true;