From 229499419b1228ebe9d4e58b48c7848910336c08 Mon Sep 17 00:00:00 2001 From: Stenzek Date: Sun, 12 May 2024 13:04:11 +1000 Subject: [PATCH] GS/DX12: Fix incorrect resource state of ImGui font --- pcsx2/GS/Renderers/DX12/GSDevice12.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/pcsx2/GS/Renderers/DX12/GSDevice12.cpp b/pcsx2/GS/Renderers/DX12/GSDevice12.cpp index 46d1cf7d23acd..9294bfb0b479b 100644 --- a/pcsx2/GS/Renderers/DX12/GSDevice12.cpp +++ b/pcsx2/GS/Renderers/DX12/GSDevice12.cpp @@ -2019,9 +2019,14 @@ void GSDevice12::RenderImGui() SetScissor(GSVector4i(clip)); - // Since we don't have the GSTexture... GSTexture12* tex = static_cast(pcmd->GetTexID()); - D3D12DescriptorHandle handle = tex ? tex->GetSRVDescriptor() : m_null_texture->GetSRVDescriptor(); + D3D12DescriptorHandle handle = m_null_texture->GetSRVDescriptor(); + if (tex) + { + tex->TransitionToState(D3D12_RESOURCE_STATE_PIXEL_SHADER_RESOURCE); + handle = tex->GetSRVDescriptor(); + } + if (m_utility_texture_cpu != handle) { m_utility_texture_cpu = handle;