Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
glFinish
  • Loading branch information
jason-simmons committed Nov 15, 2024
commit 9b2db7f56786a07f8eece529d125770bfc58838a
4 changes: 2 additions & 2 deletions impeller/renderer/backend/gles/command_buffer_gles.cc
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ bool CommandBufferGLES::OnSubmitCommands(CompletionCallback callback) {
}

// |CommandBuffer|
void CommandBufferGLES::OnWaitUntilScheduled() {
reactor_->GetProcTable().Flush();
void CommandBufferGLES::OnWaitUntilCompleted() {
reactor_->GetProcTable().Finish();
}

// |CommandBuffer|
Expand Down
2 changes: 1 addition & 1 deletion impeller/renderer/backend/gles/command_buffer_gles.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class CommandBufferGLES final : public CommandBuffer {
bool OnSubmitCommands(CompletionCallback callback) override;

// |CommandBuffer|
void OnWaitUntilScheduled() override;
void OnWaitUntilCompleted() override;

// |CommandBuffer|
std::shared_ptr<RenderPass> OnCreateRenderPass(RenderTarget target) override;
Expand Down
1 change: 1 addition & 0 deletions impeller/renderer/backend/gles/proc_table_gles.h
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ struct GLProc {
PROC(Enable); \
PROC(EnableVertexAttribArray); \
PROC(Flush); \
PROC(Finish); \
PROC(FramebufferRenderbuffer); \
PROC(FramebufferTexture2D); \
PROC(FrontFace); \
Expand Down
2 changes: 1 addition & 1 deletion impeller/renderer/backend/metal/command_buffer_mtl.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class CommandBufferMTL final : public CommandBuffer {
bool OnSubmitCommands(CompletionCallback callback) override;

// |CommandBuffer|
void OnWaitUntilScheduled() override;
void OnWaitUntilCompleted() override;

// |CommandBuffer|
std::shared_ptr<RenderPass> OnCreateRenderPass(RenderTarget target) override;
Expand Down
2 changes: 1 addition & 1 deletion impeller/renderer/backend/metal/command_buffer_mtl.mm
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ static bool LogMTLCommandBufferErrorIfPresent(id<MTLCommandBuffer> buffer) {
return true;
}

void CommandBufferMTL::OnWaitUntilScheduled() {}
void CommandBufferMTL::OnWaitUntilCompleted() {}

std::shared_ptr<RenderPass> CommandBufferMTL::OnCreateRenderPass(
RenderTarget target) {
Expand Down
2 changes: 1 addition & 1 deletion impeller/renderer/backend/vulkan/command_buffer_vk.cc
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ bool CommandBufferVK::OnSubmitCommands(CompletionCallback callback) {
FML_UNREACHABLE()
}

void CommandBufferVK::OnWaitUntilScheduled() {}
void CommandBufferVK::OnWaitUntilCompleted() {}

std::shared_ptr<RenderPass> CommandBufferVK::OnCreateRenderPass(
RenderTarget target) {
Expand Down
2 changes: 1 addition & 1 deletion impeller/renderer/backend/vulkan/command_buffer_vk.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ class CommandBufferVK final
bool OnSubmitCommands(CompletionCallback callback) override;

// |CommandBuffer|
void OnWaitUntilScheduled() override;
void OnWaitUntilCompleted() override;

// |CommandBuffer|
std::shared_ptr<RenderPass> OnCreateRenderPass(RenderTarget target) override;
Expand Down
4 changes: 2 additions & 2 deletions impeller/renderer/command_buffer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ bool CommandBuffer::SubmitCommands() {
return SubmitCommands(nullptr);
}

void CommandBuffer::WaitUntilScheduled() {
return OnWaitUntilScheduled();
void CommandBuffer::WaitUntilCompleted() {
return OnWaitUntilCompleted();
}

std::shared_ptr<RenderPass> CommandBuffer::CreateRenderPass(
Expand Down
7 changes: 4 additions & 3 deletions impeller/renderer/command_buffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,10 @@ class CommandBuffer {
virtual void SetLabel(std::string_view label) const = 0;

//----------------------------------------------------------------------------
/// @brief Force execution of pending GPU commands.
/// @brief Block the current thread until the GPU has completed execution
/// of the commands.
///
void WaitUntilScheduled();
void WaitUntilCompleted();

//----------------------------------------------------------------------------
/// @brief Create a render pass to record render commands into.
Expand Down Expand Up @@ -102,7 +103,7 @@ class CommandBuffer {

[[nodiscard]] virtual bool OnSubmitCommands(CompletionCallback callback) = 0;

virtual void OnWaitUntilScheduled() = 0;
virtual void OnWaitUntilCompleted() = 0;

virtual std::shared_ptr<ComputePass> OnCreateComputePass() = 0;

Expand Down
2 changes: 1 addition & 1 deletion impeller/renderer/testing/mocks.h
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ class MockCommandBuffer : public CommandBuffer {
OnSubmitCommands,
(CompletionCallback callback),
(override));
MOCK_METHOD(void, OnWaitUntilScheduled, (), (override));
MOCK_METHOD(void, OnWaitUntilCompleted, (), (override));
MOCK_METHOD(std::shared_ptr<ComputePass>,
OnCreateComputePass,
(),
Expand Down
2 changes: 1 addition & 1 deletion lib/ui/painting/image_decoder_impeller.cc
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ ImageDecoderImpeller::UnsafeUploadTextureToPrivate(

// Flush the pending command buffer to ensure that its output becomes visible
// to the raster thread.
command_buffer->WaitUntilScheduled();
command_buffer->WaitUntilCompleted();

context->DisposeThreadLocalCachedResources();

Expand Down