mirror of https://github.com/PCSX2/pcsx2.git
GS: Move clear functions to base GSDevice class
This commit is contained in:
parent
e5a5cf0ef0
commit
33af3392aa
|
@ -228,6 +228,21 @@ bool GSDevice::GetHostRefreshRate(float* refresh_rate)
|
|||
return WindowInfo::QueryRefreshRateForWindow(m_window_info, refresh_rate);
|
||||
}
|
||||
|
||||
void GSDevice::ClearRenderTarget(GSTexture* t, u32 c)
|
||||
{
|
||||
t->SetClearColor(c);
|
||||
}
|
||||
|
||||
void GSDevice::ClearDepth(GSTexture* t, float d)
|
||||
{
|
||||
t->SetClearDepth(d);
|
||||
}
|
||||
|
||||
void GSDevice::InvalidateRenderTarget(GSTexture* t)
|
||||
{
|
||||
t->SetState(GSTexture::State::Invalidated);
|
||||
}
|
||||
|
||||
bool GSDevice::UpdateImGuiFontTexture()
|
||||
{
|
||||
ImGuiIO& io = ImGui::GetIO();
|
||||
|
|
|
@ -877,9 +877,9 @@ public:
|
|||
/// Returns the amount of GPU time utilized since the last time this method was called.
|
||||
virtual float GetAndResetAccumulatedGPUTime() = 0;
|
||||
|
||||
virtual void ClearRenderTarget(GSTexture* t, u32 c) = 0;
|
||||
virtual void InvalidateRenderTarget(GSTexture* t) = 0;
|
||||
virtual void ClearDepth(GSTexture* t, float d) = 0;
|
||||
void ClearRenderTarget(GSTexture* t, u32 c);
|
||||
void ClearDepth(GSTexture* t, float d);
|
||||
void InvalidateRenderTarget(GSTexture* t);
|
||||
|
||||
virtual void PushDebugGroup(const char* fmt, ...) = 0;
|
||||
virtual void PopDebugGroup() = 0;
|
||||
|
|
|
@ -1057,21 +1057,6 @@ void GSDevice11::DrawIndexedPrimitive(int offset, int count)
|
|||
m_ctx->DrawIndexed(count, m_index.start + offset, m_vertex.start);
|
||||
}
|
||||
|
||||
void GSDevice11::ClearRenderTarget(GSTexture* t, u32 c)
|
||||
{
|
||||
t->SetClearColor(c);
|
||||
}
|
||||
|
||||
void GSDevice11::InvalidateRenderTarget(GSTexture* t)
|
||||
{
|
||||
t->SetState(GSTexture::State::Invalidated);
|
||||
}
|
||||
|
||||
void GSDevice11::ClearDepth(GSTexture* t, float d)
|
||||
{
|
||||
t->SetClearDepth(d);
|
||||
}
|
||||
|
||||
void GSDevice11::CommitClear(GSTexture* t)
|
||||
{
|
||||
GSTexture11* T = static_cast<GSTexture11*>(t);
|
||||
|
|
|
@ -309,10 +309,6 @@ public:
|
|||
void DrawIndexedPrimitive();
|
||||
void DrawIndexedPrimitive(int offset, int count);
|
||||
|
||||
void ClearRenderTarget(GSTexture* t, u32 c) override;
|
||||
void InvalidateRenderTarget(GSTexture* t) override;
|
||||
void ClearDepth(GSTexture* t, float v) override;
|
||||
|
||||
void PushDebugGroup(const char* fmt, ...) override;
|
||||
void PopDebugGroup() override;
|
||||
void InsertDebugMessage(DebugMessageCategory category, const char* fmt, ...) override;
|
||||
|
|
|
@ -639,30 +639,6 @@ void GSDevice12::DrawIndexedPrimitive(int offset, int count)
|
|||
g_d3d12_context->GetCommandList()->DrawIndexedInstanced(count, 1, m_index.start + offset, m_vertex.start, 0);
|
||||
}
|
||||
|
||||
void GSDevice12::ClearRenderTarget(GSTexture* t, u32 c)
|
||||
{
|
||||
if (m_current_render_target == t)
|
||||
EndRenderPass();
|
||||
|
||||
t->SetClearColor(c);
|
||||
}
|
||||
|
||||
void GSDevice12::InvalidateRenderTarget(GSTexture* t)
|
||||
{
|
||||
if (m_current_render_target == t || m_current_depth_target == t)
|
||||
EndRenderPass();
|
||||
|
||||
t->SetState(GSTexture::State::Invalidated);
|
||||
}
|
||||
|
||||
void GSDevice12::ClearDepth(GSTexture* t, float d)
|
||||
{
|
||||
if (m_current_depth_target == t)
|
||||
EndRenderPass();
|
||||
|
||||
t->SetClearDepth(d);
|
||||
}
|
||||
|
||||
void GSDevice12::LookupNativeFormat(GSTexture::Format format, DXGI_FORMAT* d3d_format, DXGI_FORMAT* srv_format,
|
||||
DXGI_FORMAT* rtv_format, DXGI_FORMAT* dsv_format) const
|
||||
{
|
||||
|
|
|
@ -279,10 +279,6 @@ public:
|
|||
void DrawIndexedPrimitive();
|
||||
void DrawIndexedPrimitive(int offset, int count);
|
||||
|
||||
void ClearRenderTarget(GSTexture* t, u32 c) override;
|
||||
void InvalidateRenderTarget(GSTexture* t) override;
|
||||
void ClearDepth(GSTexture* t, float d) override;
|
||||
|
||||
std::unique_ptr<GSDownloadTexture> CreateDownloadTexture(u32 width, u32 height, GSTexture::Format format) override;
|
||||
|
||||
void CopyRect(GSTexture* sTex, GSTexture* dTex, const GSVector4i& r, u32 destX, u32 destY) override;
|
||||
|
|
|
@ -404,10 +404,6 @@ public:
|
|||
float GetAndResetAccumulatedGPUTime() override;
|
||||
void AccumulateCommandBufferTime(id<MTLCommandBuffer> buffer);
|
||||
|
||||
void ClearRenderTarget(GSTexture* t, u32 c) override;
|
||||
void ClearDepth(GSTexture* t, float d) override;
|
||||
void InvalidateRenderTarget(GSTexture* t) override;
|
||||
|
||||
std::unique_ptr<GSDownloadTexture> CreateDownloadTexture(u32 width, u32 height, GSTexture::Format format) override;
|
||||
|
||||
void ClearSamplerCache() override;
|
||||
|
|
|
@ -1424,21 +1424,6 @@ void GSDeviceMTL::AccumulateCommandBufferTime(id<MTLCommandBuffer> buffer)
|
|||
#pragma clang diagnostic pop
|
||||
}
|
||||
|
||||
void GSDeviceMTL::ClearRenderTarget(GSTexture* t, uint32 c)
|
||||
{
|
||||
t->SetClearColor(c);
|
||||
}
|
||||
|
||||
void GSDeviceMTL::ClearDepth(GSTexture* t, float d)
|
||||
{
|
||||
t->SetClearDepth(d);
|
||||
}
|
||||
|
||||
void GSDeviceMTL::InvalidateRenderTarget(GSTexture* t)
|
||||
{
|
||||
t->SetState(GSTexture::State::Invalidated);
|
||||
}
|
||||
|
||||
std::unique_ptr<GSDownloadTexture> GSDeviceMTL::CreateDownloadTexture(u32 width, u32 height, GSTexture::Format format)
|
||||
{
|
||||
return GSDownloadTextureMTL::Create(this, width, height, format);
|
||||
|
|
|
@ -961,21 +961,6 @@ void GSDeviceOGL::CommitClear(GSTexture* t, bool use_write_fbo)
|
|||
}
|
||||
}
|
||||
|
||||
void GSDeviceOGL::ClearRenderTarget(GSTexture* t, u32 c)
|
||||
{
|
||||
t->SetClearColor(c);
|
||||
}
|
||||
|
||||
void GSDeviceOGL::InvalidateRenderTarget(GSTexture* t)
|
||||
{
|
||||
t->SetState(GSTexture::State::Invalidated);
|
||||
}
|
||||
|
||||
void GSDeviceOGL::ClearDepth(GSTexture* t, float d)
|
||||
{
|
||||
t->SetClearDepth(d);
|
||||
}
|
||||
|
||||
std::unique_ptr<GSDownloadTexture> GSDeviceOGL::CreateDownloadTexture(u32 width, u32 height, GSTexture::Format format)
|
||||
{
|
||||
return GSDownloadTextureOGL::Create(width, height, format);
|
||||
|
|
|
@ -311,10 +311,6 @@ public:
|
|||
void DrawIndexedPrimitive();
|
||||
void DrawIndexedPrimitive(int offset, int count);
|
||||
|
||||
void ClearRenderTarget(GSTexture* t, u32 c) override;
|
||||
void InvalidateRenderTarget(GSTexture* t) override;
|
||||
void ClearDepth(GSTexture* t, float d) override;
|
||||
|
||||
std::unique_ptr<GSDownloadTexture> CreateDownloadTexture(u32 width, u32 height, GSTexture::Format format) override;
|
||||
|
||||
GSTexture* InitPrimDateTexture(GSTexture* rt, const GSVector4i& area, bool datm);
|
||||
|
|
|
@ -790,21 +790,6 @@ void GSDeviceVK::DrawIndexedPrimitive(int offset, int count)
|
|||
vkCmdDrawIndexed(g_vulkan_context->GetCurrentCommandBuffer(), count, 1, m_index.start + offset, m_vertex.start, 0);
|
||||
}
|
||||
|
||||
void GSDeviceVK::ClearRenderTarget(GSTexture* t, u32 c)
|
||||
{
|
||||
t->SetClearColor(c);
|
||||
}
|
||||
|
||||
void GSDeviceVK::InvalidateRenderTarget(GSTexture* t)
|
||||
{
|
||||
t->SetState(GSTexture::State::Invalidated);
|
||||
}
|
||||
|
||||
void GSDeviceVK::ClearDepth(GSTexture* t, float d)
|
||||
{
|
||||
t->SetClearDepth(d);
|
||||
}
|
||||
|
||||
VkFormat GSDeviceVK::LookupNativeFormat(GSTexture::Format format) const
|
||||
{
|
||||
static constexpr std::array<VkFormat, static_cast<int>(GSTexture::Format::BC7) + 1> s_format_mapping = {{
|
||||
|
|
|
@ -265,10 +265,6 @@ public:
|
|||
void DrawIndexedPrimitive();
|
||||
void DrawIndexedPrimitive(int offset, int count);
|
||||
|
||||
void ClearRenderTarget(GSTexture* t, u32 c) override;
|
||||
void InvalidateRenderTarget(GSTexture* t) override;
|
||||
void ClearDepth(GSTexture* t, float d) override;
|
||||
|
||||
std::unique_ptr<GSDownloadTexture> CreateDownloadTexture(u32 width, u32 height, GSTexture::Format format) override;
|
||||
|
||||
void CopyRect(GSTexture* sTex, GSTexture* dTex, const GSVector4i& r, u32 destX, u32 destY) override;
|
||||
|
|
Loading…
Reference in New Issue