From 21ac489d575662091be107fab0d807392b1e9fdf Mon Sep 17 00:00:00 2001 From: TellowKrinkle Date: Thu, 30 Oct 2025 20:44:45 -0500 Subject: [PATCH] VideoCommon: Fix render to texture in wrong layout --- Source/Core/VideoCommon/FramebufferManager.cpp | 8 ++++---- Source/Core/VideoCommon/TextureCacheBase.cpp | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Source/Core/VideoCommon/FramebufferManager.cpp b/Source/Core/VideoCommon/FramebufferManager.cpp index bec54b5b10..f3f6d3968e 100644 --- a/Source/Core/VideoCommon/FramebufferManager.cpp +++ b/Source/Core/VideoCommon/FramebufferManager.cpp @@ -337,8 +337,8 @@ AbstractTexture* FramebufferManager::ResolveEFBColorTexture(const MathUtil::Rect } else { - m_efb_color_texture->FinishedRendering(); g_gfx->BeginUtilityDrawing(); + m_efb_color_texture->FinishedRendering(); g_gfx->SetAndDiscardFramebuffer(m_efb_color_resolve_framebuffer.get()); g_gfx->SetPipeline(m_efb_color_resolve_pipeline.get()); g_gfx->SetTexture(0, m_efb_color_texture.get()); @@ -365,8 +365,8 @@ AbstractTexture* FramebufferManager::ResolveEFBDepthTexture(const MathUtil::Rect MathUtil::Rectangle clamped_region = region; clamped_region.ClampUL(0, 0, GetEFBWidth(), GetEFBHeight()); - m_efb_depth_texture->FinishedRendering(); g_gfx->BeginUtilityDrawing(); + m_efb_depth_texture->FinishedRendering(); g_gfx->SetAndDiscardFramebuffer(m_efb_depth_resolve_framebuffer.get()); g_gfx->SetPipeline(IsEFBMultisampled() ? m_efb_depth_resolve_pipeline.get() : m_efb_depth_cache.copy_pipeline.get()); @@ -389,8 +389,8 @@ bool FramebufferManager::ReinterpretPixelData(EFBReinterpretType convtype) // We don't discard here because discarding the framebuffer also throws away the depth // buffer, which we want to preserve. If we find this to be hindering performance in the // future (e.g. on mobile/tilers), it may be worth discarding only the color buffer. - m_efb_color_texture->FinishedRendering(); g_gfx->BeginUtilityDrawing(); + m_efb_color_texture->FinishedRendering(); g_gfx->SetFramebuffer(m_efb_convert_framebuffer.get()); g_gfx->SetViewportAndScissor(m_efb_framebuffer->GetRect()); g_gfx->SetPipeline(m_format_conversion_pipelines[static_cast(convtype)].get()); @@ -807,8 +807,8 @@ void FramebufferManager::PopulateEFBCache(bool depth, u32 tile_index, bool async // Downsample from internal resolution to 1x. // TODO: This won't produce correct results at IRs above 2x. More samples are required. // This is the same issue as with EFB copies. - src_texture->FinishedRendering(); g_gfx->BeginUtilityDrawing(); + src_texture->FinishedRendering(); const float rcp_src_width = 1.0f / m_efb_framebuffer->GetWidth(); const float rcp_src_height = 1.0f / m_efb_framebuffer->GetHeight(); diff --git a/Source/Core/VideoCommon/TextureCacheBase.cpp b/Source/Core/VideoCommon/TextureCacheBase.cpp index 46f571df30..f057c4f23d 100644 --- a/Source/Core/VideoCommon/TextureCacheBase.cpp +++ b/Source/Core/VideoCommon/TextureCacheBase.cpp @@ -2835,8 +2835,8 @@ void TextureCacheBase::CopyEFBToCacheEntry(RcTcacheEntry& entry, bool is_depth_c is_depth_copy ? g_framebuffer_manager->ResolveEFBDepthTexture(framebuffer_rect) : g_framebuffer_manager->ResolveEFBColorTexture(framebuffer_rect); - src_texture->FinishedRendering(); g_gfx->BeginUtilityDrawing(); + src_texture->FinishedRendering(); // Fill uniform buffer. struct Uniforms @@ -2909,8 +2909,8 @@ void TextureCacheBase::CopyEFB(AbstractStagingTexture* dst, const EFBCopyParams& params.depth ? g_framebuffer_manager->ResolveEFBDepthTexture(framebuffer_rect) : g_framebuffer_manager->ResolveEFBColorTexture(framebuffer_rect); - src_texture->FinishedRendering(); g_gfx->BeginUtilityDrawing(); + src_texture->FinishedRendering(); // Fill uniform buffer. struct Uniforms