Skip to content

Commit

Permalink
Added View mask to begin dynamic rendering parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
MatejSakmary committed Mar 28, 2024
1 parent e58f0ad commit f34f844
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion include/avk/commands.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -514,7 +514,7 @@ namespace avk
* @param aRenderAreaExtent Render area extent (default is full extent inferred from images passed in aImageViews)
* @param aLayerCount number of layers that will be used for rendering (default is 1)
*/
extern action_type_command begin_dynamic_rendering(std::vector<attachment> aAttachments, std::vector<image_view> aImageViews, vk::Offset2D aRenderAreaOffset = {0, 0}, std::optional<vk::Extent2D> aRenderAreaExtent = {}, uint32_t aLayerCount = 1);
extern action_type_command begin_dynamic_rendering(std::vector<attachment> aAttachments, std::vector<image_view> aImageViews, vk::Offset2D aRenderAreaOffset = {0, 0}, std::optional<vk::Extent2D> aRenderAreaExtent = {}, uint32_t aLayerCount = 1, uint32_t aViewMask = 0);

/** Ends dynamic rendering scope
*/
Expand Down
6 changes: 4 additions & 2 deletions src/avk.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8383,7 +8383,8 @@ namespace avk
std::vector<image_view> aImageViews,
vk::Offset2D aRenderAreaOffset,
std::optional<vk::Extent2D> aRenderAreaExtent,
uint32_t aLayerCount)
uint32_t aLayerCount,
uint32_t aViewMask)
{
#ifdef _DEBUG
if (aAttachments.size() != aImageViews.size()) {
Expand Down Expand Up @@ -8526,13 +8527,14 @@ namespace avk
depthAttachment,
stencilAttachment,
aLayerCount,
aViewMask,
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?
.setViewMask(aViewMask)
.setColorAttachmentCount(static_cast<uint32_t>(colorAttachments.size()))
.setPColorAttachments(colorAttachments.data())
.setPDepthAttachment(depthAttachment.has_value() ? &depthAttachment.value() : nullptr)
Expand Down

0 comments on commit f34f844

Please sign in to comment.