-
Notifications
You must be signed in to change notification settings - Fork 469
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
vkGetMemoryWin32HandleKHR behavior should be more explicit #2420
Comments
I assume you're saying when you call vkGetMemoryWin32HandleKHR() on a (memory object, handle type) pair multiple times, the behavior of graphics drivers differs? That's expected given the VU makes that undefined behavior.
We don't generally change the spec in backwards-incompatible ways and/or ways that make it inconsistent with existing driver behavior unless we're relatively certain it won't break any applications in the field relying on the old behavior, nor break any future application running on existing drivers but expecting the new behavior, with the rare exception being when there is no other option to resolve a fundamental flaw in the spec. This might meet the first qualification, but not the second, and I don't think it's dire enough to make it worth the risk absent further justification (I.e., 'this could be cleaner' isn't enough to warrant breaking with existing driver behavior). Are you aware of applications in which the currently specified behavior is causing issues? |
I see, despite it not being ABI break, it is backward incompatible. May then the fix be the introduction of I am thinking of Vulkan Memory Allocator, for which this consistency would be beneficial, since resource allocation is detached from memory allocation and it is encouraged to do so.It makes it hard to predict the behavior of interop. This may cause issues e.g. for Prime. It currently runs on NVidia, but if we switch to AMD it will leak memory. Fix on higher level is possible, I am working on custom function for vma, but otherwise it is non-trivial. It requires some kind of map {VkDeviceMemory -> HANDLE}, which adds a lot of unnecessary bloat to the otherwise linear application. |
What does this mean? Prime is a Linux thing, but you're talking about Win32 here. Can you clarify? |
Chyron Prime to be exact. |
The Working Group discussed this, and reached the same conclusion as @cubanismo expressed above:
|
Hello, I'm investigating the behavior of interop functions for device memory allocations.
I have stumbled upon this spec for win32 handles. After analyzing the behavior on multiple graphics cards the behavior is different. One returns the same handle, the second returns different handle.
I'd like to propose a fix, to make the API more stable, and add opportunity to create handles for the same memory the same way that Fd does: Creating a duplicate handle on subsequent calls. Making them open a duplicate handle will just make internal shared counter increment, so it wouldn't be much of an overhead.
Every such handle will need to be closed.
Proposed change:
shall be removed from the spec.
The text was updated successfully, but these errors were encountered: