Skip to content

Commit

Permalink
Let's have DispatchFlush check for drawcalls before calling DoFlush, …
Browse files Browse the repository at this point in the history
…too.
  • Loading branch information
hrydgard committed May 3, 2023
1 parent c80671d commit d56e27a
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 4 deletions.
6 changes: 5 additions & 1 deletion GPU/D3D11/DrawEngineD3D11.h
Expand Up @@ -149,7 +149,11 @@ class DrawEngineD3D11 : public DrawEngineCommon {
DecodeVerts(decoded);
}

void DispatchFlush() override { Flush(); }
void DispatchFlush() override {
if (!numDrawCalls)
return;
Flush();
}

void ClearTrackedVertexArrays() override;

Expand Down
6 changes: 5 additions & 1 deletion GPU/Directx9/DrawEngineDX9.h
Expand Up @@ -139,7 +139,11 @@ class DrawEngineDX9 : public DrawEngineCommon {
DecodeVerts(decoded);
}

void DispatchFlush() override { Flush(); }
void DispatchFlush() override {
if (!numDrawCalls)
return;
Flush();
}

protected:
// Not currently supported.
Expand Down
6 changes: 5 additions & 1 deletion GPU/GLES/DrawEngineGLES.h
Expand Up @@ -97,7 +97,11 @@ class DrawEngineGLES : public DrawEngineCommon {
DoFlush();
}

void DispatchFlush() override { Flush(); }
void DispatchFlush() override {
if (!numDrawCalls)
return;
Flush();
}

GLPushBuffer *GetPushVertexBuffer() {
return frameData_[render_->GetCurFrame()].pushVertex;
Expand Down
6 changes: 5 additions & 1 deletion GPU/Vulkan/DrawEngineVulkan.h
Expand Up @@ -177,7 +177,11 @@ class DrawEngineVulkan : public DrawEngineCommon {
DoFlush();
}

void DispatchFlush() override { Flush(); }
void DispatchFlush() override {
if (!numDrawCalls)
return;
Flush();
}

VkPipelineLayout GetPipelineLayout() const {
return pipelineLayout_;
Expand Down

0 comments on commit d56e27a

Please sign in to comment.