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

#include <CeresEngine/RenderAPI/Vulkan/VKRenderPass.hpp>

Inheritance diagram for CeresEngine::VKRenderPass:
CeresEngine::GPURenderPass CeresEngine::VKDeviceObject< VKRenderPass, GPURenderPass > CeresEngine::TDeviceObject< GPURenderPassDescriptor > CeresEngine::VKObject< ChildTypeName, ParentType > CeresEngine::VKDeviceObjectBase CeresEngine::GPUDeviceObject CeresEngine::VKObjectBase CeresEngine::GPUObject

Public Types

using Allocator = VKObjectAllocator
 An allocator type used to allocate new VKRenderPass instances from a memory pool.
 
- Public Types inherited from CeresEngine::TDeviceObject< GPURenderPassDescriptor >
using Descriptor = GPURenderPassDescriptor
 An type-alias to the descriptor struct type.
 

Public Member Functions

 VKRenderPass (VKDevice &device, const GPURenderPassDescriptor &descriptor)
 
 ~VKRenderPass () final
 
void destroy () noexcept final
 
 operator VkRenderPass () const noexcept
 The render pass object.
 
void begin (GPUCommandBuffer &commandBuffer, GPURenderTarget &renderTarget, const Color &clearColor=Color(0.0, 0.0, 0.0, 0.0)) final
 
void end (GPUCommandBuffer &commandBuffer, GPURenderTarget &renderTarget) final
 
UInt32 getNumberOfColorAttachments () const
 
void prepareRenderTarget (VkCommandBuffer commandBuffer, const VKRenderTarget &renderTarget)
 
void finishRenderTarget (VkCommandBuffer commandBuffer, const VKRenderTarget &renderTarget)
 
- Public Member Functions inherited from CeresEngine::GPURenderPass
 GPURenderPass (const GPURenderPass &)=delete
 Deleted copy constructor.
 
GPURenderPassoperator= (const GPURenderPass &)=delete
 
 GPURenderPass (GPURenderPass &&)=delete
 Deleted move constructor.
 
GPURenderPassoperator= (GPURenderPass &&)=delete
 
