30 struct RenderTaskResourceUsage;
31 class RenderTaskCompiler;
Definition RenderResource.hpp:193
Definition RenderTask.hpp:468
A class that describes the connection between an input and an output slot.
Definition RenderGraphSlot.hpp:188
A retain-release type of smart pointer.
Definition SmartPtr.hpp:132
Definition GPUCommandBuffer.hpp:77
Definition GPUComputePipeline.hpp:62
Definition GPUDevice.hpp:357
Definition GPUGraphicsPipeline.hpp:790
Definition GPURenderPass.hpp:149
Definition GPURenderTarget.hpp:105
Definition RenderTask.hpp:289
virtual GPURenderTargetPtr createRenderTarget(GPUDevice &device, GPURenderPass &renderPass)
Creates a new render target instance for the render task.
GPURenderPassPtr mRenderPass
The cached render pass instance.
Definition RenderTask.hpp:292
virtual bool isRenderTargetDirty(GPURenderTarget &renderTarget, GPURenderPass &renderPass) const
Checks if the render target is dirty and needs to be recreated.
virtual GPURenderPassPtr createRenderPass(GPUDevice &device)
Creates a new render pass instance for the render task.
GPURenderTargetPtr mRenderTarget
The cached render target instance.
Definition RenderTask.hpp:295
void execute(RenderGraphContext &context, GPUCommandBuffer &commandBuffer) override
virtual bool isRenderPassDirty(GPURenderPass &renderPass) const
Checks if the render pass is dirty and needs to be recreated.
virtual void execute(RenderGraphContext &context, GPUCommandBuffer &commandBuffer, GPURenderTarget &renderTarget)=0
Executes the graphics render task with the given commandBuffer and renderTarget.
Definition RenderResource.hpp:114
A slot that outputs a resource. Can be connected to multiple input slots.
Definition RenderGraphSlot.hpp:159
Definition RenderTask.hpp:519
void execute(RenderGraphContext &context, GPUCommandBuffer &commandBuffer) final
Executes the render task with the given commandBuffer.
void compile(RenderTaskCompiler &compiler) final
Compiles the render task.
ImageInput image
The image to be presented by the task.
Definition RenderTask.hpp:522
A simple reference counter base class.
Definition SmartPtr.hpp:438
Definition RenderGraph.hpp:23
Definition RenderResource.hpp:27
Definition RenderTask.hpp:243
RenderTaskCompiler & addColorAttachment(ImageRenderResource &image, GPUAttachmentLoadOp loadOp=GPUAttachmentLoadOp::Load, GPUAttachmentStoreOp storeOp=GPUAttachmentStoreOp::Store)
Adds a new resource that will be used as a color attachment in a render pass.
RenderTaskCompiler & writes(RenderResource &resource)
Adds a new resource that will be used for writing in a shader.
RenderTaskResourceUsage & mResourceUsage
Definition RenderTask.hpp:245
RenderTaskCompiler(RenderTaskResourceUsage &resourceUsage)
Definition RenderTask.hpp:248
RenderTaskCompiler & setStencilAttachment(ImageRenderResource &image, GPUAttachmentLoadOp loadOp=GPUAttachmentLoadOp::Load, GPUAttachmentStoreOp storeOp=GPUAttachmentStoreOp::Store)
Sets a resource that will be used as stencil attachment in a render pass.
RenderTaskCompiler & setDepthAttachment(ImageRenderResource &image, GPUAttachmentLoadOp loadOp=GPUAttachmentLoadOp::Load, GPUAttachmentStoreOp storeOp=GPUAttachmentStoreOp::Store)
Sets a resource that will be used as depth attachment in a render pass.
RenderTaskCompiler & reads(RenderResource &resource)
Adds a new resource that will be used for reading in a shader.
Definition RenderTask.hpp:164
const RenderTaskResourceUsage & getResourceUsage() const
Definition RenderTask.hpp:236
const Vector< OutputSlot * > & getOutputs() const
Definition RenderTask.hpp:212
virtual void compile(RenderTaskCompiler &compiler)=0
Compiles the render task.
RenderTask(RenderGraph &renderGraph)
Definition RenderTask.hpp:180
virtual RenderTaskStatus check() const
Returns true if the task is dirty and needs to be run.
Definition RenderTask.hpp:195
virtual Any getSettings() const
Gets a const-reference to the render task settings.
Definition RenderTask.hpp:203
RenderTaskResourceUsage & compile()
Compiles the render task.
RenderGraph & mRenderGraph
Definition RenderTask.hpp:171
Vector< OutputSlot * > mOutputs
Definition RenderTask.hpp:174
virtual bool shouldConnect(const Slot &slot, const Slot &targetSlot) const
An internal method called whenever a new connection is being made.
Definition RenderTask.hpp:217
Vector< InputSlot * > mInputs
Definition RenderTask.hpp:173
virtual bool shouldDisconnect(const Slot &slot, const Connection &connection) const
An internal method called whenever a new disconnection is being made.
Definition RenderTask.hpp:227
ImageRenderResource & create(const GPUImageDescriptor &descriptor)
BufferRenderResource & create(const GPUBufferDescriptor &descriptor)
RenderTaskResourceUsage mResourceUsage
Definition RenderTask.hpp:177
virtual void didDisconnect(Slot &slot, Connection &connection)
An internal method called whenever the slot is disconnected.
const Vector< InputSlot * > & getInputs() const
Definition RenderTask.hpp:209
virtual void willDisconnect(Slot &slot, Connection &connection)
An internal method called before the slot is disconnected.
Definition RenderTask.hpp:230
virtual Any getSettings()
Gets a reference to the render task settings.
Definition RenderTask.hpp:206
virtual void willConnect(Slot &slot, Slot &targetSlot)
An internal method called before the slot is connected.
Definition RenderTask.hpp:220
virtual void didConnect(Slot &slot, Connection &connection)
An internal method called after the slot is connected.
virtual StringView getName() const
Returns a display name for the render task.
Definition RenderTask.hpp:192
virtual void execute(RenderGraphContext &context, GPUCommandBuffer &commandBuffer)=0
Executes the render task with the given commandBuffer.
A renderer graphics pipeline.
Definition RendererGraphicsPipeline.hpp:60
The renderer graphics pipeline manager that is responsible for managing and re-using GPU graphics pip...
Definition RendererGraphicsPipeline.hpp:182
The CeresEngine renderer.
Definition Renderer.hpp:35
A renderer shader.
Definition RendererShader.hpp:44
The renderer shader manager that is responsible for managing and re-using GPU shaders.
Definition RendererShader.hpp:85
Definition RenderTask.hpp:473
virtual bool isComputePipelineDirty(GPUComputePipeline &computePipeline) const
Checks if the compute pipeline is dirty and needs to be recreated.
Definition RenderTask.hpp:509
StringView getName() const override
Returns a display name for the render task.
Definition RenderTask.hpp:492
bool mInitialized
A flag that indicates if the render task initializer has been called.
Definition RenderTask.hpp:482
SimpleComputeRenderTask(RenderGraph &renderGraph, const String &name)
Definition RenderTask.hpp:485
virtual void execute(RenderGraphContext &context, GPUCommandBuffer &commandBuffer, GPUComputePipeline &pipeline)=0
Executes the compute render task with the given commandBuffer, pipeline and renderTarget.
void execute(RenderGraphContext &context, GPUCommandBuffer &commandBuffer) override
virtual void initialize(GPUDevice &device)
Perform a sequence of steps that initialize the compute render task.
Definition RenderTask.hpp:497
virtual GPUComputePipelinePtr createComputePipeline(GPUDevice &device)=0
Creates a new compute pipeline instance for the render task.
GPUComputePipelinePtr mPipeline
The cached compute pipeline instance.
Definition RenderTask.hpp:479
String mName
A display name for the render task.
Definition RenderTask.hpp:476
A simple graphics task that makes easier implementing tasks that use a single graphics pipeline.
Definition RenderTask.hpp:393
bool mInitialized
A flag that indicates if the render task initializer has been called.
Definition RenderTask.hpp:399
RendererGraphicsPipelinePtr mPipeline
The cached graphics pipeline instance.
Definition RenderTask.hpp:406
StringView getName() const override
Returns a display name for the render task.
Definition RenderTask.hpp:418
virtual RendererShaderPtr createShader(RendererShaderManager &shaderManager, GPURenderPass &renderPass)=0
Creates a new shader instance for the render task.
void execute(RenderGraphContext &context, GPUCommandBuffer &commandBuffer, GPURenderTarget &renderTarget) override
RendererShaderPtr mShader
The cached graphics pipeline instance.
Definition RenderTask.hpp:403
String mName
A display name for the render task.
Definition RenderTask.hpp:396
virtual RendererGraphicsPipelinePtr createGraphicsPipeline(RendererGraphicsPipelineManager &graphicsPipelineManager, RendererShader &shader, GPURenderPass &renderPass)=0
Creates a new graphics pipeline instance for the render task.
SimpleGraphicsRenderTask2(RenderGraph &renderGraph, const String &name)
Definition RenderTask.hpp:409
virtual bool isShaderDirty(RendererShader &shader, GPURenderPass &renderPass) const
Checks if the shader is dirty and needs to be recreated.
Definition RenderTask.hpp:438
virtual void initialize(GPUDevice &device)
Perform a sequence of steps that initialize the graphics render task.
Definition RenderTask.hpp:423
virtual bool isGraphicsPipelineDirty(RendererGraphicsPipeline &graphicsPipeline, GPURenderPass &renderPass) const
Checks if the graphics pipeline is dirty and needs to be recreated.
Definition RenderTask.hpp:454
virtual void execute(RenderGraphContext &context, GPUCommandBuffer &commandBuffer, GPURenderTarget &renderTarget, RendererGraphicsPipeline &pipeline)=0
Executes the graphics render task with the given commandBuffer, pipeline and renderTarget.
A simple graphics task that makes easier implementing tasks that use a single graphics pipeline.
Definition RenderTask.hpp:338
bool mInitialized
A flag that indicates if the render task initializer has been called.
Definition RenderTask.hpp:344
virtual GPUGraphicsPipelinePtr createGraphicsPipeline(GPUDevice &device, GPURenderPass &renderPass)=0
Creates a new graphics pipeline instance for the render task.
String mName
A display name for the render task.
Definition RenderTask.hpp:341
void execute(RenderGraphContext &context, GPUCommandBuffer &commandBuffer, GPURenderTarget &renderTarget) override
virtual void execute(RenderGraphContext &context, GPUCommandBuffer &commandBuffer, GPURenderTarget &renderTarget, GPUGraphicsPipeline &pipeline)=0
Executes the graphics render task with the given commandBuffer, pipeline and renderTarget.
virtual bool isGraphicsPipelineDirty(GPUGraphicsPipeline &graphicsPipeline, GPURenderPass &renderPass) const
Checks if the graphics pipeline is dirty and needs to be recreated.
Definition RenderTask.hpp:380
virtual void initialize(GPUDevice &device)
Perform a sequence of steps that initialize the graphics render task.
Definition RenderTask.hpp:365
StringView getName() const override
Returns a display name for the render task.
Definition RenderTask.hpp:360
SimpleGraphicsRenderTask(RenderGraph &renderGraph, const String &name)
Definition RenderTask.hpp:351
GPUGraphicsPipelinePtr mPipeline
The cached graphics pipeline instance.
Definition RenderTask.hpp:348
A render task slot.
Definition RenderGraphSlot.hpp:23
Definition Application.hpp:19
GPUAttachmentLoadOp
Enumeration for render pass attachment load operations.
Definition GPURenderPass.hpp:32
@ Clear
Clear the previous content of the respective render target attachment.
@ Load
Loads the previous content of the respective render target attachment.
BasicStringView< char > StringView
Narrow string view used for handling narrow encoded text in UTF-8.
Definition String.hpp:190
GPUImageLayout
Definition GPUImage.hpp:65
GPUAttachmentStoreOp
Enumeration for render pass attachment store operations.
Definition GPURenderPass.hpp:48
@ Store
Stores the outcome in the respective render target attachment.
std::vector< T, ScopedAllocatorAdaptor< StdAllocator< T, RawAllocator > > > Vector
Vector is a sequence container that encapsulates dynamic size arrays.
Definition Vector.hpp:17
RenderTaskStatus
Definition RenderTask.hpp:158
std::uint32_t UInt32
Definition DataTypes.hpp:23
constexpr size_t hash(const T &v)
Generates a hash for the provided type.
Definition Hash.hpp:25
Hardware buffer descriptor structure.
Definition GPUBuffer.hpp:92
Definition GPUImage.hpp:247
A context structure that holds context for a render graph pass.
Definition RenderTask.hpp:143
Renderer & renderer
The renderer that is executing the render graph.
Definition RenderTask.hpp:145
RenderGraphContext(Renderer &renderer, GPUDevice &device)
Creates a new context for a render graph execution.
Definition RenderTask.hpp:155
GPUStorageBufferPool storageBuffers
A storage buffer pool.
Definition RenderTask.hpp:151
GPUUniformBufferPool uniformBuffers
A uniform buffer pool.
Definition RenderTask.hpp:148
A structure that describes a attachment resource.
Definition RenderTask.hpp:48
ImageRenderResource * resource
The resource that will be used as an attachment.
Definition RenderTask.hpp:50
GPUImageLayout finalLayout
The required final layout for the attachment resource image.
Definition RenderTask.hpp:64
GPUImageLayout initialLayout
The required initial layout for the attachment resource image.
Definition RenderTask.hpp:60
GPUAttachmentStoreOp storeOp
The attachment store operation to be used for the render pass.
Definition RenderTask.hpp:56
GPUAttachmentLoadOp loadOp
The attachment load operation to be used for the render pass.
Definition RenderTask.hpp:53
A structure that describes a resource realization.
Definition RenderTask.hpp:77
RenderResource * resource
The resource that will be realized.
Definition RenderTask.hpp:79
A structure that describes a shader resource.
Definition RenderTask.hpp:36
RenderResource * resource
The resource that will be used by a shader.
Definition RenderTask.hpp:38
A structure that describes a resource unrealization.
Definition RenderTask.hpp:86
RenderResource * resource
The resource that will be unrealized.
Definition RenderTask.hpp:88
A structure that describes how and what resources are used by a render task.
Definition RenderTask.hpp:34
bool uses(const RenderResource &resource) const
Checks if the given resource is used by the render task.
bool writes(const RenderResource &resource) const
Checks if the given resource is written in a shader by the render task.
Vector< UnrealizedResourceInfo > unrealizations
A list of resources that will be unrealized for this task.
Definition RenderTask.hpp:92
bool realizes(const RenderResource &resource) const
Checks if a resource is realized for this render task.
bool unrealizes(const RenderResource &resource) const
Checks if a resource is unrealized for this render task.
RenderResource & getResource(const Slot &slot) const
Gets the current resource instance for the given slot.
Vector< AttachmentResourceInfo > colorAttachments
A list of resources that are used as color attachments.
Definition RenderTask.hpp:68
const AttachmentResourceInfo * getAttachmentInfo(const ImageRenderResource &resource) const
Finds the AttachmentResourceInfo structure for the attachment using resource.
bool reads(const RenderResource &resource) const
Checks if the given resource is read in a shader by the render task.
Vector< ShaderResourceInfo > shaderWrites
A list of resources that are written by shaders.
Definition RenderTask.hpp:45
const AttachmentResourceInfo * getAttachmentInfo(UInt32 attachmentIdx) const
Finds the AttachmentResourceInfo structure for the attachment at index attachmentIdx
AttachmentResourceInfo depthAttachment
A resource that is used as depth attachment.
Definition RenderTask.hpp:71
Vector< RealizedResourceInfo > realizations
A list of resources that will be realized for this task.
Definition RenderTask.hpp:83
Vector< ShaderResourceInfo > shaderReads
A list of resources that are read by shaders.
Definition RenderTask.hpp:42
AttachmentResourceInfo stencilAttachment
A resource that is used as stencil attachment.
Definition RenderTask.hpp:74