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

Changes to PFN_vmaAllocateDeviceMemoryFunction #417

Open
debaetsd opened this issue May 2, 2024 · 1 comment
Open

Changes to PFN_vmaAllocateDeviceMemoryFunction #417

debaetsd opened this issue May 2, 2024 · 1 comment
Labels
feature Adding new feature wontfix This will not be worked on

Comments

@debaetsd
Copy link

debaetsd commented May 2, 2024

I modified the Allocate callback (VmaDeviceMemoryCallbacks) of our local copy to include additional information about the used VmaPool and dedicated allocations.
The signature is now basically

typedef void (VKAPI_PTR* PFN_vmaAllocateDeviceMemoryFunction)(
    VmaAllocator VMA_NOT_NULL                    allocator,
    uint32_t                                     memoryType,
    VkDeviceMemory VMA_NOT_NULL_NON_DISPATCHABLE memory,
    VkDeviceSize                                 size,
    VmaPool VMA_NULLABLE                         pool,
    bool                                         isDedicated,
    void* VMA_NULLABLE                           pUserData);

This requires some data pipelining (aka making sure the new parameters are available at the call site) but nothing all to crazy.
We have done this to improve statistic tracking and simplify interop tracking.

Ideally we would like to upstream this change (so we do not have to keep a fork).
Is this something you would be willing to accept? We can make the PR.

@adam-sawicki-a
Copy link
Contributor

Thank you for the proposal, but I want to avoid complicating the library code by adding new features like this. Adding new parameters to PFN_vmaAllocateDeviceMemoryFunction would break backward-compatibility, so I would need to extend the structure VmaDeviceMemoryCallbacks with some new version PFN_vmaAllocateDeviceMemoryFunction2, which would add more code.

@adam-sawicki-a adam-sawicki-a added feature Adding new feature wontfix This will not be worked on labels May 6, 2024
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

No branches or pull requests

2 participants