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

Shared Textures with Native Backend #274

Closed
jinleili opened this issue Aug 8, 2019 · 10 comments
Closed

Shared Textures with Native Backend #274

jinleili opened this issue Aug 8, 2019 · 10 comments
Labels
area: api Issues related to API surface help required We need community help to make this happen. type: enhancement New feature or request

Comments

@jinleili
Copy link
Contributor

jinleili commented Aug 8, 2019

On camera, video or AR apps, pixel data updated every frame, currently, we use wgpu_command_buffer_copy_buffer_to_texture to fill a texture, this command will cause pixel copy.

On these scenario, we need more efficient way to fill a wgpu texture, maybe shared memory with app client?

@jinleili jinleili changed the title Need a way to use app client generated video frame's pixel buffer create wgpu Texture Need a way to use app client generated video frame's pixel buffer fill wgpu texture Aug 8, 2019
@jinleili jinleili changed the title Need a way to use app client generated video frame's pixel buffer fill wgpu texture Need more efficient way to use app client generated video frame's pixel buffer fill wgpu texture Aug 8, 2019
@jinleili
Copy link
Contributor Author

jinleili commented Aug 8, 2019

On iOS and macOS, camera or video decode generated data is called CVPixelBuffer,on Android, camera’s frame data is called byte[] , but video decode data is called ByteBuffer, I understand that it may be hard to provide a general fn wrap a texture.

@kvark kvark added the type: enhancement New feature or request label Aug 8, 2019
@kvark
Copy link
Member

kvark commented Aug 8, 2019

This is a much needed issue, which also happens to be very hard to bring in. "wgpu-native" attempts to be safe and portable. Having externally managed texture contents means it's not directly in control of our implementation, and thus it's difficult to make it safe. Portability is also thrown out because these video subsystems are all different in different platforms.

First step - we need some way to provide external texture data to gfx-hal backends. Second step would be to make our tracking aware of external resources, investigate the needs for state transitions there, etc. It's a whole ton of work.

@bes
Copy link
Contributor

bes commented Aug 14, 2021

Sorry for bumping this, but I am looking to start experimenting on converting our video pipeline (ios/web/android/desktop/headless) which has implementation copied and slightly different for each platform into wgpu.

I am trying to get a feel for how far into the future this support would be, if there has been any movement?

As stated each platform is different, and I guess it has overlap with #274 and maybe other issues as well.

Sorry for bumping an old issue :(

@kvark
Copy link
Member

kvark commented Aug 16, 2021

There's been a ton of changes since this issue was updated. The last state of things is: we still want this.
One way to get there is via #1609 on Vulkan only. Another way would be to rely on texture sharing (between backends, and backend-users), which we haven't implemented yet.

@bes
Copy link
Contributor

bes commented Aug 16, 2021

Thanks for the update @kvark, I would be happy with an OpenGL-only solution for now, but it seems I am out of luck. Would be happy to help with testing or other simliar things if needed. I really like this project 👍

@Xaeroxe
Copy link

Xaeroxe commented Mar 12, 2022

I'm interested in making shared textures happen and might be able to provide some labor towards it. I have a specific focus on Windows, which means I'd like wgpu to be able to interact with shared resources from DirectX 11 and DirectX 12. Is there any work towards this? Do we have any specifications or prior art for how we'd like this feature to work?

@kvark
Copy link
Member

kvark commented Mar 12, 2022

@cwfitzgerald cwfitzgerald changed the title Need more efficient way to use app client generated video frame's pixel buffer fill wgpu texture Shared Textures with Native Backend Jun 5, 2022
@cwfitzgerald cwfitzgerald added area: api Issues related to API surface help required We need community help to make this happen. labels Jun 5, 2022
@bes
Copy link
Contributor

bes commented Jan 29, 2023

Is the implementation of this issue (positively) affected by the new functionality in v0.15.0 around Queue::copy_external_image_to_texture by @cwfitzgerald in #3288 ? Or are "texture sharing" and "low-copy" orthogonal concerns?

@Xaeroxe
Copy link

Xaeroxe commented Jan 29, 2023

Just as an FYI my employment situation has changed and I'm no longer going to work on this. By the way if your company needs an experienced Rust Engineer, I'm looking for a job.

@cwfitzgerald
Copy link
Member

See #4067 for plans that should enable this.

@cwfitzgerald cwfitzgerald closed this as not planned Won't fix, can't repro, duplicate, stale Oct 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: api Issues related to API surface help required We need community help to make this happen. type: enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants