Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -686,15 +686,7 @@ void DynamicRenderingLocalRead::prepare_pipelines()
pipeline_rendering_create_info.stencilAttachmentFormat = depth_format;
}

VkRenderingInputAttachmentIndexInfo rendering_attachment_index_info{VK_STRUCTURE_TYPE_RENDERING_INPUT_ATTACHMENT_INDEX_INFO};
pipeline_rendering_create_info.pNext = &rendering_attachment_index_info;

std::array<uint32_t, 4> colorAttachments = {VK_ATTACHMENT_UNUSED, 0, 1, 2};
rendering_attachment_index_info.pNext = nullptr;
rendering_attachment_index_info.colorAttachmentCount = colorAttachments.size();
rendering_attachment_index_info.pColorAttachmentInputIndices = colorAttachments.data();
rendering_attachment_index_info.pDepthInputAttachmentIndex = nullptr;
rendering_attachment_index_info.pStencilInputAttachmentIndex = nullptr;
#else
pipeline_create_info.subpass = 0;
#endif
Expand Down Expand Up @@ -902,6 +894,9 @@ void DynamicRenderingLocalRead::build_command_buffers()
VkRect2D scissor = vkb::initializers::rect2D(width, height, 0, 0);
vkCmdSetScissor(cmd, 0, 1, &scissor);

// Set input attachment indices for the composition and transparent passes
vkCmdSetRenderingInputAttachmentIndicesKHR(cmd, &rendering_attachment_index_info);

/*
First draw
Fills the G-Buffer attachments containing image data for the deferred composition (color+depth, normals, albedo)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,12 @@ class DynamicRenderingLocalRead : public ApiVulkanSample
int32_t attachment_width{0};
int32_t attachment_height{0};

std::array<uint32_t, 4> color_attachment_input_indices{VK_ATTACHMENT_UNUSED, 0, 1, 2};
VkRenderingInputAttachmentIndexInfo rendering_attachment_index_info{VK_STRUCTURE_TYPE_RENDERING_INPUT_ATTACHMENT_INDEX_INFO_KHR,
nullptr,
static_cast<uint32_t>(color_attachment_input_indices.size()),
color_attachment_input_indices.data()};

void setup_framebuffer() override;
void setup_render_pass() override;
void prepare_gui() override;
Expand Down
Loading