6#include "flutter/fml/logging.h"
13SceneEncoder::SceneEncoder() =
default;
21 const Matrix& view_transform,
31 PipelineKey{scene_command.geometry->GetGeometryType(),
32 scene_command.material->GetMaterialType()},
36 scene_context, host_buffer, view_transform * scene_command.
transform,
45std::shared_ptr<CommandBuffer> SceneEncoder::BuildSceneCommandBuffer(
46 const SceneContext& scene_context,
47 const Matrix& camera_transform,
58 scene_context.GetContext()->GetResourceAllocator()->CreateTexture(
78 auto command_buffer = scene_context.GetContext()->CreateCommandBuffer();
79 if (!command_buffer) {
84 auto render_pass = command_buffer->CreateRenderPass(render_target);
90 for (
auto&
command : commands_) {
94 if (!render_pass->EncodeCommands()) {
95 FML_LOG(
ERROR) <<
"Failed to encode render pass commands.";
99 return command_buffer;
Render passes encode render commands directed as one specific render target into an underlying comman...
virtual void SetStencilReference(uint32_t value)
virtual void SetPipeline(const std::shared_ptr< Pipeline< PipelineDescriptor > > &pipeline)
The pipeline to use for this command.
virtual fml::Status Draw()
Record the currently pending command.
virtual void SetCommandLabel(std::string_view label)
The debugging label to use for the command.
RenderTarget & SetDepthAttachment(std::optional< DepthAttachment > attachment)
ISize GetRenderTargetSize() const
RenderTarget & SetStencilAttachment(std::optional< StencilAttachment > attachment)
virtual void BindToCommand(const SceneContext &scene_context, HostBuffer &buffer, const Matrix &transform, RenderPass &pass) const =0
virtual void BindToCommand(const SceneContext &scene_context, HostBuffer &buffer, RenderPass &pass) const =0
SceneContextOptions GetContextOptions(const RenderPass &pass) const
std::shared_ptr< Pipeline< PipelineDescriptor > > GetPipeline(PipelineKey key, SceneContextOptions opts) const
HostBuffer & GetTransientsBuffer() const
void Add(const SceneCommand &command)
#define FML_LOG(severity)
static void EncodeCommand(const SceneContext &scene_context, const Matrix &view_transform, RenderPass &render_pass, const SceneCommand &scene_command)
std::shared_ptr< Texture > texture
A 4x4 matrix using column-major storage.
A lightweight object that describes the attributes of a texture that can then used an allocator to cr...