-
Notifications
You must be signed in to change notification settings - Fork 961
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
Texture
from ID3D12Resource/ID3D11Resource
?
#6228
Comments
there's #6161 but in general there's no universal interface to interop with all possible APIs. btw, as far as I can tell, all the interops are possible to implement outside of That might be a good question to the maintainers: Do you prefer more PRs like #6161 or a separate crate for these zero-copy texture/buffer interops? |
@AdrianEddy Thank you for answering my questions! First of all, you mentioned that it is possible to interoperate outside of wgpu, how is this possible? Currently, there doesn't seem to be any method or implementation for the My understanding is that wgpu's At the moment I don't need to interoperate between different backends, I think #6161 is for interoperating between different backends, from D3D to Vulkan. Maybe I'm not describing it very well, what I might need is that if the backend wgpu is currently using is D3D, then What I mean is, when wgpu and other external implementations are using the same backend, how can we easily use the external resources with zero overhead instead of sharing the resources between different implementations. Because in reality, other implementations or modules (not even Rust at all) often use the same GPU devices and graphics APIs as the wgpu, in which case the resources of the other implementation or module can actually be used directly by the wgpu at zero or low cost. Finally, to answer your last question, if the wgpu is using the same set of graphics APIs as the external implementation and needs to interoperate at this point, then I'd be inclined to have the wgpu itself support this behavior, but if it's across different graphics APIs/backends then I think it's best to let the external crate do the work and the wgpu doesn't have much need to bother with it. Of course, this is just my personal opinion, so please forgive me and bring it up if you find it problematic. |
There are |
Sorry, I saw the method |
I've tried searching the issues have looked at crate's documentation and there doesn't seem to be a way to directly use resources from other D3D devices right now, such as 2d texture, is that because of something that's causing a blockage or is there a plan in place but no support right now?
I'd probably want an interface like
Texture::from_raw_texture
or something like that, where the user handles the use of different raw textures under different backends themselves.There doesn't seem to be any way to do this or an alternative at the moment, except for a custom wgpu backend, I guess.
This is useful in scenarios where high performance hardware acceleration is required, for example, the frame output from a hardware video decoder is ID3D11Resource2DTexture, which the wgpu would need to transfer to memory via the cpu and then submit to the wgpu's memory by copying the texture from the software, which is an expensive way to do it! .
I'm just illustrating the use of D3D devices here, other backends should be able to provide support in the same way.
The text was updated successfully, but these errors were encountered: