From b1b3f0dbac7cbad21a4691bd3f5543e0c8018ffd Mon Sep 17 00:00:00 2001 From: Connor McLaughlin Date: Thu, 22 Dec 2022 20:39:07 +1000 Subject: [PATCH] GS/HW: Reuse texture for RT copy in DX12/GL/Vulkan Fixes VRAM usage blowing out with high blending. --- pcsx2/GS/Renderers/DX12/GSDevice12.cpp | 2 +- pcsx2/GS/Renderers/OpenGL/GSDeviceOGL.cpp | 2 +- pcsx2/GS/Renderers/Vulkan/GSDeviceVK.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pcsx2/GS/Renderers/DX12/GSDevice12.cpp b/pcsx2/GS/Renderers/DX12/GSDevice12.cpp index 2ebd07713b..594b8dc958 100644 --- a/pcsx2/GS/Renderers/DX12/GSDevice12.cpp +++ b/pcsx2/GS/Renderers/DX12/GSDevice12.cpp @@ -2626,7 +2626,7 @@ void GSDevice12::RenderHW(GSHWDrawConfig& config) else if (config.require_one_barrier) { // requires a copy of the RT - draw_rt_clone = static_cast(CreateTexture(rtsize.x, rtsize.y, 1, GSTexture::Format::Color, false)); + draw_rt_clone = static_cast(CreateTexture(rtsize.x, rtsize.y, 1, GSTexture::Format::Color, true)); if (draw_rt_clone) { EndRenderPass(); diff --git a/pcsx2/GS/Renderers/OpenGL/GSDeviceOGL.cpp b/pcsx2/GS/Renderers/OpenGL/GSDeviceOGL.cpp index 47a5cc0c42..ce7722bf3f 100644 --- a/pcsx2/GS/Renderers/OpenGL/GSDeviceOGL.cpp +++ b/pcsx2/GS/Renderers/OpenGL/GSDeviceOGL.cpp @@ -1868,7 +1868,7 @@ void GSDeviceOGL::RenderHW(GSHWDrawConfig& config) else if (config.require_one_barrier && !m_features.texture_barrier) { // Requires a copy of the RT - draw_rt_clone = CreateTexture(rtsize.x, rtsize.y, 1, GSTexture::Format::Color, false); + draw_rt_clone = CreateTexture(rtsize.x, rtsize.y, 1, GSTexture::Format::Color, true); GL_PUSH("Copy RT to temp texture for fbmask {%d,%d %dx%d}", config.drawarea.left, config.drawarea.top, config.drawarea.width(), config.drawarea.height()); diff --git a/pcsx2/GS/Renderers/Vulkan/GSDeviceVK.cpp b/pcsx2/GS/Renderers/Vulkan/GSDeviceVK.cpp index 1acb9ee1c8..1270b09611 100644 --- a/pcsx2/GS/Renderers/Vulkan/GSDeviceVK.cpp +++ b/pcsx2/GS/Renderers/Vulkan/GSDeviceVK.cpp @@ -3114,7 +3114,7 @@ void GSDeviceVK::RenderHW(GSHWDrawConfig& config) else if (config.require_one_barrier && !m_features.texture_barrier) { // requires a copy of the RT - draw_rt_clone = static_cast(CreateTexture(rtsize.x, rtsize.y, 1, GSTexture::Format::Color, false)); + draw_rt_clone = static_cast(CreateTexture(rtsize.x, rtsize.y, 1, GSTexture::Format::Color, true)); if (draw_rt_clone) { EndRenderPass();