template<typename Func , typename... Args>
decltype(autowith (GPUCommandBuffer &commandBuffer, GPURenderTarget &renderTarget, Func &&block, Args &&... args)
 Prepares the render pass for execution.
 
 TDeviceObject (GPUDevice &device, const Descriptor &descriptor)
 Inherited constructors.
 
 TDeviceObject (const TDeviceObject &)=delete
 Inherited constructors.
 
 TDeviceObject (TDeviceObject &&)=delete
 Inherited constructors.
 
- Public Member Functions inherited from CeresEngine::TDeviceObject< GPURenderPassDescriptor >
 TDeviceObject (GPUDevice &device, const Descriptor &descriptor)
 Initializes a new RenderAPI device object instance.
 
 TDeviceObject (const TDeviceObject &)=delete
 
 TDeviceObject (TDeviceObject &&)=delete
 
 ~TDeviceObject () override=default
 
TDeviceObjectoperator= (const TDeviceObject &)=delete
 
TDeviceObjectoperator= (TDeviceObject &&)=delete
 
- Public Member Functions inherited from CeresEngine::GPUDeviceObject
 GPUDeviceObject (GPUDevice &device)
 
 ~GPUDeviceObject () override
 
- Public Member Functions inherited from CeresEngine::GPUObject
 GPUObject ()=default
 
virtual ~GPUObject ()=default
 
 GPUObject (const GPUObject &)=delete
 
GPUObjectoperator= (const GPUObject &)=delete
 
 GPUObject (GPUObject &&)=delete
 
GPUObjectoperator= (GPUObject &&)=delete
 
void retain () noexcept
 Retains the object by increment it's reference count by one.
 
bool release () noexcept
 Releases the object by decrementing it's reference count by one.
 
- Public Member Functions inherited from CeresEngine::VKDeviceObjectBase
 VKDeviceObjectBase (VKDevice &device) noexcept
 Creates a new VKDeviceObjectBase from the given device.
 
 ~VKDeviceObjectBase () noexcept
 Destroys the VKDeviceObjectBase.
 

Static Public Member Functions

static AllocatorgetAllocator () noexcept
 Returns the allocator for VKRenderPass.
 
static voidoperator new (size_t size) noexcept
 Allocates memory for a new instance of VKRenderPass.
 
static void operator delete (void *p, std::size_t size) noexcept
 Deletes memory for an instance of VKRenderPass.
 
- Static Public Member Functions inherited from CeresEngine::VKObject< ChildTypeName, ParentType >
static RC< ChildTypeNamecast (const RC< ParentType > &ptr)
 Casts a RC containing a ParentType pointer to a pointer to a pointer to a ChildTypeName.
 
static ChildTypeNamecast (ParentType &object)
 Casts a object of type ParentType to a object of type ChildTypeName.
 
static const ChildTypeNamecast (const ParentType &object)
 Casts a object of type ParentType to a object of type ChildTypeName.
 
static ChildTypeNamecast (ParentType *object)
 Casts a object of type ParentType to a object of type ChildTypeName.
 
static const ChildTypeNamecast (const ParentType *object)
 Casts a object of type ParentType to a object of type ChildTypeName.
 
- Static Public Member Functions inherited from CeresEngine::VKObjectBase
static voidoperator new (size_t size) noexcept
 
static void operator delete (void *p, std::size_t sz) noexcept
 

Private Attributes

const GPURenderPassDescriptor descriptorVK
 A structure that describes the render pass and it's properties.
 
VkRenderPass mRenderPass = VK_NULL_HANDLE
 The render pass object.
 
UInt32 mNumberOfColorAttachments = 0
 The number of color attachments in the render pass.
 
Vector< GPUAttachmentFormatDescriptor, VKAllocatormColorAttachments {gVKAllocator()}
 Specifies the color attachments used within the render pass.
 
GPUAttachmentFormatDescriptor mDepthAttachment
 Specifies the depth attachment used within the render pass.
 
GPUAttachmentFormatDescriptor mStencilAttachment
 Specifies the depth attachment used within the render pass.
 

Additional Inherited Members

- Public Attributes inherited from CeresEngine::TDeviceObject< GPURenderPassDescriptor >
const Descriptordescriptor
 A structure that describes the object and it's properties.
 
- Public Attributes inherited from CeresEngine::GPUDeviceObject
GPUDevicedevice
 The owning device this object was created from.
 
- Public Attributes inherited from CeresEngine::VKDeviceObjectBase
VKDevicedeviceVK
 The owning VKDevice instance.
 
- Protected Member Functions inherited from CeresEngine::VKDeviceObject< VKRenderPass, GPURenderPass >
 VKDeviceObject (VKDevice &device) noexcept
 Creates a new VKDeviceObject from the given device.
 

Member Typedef Documentation

◆ Allocator

An allocator type used to allocate new VKRenderPass instances from a memory pool.

Constructor & Destructor Documentation

◆ VKRenderPass()

CeresEngine::VKRenderPass::VKRenderPass ( VKDevice device,
const GPURenderPassDescriptor descriptor 
)

◆ ~VKRenderPass()

CeresEngine::VKRenderPass::~VKRenderPass ( )
final

Member Function Documentation

◆ begin()

void CeresEngine::VKRenderPass::begin ( GPUCommandBuffer commandBuffer,
GPURenderTarget renderTarget,
const Color clearColor = Color(0.0, 0.0, 0.0, 0.0) 
)
finalvirtual

◆ destroy()

void CeresEngine::VKRenderPass::destroy ( )
finalvirtualnoexcept

Reimplemented from CeresEngine::GPUObject.

◆ end()

void CeresEngine::VKRenderPass::end ( GPUCommandBuffer commandBuffer,
GPURenderTarget renderTarget 
)
finalvirtual

◆ finishRenderTarget()

void CeresEngine::VKRenderPass::finishRenderTarget ( VkCommandBuffer  commandBuffer,
const VKRenderTarget renderTarget 
)

◆ getAllocator()

static Allocator & CeresEngine::VKRenderPass::getAllocator ( )
staticnoexcept

Returns the allocator for VKRenderPass.

◆ getNumberOfColorAttachments()

UInt32 CeresEngine::VKRenderPass::getNumberOfColorAttachments ( ) const
inline
Returns
The number of color attachments in the render pass

◆ operator delete()

static void CeresEngine::VKRenderPass::operator delete ( void p,
std::size_t  size 
)
staticnoexcept

Deletes memory for an instance of VKRenderPass.

◆ operator new()

static void * CeresEngine::VKRenderPass::operator new ( size_t  size)
staticnoexcept

Allocates memory for a new instance of VKRenderPass.

◆ operator VkRenderPass()

CeresEngine::VKRenderPass::operator VkRenderPass ( ) const
inlinenoexcept

The render pass object.

◆ prepareRenderTarget()

void CeresEngine::VKRenderPass::prepareRenderTarget ( VkCommandBuffer  commandBuffer,
const VKRenderTarget renderTarget 
)

Member Data Documentation

◆ descriptorVK

const GPURenderPassDescriptor CeresEngine::VKRenderPass::descriptorVK
private

A structure that describes the render pass and it's properties.

◆ mColorAttachments

Vector<GPUAttachmentFormatDescriptor, VKAllocator> CeresEngine::VKRenderPass::mColorAttachments {gVKAllocator()}
private

Specifies the color attachments used within the render pass.

A render context usually uses an BGRA format instead of an RGBA format.

◆ mDepthAttachment

GPUAttachmentFormatDescriptor CeresEngine::VKRenderPass::mDepthAttachment
private

Specifies the depth attachment used within the render pass.

Remarks
The depth attachment and stencil attachment usually share the same format (e.g. Format::D24UNormS8UInt). They are separated here to specify different load and store operations.

◆ mNumberOfColorAttachments

UInt32 CeresEngine::VKRenderPass::mNumberOfColorAttachments = 0
private

The number of color attachments in the render pass.

◆ mRenderPass

VkRenderPass CeresEngine::VKRenderPass::mRenderPass = VK_NULL_HANDLE
private

The render pass object.

◆ mStencilAttachment

GPUAttachmentFormatDescriptor CeresEngine::VKRenderPass::mStencilAttachment
private

Specifies the depth attachment used within the render pass.

Remarks
The depth attachment and stencil attachment usually share the same format (e.g. Format::D24UNormS8UInt). They are separated here to specify different load and store operations.

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