-
Notifications
You must be signed in to change notification settings - Fork 959
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
Vulkan: create texture from d3d11 shared handle #6161
Vulkan: create texture from d3d11 shared handle #6161
Conversation
989df37
to
c9f009e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good! Some comments
2ce979b
to
e2edab2
Compare
1563ef2
to
4ebcdb3
Compare
d221534
to
6e1d7c6
Compare
a0a89e4
to
b55c0ba
Compare
@cwfitzgerald Does this PR need any other improvements? This feature is already working properly in our product. |
b55c0ba
to
56a88b6
Compare
Hello. I've been working on sharing textures with wgpu using both Dx12 and Vulkan but without doing any changes to wgpu itself. My memory allocation code ended up looking very similar with important difference: In fact this new method is called Change to adapter to add Other considerations: If I'm not wrong, NT handle holds the resource alive and it won't be cleaned up unless you call CloseHandle. I may be wrong here but I think Vulkan will NOT close the handle itself so user should do that manually. In my specific situation (sending textures between processes) I'm managing handles outside of wgpu - I remove injected shared textures from wgpu and it gets sent to different process. I think that this ownership situation should be reflected in documentation of this method (but please don't quote me on that, I'm not 100% sure how exactly this mechanism works after reading documentation and my limited tests). |
I too have the interop code here if that's helpful to anyone. One thing I had to do is copy the texture format (DXGI_FORMAT) conversion functions, it would be nice if they were exposed from wgpu |
Sorry my time basically disappeared suddenly - looking now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approving with nits
56a88b6
to
b8c93f5
Compare
@Tsuguri |
0078fbf
to
9fb8b4f
Compare
@MarijnS95 Any other suggestions? |
eb2a91f
to
ead5b0a
Compare
ead5b0a
to
5c5e928
Compare
Can this PR be merged before #6465? |
bc2e315
to
efd70d0
Compare
Description
VK_KHR_external_memory_win32 extension enables application to import Vulkan memory objects from Windows handles.
Testing
texture_from_d3d11_shared_handle
Checklist
cargo fmt
.cargo clippy
. If applicable, add:--target wasm32-unknown-unknown
--target wasm32-unknown-emscripten
cargo xtask test
to run tests.CHANGELOG.md
. See simple instructions inside file.