-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
feat(extensions/webgpu): swapchain support #10690
Conversation
# Conflicts: # Cargo.lock # extensions/webgpu/Cargo.toml # extensions/webgpu/swapchain.rs # op_crates/webgpu/lib.rs
# Conflicts: # Cargo.lock # extensions/webgpu/Cargo.toml
Fantastic work! Is there anything missing yet? Maybe I could help. I was trying to do something like this and I've found this PR. |
@EnzoAlbornoz currently only the JS code is missing, but this where it gets tricky: we want to be web compatible, but the spec wasn't designed to work with native windowing, so we are waiting for discussion by the webgpu people in regards to this issue |
There already is a discussion opened in the WebGPU repository that I could track? Or we need to open it? |
use serde::Deserialize; | ||
use std::borrow::Cow; | ||
|
||
struct WebGpuRawWindowHandle(DynHasRawWindowHandle); |
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.
This struct shouldn't be public? I mean, how can I integrate with Winit Window with this struct? When I tried to use the Winit window this error occurred:
error: Uncaught (in promise) BadResource: Bad resource ID
I tried to use this implementation, but TypeId from dynamic load libraries is different. Because they have different ids, the resource table returns bad_resource_id. There is some way to solve this? I'm trying to test this for more than two days |
Yeah this is a limitation of Rust compilation. @eliassjogreen had some |
Yes, the unsafe workaround is as follows: let resource_dyn = state
.resource_table
.get_any(args.rid)
.ok_or_else(bad_resource_id)?;
let resource_ptr = &resource_dyn as *const Rc<_> as *const Rc<WebGpuRawWindowHandle>;
let resource = unsafe { &*resource_ptr }; It is however pretty safe because the |
It worked!. But now I'm having the following problem:
Anyone had this problem too? |
I have played around with my module too and had the same problem, when looking at the exit code it usually exits with a segfault if I am not mistaken. |
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions. |
Any plans to continue working on this in another PR, or what's the status here? |
This is still stuck on webgpu-native/webgpu-headers#88 |
Looks like there's progress on the blockers. 🎉 See webgpu-native/webgpu-headers#164 |
This should be reopened. Progress is slow but there is progress. The stale bot only made this more difficult to find... |
Seems like it's merged? |
No description provided.