Skip to content

Commit

Permalink
Fix bugs in begin_dynamic_rendering()
Browse files Browse the repository at this point in the history
  • Loading branch information
MatejSakmary committed Oct 31, 2023
1 parent 38350f2 commit 8c3acbd
Showing 1 changed file with 17 additions and 10 deletions.
27 changes: 17 additions & 10 deletions src/avk.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8388,7 +8388,7 @@ namespace avk
}
}
#endif //_DEBUG
const bool detectExtent = aRenderAreaExtent.has_value();
const bool detectExtent = !aRenderAreaExtent.has_value();
std::vector<vk::RenderingAttachmentInfoKHR> colorAttachments = {};
std::optional<vk::RenderingAttachmentInfoKHR> depthAttachment = {};
std::optional<vk::RenderingAttachmentInfoKHR> stencilAttachment = {};
Expand Down Expand Up @@ -8480,14 +8480,6 @@ namespace avk
}
}
}
auto const renderingInfo = vk::RenderingInfoKHR{}
.setRenderArea(vk::Rect2D(aRenderAreaOffset, aRenderAreaExtent.value()))
.setLayerCount(aLayerCount)
.setViewMask(0) //TODO(msakmary) this is for multiview - do we want to support it?
.setColorAttachmentCount(static_cast<uint32_t>(colorAttachments.size()))
.setPColorAttachments(colorAttachments.data())
.setPDepthAttachment(depthAttachment.has_value() ? &depthAttachment.value() : nullptr)
.setPStencilAttachment(stencilAttachment.has_value() ? &stencilAttachment.value() : nullptr);

return action_type_command{
avk::sync::sync_hint {
Expand All @@ -8501,7 +8493,22 @@ namespace avk
}}
},
{},
[renderingInfo](avk::command_buffer_t& cb) {
[
colorAttachments,
depthAttachment,
stencilAttachment,
aLayerCount,
aRenderAreaOffset,
aRenderAreaExtent
](avk::command_buffer_t& cb) {
auto const renderingInfo = vk::RenderingInfoKHR{}
.setRenderArea(vk::Rect2D(aRenderAreaOffset, aRenderAreaExtent.value()))
.setLayerCount(aLayerCount)
.setViewMask(0) //TODO(msakmary) this is for multiview - do we want to support it?
.setColorAttachmentCount(static_cast<uint32_t>(colorAttachments.size()))
.setPColorAttachments(colorAttachments.data())
.setPDepthAttachment(depthAttachment.has_value() ? &depthAttachment.value() : nullptr)
.setPStencilAttachment(stencilAttachment.has_value() ? &stencilAttachment.value() : nullptr);
cb.handle().beginRenderingKHR(renderingInfo, cb.root_ptr()->dispatch_loader_ext());
}
};
Expand Down

0 comments on commit 8c3acbd

Please sign in to comment.