Skip to content
Snippets Groups Projects
Commit b4ea70f5 authored by Alexander Gauggel's avatar Alexander Gauggel
Browse files

[18]fix renderpass creation validation error if no depth pass is used

parent e1734709
Branches
Tags
4 merge requests!12Resolve "Swapchain Class",!7Resolve "Shader Program Class",!5Resolve "Pipeline State Object",!4Resolve "Renderpass Class"
......@@ -575,6 +575,7 @@ namespace vkcv
std::vector<vk::AttachmentReference> colorAttachmentReferences{};
// individual reference to depth attachment (of a subpass)
vk::AttachmentReference depthAttachmentReference{};
vk::AttachmentReference *pDepthAttachment = nullptr; //stays nullptr if no depth attachment used
for(uint32_t i = 0; i < pass.attachments.size(); i++)
{
......@@ -587,6 +588,7 @@ namespace vkcv
depthAttachmentReference.attachment = i;
depthAttachmentReference.layout = getVkLayoutFromAttachLayout(pass.attachments[i].layout_in_pass);
pDepthAttachment = &depthAttachmentReference;
}
else
{
......@@ -608,15 +610,15 @@ namespace vkcv
}
vk::SubpassDescription subpassDescription({},
vk::PipelineBindPoint::eGraphics,
0,
{},
static_cast<uint32_t>(colorAttachmentReferences.size()),
colorAttachmentReferences.data(),
{},
&depthAttachmentReference,
0,
{});
vk::PipelineBindPoint::eGraphics,
0,
{},
static_cast<uint32_t>(colorAttachmentReferences.size()),
colorAttachmentReferences.data(),
{},
pDepthAttachment,
0,
{});
vk::RenderPassCreateInfo passInfo({},
static_cast<uint32_t>(attachmentDescriptions.size()),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment