Skip to content

Commit

Permalink
Fix generated RP barriers to specify no queue transfer explicitly
Browse files Browse the repository at this point in the history
* For concurrent images this is required, and for shared images it's still
  valid.
  • Loading branch information
baldurk committed Dec 2, 2021
1 parent d6ef7d5 commit f8476b5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
3 changes: 2 additions & 1 deletion renderdoc/driver/vulkan/vk_image_states.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1039,7 +1039,8 @@ void ImageState::RecordBarrier(VkImageMemoryBarrier barrier, uint32_t queueFamil
if(!(barrier.srcQueueFamilyIndex == VK_QUEUE_FAMILY_IGNORED &&
barrier.dstQueueFamilyIndex == VK_QUEUE_FAMILY_IGNORED))
{
RDCWARN("Barrier contains invalid queue families for VK_SHARING_MODE_CONCURRENT");
RDCWARN("Barrier contains invalid queue families for VK_SHARING_MODE_CONCURRENT (%u %u)",
barrier.srcQueueFamilyIndex, barrier.dstQueueFamilyIndex);
}
barrier.srcQueueFamilyIndex = barrier.dstQueueFamilyIndex = queueFamilyIndex;
}
Expand Down
10 changes: 8 additions & 2 deletions renderdoc/driver/vulkan/vk_resources.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3308,6 +3308,8 @@ RenderPassInfo::RenderPassInfo(const VkRenderPassCreateInfo &ci)
imageAttachments[i].barrier.sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER;
imageAttachments[i].barrier.oldLayout = ci.pAttachments[i].initialLayout;
imageAttachments[i].barrier.newLayout = ci.pAttachments[i].finalLayout;
imageAttachments[i].barrier.srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED;
imageAttachments[i].barrier.dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED;
imageAttachments[i].format = ci.pAttachments[i].format;
imageAttachments[i].samples = ci.pAttachments[i].samples;
}
Expand Down Expand Up @@ -3442,8 +3444,10 @@ RenderPassInfo::RenderPassInfo(const VkRenderPassCreateInfo2 &ci)
imageAttachments[a].barrier.sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER;
imageAttachments[a].barrier.oldLayout = ci.pAttachments[i].initialLayout;
imageAttachments[a].barrier.newLayout = ci.pAttachments[i].finalLayout;
imageAttachments[i].format = ci.pAttachments[i].format;
imageAttachments[i].samples = ci.pAttachments[i].samples;
imageAttachments[a].barrier.srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED;
imageAttachments[a].barrier.dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED;
imageAttachments[a].format = ci.pAttachments[i].format;
imageAttachments[a].samples = ci.pAttachments[i].samples;

indexRemapTable[i] = a;

Expand All @@ -3462,6 +3466,8 @@ RenderPassInfo::RenderPassInfo(const VkRenderPassCreateInfo2 &ci)
imageAttachments[a].barrier.sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER;
imageAttachments[a].barrier.oldLayout = separateStencil->stencilInitialLayout;
imageAttachments[a].barrier.newLayout = separateStencil->stencilFinalLayout;
imageAttachments[a].barrier.srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED;
imageAttachments[a].barrier.dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED;
imageAttachments[a].barrier.subresourceRange.aspectMask = VK_IMAGE_ASPECT_STENCIL_BIT;
}
}
Expand Down

0 comments on commit f8476b5

Please sign in to comment.