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(CompletionCallback callback) {
33 const auto result = reactor_->React();
35 callback(result ? CommandBuffer::Status::kCompleted
36 : CommandBuffer::Status::kError);
42 void CommandBufferGLES::OnWaitUntilCompleted() {
43 reactor_->GetProcTable().Finish();
47 void CommandBufferGLES::OnWaitUntilScheduled() {
48 reactor_->GetProcTable().Flush();
52 std::shared_ptr<RenderPass> CommandBufferGLES::OnCreateRenderPass(
53 RenderTarget target) {
57 auto context = context_.lock();
61 auto pass = std::shared_ptr<RenderPassGLES>(
62 new RenderPassGLES(context, target, reactor_));
63 if (!pass->IsValid()) {
70 std::shared_ptr<BlitPass> CommandBufferGLES::OnCreateBlitPass() {
74 auto pass = std::shared_ptr<BlitPassGLES>(
new BlitPassGLES(reactor_));
75 if (!pass->IsValid()) {
82 std::shared_ptr<ComputePass> CommandBufferGLES::OnCreateComputePass() {