-
Notifications
You must be signed in to change notification settings - Fork 190
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
How to deal with large ash::Device type in libraries #731
Comments
I pass
If you're sharing a logical Vulkan device, you need to carefully coordinate ownership regardless of how you get function pointers. |
If the library owns a ash::Device and another owns a |
Sounds like the library in question ( Fwiw in our codebase we very carefully guard drop order. Despite using |
I opened Traverse-Research/gpu-allocator#159 a week ago and while thinking how to resolve that issue on a larger scale across the ecosystem where ash is used, the ash::Device type is quite large. In Smithay's WIP vulkan renderer by using gpu_allocator and having the renderer own a ash::Device I essentially double the size of my VulkanRenderer type. If I wanted to bring in a descriptor pool allocator it would be a third ash::Device.
Clearly tripling the size of the type (without any Boxes) is quite bad. I believe ash is probably the best spot to find a solution so that the ecosystem can adopt it.
Possible solutions
Most libraries and apps use a fraction of the vulkan commands. It would make sense then to reduce the size of types by only loading what the app uses. A few solutions to the problem come to mind:
The text was updated successfully, but these errors were encountered: