Flutter Engine
 
Loading...
Searching...
No Matches
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
 
BufferView index_buffer
 The index buffer binding used by the vertex shader stage.
 
Range bound_buffers = Range{0, 0}
 
Range bound_textures = Range{0, 0}
 
Range vertex_buffers
 
std::optional< Viewportviewport
 
std::optional< IRect32scissor
 
uint64_t base_vertex = 0u
 
uint32_t element_count = 0u
 
uint32_t instance_count = 1u
 
uint32_t stencil_reference = 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 80 of file command.h.

Member Function Documentation

◆ IsValid()

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

Definition at line 156 of file command.h.

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

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 126 of file command.h.

Referenced by impeller::RenderPass::SetBaseVertex(), and impeller::testing::RecordingRenderPass::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 92 of file command.h.

92{0, 0};

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

◆ bound_textures

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

Definition at line 93 of file command.h.

93{0, 0};

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

◆ element_count

uint32_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 131 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 88 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 154 of file command.h.

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

◆ instance_count

uint32_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 140 of file command.h.

Referenced by impeller::RenderPass::SetInstanceCount(), and impeller::testing::RecordingRenderPass::SetInstanceCount().

◆ pipeline

PipelineRef impeller::Command::pipeline

The pipeline to use for this command.

Definition at line 84 of file command.h.

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

◆ scissor

std::optional<IRect32> 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 114 of file command.h.

Referenced by impeller::RenderPass::SetScissor(), and impeller::testing::RecordingRenderPass::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 149 of file command.h.

Referenced by impeller::RenderPass::SetStencilReference(), and impeller::testing::RecordingRenderPass::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 99 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 107 of file command.h.

Referenced by impeller::RenderPass::SetViewport(), and impeller::testing::RecordingRenderPass::SetViewport().


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