CeresEngine 0.2.0
A game development framework
Loading...
Searching...
No Matches
CeresEngine::SimpleGraphicsRenderTask Class Referenceabstract

A simple graphics task that makes easier implementing tasks that use a single graphics pipeline. More...

#include <CeresEngine/Renderer/RenderGraph/RenderTask.hpp>

Inheritance diagram for CeresEngine::SimpleGraphicsRenderTask:
CeresEngine::GraphicsRenderTask CeresEngine::RenderTask CeresEngine::RefCounted< RenderTask > CeresEngine::Graphics::UI::UIRenderTask CeresEngine::IBLAmbientLightingRenderTask CeresEngine::SkyboxRenderTask CeresEngine::UnshadedRenderTask CeresEngine::VoxelConeTracing::DebugRenderTask CeresEngine::VoxelConeTracing::IndirectLightingRenderTask CeresEngine::VoxelConeTracing::UpscalingRenderTask CeresEngine::VoxelConeTracing::VoxelizationRenderTask

Public Member Functions

 SimpleGraphicsRenderTask (RenderGraph &renderGraph, const String &name)
 
void execute (RenderGraphContext &context, GPUCommandBuffer &commandBuffer, GPURenderTarget &renderTarget) override
 
StringView getName () const override
 Returns a display name for the render task.
 
virtual void execute (RenderGraphContext &context, GPUCommandBuffer &commandBuffer)=0
 Executes the render task with the given commandBuffer.
 
- Public Member Functions inherited from CeresEngine::GraphicsRenderTask
 RenderTask (RenderGraph &renderGraph)
 
- Public Member Functions inherited from CeresEngine::RenderTask
 RenderTask (RenderGraph &renderGraph)
 
virtual ~RenderTask ()
 
RenderTaskResourceUsagecompile ()
 Compiles the render task.
 
virtual RenderTaskStatus check () const
 Returns true if the task is dirty and needs to be run.
 
virtual Any getSettings () const
 Gets a const-reference to the render task settings.
 
virtual Any getSettings ()
 Gets a reference to the render task settings.
 
const Vector< InputSlot * > & getInputs () const
 
const Vector< OutputSlot * > & getOutputs () const
 
const RenderTaskResourceUsagegetResourceUsage () const
 
- Public Member Functions inherited from CeresEngine::RefCounted< RenderTask >
 RefCounted (Args &&... args)
 Creates a new RefCounted object and constructs a new Deleter by forwarding Args to it.
 
void retain () noexcept
 Retains the object by increment it's reference count by one.
 
bool release () noexcept
 Relases the object by decrementing it's reference count by one.
 

Protected Member Functions

virtual void initialize (GPUDevice &device)
 Perform a sequence of steps that initialize the graphics render task.
 
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.
 
virtual GPUGraphicsPipelinePtr createGraphicsPipeline (GPUDevice &device, GPURenderPass &renderPass)=0
 Creates a new graphics pipeline instance for the render task.
 
- Protected Member Functions inherited from CeresEngine::GraphicsRenderTask
virtual bool isRenderPassDirty (GPURenderPass &renderPass) const
 Checks if the render pass is dirty and needs to be recreated.
 
virtual GPURenderPassPtr createRenderPass (GPUDevice &device)
 Creates a new render pass instance for the render task.
 
virtual bool isRenderTargetDirty (GPURenderTarget &renderTarget, GPURenderPass &renderPass) const
 Checks if the render target is dirty and needs to be recreated.
 
virtual GPURenderTargetPtr createRenderTarget (GPUDevice &device, GPURenderPass &renderPass)
 Creates a new render target instance for the render task.
 
- Protected Member Functions inherited from CeresEngine::RenderTask
virtual void compile (RenderTaskCompiler &compiler)=0
 Compiles the render task.
 
virtual bool shouldConnect (const Slot &slot, const Slot &targetSlot) const
 An internal method called whenever a new connection is being made.
 
virtual void willConnect (Slot &slot, Slot &targetSlot)
 An internal method called before the slot is connected.
 
virtual void didConnect (Slot &slot, Connection &connection)
 An internal method called after the slot is connected.
 
virtual bool shouldDisconnect (const Slot &slot, const Connection &connection) const
 An internal method called whenever a new disconnection is being made.
 
virtual void willDisconnect (Slot &slot, Connection &connection)
 An internal method called before the slot is disconnected.
 
virtual void didDisconnect (Slot &slot, Connection &connection)
 An internal method called whenever the slot is disconnected.
 
ImageRenderResourcecreate (const GPUImageDescriptor &descriptor)
 
BufferRenderResourcecreate (const GPUBufferDescriptor &descriptor)
 

Protected Attributes

GPUGraphicsPipelinePtr mPipeline
 The cached graphics pipeline instance.
 
- Protected Attributes inherited from CeresEngine::GraphicsRenderTask
GPURenderPassPtr mRenderPass
 The cached render pass instance.
 
GPURenderTargetPtr mRenderTarget
 The cached render target instance.
 
- Protected Attributes inherited from CeresEngine::RenderTask
RenderTaskResourceUsage mResourceUsage
 

Private Attributes

String mName
 A display name for the render task.
 
