Minor updates to pass return values.

This commit is contained in:
Chinmay Garde 2021-06-18 14:47:34 -07:00 committed by Dan Field
parent 63e3764ddf
commit ca5b3ac286
3 changed files with 12 additions and 5 deletions

View File

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

View File

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

View File

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