Flutter Engine
The Flutter Engine
Public Types | Static Public Member Functions | List of all members
impeller::ComputePipelineBuilder< ComputeShader_ > Struct Template Reference

An optional (but highly recommended) utility for creating pipelines from reflected shader information. More...

#include <compute_pipeline_builder.h>

Public Types

using ComputeShader = ComputeShader_
 

Static Public Member Functions

static std::optional< ComputePipelineDescriptorMakeDefaultPipelineDescriptor (const Context &context)
 Create a default pipeline descriptor using the combination reflected shader information. The descriptor can be configured further before a pipeline state object is created using it. More...
 
static bool InitializePipelineDescriptorDefaults (const Context &context, ComputePipelineDescriptor &desc)
 

Detailed Description

template<class ComputeShader_>
struct impeller::ComputePipelineBuilder< ComputeShader_ >

An optional (but highly recommended) utility for creating pipelines from reflected shader information.

Template Parameters
Compute_ShaderThe reflected compute shader information. Found in a generated header file called <shader_name>.comp.h.

Definition at line 25 of file compute_pipeline_builder.h.

Member Typedef Documentation

◆ ComputeShader

template<class ComputeShader_ >
using impeller::ComputePipelineBuilder< ComputeShader_ >::ComputeShader = ComputeShader_

Definition at line 27 of file compute_pipeline_builder.h.

Member Function Documentation

◆ InitializePipelineDescriptorDefaults()

template<class ComputeShader_ >
static bool impeller::ComputePipelineBuilder< ComputeShader_ >::InitializePipelineDescriptorDefaults ( const Context context,
ComputePipelineDescriptor desc 
)
inlinestatic

Definition at line 49 of file compute_pipeline_builder.h.

51 {
52 // Setup debug instrumentation.
53 desc.SetLabel(SPrintF("%s Pipeline", ComputeShader::kLabel.data()));
54
55 // Resolve pipeline entrypoints.
56 {
57 auto compute_function = context.GetShaderLibrary()->GetFunction(
58 ComputeShader::kEntrypointName, ShaderStage::kCompute);
59
60 if (!compute_function) {
61 VALIDATION_LOG << "Could not resolve compute pipeline entrypoint '"
62 << ComputeShader::kEntrypointName
63 << "' for pipeline named '" << ComputeShader::kLabel
64 << "'.";
65 return false;
66 }
67
68 if (!desc.RegisterDescriptorSetLayouts(
69 ComputeShader::kDescriptorSetLayouts)) {
70 VALIDATION_LOG << "Could not configure compute descriptor set layout "
71 "for pipeline named '"
72 << ComputeShader::kLabel << "'.";
73 return false;
74 }
75
76 desc.SetStageEntrypoint(std::move(compute_function));
77 }
78 return true;
79 }
std::string SPrintF(const char *format,...)
Definition: strings.cc:12
std::shared_ptr< const fml::Mapping > data
Definition: texture_gles.cc:63
#define VALIDATION_LOG
Definition: validation.h:73

◆ MakeDefaultPipelineDescriptor()

template<class ComputeShader_ >
static std::optional< ComputePipelineDescriptor > impeller::ComputePipelineBuilder< ComputeShader_ >::MakeDefaultPipelineDescriptor ( const Context context)
inlinestatic

Create a default pipeline descriptor using the combination reflected shader information. The descriptor can be configured further before a pipeline state object is created using it.

Parameters
[in]contextThe context
Returns
If the combination of reflected shader information is compatible and the requisite functions can be found in the context, a pipeline descriptor.

Definition at line 40 of file compute_pipeline_builder.h.

41 {
42 ComputePipelineDescriptor desc;
44 return {std::move(desc)};
45 }
46 return std::nullopt;
47 }
static bool InitializePipelineDescriptorDefaults(const Context &context, ComputePipelineDescriptor &desc)

The documentation for this struct was generated from the following file: