CeresEngine 0.2.0
A game development framework
Loading...
Searching...
No Matches
CeresEngine::TransientBufferRenderResource Class Referencefinal

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

Inheritance diagram for CeresEngine::TransientBufferRenderResource:
CeresEngine::BufferRenderResource CeresEngine::TRenderResource< GPUBuffer, GPUBufferDescriptor, RenderResourceType::Buffer > CeresEngine::RenderResource CeresEngine::RefCounted< RenderResource >

Public Member Functions

 TransientBufferRenderResource (RenderGraph &renderGraph, const GPUBufferDescriptor &descriptor)
 
void realize (GPUDevice &device) final
 Realizes the resource.
 
void unrealize (GPUDevice &device) final
 Unrealizes the resource.
 
GPUBufferget () const final
 
const GPUBufferDescriptorgetDescriptor () const final
 Gets the resource descriptor.
 
bool isTransient () const final
 
bool isExternal () const final
 
- Public Member Functions inherited from CeresEngine::TRenderResource< GPUBuffer, GPUBufferDescriptor, RenderResourceType::Buffer >
bool isValid () const override
 
GPUBufferoperator* () const
 
GPUBufferoperator-> () const
 
 operator GPUBuffer & () const
 
 operator GPUBuffer * () const
 
 operator RC< GPUBuffer > () const
 
 RenderResource (RenderGraph &renderGraph)
 
- Public Member Functions inherited from CeresEngine::RenderResource
 RenderResource (RenderGraph &renderGraph)
 
virtual ~RenderResource ()=default
 
 operator bool () const
 
const Vector< RenderTask * > & getReaders () const
 
const Vector< RenderTask * > & getWriters () const
 
- Public Member Functions inherited from CeresEngine::RefCounted< RenderResource >
 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.
 

Private Attributes

GPUBufferDescriptor mDescriptor
 
GPUBufferPtr mBuffer = nullptr
 

Additional Inherited Members

- Static Public Attributes inherited from CeresEngine::TRenderResource< GPUBuffer, GPUBufferDescriptor, RenderResourceType::Buffer >
static const constexpr RenderResourceType resourceType
 
- Protected Attributes inherited from CeresEngine::RenderResource
RenderGraphmRenderGraph
 The owning render graph instance.
 

Constructor & Destructor Documentation

◆ TransientBufferRenderResource()

CeresEngine::TransientBufferRenderResource::TransientBufferRenderResource ( RenderGraph renderGraph,
const GPUBufferDescriptor descriptor 
)

Member Function Documentation

◆ get()

GPUBuffer * CeresEngine::TransientBufferRenderResource::get ( ) const
inlinefinalvirtual

◆ getDescriptor()

const GPUBufferDescriptor & CeresEngine::TransientBufferRenderResource::getDescriptor ( ) const
inlinefinalvirtual

Gets the resource descriptor.

If this resource is transient, returns the descriptor that will be used to create it, if external returns the descriptor for the currently bound resource.

Implements CeresEngine::TRenderResource< GPUBuffer, GPUBufferDescriptor, RenderResourceType::Buffer >.

◆ isExternal()

bool CeresEngine::TransientBufferRenderResource::isExternal ( ) const
inlinefinalvirtual

Returns
true if the resource is external and must be provided externally.

Implements CeresEngine::RenderResource.

◆ isTransient()

bool CeresEngine::TransientBufferRenderResource::isTransient ( ) const
inlinefinalvirtual

Returns
true if the resource is transient and will be automatically created by the render graph implementation.

Implements CeresEngine::RenderResource.

◆ realize()

void CeresEngine::TransientBufferRenderResource::realize ( GPUDevice device)
finalvirtual

Realizes the resource.

If the resource is a transient resource, it will be created at this stage. Normally, this method is called before executing the first render tasks that uses it.

Parameters
deviceThe device to allocate the resource from.

Implements CeresEngine::RenderResource.

◆ unrealize()

void CeresEngine::TransientBufferRenderResource::unrealize ( GPUDevice device)
finalvirtual

Unrealizes the resource.

If the resource is a transient resource, it will be destroyed at this stage. Normally, this method is called after executing the last render tasks that uses it.

Parameters
deviceThe device to allocate the resource from.

Implements CeresEngine::RenderResource.

Member Data Documentation

◆ mBuffer

GPUBufferPtr CeresEngine::TransientBufferRenderResource::mBuffer = nullptr
private

◆ mDescriptor

GPUBufferDescriptor CeresEngine::TransientBufferRenderResource::mDescriptor
private

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