GS: Remove ClearStencil from GSDevice

It's never used generically, and GSTexture's shared clear tracking doesn't support it
If anyone ever actually needs this, they should update GSTexture to make it properly tracked into a render pass load action
This commit is contained in:
TellowKrinkle 2023-05-16 21:59:54 -05:00 committed by lightningterror
parent c1f3f0a247
commit d88921bb58
9 changed files with 2 additions and 43 deletions

View File

@ -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;

View File

@ -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;

View File

@ -677,19 +677,6 @@ void GSDevice12::ClearDepth(GSTexture* t)
static_cast<GSTexture12*>(t)->SetClearDepth(0.0f);
}
void GSDevice12::ClearStencil(GSTexture* t, u8 c)
{
if (!t)
return;
EndRenderPass();
GSTexture12* dxt = static_cast<GSTexture12*>(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
{

View File

@ -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<GSDownloadTexture> CreateDownloadTexture(u32 width, u32 height, GSTexture::Format format) override;

View File

@ -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<GSDownloadTexture> CreateDownloadTexture(u32 width, u32 height, GSTexture::Format format) override;

View File

@ -1438,12 +1438,6 @@ void GSDeviceMTL::ClearDepth(GSTexture* t)
static_cast<GSTextureMTL*>(t)->RequestDepthClear(0);
}
void GSDeviceMTL::ClearStencil(GSTexture* t, uint8 c)
{
if (!t) return;
static_cast<GSTextureMTL*>(t)->RequestStencilClear(c);
}
void GSDeviceMTL::InvalidateRenderTarget(GSTexture* t)
{
if (!t) return;

View File

@ -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<GSDownloadTexture> CreateDownloadTexture(u32 width, u32 height, GSTexture::Format format) override;

View File

@ -825,24 +825,6 @@ void GSDeviceVK::ClearDepth(GSTexture* t)
static_cast<GSTextureVK*>(t)->SetClearDepth(0.0f);
}
void GSDeviceVK::ClearStencil(GSTexture* t, u8 c)
{
if (!t)
return;
EndRenderPass();
static_cast<GSTextureVK*>(t)->TransitionToLayout(GSTextureVK::Layout::ClearDst);
const VkClearDepthStencilValue dsv{0.0f, static_cast<u32>(c)};
const VkImageSubresourceRange srr{VK_IMAGE_ASPECT_STENCIL_BIT, 0u, 1u, 0u, 1u};
vkCmdClearDepthStencilImage(g_vulkan_context->GetCurrentCommandBuffer(), static_cast<GSTextureVK*>(t)->GetImage(),
VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, &dsv, 1, &srr);
static_cast<GSTextureVK*>(t)->TransitionToLayout(GSTextureVK::Layout::DepthStencilAttachment);
}
VkFormat GSDeviceVK::LookupNativeFormat(GSTexture::Format format) const
{
static constexpr std::array<VkFormat, static_cast<int>(GSTexture::Format::BC7) + 1> s_format_mapping = {{

View File

@ -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<GSDownloadTexture> CreateDownloadTexture(u32 width, u32 height, GSTexture::Format format) override;