5#ifndef FLUTTER_IMPELLER_RENDERER_RENDER_PASS_H_
6#define FLUTTER_IMPELLER_RENDERER_RENDER_PASS_H_
34 const std::shared_ptr<const Context>&
GetContext()
const;
44 void SetLabel(std::string_view label);
152 size_t vertex_buffer_count);
186 std::shared_ptr<const Texture>
texture,
193 std::unique_ptr<ShaderMetadata> metadata,
194 std::shared_ptr<const Texture>
texture,
201 std::unique_ptr<ShaderMetadata> metadata,
265 RenderPass(std::shared_ptr<const Context> context,
269 size_t vertex_buffer_count);
293 std::optional<size_t> bound_buffers_start_ = std::nullopt;
294 std::optional<size_t> bound_textures_start_ = std::nullopt;
295 std::optional<size_t> vertex_buffers_start_ = std::nullopt;
To do anything rendering related with Impeller, you need a context.
Describes the fixed function and programmable aspects of rendering and compute operations performed b...
Render passes encode render commands directed as one specific render target into an underlying comman...
std::vector< TextureAndSampler > bound_textures_
virtual bool BindDynamicResource(ShaderStage stage, DescriptorType type, const SampledImageSlot &slot, std::unique_ptr< ShaderMetadata > metadata, std::shared_ptr< const Texture > texture, raw_ptr< const Sampler >)
Bind with dynamically generated shader metadata.
const bool has_depth_attachment_
static bool ValidateIndexBuffer(const BufferView &index_buffer, IndexType index_type)
virtual bool SetVertexBuffer(VertexBuffer buffer)
Specify the vertex and index buffer to use for this command.
virtual bool BindResource(ShaderStage stage, DescriptorType type, const ShaderUniformSlot &slot, const ShaderMetadata *metadata, BufferView view) override
const bool has_stencil_attachment_
virtual void SetStencilReference(uint32_t value)
virtual void SetScissor(IRect32 scissor)
const RenderTarget & GetRenderTarget() const
SampleCount GetSampleCount() const
The sample count of the attached render target.
virtual bool SetIndexBuffer(BufferView index_buffer, IndexType index_type)
Specify an index buffer to use for this command. To unset the index buffer, pass IndexType::kNone to ...
bool AddCommand(Command &&command)
Record a command for subsequent encoding to the underlying command buffer. No work is encoded into th...
const SampleCount sample_count_
virtual bool OnEncodeCommands(const Context &context) const =0
PixelFormat GetRenderTargetPixelFormat() const
The pixel format of the attached render target.
const Matrix & GetOrthographicTransform() const
std::vector< Command > commands_
virtual const std::vector< Command > & GetCommands() const
Accessor for the current Commands.
const std::shared_ptr< const Context > context_
std::vector< BufferResource > bound_buffers_
static bool ValidateVertexBuffers(const BufferView vertex_buffers[], size_t vertex_buffer_count)
bool HasStencilAttachment() const
Whether the render target has an stencil attachment.
virtual void OnSetLabel(std::string_view label)=0
const Matrix orthographic_
void SetLabel(std::string_view label)
virtual bool IsValid() const =0
std::vector< BufferView > vertex_buffers_
virtual void SetPipeline(PipelineRef pipeline)
The pipeline to use for this command.
const ISize render_target_size_
ISize GetRenderTargetSize() const
virtual void SetInstanceCount(size_t count)
virtual fml::Status Draw()
Record the currently pending command.
bool HasDepthAttachment() const
Whether the render target has a depth attachment.
virtual void SetElementCount(size_t count)
virtual void SetCommandLabel(std::string_view label)
The debugging label to use for the command.
bool EncodeCommands() const
Encode the recorded commands to the underlying command buffer.
const std::shared_ptr< const Context > & GetContext() const
virtual void SetBaseVertex(uint64_t value)
virtual void SetViewport(Viewport viewport)
const RenderTarget render_target_
const PixelFormat pixel_format_
PixelFormat
The Pixel formats supported by Impeller. The naming convention denotes the usage of the component,...
impeller::ShaderType type
An object used to specify work to the GPU along with references to resources the GPU will used when d...
A 4x4 matrix using column-major storage.
An interface for binding resources. This is implemented by |Command| and |ComputeCommand| to make GPU...
Metadata required to bind a combined texture and sampler.