mirror of
https://github.com/skyline-emu/skyline.git
synced 2024-11-05 11:45:10 +01:00
Use resource size rather than allocation size for staging buffer size
As per VMA docs: 'Allocation size returned in this variable may be greater than the size requested for the resource e.g. as VkBufferCreateInfo::size. Whole size of the allocation is accessible for operations on memory e.g. using a pointer after mapping with vmaMapMemory(), but operations on the resource e.g. using vkCmdCopyBuffer must be limited to the size of the resource.'
This commit is contained in:
parent
d2acec24f5
commit
601d67e369
@ -92,7 +92,7 @@ namespace skyline::gpu::memory {
|
||||
VmaAllocationInfo allocationInfo;
|
||||
ThrowOnFail(vmaCreateBuffer(vmaAllocator, &static_cast<const VkBufferCreateInfo &>(bufferCreateInfo), &allocationCreateInfo, &buffer, &allocation, &allocationInfo));
|
||||
|
||||
return std::make_shared<memory::StagingBuffer>(reinterpret_cast<u8 *>(allocationInfo.pMappedData), allocationInfo.size, vmaAllocator, buffer, allocation);
|
||||
return std::make_shared<memory::StagingBuffer>(reinterpret_cast<u8 *>(allocationInfo.pMappedData), size, vmaAllocator, buffer, allocation);
|
||||
}
|
||||
|
||||
Buffer MemoryManager::AllocateBuffer(vk::DeviceSize size) {
|
||||
|
Loading…
Reference in New Issue
Block a user