mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-04 17:10:47 +00:00
Don't rely on creation info during capture, it isn't populated
* On capture when we need the buffer size we can get it from the resource record.
This commit is contained in:
@@ -517,26 +517,10 @@ VkResult WrappedVulkan::vkAllocateMemory(VkDevice device, const VkMemoryAllocate
|
||||
{
|
||||
// either set the buffer that's dedicated, or if this is dedicated image memory set NULL
|
||||
wholeMemBuf = dedicated->buffer;
|
||||
|
||||
VkDeviceSize bufSize = m_CreationInfo.m_Buffer[GetResID(dedicated->buffer)].size;
|
||||
if(memSize > bufSize)
|
||||
{
|
||||
RDCDEBUG("Truncating memory size %llu to dedicated buffer size %llu for %s", memSize,
|
||||
bufSize, ToStr(id).c_str());
|
||||
memSize = bufSize;
|
||||
}
|
||||
}
|
||||
else if(dedicatedNV)
|
||||
{
|
||||
wholeMemBuf = dedicatedNV->buffer;
|
||||
|
||||
VkDeviceSize bufSize = m_CreationInfo.m_Buffer[GetResID(dedicatedNV->buffer)].size;
|
||||
if(memSize > bufSize)
|
||||
{
|
||||
RDCDEBUG("Truncating memory size %llu to dedicated buffer size %llu for %s", memSize,
|
||||
bufSize, ToStr(id).c_str());
|
||||
memSize = bufSize;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -556,6 +540,19 @@ VkResult WrappedVulkan::vkAllocateMemory(VkDevice device, const VkMemoryAllocate
|
||||
ObjDisp(device)->BindBufferMemory(Unwrap(device), Unwrap(wholeMemBuf), Unwrap(*pMemory), 0);
|
||||
}
|
||||
|
||||
if((dedicated != NULL || dedicatedNV != NULL) && wholeMemBuf != VK_NULL_HANDLE)
|
||||
{
|
||||
VkDeviceSize bufSize = IsCaptureMode(m_State)
|
||||
? GetRecord(wholeMemBuf)->memSize
|
||||
: m_CreationInfo.m_Buffer[GetResID(wholeMemBuf)].size;
|
||||
if(memSize > bufSize)
|
||||
{
|
||||
RDCDEBUG("Truncating memory size %llu to dedicated buffer size %llu for %s", memSize,
|
||||
bufSize, ToStr(id).c_str());
|
||||
memSize = bufSize;
|
||||
}
|
||||
}
|
||||
|
||||
if(IsCaptureMode(m_State))
|
||||
{
|
||||
Chunk *chunk = NULL;
|
||||
|
||||
Reference in New Issue
Block a user