Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

[Impeller] revert vestiges of submit batching. #51450

Merged
merged 1 commit into from
Mar 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
1 change: 0 additions & 1 deletion impeller/aiks/aiks_context.cc
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ bool AiksContext::Render(const Picture& picture,
}

fml::ScopedCleanupClosure closure([&]() {
content_context_->FlushCommandBuffers();
if (reset_host_buffer) {
content_context_->GetTransientsBuffer().Reset();
}
Expand Down
14 changes: 3 additions & 11 deletions impeller/entity/contents/content_context.cc
Original file line number Diff line number Diff line change
Expand Up @@ -544,7 +544,9 @@ fml::StatusOr<RenderTarget> ContentContext::MakeSubpass(
}
}

RecordCommandBuffer(std::move(sub_command_buffer));
if (!context->GetCommandQueue()->Submit({sub_command_buffer}).ok()) {
return fml::Status(fml::StatusCode::kUnknown, "");
}

return subpass_target;
}
Expand Down Expand Up @@ -597,16 +599,6 @@ void ContentContext::ClearCachedRuntimeEffectPipeline(
}
}

void ContentContext::RecordCommandBuffer(
std::shared_ptr<CommandBuffer> command_buffer) const {
GetContext()->GetCommandQueue()->Submit({std::move(command_buffer)});
}

void ContentContext::FlushCommandBuffers() const {
auto buffers = std::move(pending_command_buffers_->command_buffers);
GetContext()->GetCommandQueue()->Submit(buffers);
}

void ContentContext::InitializeCommonlyUsedShadersIfNeeded() const {
TRACE_EVENT0("flutter", "InitializeCommonlyUsedShadersIfNeeded");
GetContext()->InitializeCommonlyUsedShadersIfNeeded();
Expand Down
4 changes: 0 additions & 4 deletions impeller/entity/contents/content_context.h
Original file line number Diff line number Diff line change
Expand Up @@ -779,10 +779,6 @@ class ContentContext {

void SetWireframe(bool wireframe);

void RecordCommandBuffer(std::shared_ptr<CommandBuffer> command_buffer) const;

void FlushCommandBuffers() const;

using SubpassCallback =
std::function<bool(const ContentContext&, RenderPass&)>;

Expand Down
14 changes: 12 additions & 2 deletions impeller/entity/entity_pass.cc
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,12 @@ bool EntityPass::Render(ContentContext& renderer,
VALIDATION_LOG << "Failed to encode root pass blit command.";
return false;
}
renderer.RecordCommandBuffer(std::move(command_buffer));
if (!renderer.GetContext()
->GetCommandQueue()
->Submit({command_buffer})
.ok()) {
return false;
}
} else {
auto render_pass = command_buffer->CreateRenderPass(root_render_target);
render_pass->SetLabel("EntityPass Root Render Pass");
Expand Down Expand Up @@ -446,7 +451,12 @@ bool EntityPass::Render(ContentContext& renderer,
VALIDATION_LOG << "Failed to encode root pass command buffer.";
return false;
}
renderer.RecordCommandBuffer(std::move(command_buffer));
if (!renderer.GetContext()
->GetCommandQueue()
->Submit({command_buffer})
.ok()) {
return false;
}
}

return true;
Expand Down
7 changes: 6 additions & 1 deletion impeller/entity/geometry/point_field_geometry.cc
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,12 @@ GeometryResult PointFieldGeometry::GetPositionBufferGPU(
if (!compute_pass->EncodeCommands()) {
return {};
}
renderer.RecordCommandBuffer(std::move(cmd_buffer));
if (!renderer.GetContext()
->GetCommandQueue()
->Submit({std::move(cmd_buffer)})
.ok()) {
return {};
}

return {
.type = PrimitiveType::kTriangle,
Expand Down
7 changes: 6 additions & 1 deletion impeller/entity/inline_pass_context.cc
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,12 @@ bool InlinePassContext::EndPass() {
return false;
}
}
renderer_.RecordCommandBuffer(std::move(command_buffer_));
if (!renderer_.GetContext()
->GetCommandQueue()
->Submit({std::move(command_buffer_)})
.ok()) {
return false;
}

pass_ = nullptr;
command_buffer_ = nullptr;
Expand Down
1 change: 1 addition & 0 deletions impeller/renderer/backend/vulkan/render_pass_vk.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include "impeller/renderer/backend/vulkan/context_vk.h"
#include "impeller/renderer/backend/vulkan/pipeline_vk.h"
#include "impeller/renderer/backend/vulkan/shared_object_vk.h"
#include "impeller/renderer/command_buffer.h"
#include "impeller/renderer/render_pass.h"
#include "impeller/renderer/render_target.h"
#include "vulkan/vulkan_handles.hpp"
Expand Down