GS/HW: Don't mess with ZMSK for no_ds

Fixes broken depth in Superman Returns.
This commit is contained in:
Stenzek 2023-04-28 15:28:04 +10:00 committed by lightningterror
parent 6535e7e43a
commit b5ebc19eff
2 changed files with 4 additions and 5 deletions

View File

@ -1524,7 +1524,6 @@ void GSRendererHW::Draw()
GL_CACHE("Disabling Z buffer because all tests will pass.");
m_cached_ctx.TEST.ZTST = ZTST_ALWAYS;
m_cached_ctx.ZBUF.ZMSK = true;
}
if (no_rt && no_ds)
@ -2512,9 +2511,9 @@ void GSRendererHW::SetupIA(float target_scale, float sx, float sy)
m_conf.nindices = m_index.tail;
}
void GSRendererHW::EmulateZbuffer()
void GSRendererHW::EmulateZbuffer(const GSTextureCache::Target* ds)
{
if (m_cached_ctx.TEST.ZTE)
if (ds && m_cached_ctx.TEST.ZTE)
{
m_conf.depth.ztst = m_cached_ctx.TEST.ZTST;
// AA1: Z is not written on lines since coverage is always less than 0x80.
@ -4188,7 +4187,7 @@ __ri void GSRendererHW::DrawPrims(GSTextureCache::Target* rt, GSTextureCache::Ta
m_conf.ds = ds ? ds->m_texture : nullptr;
// Z setup has to come before channel shuffle
EmulateZbuffer();
EmulateZbuffer(ds);
// HLE implementation of the channel selection effect
//

View File

@ -86,7 +86,7 @@ private:
bool& target_region, GSVector2i& unscaled_size, float& scale, GSTexture*& src_copy);
bool CanUseTexIsFB(const GSTextureCache::Target* rt, const GSTextureCache::Source* tex) const;
void EmulateZbuffer();
void EmulateZbuffer(const GSTextureCache::Target* ds);
void EmulateATST(float& AREF, GSHWDrawConfig::PSSelector& ps, bool pass_2);
void SetTCOffset();