WIP: wgpu renderer #35

Draft
mars wants to merge 15 commits from wgpu-renderer into main
Owner

This PR adds a dedicated wgpu renderer crate for Canary and replaces Magpie's glium-based windowing and rendering with wgpu + winit. Resolves #20.

This can't be merged yet because of winit/wgpu's poor behavior on Wayland + Nvidia. Because myself and the other current contributors are all Wayland + Nvidia users, this PR cannot be merged until this behavior is fixed. Here's what needs to be fixed:

  • Magpie will panic with Error in Surface::configure: parent device is lost unless winit is forced to run in XWayland with an environment variable: WINIT_UNIX_BACKEND=x11
  • Magpie windows (at least in forced XWayland mode) will flicker to their clear color when resized
  • Magpie will either (on my Nvidia GT 710, but no others yet) panic with Error in Surface::configure: parent device is lost or lock up and require a force quit when a window is continuously resized for more than a few seconds

These all seem to be wgpu<->winit swapchain issues. I do not know enough about the internals of Wayland or wgpu to figure out how to fix these, and we will most likely need to at the very least open issues on wgpu describing these issues in more depth and probably contribute to wgpu ourselves.

Clues about where to go from here:

This PR adds a dedicated wgpu renderer crate for Canary and replaces Magpie's glium-based windowing and rendering with wgpu + winit. Resolves #20. This can't be merged yet because of winit/wgpu's poor behavior on Wayland + Nvidia. Because myself and the other current contributors are all Wayland + Nvidia users, this PR cannot be merged until this behavior is fixed. Here's what needs to be fixed: - [ ] Magpie will panic with `Error in Surface::configure: parent device is lost` unless winit is forced to run in XWayland with an environment variable: `WINIT_UNIX_BACKEND=x11` - [ ] Magpie windows (at least in forced XWayland mode) will flicker to their clear color when resized - [ ] Magpie will either (on my Nvidia GT 710, but no others yet) panic with `Error in Surface::configure: parent device is lost` or lock up and require a force quit when a window is continuously resized for more than a few seconds These all seem to be wgpu<->winit swapchain issues. I do not know enough about the internals of Wayland or wgpu to figure out how to fix these, and we will most likely need to at the very least open issues on wgpu describing these issues in more depth and probably contribute to wgpu ourselves. Clues about where to go from here: - [wgpu's GitHub issue tracker](https://github.com/gfx-rs/wgpu/issues) - [similar crash on Xorg with GT 730](https://github.com/gfx-rs/wgpu/issues/2301)
mars added the
bug
feature
cleanup
consistency
abi change
labels 2022-11-12 02:24:02 +00:00
mars added 8 commits 2022-11-12 02:24:02 +00:00
Author
Owner

I've tested vkcube on my computer and it suffers from the same issues. This isn't a wgpu problem; it's a Linux Nvidia driver error.

More non-wgpu-related examples in the wild:

I've tested vkcube on my computer and it suffers from the same issues. This isn't a wgpu problem; it's a Linux Nvidia driver error. More non-wgpu-related examples in the wild: - https://github.com/ocornut/imgui/issues/2626 - https://github.com/KhronosGroup/Vulkan-Samples/issues/250
mars added 1 commit 2022-11-17 06:35:16 +00:00
mars added 4 commits 2022-11-17 21:25:17 +00:00
mars added 1 commit 2022-11-18 23:57:44 +00:00
mars added 1 commit 2022-12-04 22:11:32 +00:00
This pull request has changes conflicting with the target branch.
  • Cargo.toml
  • apps/magpie/Cargo.toml
  • apps/magpie/src/service/window.rs
You can also view command line instructions.

Step 1:

From your project repository, check out a new branch and test the changes.
git checkout -b wgpu-renderer main
git pull origin wgpu-renderer

Step 2:

Merge the changes and update on Forgejo.
git checkout main
git merge --no-ff wgpu-renderer
git push origin main
Sign in to join this conversation.
No description provided.