KarmaEngine
Game Engine for practical learning and research purposes
Loading...
Searching...
No Matches
Karma::FVulkanAttachmentReference< TAttachmentReferenceType > Struct Template Reference

Template definition of FVulkanAttachmentReference with specializations done later. More...

#include <VulkanRenderPass.h>

Inheritance diagram for Karma::FVulkanAttachmentReference< TAttachmentReferenceType >:

Public Member Functions

 FVulkanAttachmentReference (const VkAttachmentReference &AttachmentReferenceIn, VkImageAspectFlags AspectMask)
 Constructor to copy from VkAttachmentReference.
void SetAttachment (const VkAttachmentReference &AttachmentReferenceIn, VkImageAspectFlags AspectMask)
 Disable method enforced here (checkNoEntry()).
void SetAttachment (const FVulkanAttachmentReference< TAttachmentReferenceType > &AttachmentReferenceIn, VkImageAspectFlags AspectMask)
 Template definition of SetAttachment (specialized out-of-class definition exists).
void SetDepthStencilAttachment (const VkAttachmentReference &AttachmentReferenceIn, const VkAttachmentReferenceStencilLayout *StencilReference, VkImageAspectFlags AspectMask, bool bSupportsParallelRendering)
 Disable method enforced here (checkNoEntry()).
void ZeroStruct ()
 Template definition for zero initialization. Specialized out-of-class definition exists.
void SetAttachment (const VkAttachmentReference &AttachmentReferenceIn, VkImageAspectFlags AspectMask)
 This is template specialization out-of-class definition triggered by m_ColorAttachmentReferences.Add(TAttachmentReferenceClass(RTLayout.GetColorAttachmentReferences()[ColorAttachment], 0));.
void SetDepthStencilAttachment (const VkAttachmentReference &AttachmentReferenceIn, const VkAttachmentReferenceStencilLayout *StencilReference, VkImageAspectFlags AspectMask, bool bSupportsParallelRendering)
 This is template specialization out-of-class definition triggered by m_DepthStencilAttachmentReference.SetDepthStencilAttachment.
void ZeroStruct ()
 Template specialization out-of-class definition for zero initialization.

Detailed Description

template<typename TAttachmentReferenceType>
struct Karma::FVulkanAttachmentReference< TAttachmentReferenceType >

Template definition of FVulkanAttachmentReference with specializations done later.

This is primary struct template for attachment references like color, depth, and input attachments

See VkRenderPass CreateVulkanRenderPass() { .. FVulkanRenderPassBuilder<.., FVulkanAttachmentReference<VkAttachmentReference>, ..> Creator(InDevice); Creator.Create(RTLayout); .. }

where FVulkanRenderPassBuilder::m_ColorAttachmentReferences and FVulkanRenderPassBuilder::m_DepthStencilAttachmentReference are called

m_ColorAttachmentReferences.Add(TAttachmentReferenceClass(RTLayout.GetColorAttachmentReferences()[ColorAttachment], 0)); m_DepthStencilAttachmentReference.SetDepthStencilAttachment

triggering class template specializations out-of-class definitions of SetAttachment and SetDepthStencilAttachment

Since
Karma 1.0.0

Constructor & Destructor Documentation

◆ FVulkanAttachmentReference()

template<typename TAttachmentReferenceType>
Karma::FVulkanAttachmentReference< TAttachmentReferenceType >::FVulkanAttachmentReference ( const VkAttachmentReference & AttachmentReferenceIn,
VkImageAspectFlags AspectMask )
inline

Constructor to copy from VkAttachmentReference.

Since
Karma 1.0.0

Member Function Documentation

◆ SetAttachment() [1/3]

template<typename TAttachmentReferenceType>
void Karma::FVulkanAttachmentReference< TAttachmentReferenceType >::SetAttachment ( const FVulkanAttachmentReference< TAttachmentReferenceType > & AttachmentReferenceIn,
VkImageAspectFlags AspectMask )
inline

Template definition of SetAttachment (specialized out-of-class definition exists).

Since
Karma 1.0.0

◆ SetAttachment() [2/3]

void Karma::FVulkanAttachmentReference< VkAttachmentReference >::SetAttachment ( const VkAttachmentReference & AttachmentReferenceIn,
VkImageAspectFlags AspectMask )
inline

This is template specialization out-of-class definition triggered by m_ColorAttachmentReferences.Add(TAttachmentReferenceClass(RTLayout.GetColorAttachmentReferences()[ColorAttachment], 0));.

Since
Karma 1.0.0

◆ SetAttachment() [3/3]

template<typename TAttachmentReferenceType>
void Karma::FVulkanAttachmentReference< TAttachmentReferenceType >::SetAttachment ( const VkAttachmentReference & AttachmentReferenceIn,
VkImageAspectFlags AspectMask )
inline

Disable method enforced here (checkNoEntry()).

This "poison" is to ensure correct use (or trap the misuse) at call site

Input attachments: mutation blocked (checkNoEntry()) FVulkanAttachmentReference<VkInputAttachmentReference> inputRef;
inputRef.SetAttachment(...); // Asserts/crashes - prevents bugs

✅ Color/depth attachments: mutation allowed FVulkanAttachmentReference<VkAttachmentReference> colorRef;
colorRef.SetAttachment(ref, mask); // Copies attachment/layout safely

This selectively enables mutation only for standard attachments. Or this discourages certain uses

Since
Karma 1.0.0

◆ SetDepthStencilAttachment() [1/2]

void Karma::FVulkanAttachmentReference< VkAttachmentReference >::SetDepthStencilAttachment ( const VkAttachmentReference & AttachmentReferenceIn,
const VkAttachmentReferenceStencilLayout * StencilReference,
VkImageAspectFlags AspectMask,
bool bSupportsParallelRendering )
inline

This is template specialization out-of-class definition triggered by m_DepthStencilAttachmentReference.SetDepthStencilAttachment.

Since
Karma 1.0.0

◆ SetDepthStencilAttachment() [2/2]

template<typename TAttachmentReferenceType>
void Karma::FVulkanAttachmentReference< TAttachmentReferenceType >::SetDepthStencilAttachment ( const VkAttachmentReference & AttachmentReferenceIn,
const VkAttachmentReferenceStencilLayout * StencilReference,
VkImageAspectFlags AspectMask,
bool bSupportsParallelRendering )
inline

Disable method enforced here (checkNoEntry()).

This is to prevent misuse for non-depth-stencil attachments

Note
Specialized out-of-class definition exists for VkAttachmentReference
Since
Karma 1.0.0

◆ ZeroStruct() [1/2]

void Karma::FVulkanAttachmentReference< VkAttachmentReference >::ZeroStruct ( )
inline

Template specialization out-of-class definition for zero initialization.

This function is triggered by FVulkanAttachmentReference constructor

Since
Karma 1.0.0

◆ ZeroStruct() [2/2]

template<typename TAttachmentReferenceType>
void Karma::FVulkanAttachmentReference< TAttachmentReferenceType >::ZeroStruct ( )
inline

Template definition for zero initialization. Specialized out-of-class definition exists.

Since
Karma 1.0.0

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