Render passes encode render commands directed as one specific render target into an underlying command buffer. More...
#include <render_pass.h>
Public Member Functions | |
| virtual | ~RenderPass () |
| const std::weak_ptr< const Context > & | GetContext () const |
| const RenderTarget & | GetRenderTarget () const |
| ISize | GetRenderTargetSize () const |
| const Matrix & | GetOrthographicTransform () const |
| virtual bool | IsValid () const =0 |
| void | SetLabel (std::string label) |
| void | ReserveCommands (size_t command_count) |
| Reserve [command_count] commands in the HAL command buffer. More... | |
| HostBuffer & | GetTransientsBuffer () |
| bool | AddCommand (Command &&command) |
| Record a command for subsequent encoding to the underlying command buffer. No work is encoded into the command buffer at this time. More... | |
| bool | EncodeCommands () const |
| Encode the recorded commands to the underlying command buffer. More... | |
| const std::vector< Command > & | GetCommands () const |
| Accessor for the current Commands. More... | |
| SampleCount | GetSampleCount () const |
| The sample count of the attached render target. More... | |
| PixelFormat | GetRenderTargetPixelFormat () const |
| The pixel format of the attached render target. More... | |
| bool | HasStencilAttachment () const |
| Whether the render target has an stencil attachment. More... | |
Protected Member Functions | |
| RenderPass (std::weak_ptr< const Context > context, const RenderTarget &target) | |
| virtual void | OnSetLabel (std::string label)=0 |
| virtual bool | OnEncodeCommands (const Context &context) const =0 |
Protected Attributes | |
| const std::weak_ptr< const Context > | context_ |
| const SampleCount | sample_count_ |
| const PixelFormat | pixel_format_ |
| const bool | has_stencil_attachment_ |
| const ISize | render_target_size_ |
| const RenderTarget | render_target_ |
| std::shared_ptr< HostBuffer > | transients_buffer_ |
| std::vector< Command > | commands_ |
| const Matrix | orthographic_ |
Render passes encode render commands directed as one specific render target into an underlying command buffer.
Render passes can be obtained from the command buffer in which the pass is meant to encode commands into.
CommandBuffer Definition at line 29 of file render_pass.h.
|
virtual |
|
protected |
| bool impeller::RenderPass::AddCommand | ( | Command && | command | ) |
Record a command for subsequent encoding to the underlying command buffer. No work is encoded into the command buffer at this time.
| [in] | command | The command |
Definition at line 67 of file render_pass.cc.
References commands_, impeller::RenderTarget::GetRenderTargetSize(), impeller::TRect< int64_t >::MakeSize(), render_target_, and VALIDATION_LOG.
Referenced by impeller::scene::EncodeCommand(), ImGui_ImplImpeller_RenderDrawData(), 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().
| bool impeller::RenderPass::EncodeCommands | ( | ) | const |
Encode the recorded commands to the underlying command buffer.
Definition at line 93 of file render_pass.cc.
References context_, and OnEncodeCommands().
|
inline |
Accessor for the current Commands.
Visible for testing.
Definition at line 78 of file render_pass.h.
References commands_.
| const std::weak_ptr< const Context > & impeller::RenderPass::GetContext | ( | ) | const |
Definition at line 102 of file render_pass.cc.
References context_.
| const Matrix & impeller::RenderPass::GetOrthographicTransform | ( | ) | const |
Definition at line 51 of file render_pass.cc.
References orthographic_.
Referenced by impeller::Geometry::ComputePositionGeometry(), impeller::Geometry::ComputePositionUVGeometry(), impeller::ComputeUVGeometryForRect(), impeller::VerticesGeometry::GetPositionBuffer(), impeller::VerticesGeometry::GetPositionColorBuffer(), impeller::VerticesGeometry::GetPositionUVBuffer(), impeller::ClipContents::Render(), impeller::SolidRRectBlurContents::Render(), impeller::TextContents::Render(), impeller::TextureContents::Render(), impeller::AtlasContents::Render(), impeller::ClipRestoreContents::Render(), impeller::AtlasTextureContents::Render(), impeller::AtlasColorContents::Render(), and impeller::testing::TEST_P().
| const RenderTarget & impeller::RenderPass::GetRenderTarget | ( | ) | const |
Definition at line 43 of file render_pass.cc.
References render_target_.
Referenced by impeller::EncodeCommandsInReactor(), and impeller::scene::Material::GetContextOptions().
| PixelFormat impeller::RenderPass::GetRenderTargetPixelFormat | ( | ) | const |
The pixel format of the attached render target.
Definition at line 35 of file render_pass.cc.
References pixel_format_.
Referenced by impeller::OptionsFromPass().
| ISize impeller::RenderPass::GetRenderTargetSize | ( | ) | const |
Definition at line 47 of file render_pass.cc.
References render_target_size_.
Referenced by impeller::EncodeCommandsInReactor(), ImGui_ImplImpeller_RenderDrawData(), impeller::SceneContents::Render(), impeller::ClipContents::Render(), impeller::ClipRestoreContents::Render(), impeller::Entity::Render(), and impeller::testing::TEST_P().
| SampleCount impeller::RenderPass::GetSampleCount | ( | ) | const |
The sample count of the attached render target.
Definition at line 31 of file render_pass.cc.
References sample_count_.
Referenced by impeller::OptionsFromPass().
| HostBuffer & impeller::RenderPass::GetTransientsBuffer | ( | ) |
Definition at line 55 of file render_pass.cc.
References transients_buffer_.
Referenced by impeller::Geometry::ComputePositionGeometry(), impeller::Geometry::ComputePositionUVGeometry(), impeller::ComputeUVGeometryForRect(), impeller::scene::EncodeCommand(), ImGui_ImplImpeller_RenderDrawData(), 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().
| bool impeller::RenderPass::HasStencilAttachment | ( | ) | const |
Whether the render target has an stencil attachment.
Definition at line 39 of file render_pass.cc.
References has_stencil_attachment_.
Referenced by impeller::OptionsFromPass().
|
pure virtual |
|
protectedpure virtual |
Referenced by EncodeCommands().
|
protectedpure virtual |
Referenced by SetLabel().
|
inline |
Reserve [command_count] commands in the HAL command buffer.
Note: this is not the native command buffer.
Definition at line 48 of file render_pass.h.
References commands_.
| void impeller::RenderPass::SetLabel | ( | std::string | label | ) |
Definition at line 59 of file render_pass.cc.
References OnSetLabel(), impeller::SPrintF(), and transients_buffer_.
|
protected |
Definition at line 105 of file render_pass.h.
Referenced by AddCommand(), impeller::EncodeCommandsInReactor(), GetCommands(), and ReserveCommands().
|
protected |
Definition at line 93 of file render_pass.h.
Referenced by EncodeCommands(), GetContext(), RenderPass(), and ~RenderPass().
|
protected |
Definition at line 101 of file render_pass.h.
Referenced by HasStencilAttachment().
|
protected |
Definition at line 106 of file render_pass.h.
Referenced by GetOrthographicTransform().
|
protected |
Definition at line 100 of file render_pass.h.
Referenced by GetRenderTargetPixelFormat().
|
protected |
Definition at line 103 of file render_pass.h.
Referenced by AddCommand(), and GetRenderTarget().
|
protected |
Definition at line 102 of file render_pass.h.
Referenced by GetRenderTargetSize().
|
protected |
Definition at line 99 of file render_pass.h.
Referenced by GetSampleCount().
|
protected |
Definition at line 104 of file render_pass.h.
Referenced by GetTransientsBuffer(), RenderPass(), SetLabel(), and ~RenderPass().