If an image is in an external or foreign queue we can't fetch contents

* There's nothing we can do - we can't safely transition from/to the external
  queue so we have to treat the initial contents as missing/undefined.
This commit is contained in:
baldurk
2019-01-03 17:56:53 +00:00
parent e13f0e882a
commit e3b50d2377
3 changed files with 12 additions and 2 deletions
+2 -2
View File
@@ -1180,8 +1180,8 @@ bool WrappedVulkan::Serialise_BeginCaptureFrame(SerialiserType &ser)
barrier.sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER;
barrier.oldLayout = VK_IMAGE_LAYOUT_UNDEFINED;
barrier.newLayout = VK_IMAGE_LAYOUT_GENERAL;
barrier.srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED;
barrier.dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED;
barrier.srcQueueFamilyIndex = m_QueueFamilyIdx;
barrier.dstQueueFamilyIndex = m_QueueFamilyIdx;
barrier.image = Unwrap(img);
barrier.subresourceRange = stit->subresourceRange;
+8
View File
@@ -117,6 +117,14 @@ bool WrappedVulkan::Prepare_InitialState(WrappedVkRes *res)
layout = &m_ImageLayouts[im->id];
}
if(layout->queueFamilyIndex == VK_QUEUE_FAMILY_EXTERNAL ||
layout->queueFamilyIndex == VK_QUEUE_FAMILY_FOREIGN_EXT)
{
RDCWARN("Image %s in external/foreign queue family, initial contents impossible to fetch.",
ToStr(im->id).c_str());
return true;
}
if(layout->queueFamilyIndex != m_QueueFamilyIdx)
{
// get a command buffer for giving up ownership before the copy and acquiring it afterwards.
+2
View File
@@ -279,6 +279,8 @@ void VulkanResourceManager::SerialiseImageStates(SerialiserType &ser,
t.srcQueueFamilyIndex = ImageState.queueFamilyIndex;
t.dstQueueFamilyIndex = ImageState.queueFamilyIndex;
m_Core->RemapQueueFamilyIndices(t.srcQueueFamilyIndex, t.dstQueueFamilyIndex);
if(t.dstQueueFamilyIndex == VK_QUEUE_FAMILY_IGNORED)
t.dstQueueFamilyIndex = t.srcQueueFamilyIndex = m_Core->GetQueueFamilyIndex();
state.dstQueueFamilyIndex = t.dstQueueFamilyIndex;
t.image = Unwrap(GetCurrentHandle<VkImage>(liveid));
t.oldLayout = VK_IMAGE_LAYOUT_UNDEFINED;