GS-hw: Optimize fbmask on 16bit format.

Set fbmask to 0 if unused bits are the ones enabling it, they aren't used anyway.
This commit is contained in:
lightningterror 2022-02-04 17:02:50 +01:00
parent ae4733c59d
commit f84cb1c9cc
1 changed files with 7 additions and 1 deletions

View File

@ -298,7 +298,13 @@ void GSRendererNew::EmulateTextureShuffleAndFbmask()
{
m_conf.ps.dfmt = GSLocalMemory::m_psm[m_context->FRAME.PSM].fmt;
const GSVector4i fbmask_v = GSVector4i::load((int)m_context->FRAME.FBMSK);
// Don't allow only unused bits on 16bit format to enable fbmask,
// let's set the mask to 0 in such cases.
int fbmask = static_cast<int>(m_context->FRAME.FBMSK);
if (!(fbmask & 0x80F8F8F8) && fbmask != 0x0 && m_conf.ps.dfmt == 2)
fbmask = 0x0;
const GSVector4i fbmask_v = GSVector4i::load(fbmask);
const int ff_fbmask = fbmask_v.eq8(GSVector4i::xffffffff()).mask();
const int zero_fbmask = fbmask_v.eq8(GSVector4i::zero()).mask();