Setup color data.
Setup depth data.
Setup stencil data.
512 {
514 return false;
515 }
517 if (!render_target.HasColorAttachment(0u)) {
518 return false;
519 }
520 const auto& color0 = render_target.GetColorAttachments().at(0u);
521 const auto& depth0 = render_target.GetDepthAttachment();
522 const auto& stencil0 = render_target.GetStencilAttachment();
523
524 auto pass_data = std::make_shared<RenderPassData>();
525 pass_data->label = label_;
527
528
529
530
531 pass_data->color_attachment = color0.texture;
532 pass_data->clear_color = color0.clear_color;
534 pass_data->discard_color_attachment =
536
537
538
539
540 if (color0.resolve_texture) {
541 FML_DCHECK(context.GetCapabilities()->SupportsImplicitResolvingMSAA());
542 pass_data->discard_color_attachment = false;
543 }
544
545
546
547
548 if (depth0.has_value()) {
549 pass_data->depth_attachment = depth0->texture;
550 pass_data->clear_depth = depth0->clear_depth;
552 pass_data->discard_depth_attachment =
554 }
555
556
557
558
559 if (stencil0.has_value()) {
560 pass_data->stencil_attachment = stencil0->texture;
561 pass_data->clear_stencil = stencil0->clear_stencil;
562 pass_data->clear_stencil_attachment =
564 pass_data->discard_stencil_attachment =
566 }
567
568 std::shared_ptr<const RenderPassGLES> shared_this = shared_from_this();
570 return reactor_->AddOperation([pass_data,
571 allocator = context.GetResourceAllocator(),
572 render_pass = std::move(shared_this),
573 tracer](const auto& reactor) {
574 auto result = EncodeCommandsInReactor(*pass_data, allocator, reactor,
575 render_pass->commands_, tracer);
576 FML_CHECK(result) << "Must be able to encode GL commands without error.";
577 });
578}
static ContextGLES & Cast(Context &base)
std::shared_ptr< GPUTracerGLES > GetGPUTracer() const
bool IsValid() const override
const RenderTarget & GetRenderTarget() const
ISize GetRenderTargetSize() const
#define FML_DCHECK(condition)
constexpr bool CanClearAttachment(LoadAction action)
constexpr bool CanDiscardAttachmentWhenDone(StoreAction action)
static constexpr TRect MakeSize(const TSize< U > &size)