mirror of https://github.com/PCSX2/pcsx2.git
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:
parent
1c66851344
commit
f2a9b59aae
|
@ -295,7 +295,7 @@ void GSRendererDX11::EmulateTextureShuffleAndFbmask()
|
||||||
|
|
||||||
if (m_ps_sel.fbmask && enable_fbmask_emulation)
|
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.r = rg_mask;
|
||||||
ps_cb.FbMask.g = rg_mask;
|
ps_cb.FbMask.g = rg_mask;
|
||||||
ps_cb.FbMask.b = ba_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
|
// it will work. Masked bit will be constant and normally the same everywhere
|
||||||
// RT/FS output/Cached value.
|
// 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);*/
|
(GSLocalMemory::m_psm[m_context->FRAME.PSM].fmt == 2) ? 16 : 32);*/
|
||||||
m_bind_rtsample = true;
|
m_bind_rtsample = true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -261,12 +261,19 @@ void GSRendererOGL::EmulateTextureShuffleAndFbmask()
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_ps_sel.fbmask && m_sw_blending) {
|
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.r = rg_mask;
|
||||||
ps_cb.FbMask.g = rg_mask;
|
ps_cb.FbMask.g = rg_mask;
|
||||||
ps_cb.FbMask.b = ba_mask;
|
ps_cb.FbMask.b = ba_mask;
|
||||||
ps_cb.FbMask.a = ba_mask;
|
ps_cb.FbMask.a = ba_mask;
|
||||||
|
|
||||||
|
// 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;
|
m_require_full_barrier = true;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
m_ps_sel.fbmask = 0;
|
m_ps_sel.fbmask = 0;
|
||||||
}
|
}
|
||||||
|
@ -303,8 +310,8 @@ void GSRendererOGL::EmulateTextureShuffleAndFbmask()
|
||||||
TextureBarrier() will guarantee that writes have completed and caches
|
TextureBarrier() will guarantee that writes have completed and caches
|
||||||
have been invalidated before subsequent Draws are executed.
|
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
|
// No blending so hit unsafe path.
|
||||||
if (!(~ff_fbmask & ~zero_fbmask & 0x7) /*&& !UserHacks_safe_fbmask*/) {
|
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,
|
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);
|
(GSLocalMemory::m_psm[m_context->FRAME.PSM].fmt == 2) ? 16 : 32);
|
||||||
m_require_one_barrier = true;
|
m_require_one_barrier = true;
|
||||||
|
|
Loading…
Reference in New Issue