Flutter Engine Uber Docs
Docs for the entire Flutter Engine repo.
 
Loading...
Searching...
No Matches
impeller::ComputePass Class Referenceabstract

Compute passes encode compute shader into the underlying command buffer. More...

#include <compute_pass.h>

Inheritance diagram for impeller::ComputePass:
impeller::ResourceBinder impeller::ComputePassMTL impeller::ComputePassVK

Public Member Functions

virtual ~ComputePass ()
 
virtual bool IsValid () const =0
 
void SetLabel (const std::string &label)
 
virtual void SetCommandLabel (std::string_view label)=0
 
virtual void SetPipeline (const std::shared_ptr< Pipeline< ComputePipelineDescriptor > > &pipeline)=0
 
virtual fml::Status Compute (std::array< uint32_t, 3 > workgroup_count)=0
 Dispatch a grid of compute workgroups.
 
virtual void AddBufferMemoryBarrier ()=0
 Ensures all previously encoded compute command's buffer writes are visible to any subsequent compute commands.
 
virtual void AddTextureMemoryBarrier ()=0
 Ensures all previously encoded compute command's texture writes are visible to any subsequent compute commands.
 
virtual bool EncodeCommands () const =0
 Encode the recorded commands to the underlying command buffer.
 
const ContextGetContext () const
 
- Public Member Functions inherited from impeller::ResourceBinder
virtual ~ResourceBinder ()=default
 
virtual bool BindResource (ShaderStage stage, DescriptorType type, const ShaderUniformSlot &slot, const ShaderMetadata *metadata, BufferView view)=0
 
virtual bool BindResource (ShaderStage stage, DescriptorType type, const SampledImageSlot &slot, const ShaderMetadata *metadata, std::shared_ptr< const Texture > texture, raw_ptr< const Sampler >)=0
 

Protected Member Functions

 ComputePass (std::shared_ptr< const Context > context)
 
virtual void OnSetLabel (const std::string &label)=0
 

Protected Attributes

const std::shared_ptr< const Contextcontext_
 

Detailed Description

Compute passes encode compute shader into the underlying command buffer.

See also
CommandBuffer

Definition at line 25 of file compute_pass.h.

Constructor & Destructor Documentation

◆ ~ComputePass()

impeller::ComputePass::~ComputePass ( )
virtualdefault

◆ ComputePass()

impeller::ComputePass::ComputePass ( std::shared_ptr< const Context context)
explicitprotected

Definition at line 9 of file compute_pass.cc.

10 : context_(std::move(context)) {}
const std::shared_ptr< const Context > context_
std::shared_ptr< ContextGLES > context

Member Function Documentation

◆ AddBufferMemoryBarrier()

virtual void impeller::ComputePass::AddBufferMemoryBarrier ( )
pure virtual

Ensures all previously encoded compute command's buffer writes are visible to any subsequent compute commands.

On Vulkan, it does not matter if the compute command is in a different command buffer, only that it is executed later in queue order.

◆ AddTextureMemoryBarrier()

virtual void impeller::ComputePass::AddTextureMemoryBarrier ( )
pure virtual

Ensures all previously encoded compute command's texture writes are visible to any subsequent compute commands.

On Vulkan, it does not matter if the compute command is in a different command buffer, only that it is executed later in queue order.

◆ Compute()

virtual fml::Status impeller::ComputePass::Compute ( std::array< uint32_t, 3 >  workgroup_count)
pure virtual

Dispatch a grid of compute workgroups.

        The components of `workgroup_count` are workgroup
        (threadgroup) counts, not invocation counts. The number of
        invocations per workgroup (the local size) is declared by the
        shader. The total invocations along an axis is therefore the
        workgroup count times the shader's local size.
Returns
A cancelled status if any dimension is zero.

◆ EncodeCommands()

virtual bool impeller::ComputePass::EncodeCommands ( ) const
pure virtual

Encode the recorded commands to the underlying command buffer.

Returns
If the commands were encoded to the underlying command buffer.

◆ GetContext()

const Context & impeller::ComputePass::GetContext ( ) const
inline

Definition at line 75 of file compute_pass.h.

75{ return *context_; }

References context_.

◆ IsValid()

virtual bool impeller::ComputePass::IsValid ( ) const
pure virtual

◆ OnSetLabel()

virtual void impeller::ComputePass::OnSetLabel ( const std::string &  label)
protectedpure virtual

Referenced by SetLabel().

◆ SetCommandLabel()

virtual void impeller::ComputePass::SetCommandLabel ( std::string_view  label)
pure virtual

◆ SetLabel()

void impeller::ComputePass::SetLabel ( const std::string &  label)

Definition at line 14 of file compute_pass.cc.

14 {
15 if (label.empty()) {
16 return;
17 }
18 OnSetLabel(label);
19}
virtual void OnSetLabel(const std::string &label)=0

References OnSetLabel().

◆ SetPipeline()

virtual void impeller::ComputePass::SetPipeline ( const std::shared_ptr< Pipeline< ComputePipelineDescriptor > > &  pipeline)
pure virtual

Member Data Documentation

◆ context_

const std::shared_ptr<const Context> impeller::ComputePass::context_
protected

Definition at line 78 of file compute_pass.h.

Referenced by GetContext().


The documentation for this class was generated from the following files: