Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extended VmaAllocationInfo to include the size of the actual allocation #340

Closed
wants to merge 1 commit into from

Conversation

debaetsd
Copy link

Extended VmaAllocationInfo to include the actual allocation size (as-in the size used to allocate the memory when calling VkAllocateMemory).

We need the size when performing interop between Vulkan and OpenGL.
glImportMemoryFdEXT requires the size of the actual underlying Vulkan object to be passed in (not the size of a suballocated resource).

We worked around it by using dedicated allocations though extending VMA to query the size of the underlying allocation allows the benefits of the block allocator.

@adam-sawicki-a
Copy link
Contributor

Thank you for reporting this issue. I am sorry but I don't want to merge it. Query for VmaAllocationInfo is a function that may be called very often, so I want to keep it fast and avoid growing it in scope, while returning the size of the underlying memory block looks to me like an exotic feature.

Please feel free to maintain your fork of the code with this change. Another option could be using dedicated allocations or custom pools with specific VmaPoolCreateInfo::blockSize so that the size is known.

I also suggest to rename the new parameter, as "allocation" is used in VMA to name a single sub-allocated region of a memory block, as in VmaAllocation, so I recommend to rather call it a "block", "memory block", or "Vulkan memory" size.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Adding new feature wontfix This will not be worked on
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants