You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
according to the spec.
"The memoryTypeBits member is identical for all VkBuffer objects created with the same value for the flags and usage members in the VkBufferCreateInfo structure and the handleTypes member of the VkExternalMemoryBufferCreateInfo structure passed to vkCreateBuffer. Further, if usage1 and usage2 of type VkBufferUsageFlags are such that the bits set in usage2 are a subset of the bits set in usage1, and they have the same flags and VkExternalMemoryBufferCreateInfo::handleTypes, then the bits set in memoryTypeBits returned for usage1 must be a subset of the bits set in memoryTypeBits returned for usage2, for all values of flags."
it looks the returned memoryTypeBit only affected by flags and usage and external buffer type. can we create a cache to avoid everytime create a dummy buffer.
The text was updated successfully, but these errors were encountered:
The problem doesn't occur if you use Vulkan 1.3 or VK_KHR_maintenance4 extension (and inform VMA library about it during library initialization), because then function vmaFindMemoryTypeIndexForBufferInfo can use a new Vulkan function vkGetDeviceBufferMemoryRequirements. Can you enable Vulkan 1.3 or this extension in your project?
Implementing a cache for recently used buffer/image creation parameters is a good idea that may be implemented in the future.
we saw everytime call vmaFindMemoryTypeIndexForBufferInfo, it take quite a few cpu cycles to do the following
"// Must create a dummy buffer to query :(
VkBuffer hBuffer = VK_NULL_HANDLE;
res = funcs->vkCreateBuffer(
hDev, pBufferCreateInfo, allocator->GetAllocationCallbacks(), &hBuffer);
if(res == VK_SUCCESS)
{
VkMemoryRequirements memReq = {};
funcs->vkGetBufferMemoryRequirements(hDev, hBuffer, &memReq);
according to the spec.
"The memoryTypeBits member is identical for all VkBuffer objects created with the same value for the flags and usage members in the VkBufferCreateInfo structure and the handleTypes member of the VkExternalMemoryBufferCreateInfo structure passed to vkCreateBuffer. Further, if usage1 and usage2 of type VkBufferUsageFlags are such that the bits set in usage2 are a subset of the bits set in usage1, and they have the same flags and VkExternalMemoryBufferCreateInfo::handleTypes, then the bits set in memoryTypeBits returned for usage1 must be a subset of the bits set in memoryTypeBits returned for usage2, for all values of flags."
it looks the returned memoryTypeBit only affected by flags and usage and external buffer type. can we create a cache to avoid everytime create a dummy buffer.
The text was updated successfully, but these errors were encountered: