GS/HW: Prevent assertion in StretchRect().
Some checks are pending
🐧 Linux Builds / AppImage (push) Waiting to run
🐧 Linux Builds / Flatpak (push) Waiting to run
🍎 MacOS Builds / Defaults (push) Waiting to run
🖥️ Windows Builds / Lint VS Project Files (push) Waiting to run
🖥️ Windows Builds / SSE4 (push) Blocked by required conditions
🖥️ Windows Builds / AVX2 (push) Blocked by required conditions
🖥️ Windows Builds / CMake (push) Waiting to run

Depth copy was using the color StretchRect() causing an assertion in debug builds.
This commit is contained in:
TJnotJT 2025-12-10 18:02:54 -05:00 committed by lightningterror
parent 65e209b0f0
commit 461f01718c

View File

@ -2323,7 +2323,17 @@ void GSTextureCache::CombineAlignedInsideTargets(Target* target, GSTextureCache:
GL_CACHE("Combining %x-%x in to %x-%x draw %d", t->m_TEX0.TBP0, t->m_end_block, target->m_TEX0.TBP0, target->m_end_block, GSState::s_n);
g_gs_device->StretchRect(t->m_texture, source_rect, target->m_texture, target_drect, valid_color, valid_color, valid_color, valid_alpha, (target->m_type == RenderTarget) ? ShaderConvert::COPY : ShaderConvert::DEPTH_COPY);
if (target->m_type == RenderTarget)
{
g_gs_device->StretchRect(t->m_texture, source_rect, target->m_texture,
target_drect, valid_color, valid_color, valid_color, valid_alpha, ShaderConvert::COPY);
}
else
{
if (!valid_color || (!valid_alpha && (GSUtil::GetChannelMask(t->m_TEX0.PSM) & 0x8)))
GL_CACHE("Warning: CombineAlignedInsideTargets: Depth copy with invalid lower 24 bits or invalid upper 8 bits.");
g_gs_device->StretchRect(t->m_texture, source_rect, target->m_texture, target_drect, ShaderConvert::DEPTH_COPY);
}
target->UpdateValidity(target_drect_unscaled);
}