Ralith / openxrs

OpenXR bindings for Rust
Apache License 2.0
281 stars 59 forks source link

added wgpu example #124

Open Gonkalbell opened 2 years ago

Gonkalbell commented 2 years ago

This is mostly an experiment on my part to see if I could get WGPU to work on the swapchain provided by OpenXR, using WGPU-HAL's functions for working with raw Vulkan objects. I think this may be useful enough to merge into the repo in case other developers are trying to do the same thing. This example only works if you use Vulkan as a backend, but it can probably be updated later to use DX12 and Metal as well. I did have to stumble through some of the sparsely documented parts of WGPU, so I could definitely use some feedback to make sure I dot all my "i"s and cross all my "t"s.

zmerp commented 2 years ago

I just want to mention I did a similar thing a while ago, but I took some shortcuts (no multiview and i reused the same swapchain for both eyes which does not make sense), and the wgpu version is old: https://github.com/zarik5/openxrs/tree/wgpu-test Maybe it can be useful.

LoganDark commented 1 year ago

image

WMR OpenXR does not support Vulkan at all, is there any way to use DX11 or DX12? I know wgpu supports DirectX as well...

edit: actually wait, https://github.com/mbucchia/OpenXR-Vk-D3D12 works lmao

image

LoganDark commented 1 year ago

Alright, soooooo,,, this crashes with an access violation if I go to the WMR Home. No idea how or why.