GS/HW: Don't use TEXA on 16/24 bit when TCC is set to Vertex alpha

This commit is contained in:
refractionpcsx2 2023-08-26 02:13:47 +01:00
parent 447054a14f
commit 5df0c95e51
1 changed files with 14 additions and 5 deletions

View File

@ -4190,7 +4190,7 @@ __ri void GSRendererHW::EmulateTextureSampler(const GSTextureCache::Target* rt,
// Force a 32 bits access (normally shuffle is done on 16 bits)
// m_ps_sel.tex_fmt = 0; // removed as an optimization
m_conf.ps.aem = TEXA.AEM;
//ASSERT(tex->m_target);
// Require a float conversion if the texure is a depth otherwise uses Integral scaling
@ -4200,10 +4200,19 @@ __ri void GSRendererHW::EmulateTextureSampler(const GSTextureCache::Target* rt,
}
// Shuffle is a 16 bits format, so aem is always required
GSVector4 ta(TEXA & GSVector4i::x000000ff());
ta /= 255.0f;
m_conf.cb_ps.TA_MaxDepth_Af.x = ta.x;
m_conf.cb_ps.TA_MaxDepth_Af.y = ta.y;
if (m_cached_ctx.TEX0.TCC)
{
m_conf.ps.aem = TEXA.AEM;
GSVector4 ta(TEXA & GSVector4i::x000000ff());
ta /= 255.0f;
m_conf.cb_ps.TA_MaxDepth_Af.x = ta.x;
m_conf.cb_ps.TA_MaxDepth_Af.y = ta.y;
}
else
{
m_conf.cb_ps.TA_MaxDepth_Af.x = 0;
m_conf.cb_ps.TA_MaxDepth_Af.y = 1.0f;
}
// The purpose of texture shuffle is to move color channel. Extra interpolation is likely a bad idea.
bilinear &= m_vt.IsLinear();