SpiecsEngine
 
Loading...
Searching...
No Matches

◆ AddAttachment() [1/2]

uint32_t Spices::RendererPass::AddAttachment ( const std::string & attachmentName,
const VkAttachmentDescription & description,
const VkClearValue & clearValue,
uint32_t layers,
const VkImageView & view )

Add a attachment to this renderer pass.

Parameters
[in]attachmentNameThe name of attachment.
[in]descriptionThe description of attachment.
[in]clearValueThe clear value of attachment.
[in]layersThe layers of attachment.
[in]viewThe view of attachment.
Returns
Return the index of attachment.

Definition at line 85 of file RendererPass.cpp.

92 {
94
95 if (m_AttachmentDescriptions.has_key(attachmentName))
96 {
97 uint32_t index = 0;
98 m_AttachmentDescriptions.for_each([&](const auto& K, const auto& V) {
99 if (K == attachmentName)
100 {
101 return true;
102 }
103 else
104 {
105 index++;
106 return false;
107 }
108 });
109 return index;
110 }
111
112 if (attachmentName == "SwapChainImage")
113 {
115 }
116
117 m_MaxLayers = glm::max(m_MaxLayers, layers);
118 m_ClearValues.push_back(clearValue);
119 m_AttachmentDescriptions.push_back(attachmentName, description);
120 m_ImageViews.push_back(view);
121
122 return static_cast<uint32_t>(m_AttachmentDescriptions.size() - 1);
123 }
#define SPICES_PROFILE_ZONE
uint32_t m_MaxLayers
Max Attachment layer.
scl::linked_unordered_map< std::string, VkAttachmentDescription > m_AttachmentDescriptions
VkAttachmentDescription this RenderPass handled.
std::vector< VkImageView > m_ImageViews
VkImageView this RenderPass handled.
std::vector< VkClearValue > m_ClearValues
VkClearValue this RenderPass handled.
bool m_IsSwapChainImageInUse
True if the RendererPass is using swapchain image.
void push_back(const K &key, const V &value)
Add a element to this container.
bool has_key(const K &key)
Determine whether the key is in the container.
size_t size()
The container's element size.
void for_each(F &fn)
Iter the container in order.

References m_IsSwapChainImageInUse.