mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Minor updates to pass return values.
This commit is contained in:
parent
63e3764ddf
commit
ca5b3ac286
@ -73,9 +73,9 @@ class RenderPass {
|
||||
|
||||
HostBuffer& GetTransientsBuffer();
|
||||
|
||||
bool RecordCommand(Command command);
|
||||
[[nodiscard]] bool RecordCommand(Command command);
|
||||
|
||||
bool FinishEncoding(Allocator& transients_allocator) const;
|
||||
[[nodiscard]] bool FinishEncoding(Allocator& transients_allocator) const;
|
||||
|
||||
private:
|
||||
friend class CommandBuffer;
|
||||
|
||||
@ -53,13 +53,18 @@ bool Renderer::Render(const Surface& surface) {
|
||||
return false;
|
||||
}
|
||||
|
||||
render_pass->FinishEncoding(*GetContext()->GetTransientsAllocator());
|
||||
if (!render_pass->FinishEncoding(*GetContext()->GetTransientsAllocator())) {
|
||||
return false;
|
||||
}
|
||||
|
||||
::dispatch_semaphore_wait(frames_in_flight_sema_, DISPATCH_TIME_FOREVER);
|
||||
|
||||
command_buffer->Commit(
|
||||
[sema = frames_in_flight_sema_](CommandBuffer::CommitResult) {
|
||||
[sema = frames_in_flight_sema_](CommandBuffer::CommitResult result) {
|
||||
::dispatch_semaphore_signal(sema);
|
||||
if (result != CommandBuffer::CommitResult::kCompleted) {
|
||||
FML_LOG(ERROR) << "Could not commit command buffer.";
|
||||
}
|
||||
});
|
||||
|
||||
return true;
|
||||
|
||||
@ -43,7 +43,9 @@ bool EntityRenderer::OnRender(RenderPass& pass) {
|
||||
cmd.vertex_bindings
|
||||
.buffers[shader::BoxVertexInfo::kUniformUniformBuffer.location] =
|
||||
pass.GetTransientsBuffer().Emplace(uniforms);
|
||||
pass.RecordCommand(std::move(cmd));
|
||||
if (!pass.RecordCommand(std::move(cmd))) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user