bool mInitialized = false
 A flag that indicates if the render task initializer has been called.
 

Detailed Description

A simple graphics task that makes easier implementing tasks that use a single graphics pipeline.

Constructor & Destructor Documentation

◆ SimpleGraphicsRenderTask()

CeresEngine::SimpleGraphicsRenderTask::SimpleGraphicsRenderTask ( RenderGraph renderGraph,
const String name 
)
inlineexplicit

Member Function Documentation

◆ createGraphicsPipeline()

virtual GPUGraphicsPipelinePtr CeresEngine::SimpleGraphicsRenderTask::createGraphicsPipeline ( GPUDevice device,
GPURenderPass renderPass 
)
protectedpure virtual

Creates a new graphics pipeline instance for the render task.

Parameters
deviceThe device in which the implementation should create the graphics pipeline instance from.
renderPassA reference to the current render pass. The implementation must use this render pass to create the new graphics pipeline.

Implemented in CeresEngine::UnshadedRenderTask, CeresEngine::IBLAmbientLightingRenderTask, CeresEngine::SkyboxRenderTask, CeresEngine::VoxelConeTracing::VoxelizationRenderTask, CeresEngine::VoxelConeTracing::IndirectLightingRenderTask, CeresEngine::VoxelConeTracing::UpscalingRenderTask, CeresEngine::VoxelConeTracing::DebugRenderTask, and CeresEngine::Graphics::UI::UIRenderTask.

◆ execute() [1/3]

virtual void CeresEngine::RenderTask::execute ( RenderGraphContext context,
GPUCommandBuffer commandBuffer 
)
virtual

Executes the render task with the given commandBuffer.

Parameters
commandBufferThe command buffer to encode the render task to.

Reimplemented from CeresEngine::GraphicsRenderTask.

Reimplemented in CeresEngine::VoxelConeTracing::VoxelizationRenderTask, and CeresEngine::VoxelConeTracing::VoxelizationRenderTask.

◆ execute() [2/3]

void CeresEngine::SimpleGraphicsRenderTask::execute ( RenderGraphContext context,
GPUCommandBuffer commandBuffer,
GPURenderTarget renderTarget 
)
overridevirtual

◆ execute() [3/3]

virtual void CeresEngine::SimpleGraphicsRenderTask::execute ( RenderGraphContext context,
GPUCommandBuffer commandBuffer,
GPURenderTarget renderTarget,
GPUGraphicsPipeline pipeline 
)
protectedpure virtual

Executes the graphics render task with the given commandBuffer, pipeline and renderTarget.

Parameters
commandBufferThe command buffer to encode the render task to.
renderTargetThe render target to render to.
pipelineThe graphics pipeline for the task.

Implemented in CeresEngine::UnshadedRenderTask, CeresEngine::IBLAmbientLightingRenderTask, CeresEngine::SkyboxRenderTask, CeresEngine::VoxelConeTracing::VoxelizationRenderTask, CeresEngine::VoxelConeTracing::IndirectLightingRenderTask, CeresEngine::VoxelConeTracing::UpscalingRenderTask, CeresEngine::VoxelConeTracing::DebugRenderTask, CeresEngine::Graphics::UI::UIRenderTask, and CeresEngine::VoxelConeTracing::VoxelizationRenderTask.

◆ getName()

StringView CeresEngine::SimpleGraphicsRenderTask::getName ( ) const
inlineoverridevirtual

Returns a display name for the render task.

Reimplemented from CeresEngine::RenderTask.

◆ initialize()

virtual void CeresEngine::SimpleGraphicsRenderTask::initialize ( GPUDevice device)
inlineprotectedvirtual

Perform a sequence of steps that initialize the graphics render task.

These operations are only executed once in the first execution.

Reimplemented in CeresEngine::VoxelConeTracing::IndirectLightingRenderTask, CeresEngine::UnshadedRenderTask, CeresEngine::IBLAmbientLightingRenderTask, CeresEngine::VoxelConeTracing::VoxelizationRenderTask, and CeresEngine::Graphics::UI::UIRenderTask.

◆ isGraphicsPipelineDirty()

virtual bool CeresEngine::SimpleGraphicsRenderTask::isGraphicsPipelineDirty ( GPUGraphicsPipeline graphicsPipeline,
GPURenderPass renderPass 
) const
inlineprotectedvirtual

Checks if the graphics pipeline is dirty and needs to be recreated.

Parameters
graphicsPipelineA reference to the previous graphics pipeline. The implementation can use this to compare the existing pipeline to check if it needs to recreate it.
renderPassA reference to the current render pass. The implementation must use this render pass to create the new graphics pipeline.
Returns
true if the implementation wishes to recreate the graphics pipeline.

Member Data Documentation

◆ mInitialized

bool CeresEngine::SimpleGraphicsRenderTask::mInitialized = false
private

A flag that indicates if the render task initializer has been called.

◆ mName

String CeresEngine::SimpleGraphicsRenderTask::mName
private

A display name for the render task.

◆ mPipeline

GPUGraphicsPipelinePtr CeresEngine::SimpleGraphicsRenderTask::mPipeline
protected

The cached graphics pipeline instance.


The documentation for this class was generated from the following file: