Skip to content
Permalink
Browse files

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
  • Loading branch information...
lightningterror committed Oct 3, 2019
1 parent 1c66851 commit f2a9b59aae417be940abd5d61e92635fb63a60f3
Showing with 13 additions and 6 deletions.
  1. +2 −2 plugins/GSdx/Renderers/DX11/GSRendererDX11.cpp
  2. +11 −4 plugins/GSdx/Renderers/OpenGL/GSRendererOGL.cpp
@@ -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;
}
@@ -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;

0 comments on commit f2a9b59

Please sign in to comment.
You can’t perform that action at this time.