mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-11-03 04:30:38 +00:00
VkCommandBuffer missed capture references to renderPass & framebuffer.
Added a warning in SerialiseObject that may help to detect other similar cases of this problem.
This commit is contained in:
1 parent
2978755d54
commit
80354228c3
2 files changed
+28
-10
No files matched your search
@@ -2825,16 +2825,26 @@ string ToStrHelper<false, VkPresentModeKHR>::Get(const VkPresentModeKHR &el)
|
||||
}
|
||||
|
||||
// we know the object will be a non-dispatchable object type
|
||||
#define SerialiseObject(type, name, obj) \
|
||||
{ \
|
||||
VulkanResourceManager *rm = (VulkanResourceManager *)GetUserData(); \
|
||||
ResourceId id; \
|
||||
if(m_Mode >= WRITING) \
|
||||
id = GetResID(obj); \
|
||||
Serialise(name, id); \
|
||||
if(m_Mode < WRITING) \
|
||||
obj = (id == ResourceId() || !rm->HasLiveResource(id)) ? VK_NULL_HANDLE \
|
||||
: Unwrap(rm->GetLiveHandle<type>(id)); \
|
||||
#define SerialiseObject(type, name, obj) \
|
||||
{ \
|
||||
VulkanResourceManager *rm = (VulkanResourceManager *)GetUserData(); \
|
||||
ResourceId id; \
|
||||
if(m_Mode >= WRITING) \
|
||||
id = GetResID(obj); \
|
||||
Serialise(name, id); \
|
||||
if(m_Mode < WRITING) \
|
||||
{ \
|
||||
obj = VK_NULL_HANDLE; \
|
||||
if(id != ResourceId()) \
|
||||
{ \
|
||||
if(rm->HasLiveResource(id)) \
|
||||
obj = Unwrap(rm->GetLiveHandle<type>(id)); \
|
||||
else \
|
||||
/* It can be OK for a resource to have no live equivalent if the \
|
||||
capture decided its not needed, which some APIs do fairly often. */ \
|
||||
RDCWARN("Capture may be missing reference to " #type " resource."); \
|
||||
} \
|
||||
} \
|
||||
}
|
||||
|
||||
static void SerialiseNext(Serialiser *ser, VkStructureType &sType, const void *&pNext)
|
||||
|
||||
@@ -650,6 +650,14 @@ VkResult WrappedVulkan::vkBeginCommandBuffer(VkCommandBuffer commandBuffer,
|
||||
|
||||
record->AddChunk(scope.Get());
|
||||
}
|
||||
|
||||
if(pBeginInfo->pInheritanceInfo)
|
||||
{
|
||||
record->MarkResourceFrameReferenced(GetResID(pBeginInfo->pInheritanceInfo->renderPass),
|
||||
eFrameRef_Read);
|
||||
record->MarkResourceFrameReferenced(GetResID(pBeginInfo->pInheritanceInfo->framebuffer),
|
||||
eFrameRef_Read);
|
||||
}
|
||||
}
|
||||
|
||||
VkCommandBufferInheritanceInfo unwrappedInfo;
|
||||
|
||||
Reference in new issue
Block a user