diff --git a/pcsx2/GS/Renderers/Common/GSDevice.h b/pcsx2/GS/Renderers/Common/GSDevice.h index d2356ab921..c0cae3bfdb 100644 --- a/pcsx2/GS/Renderers/Common/GSDevice.h +++ b/pcsx2/GS/Renderers/Common/GSDevice.h @@ -881,7 +881,6 @@ public: virtual void ClearRenderTarget(GSTexture* t, u32 c) = 0; virtual void InvalidateRenderTarget(GSTexture* t) = 0; virtual void ClearDepth(GSTexture* t) = 0; - virtual void ClearStencil(GSTexture* t, u8 c) = 0; virtual void PushDebugGroup(const char* fmt, ...) = 0; virtual void PopDebugGroup() = 0; diff --git a/pcsx2/GS/Renderers/DX11/GSDevice11.h b/pcsx2/GS/Renderers/DX11/GSDevice11.h index 1528fa58b6..15d80cc75a 100644 --- a/pcsx2/GS/Renderers/DX11/GSDevice11.h +++ b/pcsx2/GS/Renderers/DX11/GSDevice11.h @@ -313,7 +313,7 @@ public: void ClearRenderTarget(GSTexture* t, u32 c) override; void InvalidateRenderTarget(GSTexture* t) override; void ClearDepth(GSTexture* t) override; - void ClearStencil(GSTexture* t, u8 c) override; + void ClearStencil(GSTexture* t, u8 c); void PushDebugGroup(const char* fmt, ...) override; void PopDebugGroup() override; diff --git a/pcsx2/GS/Renderers/DX12/GSDevice12.cpp b/pcsx2/GS/Renderers/DX12/GSDevice12.cpp index cb2c5ce2d0..5b7dd1db81 100644 --- a/pcsx2/GS/Renderers/DX12/GSDevice12.cpp +++ b/pcsx2/GS/Renderers/DX12/GSDevice12.cpp @@ -677,19 +677,6 @@ void GSDevice12::ClearDepth(GSTexture* t) static_cast(t)->SetClearDepth(0.0f); } -void GSDevice12::ClearStencil(GSTexture* t, u8 c) -{ - if (!t) - return; - - EndRenderPass(); - - GSTexture12* dxt = static_cast(t); - dxt->TransitionToState(D3D12_RESOURCE_STATE_DEPTH_WRITE); - g_d3d12_context->GetCommandList()->ClearDepthStencilView( - dxt->GetWriteDescriptor(), D3D12_CLEAR_FLAG_STENCIL, 0.0f, c, 0, nullptr); -} - void GSDevice12::LookupNativeFormat(GSTexture::Format format, DXGI_FORMAT* d3d_format, DXGI_FORMAT* srv_format, DXGI_FORMAT* rtv_format, DXGI_FORMAT* dsv_format) const { diff --git a/pcsx2/GS/Renderers/DX12/GSDevice12.h b/pcsx2/GS/Renderers/DX12/GSDevice12.h index 810870ed4c..694fa0a4b6 100644 --- a/pcsx2/GS/Renderers/DX12/GSDevice12.h +++ b/pcsx2/GS/Renderers/DX12/GSDevice12.h @@ -283,7 +283,6 @@ public: void ClearRenderTarget(GSTexture* t, u32 c) override; void InvalidateRenderTarget(GSTexture* t) override; void ClearDepth(GSTexture* t) override; - void ClearStencil(GSTexture* t, u8 c) override; std::unique_ptr CreateDownloadTexture(u32 width, u32 height, GSTexture::Format format) override; diff --git a/pcsx2/GS/Renderers/Metal/GSDeviceMTL.h b/pcsx2/GS/Renderers/Metal/GSDeviceMTL.h index 96c85d56a2..2c6ed413a4 100644 --- a/pcsx2/GS/Renderers/Metal/GSDeviceMTL.h +++ b/pcsx2/GS/Renderers/Metal/GSDeviceMTL.h @@ -407,7 +407,6 @@ public: void ClearRenderTarget(GSTexture* t, const GSVector4& c) override; void ClearRenderTarget(GSTexture* t, u32 c) override; void ClearDepth(GSTexture* t) override; - void ClearStencil(GSTexture* t, u8 c) override; void InvalidateRenderTarget(GSTexture* t) override; std::unique_ptr CreateDownloadTexture(u32 width, u32 height, GSTexture::Format format) override; diff --git a/pcsx2/GS/Renderers/Metal/GSDeviceMTL.mm b/pcsx2/GS/Renderers/Metal/GSDeviceMTL.mm index 607016e6e6..5ef1442e24 100644 --- a/pcsx2/GS/Renderers/Metal/GSDeviceMTL.mm +++ b/pcsx2/GS/Renderers/Metal/GSDeviceMTL.mm @@ -1438,12 +1438,6 @@ void GSDeviceMTL::ClearDepth(GSTexture* t) static_cast(t)->RequestDepthClear(0); } -void GSDeviceMTL::ClearStencil(GSTexture* t, uint8 c) -{ - if (!t) return; - static_cast(t)->RequestStencilClear(c); -} - void GSDeviceMTL::InvalidateRenderTarget(GSTexture* t) { if (!t) return; diff --git a/pcsx2/GS/Renderers/OpenGL/GSDeviceOGL.h b/pcsx2/GS/Renderers/OpenGL/GSDeviceOGL.h index b71d7bb52e..33ea856175 100644 --- a/pcsx2/GS/Renderers/OpenGL/GSDeviceOGL.h +++ b/pcsx2/GS/Renderers/OpenGL/GSDeviceOGL.h @@ -314,7 +314,7 @@ public: void ClearRenderTarget(GSTexture* t, u32 c) override; void InvalidateRenderTarget(GSTexture* t) override; void ClearDepth(GSTexture* t) override; - void ClearStencil(GSTexture* t, u8 c) override; + void ClearStencil(GSTexture* t, u8 c); std::unique_ptr CreateDownloadTexture(u32 width, u32 height, GSTexture::Format format) override; diff --git a/pcsx2/GS/Renderers/Vulkan/GSDeviceVK.cpp b/pcsx2/GS/Renderers/Vulkan/GSDeviceVK.cpp index 2458ccd900..65b78a6e6c 100644 --- a/pcsx2/GS/Renderers/Vulkan/GSDeviceVK.cpp +++ b/pcsx2/GS/Renderers/Vulkan/GSDeviceVK.cpp @@ -825,24 +825,6 @@ void GSDeviceVK::ClearDepth(GSTexture* t) static_cast(t)->SetClearDepth(0.0f); } -void GSDeviceVK::ClearStencil(GSTexture* t, u8 c) -{ - if (!t) - return; - - EndRenderPass(); - - static_cast(t)->TransitionToLayout(GSTextureVK::Layout::ClearDst); - - const VkClearDepthStencilValue dsv{0.0f, static_cast(c)}; - const VkImageSubresourceRange srr{VK_IMAGE_ASPECT_STENCIL_BIT, 0u, 1u, 0u, 1u}; - - vkCmdClearDepthStencilImage(g_vulkan_context->GetCurrentCommandBuffer(), static_cast(t)->GetImage(), - VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, &dsv, 1, &srr); - - static_cast(t)->TransitionToLayout(GSTextureVK::Layout::DepthStencilAttachment); -} - VkFormat GSDeviceVK::LookupNativeFormat(GSTexture::Format format) const { static constexpr std::array(GSTexture::Format::BC7) + 1> s_format_mapping = {{ diff --git a/pcsx2/GS/Renderers/Vulkan/GSDeviceVK.h b/pcsx2/GS/Renderers/Vulkan/GSDeviceVK.h index 723bc975fa..89bdcda56e 100644 --- a/pcsx2/GS/Renderers/Vulkan/GSDeviceVK.h +++ b/pcsx2/GS/Renderers/Vulkan/GSDeviceVK.h @@ -269,7 +269,6 @@ public: void ClearRenderTarget(GSTexture* t, u32 c) override; void InvalidateRenderTarget(GSTexture* t) override; void ClearDepth(GSTexture* t) override; - void ClearStencil(GSTexture* t, u8 c) override; std::unique_ptr CreateDownloadTexture(u32 width, u32 height, GSTexture::Format format) override;