5#ifndef FLUTTER_IMPELLER_RENDERER_PIPELINE_BUILDER_H_
6#define FLUTTER_IMPELLER_RENDERER_PIPELINE_BUILDER_H_
29template <
class VertexShader_,
class FragmentShader_>
51 const std::vector<Scalar>& constants = {}) {
53 desc.SetSpecializationConstants(constants);
55 return {std::move(
desc)};
73 if (!vertex_function || !fragment_function) {
75 << VertexShader::kEntrypointName <<
"' and '"
76 << FragmentShader::kEntrypointName
77 <<
"' for pipeline named '" << VertexShader::kLabel
82 desc.AddStageEntrypoint(std::move(vertex_function));
83 desc.AddStageEntrypoint(std::move(fragment_function));
88 auto vertex_descriptor = std::make_shared<VertexDescriptor>();
89 vertex_descriptor->SetStageInputs(VertexShader::kAllShaderStageInputs,
90 VertexShader::kInterleavedBufferLayout);
91 vertex_descriptor->RegisterDescriptorSetLayouts(
92 VertexShader::kDescriptorSetLayouts);
93 vertex_descriptor->RegisterDescriptorSetLayouts(
94 FragmentShader::kDescriptorSetLayouts);
95 desc.SetVertexDescriptor(std::move(vertex_descriptor));
105 desc.SetColorAttachmentDescriptor(0u, color0);
112 desc.SetDepthStencilAttachmentDescriptor(depth0);
113 desc.SetDepthPixelFormat(
121 desc.SetStencilAttachmentDescriptors(stencil0);
122 desc.SetStencilPixelFormat(
To do anything rendering related with Impeller, you need a context.
virtual const std::shared_ptr< const Capabilities > & GetCapabilities() const =0
Get the capabilities of Impeller context. All optionally supported feature of the platform,...
virtual std::shared_ptr< ShaderLibrary > GetShaderLibrary() const =0
Returns the library of shaders used to specify the programmable stages of a pipeline.
static constexpr size_t kReservedVertexBufferIndex
std::string SPrintF(const char *format,...)
@ kEqual
Comparison test passes if new_value == current_value.
@ kAlways
Comparison test passes always passes.
Describe the color attachment that will be used with this pipeline.
CompareFunction depth_compare
An optional (but highly recommended) utility for creating pipelines from reflected shader information...
FragmentShader_ FragmentShader
static constexpr size_t kVertexBufferIndex
static std::optional< PipelineDescriptor > MakeDefaultPipelineDescriptor(const Context &context, const std::vector< Scalar > &constants={})
Create a default pipeline descriptor using the combination reflected shader information....
static bool InitializePipelineDescriptorDefaults(const Context &context, PipelineDescriptor &desc)
VertexShader_ VertexShader
CompareFunction stencil_compare
std::shared_ptr< const fml::Mapping > data