Skip to content

Commit

Permalink
GS/HW: Check for null when source is either target or depth.
Browse files Browse the repository at this point in the history
  • Loading branch information
lightningterror committed Feb 1, 2025
1 parent bf8693a commit 666e9e3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pcsx2/GS/Renderers/HW/GSRendererHW.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5213,7 +5213,7 @@ __ri void GSRendererHW::HandleTextureHazards(const GSTextureCache::Target* rt, c
{
// Detect framebuffer read that will need special handling
const GSTextureCache::Target* src_target = nullptr;
if (m_conf.tex == m_conf.rt)
if (rt && m_conf.tex == m_conf.rt)
{
// Can we read the framebuffer directly? (i.e. sample location matches up).
if (CanUseTexIsFB(rt, tex, tmm))
Expand All @@ -5233,7 +5233,7 @@ __ri void GSRendererHW::HandleTextureHazards(const GSTextureCache::Target* rt, c
GL_CACHE("Source is render target, taking copy.");
src_target = rt;
}
else if (m_conf.tex == m_conf.ds)
else if (ds && m_conf.tex == m_conf.ds)
{
// GL, Vulkan (in General layout), not DirectX!
const bool can_read_current_depth_buffer = g_gs_device->Features().test_and_sample_depth;
Expand Down

0 comments on commit 666e9e3

Please sign in to comment.