Skip to content
This repository has been archived by the owner on Jun 18, 2021. It is now read-only.

WIP: OpenXR integration #910

Closed
wants to merge 8 commits into from
Closed

WIP: OpenXR integration #910

wants to merge 8 commits into from

Conversation

blaind
Copy link

@blaind blaind commented May 14, 2021

I've made a proof-of-concept for OpenXR rendering on Bevy engine, using wgpu & underlying stack. See https://github.com/blaind/xrbevy

The code in this pull request is not even close to merge-able, but I thought its good idea to open it for further discussion.

See also gfx-rs/gfx#3761 and gfx-rs/wgpu#1387

For architecture of the pull request, see https://github.com/blaind/xrbevy/blob/main/docs/architecture.md (evolving document)

kvark and others added 6 commits April 29, 2021 12:51
…anic and avoid creating an unused padded buffer
In wgpu 0.7, this was a valid operation, the zero padding was done by hand. 
However in gfx-rs#872 this was removed as an optimization since buffers are zero padded, however the slice end was taken from buffer.slice which has to be aligned when mapped.
902: Release 0.8.1 r=kvark a=kvark



Co-authored-by: Imbris <imbrisf@gmail.com>
Co-authored-by: Pâris DOUADY <paris.douady@hotmail.fr>
Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
@blaind blaind marked this pull request as draft May 14, 2021 16:36
Cargo.toml Outdated
@@ -48,6 +49,7 @@ raw-window-handle = "0.3"
smallvec = "1"
tracing = { version = "0.1", default-features = false, features = ["std"] }
serde = { version = "1", features = ["derive"], optional = true }
openxr = { version = "0.14", features = ["loaded"], default-features = false, optional = true }
Copy link
Author

Choose a reason for hiding this comment

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

Is it okay to pull openxr as optional dependency?

@@ -22,6 +22,7 @@ replay = ["serde", "wgc/replay"]
# Make Vulkan backend available on platforms where it is by default not, e.g. macOS
vulkan-portability = ["wgc/gfx-backend-vulkan"]
webgl = ["wgc"]
use-openxr = ["wgc/use-openxr", "openxr"]
Copy link
Author

Choose a reason for hiding this comment

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

Should probably rename the feature use-openxr (across crates)

@@ -1586,6 +1603,25 @@ impl Device {
}
}

/// Creates a new [`Texture`] from a raw (Vulkan) image
#[cfg(feature = "use-openxr")]
pub fn create_openxr_texture_from_raw_image(
Copy link
Author

Choose a reason for hiding this comment

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

@lachlansneff
Copy link
Contributor

lachlansneff commented May 16, 2021

Fantastic! OpenXR support for wgpu-rs is something I really would like to see.

I do wonder if it could be implemented by instead exposing internal WebGPU, Vulkan, DX12, etc primitives in wgpu-rs through platform dependent traits, and then having an wgpu-openxr crate that uses those.

@blaind
Copy link
Author

blaind commented May 16, 2021

Fantastic! OpenXR support for wgpu-rs is something I really would like to see.

I do wonder if it could be implemented by instead exposing internal WebGPU, Vulkan, DX12, etc primitives in wgpu-rs through platform dependent traits, and then having an wgpu-openxr crate that uses those.

For context, I've updated the architecture document. There's quite a bit of different things going on (i/o, swapchain, device handling, etc.) so its a bit of puzzle to find the right places in ecosystem for each. Openxr itself supports vulkan and opengl at least.

@kvark
Copy link
Member

kvark commented Jun 3, 2021

Project moved to wgpu

@kvark kvark closed this Jun 3, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants