Skip to content

Commit ee69196

Browse files
authored
Add missing call to vkCmdSetRenderingInputAttachmentIndicesKHR in sample dynamic_rendering_local_read (#1424)
1 parent 449b8ff commit ee69196

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

samples/extensions/dynamic_rendering_local_read/dynamic_rendering_local_read.cpp

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -686,15 +686,7 @@ void DynamicRenderingLocalRead::prepare_pipelines()
686686
pipeline_rendering_create_info.stencilAttachmentFormat = depth_format;
687687
}
688688

689-
VkRenderingInputAttachmentIndexInfo rendering_attachment_index_info{VK_STRUCTURE_TYPE_RENDERING_INPUT_ATTACHMENT_INDEX_INFO};
690689
pipeline_rendering_create_info.pNext = &rendering_attachment_index_info;
691-
692-
std::array<uint32_t, 4> colorAttachments = {VK_ATTACHMENT_UNUSED, 0, 1, 2};
693-
rendering_attachment_index_info.pNext = nullptr;
694-
rendering_attachment_index_info.colorAttachmentCount = colorAttachments.size();
695-
rendering_attachment_index_info.pColorAttachmentInputIndices = colorAttachments.data();
696-
rendering_attachment_index_info.pDepthInputAttachmentIndex = nullptr;
697-
rendering_attachment_index_info.pStencilInputAttachmentIndex = nullptr;
698690
#else
699691
pipeline_create_info.subpass = 0;
700692
#endif
@@ -902,6 +894,9 @@ void DynamicRenderingLocalRead::build_command_buffers()
902894
VkRect2D scissor = vkb::initializers::rect2D(width, height, 0, 0);
903895
vkCmdSetScissor(cmd, 0, 1, &scissor);
904896

897+
// Set input attachment indices for the composition and transparent passes
898+
vkCmdSetRenderingInputAttachmentIndicesKHR(cmd, &rendering_attachment_index_info);
899+
905900
/*
906901
First draw
907902
Fills the G-Buffer attachments containing image data for the deferred composition (color+depth, normals, albedo)

samples/extensions/dynamic_rendering_local_read/dynamic_rendering_local_read.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,12 @@ class DynamicRenderingLocalRead : public ApiVulkanSample
9898
int32_t attachment_width{0};
9999
int32_t attachment_height{0};
100100

101+
std::array<uint32_t, 4> color_attachment_input_indices{VK_ATTACHMENT_UNUSED, 0, 1, 2};
102+
VkRenderingInputAttachmentIndexInfo rendering_attachment_index_info{VK_STRUCTURE_TYPE_RENDERING_INPUT_ATTACHMENT_INDEX_INFO_KHR,
103+
nullptr,
104+
static_cast<uint32_t>(color_attachment_input_indices.size()),
105+
color_attachment_input_indices.data()};
106+
101107
void setup_framebuffer() override;
102108
void setup_render_pass() override;
103109
void prepare_gui() override;

0 commit comments

Comments
 (0)