[Impeller] revert vestiges of submit batching. (flutter/engine#51450)

Fixes https://github.com/flutter/flutter/issues/144616

Submit batching has been off for a while. This just removes the unused parts of the API.
This commit is contained in:
Jonah Williams
2024-03-18 10:09:53 -07:00
committed by GitHub
parent 8265636e88
commit 375b19aae9
7 changed files with 28 additions and 20 deletions

View File

@@ -53,7 +53,6 @@ bool AiksContext::Render(const Picture& picture,
}
fml::ScopedCleanupClosure closure([&]() {
content_context_->FlushCommandBuffers();
if (reset_host_buffer) {
content_context_->GetTransientsBuffer().Reset();
}

View File

@@ -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;
}
@@ -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();

View File

@@ -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&)>;

View File

@@ -456,7 +456,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");
@@ -484,7 +489,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;

View File

@@ -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,

View File

@@ -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;

View File

@@ -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"