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

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

Inheritance diagram for CeresEngine::SimpleComputeRenderTask:
CeresEngine::ComputeRenderTask CeresEngine::RenderTask CeresEngine::RefCounted< RenderTask > CeresEngine::VoxelConeTracing::InjectRadianceRenderTask CeresEngine::VoxelConeTracing::PropagateRadianceRenderTask

Public Member Functions

 SimpleComputeRenderTask (RenderGraph &renderGraph, const String &name)
 
void execute (RenderGraphContext &context, GPUCommandBuffer &commandBuffer) override
 
StringView getName () const override
 Returns a display name for the render task.
 
- Public Member Functions inherited from CeresEngine::ComputeRenderTask
 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 compute render task.
 
virtual void execute (RenderGraphContext &context, GPUCommandBuffer &commandBuffer, GPUComputePipeline &pipeline)=0
 Executes the compute render task with the given commandBuffer, pipeline and renderTarget.
 
virtual bool isComputePipelineDirty (GPUComputePipeline &computePipeline) const
 Checks if the compute pipeline is dirty and needs to be recreated.
 
virtual GPUComputePipelinePtr createComputePipeline (GPUDevice &device)=0
 Creates a new compute pipeline 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)
 

Private Attributes

String mName
 A display name for the render task.
 
GPUComputePipelinePtr mPipeline
 The cached compute pipeline instance.
 
bool mInitialized = false
 A flag that indicates if the render task initializer has been called.
 

Additional Inherited Members

- Protected Attributes inherited from CeresEngine::RenderTask
RenderTaskResourceUsage mResourceUsage
 

Constructor & Destructor Documentation

◆ SimpleComputeRenderTask()

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

Member Function Documentation

◆ createComputePipeline()

virtual GPUComputePipelinePtr CeresEngine::SimpleComputeRenderTask::createComputePipeline ( GPUDevice device)
protectedpure virtual

Creates a new compute pipeline instance for the render task.

Parameters
deviceThe device in which the implementation should create the compute pipeline instance from.

Implemented in CeresEngine::VoxelConeTracing::InjectRadianceRenderTask, and CeresEngine::VoxelConeTracing::PropagateRadianceRenderTask.

◆ execute() [1/2]

void CeresEngine::SimpleComputeRenderTask::execute ( RenderGraphContext context,
GPUCommandBuffer commandBuffer 
)
overridevirtual

◆ execute() [2/2]

virtual void CeresEngine::SimpleComputeRenderTask::execute ( RenderGraphContext context,
GPUCommandBuffer commandBuffer,
GPUComputePipeline pipeline 
)
protectedpure virtual

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

Parameters
commandBufferThe command buffer to encode the render task to.
pipelineThe compute pipeline for the task.

Implemented in CeresEngine::VoxelConeTracing::InjectRadianceRenderTask, and CeresEngine::VoxelConeTracing::PropagateRadianceRenderTask.

◆ getName()

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

Returns a display name for the render task.

Reimplemented from CeresEngine::RenderTask.

◆ initialize()

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

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

These operations are only executed once in the first execution.

Reimplemented in CeresEngine::VoxelConeTracing::InjectRadianceRenderTask, and CeresEngine::VoxelConeTracing::PropagateRadianceRenderTask.

◆ isComputePipelineDirty()

virtual bool CeresEngine::SimpleComputeRenderTask::isComputePipelineDirty ( GPUComputePipeline computePipeline) const
inlineprotectedvirtual

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

Parameters
computePipelineA reference to the previous compute pipeline. The implementation can use this to compare the existing pipeline to check if it needs to recreate it.
Returns
true if the implementation wishes to recreate the compute pipeline.

Member Data Documentation

◆ mInitialized

bool CeresEngine::SimpleComputeRenderTask::mInitialized = false
private

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

◆ mName

String CeresEngine::SimpleComputeRenderTask::mName
private

A display name for the render task.

◆ mPipeline

GPUComputePipelinePtr CeresEngine::SimpleComputeRenderTask::mPipeline
private

The cached compute pipeline instance.


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