Flutter Impeller
impeller::Command Struct Reference

An object used to specify work to the GPU along with references to resources the GPU will used when doing said work. More...

#include <command.h>

Public Member Functions

bool IsValid () const
 

Public Attributes

PipelineRef pipeline
 
Range bound_buffers = Range{0, 0}
 
Range bound_textures = Range{0, 0}
 
uint32_t stencil_reference = 0u
 
uint64_t base_vertex = 0u
 
std::optional< Viewportviewport
 
std::optional< IRectscissor
 
size_t instance_count = 1u
 
Range vertex_buffers
 
BufferView index_buffer
 The index buffer binding used by the vertex shader stage. More...
 
size_t element_count = 0u
 
IndexType index_type = IndexType::kUnknown
 

Detailed Description

An object used to specify work to the GPU along with references to resources the GPU will used when doing said work.

To construct a valid command, follow these steps:

  • Specify a valid pipeline.
  • Specify vertex information via a call BindVertices
  • Specify any stage bindings.
  • (Optional) Specify a debug label.

Command can be created frequently and on demand. The resources referenced in commands views into buffers managed by other allocators and resource managers.

Definition at line 79 of file command.h.

Member Function Documentation

◆ IsValid()

bool impeller::Command::IsValid ( ) const
inline

Definition at line 151 of file command.h.

151 { return pipeline && pipeline->IsValid(); }
virtual bool IsValid() const =0
PipelineRef pipeline
Definition: command.h:83

References impeller::Pipeline< T >::IsValid(), and pipeline.

Member Data Documentation

◆ base_vertex

uint64_t impeller::Command::base_vertex = 0u

The offset used when indexing into the vertex buffer.

Definition at line 108 of file command.h.

Referenced by impeller::RenderPass::SetBaseVertex().

◆ bound_buffers

Range impeller::Command::bound_buffers = Range{0, 0}

An offset into render pass storage where bound buffers/texture metadata is stored.

Definition at line 87 of file command.h.

Referenced by impeller::RenderPass::Draw().

◆ bound_textures

Range impeller::Command::bound_textures = Range{0, 0}

Definition at line 88 of file command.h.

Referenced by impeller::RenderPass::Draw().

◆ element_count

size_t impeller::Command::element_count = 0u

The number of elements to draw. When only a vertex buffer is set, this is the vertex count. When an index buffer is set, this is the index count.

Definition at line 144 of file command.h.

Referenced by impeller::RenderPass::SetElementCount().

◆ index_buffer

BufferView impeller::Command::index_buffer

The index buffer binding used by the vertex shader stage.

Definition at line 139 of file command.h.

Referenced by impeller::RenderPass::SetIndexBuffer().

◆ index_type

IndexType impeller::Command::index_type = IndexType::kUnknown

The type of indices in the index buffer. The indices must be tightly packed in the index buffer.

Definition at line 149 of file command.h.

Referenced by impeller::RenderPass::SetIndexBuffer().

◆ instance_count

size_t impeller::Command::instance_count = 1u

The number of instances of the given set of vertices to render. Not all backends support rendering more than one instance at a time.

Warning
Setting this to more than one will limit the availability of backends to use with this command.

Definition at line 129 of file command.h.

Referenced by impeller::RenderPass::SetInstanceCount().

◆ pipeline

PipelineRef impeller::Command::pipeline

The pipeline to use for this command.

Definition at line 83 of file command.h.

Referenced by IsValid(), and impeller::RenderPass::SetPipeline().

◆ scissor

std::optional<IRect> impeller::Command::scissor

The scissor rect to use for clipping writes to the render target. The scissor rect must lie entirely within the render target. If unset, no scissor is applied.

Definition at line 121 of file command.h.

Referenced by impeller::RenderPass::SetScissor().

◆ stencil_reference

uint32_t impeller::Command::stencil_reference = 0u

The reference value to use in stenciling operations. Stencil configuration is part of pipeline setup and can be read from the pipelines descriptor.

See also
Pipeline
PipelineDescriptor

Definition at line 104 of file command.h.

Referenced by impeller::RenderPass::SetStencilReference().

◆ vertex_buffers

Range impeller::Command::vertex_buffers

An offset and range of vertex buffers bound for this draw call.

The vertex buffers are stored on the render pass object.

Definition at line 135 of file command.h.

Referenced by impeller::RenderPass::Draw(), and impeller::RenderPass::SetVertexBuffer().

◆ viewport

std::optional<Viewport> impeller::Command::viewport

The viewport coordinates that the rasterizer linearly maps normalized device coordinates to. If unset, the viewport is the size of the render target with a zero origin, znear=0, and zfar=1.

Definition at line 115 of file command.h.

Referenced by impeller::RenderPass::SetViewport().


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