13 CommandBufferGLES::CommandBufferGLES(std::weak_ptr<const Context> context,
14 std::shared_ptr<ReactorGLES> reactor)
15 : CommandBuffer(
std::move(context)),
16 reactor_(
std::move(reactor)),
17 is_valid_(reactor_ && reactor_->IsValid()) {}
19 CommandBufferGLES::~CommandBufferGLES() =
default;
22 void CommandBufferGLES::SetLabel(std::string_view label)
const {
27 bool CommandBufferGLES::IsValid()
const {
32 bool CommandBufferGLES::OnSubmitCommands(
bool block_on_schedule,
33 CompletionCallback callback) {
34 const auto result = reactor_->React();
36 callback(result ? CommandBuffer::Status::kCompleted
37 : CommandBuffer::Status::kError);
43 void CommandBufferGLES::OnWaitUntilCompleted() {
44 reactor_->GetProcTable().Finish();
48 void CommandBufferGLES::OnWaitUntilScheduled() {
49 reactor_->GetProcTable().Flush();
53 std::shared_ptr<RenderPass> CommandBufferGLES::OnCreateRenderPass(
54 RenderTarget target) {
58 auto context = context_.lock();
62 auto pass = std::shared_ptr<RenderPassGLES>(
63 new RenderPassGLES(context, target, reactor_));
64 if (!pass->IsValid()) {
71 std::shared_ptr<BlitPass> CommandBufferGLES::OnCreateBlitPass() {
75 auto pass = std::shared_ptr<BlitPassGLES>(
new BlitPassGLES(reactor_));
76 if (!pass->IsValid()) {
83 std::shared_ptr<ComputePass> CommandBufferGLES::OnCreateComputePass() {