From 98b1a703f38b4f14274b112e2e2f073c605342e9 Mon Sep 17 00:00:00 2001 From: Stenzek Date: Sat, 10 Aug 2024 01:24:37 +1000 Subject: [PATCH] GPU/HW: Use texture instead of RTs for rewind/runahead w/o MSAA --- src/core/gpu_hw.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/core/gpu_hw.cpp b/src/core/gpu_hw.cpp index b08a596a2..d2e465821 100644 --- a/src/core/gpu_hw.cpp +++ b/src/core/gpu_hw.cpp @@ -340,11 +340,13 @@ bool GPU_HW::DoState(StateWrapper& sw, GPUTexture** host_texture, bool update_di { delete tex; - tex = - g_gpu_device - ->FetchTexture(m_vram_texture->GetWidth(), m_vram_texture->GetHeight(), 1, 1, m_vram_texture->GetSamples(), - GPUTexture::Type::RenderTarget, GPUTexture::Format::RGBA8, nullptr, 0) - .release(); + // We copy to/from the save state texture, but we can't have multisampled non-RTs. + tex = g_gpu_device + ->FetchTexture( + m_vram_texture->GetWidth(), m_vram_texture->GetHeight(), 1, 1, m_vram_texture->GetSamples(), + m_vram_texture->IsMultisampled() ? GPUTexture::Type::RenderTarget : GPUTexture::Type::Texture, + GPUTexture::Format::RGBA8, nullptr, 0) + .release(); *host_texture = tex; if (!tex) return false;