GPUDevice: Remove BeginPresent() skip parameter

It wasn't used - System does its own present skipping.
This commit is contained in:
Stenzek
2024-09-07 12:53:55 +10:00
parent 4b0c1fdbf2
commit ac5a2a153a
18 changed files with 30 additions and 55 deletions

View File

@ -639,11 +639,8 @@ void D3D11Device::SetVSyncMode(GPUVSyncMode mode, bool allow_present_throttle)
}
}
GPUDevice::PresentResult D3D11Device::BeginPresent(bool skip_present, u32 clear_color)
GPUDevice::PresentResult D3D11Device::BeginPresent(u32 clear_color)
{
if (skip_present)
return PresentResult::SkipPresent;
if (!m_swap_chain)
{
// Note: Really slow on Intel...

View File

@ -104,7 +104,7 @@ public:
bool SetGPUTimingEnabled(bool enabled) override;
float GetAndResetAccumulatedGPUTime() override;
PresentResult BeginPresent(bool skip_present, u32 clear_color) override;
PresentResult BeginPresent(u32 clear_color) override;
void EndPresent(bool explicit_present) override;
void SubmitPresent() override;

View File

@ -1123,7 +1123,7 @@ void D3D12Device::SetVSyncMode(GPUVSyncMode mode, bool allow_present_throttle)
}
}
GPUDevice::PresentResult D3D12Device::BeginPresent(bool frame_skip, u32 clear_color)
GPUDevice::PresentResult D3D12Device::BeginPresent(u32 clear_color)
{
if (InRenderPass())
EndRenderPass();
@ -1131,9 +1131,6 @@ GPUDevice::PresentResult D3D12Device::BeginPresent(bool frame_skip, u32 clear_co
if (m_device_was_lost) [[unlikely]]
return PresentResult::DeviceLost;
if (frame_skip)
return PresentResult::SkipPresent;
// If we're running surfaceless, kick the command buffer so we don't run out of descriptors.
if (!m_swap_chain)
{

View File

@ -126,7 +126,7 @@ public:
bool SetGPUTimingEnabled(bool enabled) override;
float GetAndResetAccumulatedGPUTime() override;
PresentResult BeginPresent(bool skip_present, u32 clear_color) override;
PresentResult BeginPresent(u32 clear_color) override;
void EndPresent(bool explicit_present) override;
void SubmitPresent() override;

View File

@ -709,7 +709,7 @@ public:
virtual void DrawIndexedWithBarrier(u32 index_count, u32 base_index, u32 base_vertex, DrawBarrier type) = 0;
/// Returns false if the window was completely occluded.
virtual PresentResult BeginPresent(bool skip_present, u32 clear_color = DEFAULT_CLEAR_COLOR) = 0;
virtual PresentResult BeginPresent(u32 clear_color = DEFAULT_CLEAR_COLOR) = 0;
virtual void EndPresent(bool explicit_submit) = 0;
virtual void SubmitPresent() = 0;

View File

@ -265,7 +265,7 @@ public:
void SetVSyncMode(GPUVSyncMode mode, bool allow_present_throttle) override;
PresentResult BeginPresent(bool skip_present, u32 clear_color) override;
PresentResult BeginPresent(u32 clear_color) override;
void EndPresent(bool explicit_submit) override;
void SubmitPresent() override;

View File

@ -2312,13 +2312,10 @@ id<MTLBlitCommandEncoder> MetalDevice::GetBlitEncoder(bool is_inline)
}
}
GPUDevice::PresentResult MetalDevice::BeginPresent(bool skip_present, u32 clear_color)
GPUDevice::PresentResult MetalDevice::BeginPresent(u32 clear_color)
{
@autoreleasepool
{
if (skip_present)
return PresentResult::SkipPresent;
if (m_layer == nil)
{
TrimTexturePool();

View File

@ -740,16 +740,12 @@ void OpenGLDevice::DestroyBuffers()
m_vertex_buffer.reset();
}
GPUDevice::PresentResult OpenGLDevice::BeginPresent(bool skip_present, u32 clear_color)
GPUDevice::PresentResult OpenGLDevice::BeginPresent(u32 clear_color)
{
if (skip_present || m_window_info.type == WindowInfo::Type::Surfaceless)
if (m_window_info.type == WindowInfo::Type::Surfaceless)
{
if (!skip_present)
{
glFlush();
TrimTexturePool();
}
glFlush();
TrimTexturePool();
return PresentResult::SkipPresent;
}

View File

@ -104,7 +104,7 @@ public:
void SetVSyncMode(GPUVSyncMode mode, bool allow_present_throttle) override;
PresentResult BeginPresent(bool skip_present, u32 clear_color) override;
PresentResult BeginPresent(u32 clear_color) override;
void EndPresent(bool explicit_present) override;
void SubmitPresent() override;

View File

@ -1784,7 +1784,7 @@ GPUDevice::PresentResult PostProcessing::ReShadeFXShader::Apply(GPUTexture* inpu
if (pass.render_targets.size() == 1 && pass.render_targets[0] == OUTPUT_COLOR_TEXTURE && !final_target)
{
// Special case: drawing to final buffer.
if (const GPUDevice::PresentResult pres = g_gpu_device->BeginPresent(false); pres != GPUDevice::PresentResult::OK)
if (const GPUDevice::PresentResult pres = g_gpu_device->BeginPresent(); pres != GPUDevice::PresentResult::OK)
{
GL_POP();
return pres;

View File

@ -177,7 +177,7 @@ GPUDevice::PresentResult PostProcessing::GLSLShader::Apply(GPUTexture* input_col
// Assumes final stage has been cleared already.
if (!final_target)
{
if (const GPUDevice::PresentResult pres = g_gpu_device->BeginPresent(false); pres != GPUDevice::PresentResult::OK)
if (const GPUDevice::PresentResult pres = g_gpu_device->BeginPresent(); pres != GPUDevice::PresentResult::OK)
return pres;
}
else

View File

@ -2342,7 +2342,7 @@ void VulkanDevice::SetVSyncMode(GPUVSyncMode mode, bool allow_present_throttle)
}
}
GPUDevice::PresentResult VulkanDevice::BeginPresent(bool frame_skip, u32 clear_color)
GPUDevice::PresentResult VulkanDevice::BeginPresent(u32 clear_color)
{
if (InRenderPass())
EndRenderPass();
@ -2350,9 +2350,6 @@ GPUDevice::PresentResult VulkanDevice::BeginPresent(bool frame_skip, u32 clear_c
if (m_device_was_lost) [[unlikely]]
return PresentResult::DeviceLost;
if (frame_skip)
return PresentResult::SkipPresent;
// If we're running surfaceless, kick the command buffer so we don't run out of descriptors.
if (!m_swap_chain)
{

View File

@ -142,7 +142,7 @@ public:
void SetVSyncMode(GPUVSyncMode mode, bool allow_present_throttle) override;
PresentResult BeginPresent(bool skip_present, u32 clear_color) override;
PresentResult BeginPresent(u32 clear_color) override;
void EndPresent(bool explicit_present) override;
void SubmitPresent() override;