mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-04 17:10:47 +00:00
Fix some cases where buffer memory requirements were assumed to be tight
* It's possible for a buffer to require more memory than its size (e.g. up to some alignment)
This commit is contained in:
@@ -506,13 +506,6 @@ bool WrappedVulkan::Prepare_InitialState(WrappedVkRes *res)
|
||||
if(readbackmem.mem == VK_NULL_HANDLE)
|
||||
return false;
|
||||
|
||||
// dummy request to keep the validation layers happy - the buffers are identical so the
|
||||
// requirements must be identical
|
||||
{
|
||||
VkMemoryRequirements mrq = {0};
|
||||
ObjDisp(d)->GetBufferMemoryRequirements(Unwrap(d), Unwrap(dstBuf), &mrq);
|
||||
}
|
||||
|
||||
CheckVkResult(vkr);
|
||||
vkr = ObjDisp(d)->BindBufferMemory(Unwrap(d), Unwrap(dstBuf), Unwrap(readbackmem.mem),
|
||||
readbackmem.offs);
|
||||
|
||||
@@ -693,7 +693,7 @@ void VulkanReplay::GetOutputWindowData(uint64_t id, bytebuf &retData)
|
||||
vt->GetBufferMemoryRequirements(Unwrap(device), readbackBuf, &mrq);
|
||||
|
||||
VkMemoryAllocateInfo allocInfo = {
|
||||
VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO, NULL, bufInfo.size,
|
||||
VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO, NULL, mrq.size,
|
||||
m_pDriver->GetReadbackMemoryIndex(mrq.memoryTypeBits),
|
||||
};
|
||||
|
||||
|
||||
@@ -3861,7 +3861,7 @@ void VulkanReplay::GetTextureData(ResourceId tex, const Subresource &sub,
|
||||
vt->GetBufferMemoryRequirements(Unwrap(dev), readbackBuf, &mrq);
|
||||
|
||||
VkMemoryAllocateInfo allocInfo = {
|
||||
VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO, NULL, dataSize,
|
||||
VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO, NULL, mrq.size,
|
||||
m_pDriver->GetReadbackMemoryIndex(mrq.memoryTypeBits),
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user