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

added wgpu example #124

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

added wgpu example #124

wants to merge 5 commits into from

Conversation

Gonkalbell
Copy link

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.

Copy link

@Noxime Noxime left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is very useful, I know a few people are interested in using WGPU with OpenXR. Just a few notes about making sure the correct instance and device extensions are loaded. Heres a gist of my code to initialize WGPU from OpenXR

openxr/examples/wgpu.rs Outdated Show resolved Hide resolved
openxr/examples/wgpu.rs Show resolved Hide resolved
@zmerp
Copy link
Contributor

zmerp commented Oct 24, 2022

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
Copy link

LoganDark commented Sep 29, 2023

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
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants