Rename GPUContext::ClearState to ResetState for constentency

This commit is contained in:
Wojtek Figat
2025-12-10 13:00:59 +01:00
parent 3b9b49950c
commit 43665aa7eb
12 changed files with 23 additions and 14 deletions

View File

@@ -67,7 +67,7 @@ void GPUContext::FrameBegin()
void GPUContext::FrameEnd()
{
ClearState();
ResetState();
FlushState();
}

View File

@@ -618,7 +618,16 @@ public:
/// <summary>
/// Clears the context state.
/// </summary>
API_FUNCTION() virtual void ClearState() = 0;
DEPRECATED("Use ResetState instead")
API_FUNCTION() void ClearState()
{
ResetState();
}
/// <summary>
/// Resets the context state.
/// </summary>
API_FUNCTION() virtual void ResetState() = 0;
/// <summary>
/// Flushes the internal cached context state with a command buffer.

View File

@@ -724,7 +724,7 @@ void GPUContextDX11::SetState(GPUPipelineState* state)
}
}
void GPUContextDX11::ClearState()
void GPUContextDX11::ResetState()
{
if (!_context)
return;

View File

@@ -158,7 +158,7 @@ public:
void SetScissor(const Rectangle& scissorRect) override;
GPUPipelineState* GetState() const override;
void SetState(GPUPipelineState* state) override;
void ClearState() override;
void ResetState() override;
void FlushState() override;
void Flush() override;
void UpdateBuffer(GPUBuffer* buffer, const void* data, uint32 size, uint32 offset) override;

View File

@@ -1304,7 +1304,7 @@ void GPUContextDX12::SetState(GPUPipelineState* state)
}
}
void GPUContextDX12::ClearState()
void GPUContextDX12::ResetState()
{
if (!_commandList)
return;

View File

@@ -201,7 +201,7 @@ public:
void SetScissor(const Rectangle& scissorRect) override;
GPUPipelineState* GetState() const override;
void SetState(GPUPipelineState* state) override;
void ClearState() override;
void ResetState() override;
void FlushState() override;
void Flush() override;
void UpdateBuffer(GPUBuffer* buffer, const void* data, uint32 size, uint32 offset) override;

View File

@@ -177,7 +177,7 @@ public:
{
}
void ClearState() override
void ResetState() override
{
}

View File

@@ -1329,7 +1329,7 @@ void GPUContextVulkan::SetState(GPUPipelineState* state)
}
}
void GPUContextVulkan::ClearState()
void GPUContextVulkan::ResetState()
{
ResetRenderTarget();
ResetSR();

View File

@@ -193,7 +193,7 @@ public:
void SetScissor(const Rectangle& scissorRect) override;
GPUPipelineState* GetState() const override;
void SetState(GPUPipelineState* state) override;
void ClearState() override;
void ResetState() override;
void FlushState() override;
void Flush() override;
void UpdateBuffer(GPUBuffer* buffer, const void* data, uint32 size, uint32 offset) override;

View File

@@ -509,7 +509,7 @@ void ProbesRendererService::OnRender(RenderTask* task, GPUContext* context)
// Render frame
Renderer::Render(_task);
context->ClearState();
context->ResetState();
// Copy frame to cube face
{
@@ -568,7 +568,7 @@ void ProbesRendererService::OnRender(RenderTask* task, GPUContext* context)
}
// Cleanup
context->ClearState();
context->ResetState();
if (_workStep < 7)
return; // Continue rendering next frame

View File

@@ -200,7 +200,7 @@ void Renderer::Render(SceneRenderTask* task)
// Prepare GPU context
auto context = GPUDevice::Instance->GetMainContext();
context->ClearState();
context->ResetState();
context->FlushState();
const Viewport viewport = task->GetViewport();
context->SetViewportAndScissors(viewport);

View File

@@ -376,7 +376,7 @@ void ShadowsOfMordor::Builder::onJobRender(GPUContext* context)
EnableLightmapsUsage = _giBounceRunningIndex != 0;
//
Renderer::Render(_task);
context->ClearState();
context->ResetState();
//
IsRunningRadiancePass = false;
EnableLightmapsUsage = true;
@@ -515,7 +515,7 @@ void ShadowsOfMordor::Builder::onJobRender(GPUContext* context)
}
// Cleanup after rendering
context->ClearState();
context->ResetState();
// Mark job as done
Platform::AtomicStore(&_wasJobDone, 1);