19 : library_(
std::move(library)),
desc_(
std::move(desc)) {}
26 std::optional<PipelineDescriptor> desc,
29 return {desc, RealizedFuture<std::shared_ptr<Pipeline<PipelineDescriptor>>>(
33 return context.GetPipelineLibrary()->GetPipeline(std::move(desc),
39 std::optional<ComputePipelineDescriptor> desc) {
43 RealizedFuture<std::shared_ptr<Pipeline<ComputePipelineDescriptor>>>(
47 return context.GetPipelineLibrary()->GetPipeline(std::move(desc));
58 const std::function<
void(T& desc)>& descriptor_callback)
const {
59 if (!descriptor_callback) {
61 RealizedFuture<std::shared_ptr<Pipeline<T>>>(
nullptr)};
64 auto copied_desc =
desc_;
66 descriptor_callback(copied_desc);
68 auto library = library_.lock();
70 VALIDATION_LOG <<
"The library from which this pipeline was created was "
72 return {
desc_, RealizedFuture<std::shared_ptr<Pipeline<T>>>(
nullptr)};
75 return library->GetPipeline(std::move(copied_desc), async);
To do anything rendering related with Impeller, you need a context.
Pipeline(std::weak_ptr< PipelineLibrary > library, const T &desc)
PipelineFuture< T > CreateVariant(bool async, const std::function< void(T &desc)> &descriptor_callback) const
const T & GetDescriptor() const
Get the descriptor that was responsible for creating this pipeline. It may be copied and modified to ...
std::optional< PipelineDescriptor > desc_
PipelineFuture< PipelineDescriptor > CreatePipelineFuture(const Context &context, std::optional< PipelineDescriptor > desc, bool async)
Create a pipeline for the given descriptor.
std::shared_ptr< ContextGLES > context