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 | BindVertices (const VertexBuffer &buffer) |
| Specify the vertex and index buffer to use for this command. More... | |
| bool | BindResource (ShaderStage stage, const ShaderUniformSlot &slot, const ShaderMetadata &metadata, const BufferView &view) override |
| bool | BindResource (ShaderStage stage, const ShaderUniformSlot &slot, const std::shared_ptr< const ShaderMetadata > &metadata, const BufferView &view) |
| bool | BindResource (ShaderStage stage, const SampledImageSlot &slot, const ShaderMetadata &metadata, const std::shared_ptr< const Texture > &texture, const std::shared_ptr< const Sampler > &sampler) override |
| BufferView | GetVertexBuffer () const |
| constexpr | operator bool () const |
Public Member Functions inherited from impeller::ResourceBinder | |
| virtual | ~ResourceBinder ()=default |
Public Attributes | |
| std::shared_ptr< Pipeline< PipelineDescriptor > > | pipeline |
| Bindings | vertex_bindings |
| Bindings | fragment_bindings |
| BufferView | index_buffer |
| size_t | vertex_count = 0u |
| IndexType | index_type = IndexType::kUnknown |
| uint32_t | stencil_reference = 0u |
| uint64_t | base_vertex = 0u |
| std::optional< Viewport > | viewport |
| std::optional< IRect > | scissor |
| size_t | instance_count = 1u |
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:
BindVerticesCommand are very lightweight objects and can be created frequently and on demand. The resources referenced in commands views into buffers managed by other allocators and resource managers.
|
overridevirtual |
Implements impeller::ResourceBinder.
Definition at line 78 of file command.cc.
References fragment_bindings, impeller::SampledImageSlot::HasSampler(), impeller::SampledImageSlot::HasTexture(), impeller::kCompute, impeller::kFragment, impeller::kTessellationControl, impeller::kTessellationEvaluation, impeller::kUnknown, impeller::kVertex, impeller::Bindings::sampled_images, impeller::SampledImageSlot::sampler_index, impeller::TextureAndSampler::slot, VALIDATION_LOG, and vertex_bindings.
|
overridevirtual |
Implements impeller::ResourceBinder.
Definition at line 33 of file command.cc.
Referenced by impeller::RuntimeEffectContents::Render().
| bool impeller::Command::BindResource | ( | ShaderStage | stage, |
| const ShaderUniformSlot & | slot, | ||
| const std::shared_ptr< const ShaderMetadata > & | metadata, | ||
| const BufferView & | view | ||
| ) |
Definition at line 40 of file command.cc.
| bool impeller::Command::BindVertices | ( | const VertexBuffer & | buffer | ) |
Specify the vertex and index buffer to use for this command.
| [in] | buffer | The vertex and index buffer definition. |
Definition at line 15 of file command.cc.
References impeller::VertexBuffer::index_buffer, index_buffer, impeller::VertexBuffer::index_type, index_type, impeller::kUnknown, impeller::BufferAndUniformSlot::slot, VALIDATION_LOG, vertex_bindings, impeller::VertexBuffer::vertex_buffer, impeller::Bindings::vertex_buffer, impeller::VertexBuffer::vertex_count, and vertex_count.
Referenced by impeller::AdvancedBlend(), impeller::scene::CuboidGeometry::BindToCommand(), impeller::scene::UnskinnedVertexBufferGeometry::BindToCommand(), impeller::scene::SkinnedVertexBufferGeometry::BindToCommand(), ImGui_ImplImpeller_RenderDrawData(), impeller::PipelineBlend(), impeller::CheckerboardContents::Render(), impeller::RuntimeEffectContents::Render(), impeller::TiledTextureContents::Render(), impeller::ClipContents::Render(), impeller::SolidRRectBlurContents::Render(), impeller::SolidColorContents::Render(), impeller::TextContents::Render(), impeller::TextureContents::Render(), impeller::VerticesColorContents::Render(), impeller::AtlasContents::Render(), impeller::ClipRestoreContents::Render(), impeller::VerticesUVContents::Render(), impeller::AtlasTextureContents::Render(), impeller::AtlasColorContents::Render(), and impeller::testing::TEST_P().
| BufferView impeller::Command::GetVertexBuffer | ( | ) | const |
Definition at line 29 of file command.cc.
References impeller::Resource< T >::resource, vertex_bindings, impeller::Bindings::vertex_buffer, and impeller::BufferAndUniformSlot::view.
Referenced by impeller::EncodeCommand().
|
inlineexplicitconstexpr |
| uint64_t impeller::Command::base_vertex = 0u |
The offset used when indexing into the vertex buffer.
Definition at line 156 of file command.h.
Referenced by impeller::EncodeCommand(), and ImGui_ImplImpeller_RenderDrawData().
| Bindings impeller::Command::fragment_bindings |
The buffer, texture, and sampler bindings used by the fragment pipeline stage.
Definition at line 113 of file command.h.
Referenced by impeller::AllocateAndBindDescriptorSets(), BindResource(), and impeller::UpdateBindingLayouts().
| BufferView impeller::Command::index_buffer |
The index buffer binding used by the vertex shader stage. Instead of setting this directly, it usually easier to specify the vertex and index buffer bindings directly via a single call to BindVertices.
BindVertices Definition at line 121 of file command.h.
Referenced by BindVertices(), and impeller::EncodeCommand().
| 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 136 of file command.h.
Referenced by BindVertices(), and impeller::EncodeCommand().
| 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.
Definition at line 177 of file command.h.
Referenced by impeller::EncodeCommand(), and impeller::testing::TEST_P().
| std::shared_ptr<Pipeline<PipelineDescriptor> > impeller::Command::pipeline |
The pipeline to use for this command.
Definition at line 103 of file command.h.
Referenced by impeller::AdvancedBlend(), impeller::scene::EncodeCommand(), impeller::EncodeCommand(), ImGui_ImplImpeller_RenderDrawData(), operator bool(), impeller::PipelineBlend(), impeller::CheckerboardContents::Render(), impeller::RuntimeEffectContents::Render(), impeller::TiledTextureContents::Render(), impeller::ClipContents::Render(), impeller::SolidRRectBlurContents::Render(), impeller::SolidColorContents::Render(), impeller::TextContents::Render(), impeller::TextureContents::Render(), impeller::VerticesColorContents::Render(), impeller::AtlasContents::Render(), impeller::ClipRestoreContents::Render(), impeller::VerticesUVContents::Render(), impeller::AtlasTextureContents::Render(), impeller::AtlasColorContents::Render(), and impeller::testing::TEST_P().
| 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 169 of file command.h.
Referenced by ImGui_ImplImpeller_RenderDrawData(), and impeller::SetViewportAndScissor().
| 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.
Pipeline PipelineDescriptor Definition at line 152 of file command.h.
Referenced by impeller::scene::EncodeCommand(), impeller::EncodeCommand(), impeller::TiledTextureContents::Render(), impeller::RuntimeEffectContents::Render(), impeller::ClipContents::Render(), impeller::SolidRRectBlurContents::Render(), impeller::SolidColorContents::Render(), impeller::TextContents::Render(), impeller::TextureContents::Render(), impeller::VerticesColorContents::Render(), impeller::AtlasContents::Render(), impeller::ClipRestoreContents::Render(), impeller::VerticesUVContents::Render(), impeller::AtlasTextureContents::Render(), impeller::AtlasColorContents::Render(), and impeller::testing::TEST_P().
| Bindings impeller::Command::vertex_bindings |
The buffer, texture, and sampler bindings used by the vertex pipeline stage.
Definition at line 108 of file command.h.
Referenced by impeller::AllocateAndBindDescriptorSets(), BindResource(), BindVertices(), GetVertexBuffer(), and impeller::UpdateBindingLayouts().
| size_t impeller::Command::vertex_count = 0u |
The number of vertices to draw.
If the index_type is IndexType::kNone, this is a count into the vertex buffer. Otherwise, it is a count into the index buffer. Set the vertex and index buffers as well as the index count using a call to BindVertices.
BindVertices Definition at line 131 of file command.h.
Referenced by BindVertices(), and impeller::EncodeCommand().
| 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 163 of file command.h.
Referenced by ImGui_ImplImpeller_RenderDrawData(), and impeller::SetViewportAndScissor().