| Flutter Impeller |

Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
impeller::ComputePass Class Referenceabstract

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

`#include <compute_pass.h>`

Inheritance diagram for impeller::ComputePass:

## 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 (const ISize &grid_size)=0
virtual void | AddBufferMemoryBarrier ()=0
| Ensures all previously encoded compute command's buffer writes are visible to any subsequent compute commands. More...
virtual void | AddTextureMemoryBarrier ()=0
| Ensures all previously encoded compute command's texture writes are visible to any subsequent compute commands. More...
virtual bool | EncodeCommands () const =0
| Encode the recorded commands to the underlying command buffer. More...
const Context & | GetContext () 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, const std::unique_ptr< const Sampler > &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 Context > | context_

## Detailed Description

Compute passes encode compute shader into the underlying command buffer.

See also
  `CommandBuffer`

Definition at line 23 of file compute_pass.h.

## Constructor & Destructor Documentation

## ◆ ~ComputePass()

impeller::ComputePass::~ComputePass | ( |  | ) |
| virtual default

## ◆ ComputePass()

impeller::ComputePass::ComputePass | ( | std::shared_ptr< const Context > | context | ) |
| explicit protected

Definition at line 9 of file compute_pass.cc.

10 : context_(std::move(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 | ( | const ISize & | grid_size | ) |
| pure virtual

## ◆ 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 62 of file compute_pass.h.

62 { return *context_; }

References context_.

## ◆ IsValid()

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

## ◆ OnSetLabel()

virtual void impeller::ComputePass::OnSetLabel | ( | const std::string & | label | ) |
| protected pure 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 }

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 65 of file compute_pass.h.

Referenced by GetContext().

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

- impeller/renderer/compute_pass.h
- impeller/renderer/compute_pass.cc

impeller::ComputePass::context_
const std::shared_ptr< const Context > context_
Definition: compute_pass.h:65
impeller::ComputePass::OnSetLabel
virtual void OnSetLabel(const std::string &label)=0