Skip to content

Commit 10faa5d

Browse files
committed
Load instead of Clear in ImGui pass
1 parent 33c6149 commit 10faa5d

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

guide/src/dear_imgui/imgui_integration.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ We use a separate render pass for Dear ImGui, again for isolation, and to enable
4646
4747
```cpp
4848
m_imgui->end_frame();
49+
// we don't want to clear the image again, instead load it intact after the
50+
// previous pass.
51+
color_attachment.setLoadOp(vk::AttachmentLoadOp::eLoad);
4952
rendering_info.setColorAttachments(color_attachment)
5053
.setPDepthAttachment(nullptr);
5154
command_buffer.beginRendering(rendering_info);

src/app.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,9 @@ void App::render(vk::CommandBuffer const command_buffer) {
244244
command_buffer.endRendering();
245245

246246
m_imgui->end_frame();
247+
// we don't want to clear the image again, instead load it intact after the
248+
// previous pass.
249+
color_attachment.setLoadOp(vk::AttachmentLoadOp::eLoad);
247250
rendering_info.setColorAttachments(color_attachment)
248251
.setPDepthAttachment(nullptr);
249252
command_buffer.beginRendering(rendering_info);

0 commit comments

Comments
 (0)