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

OpenXR backend #37

Merged
merged 6 commits into from Aug 9, 2019
Merged

OpenXR backend #37

merged 6 commits into from Aug 9, 2019

Conversation

@Manishearth
Copy link
Member

Manishearth commented Aug 9, 2019

This enters immersive mode without erroring, however doesn't yet render anything. I'm waiting for @paulrouget to write the code that blits the two subregions of the supplied openGL/angle texture into the swapchain-supplied D3D surfaces.

To work properly this needs the hl branch on servo/openxrs, and also the DLL built by https://github.com/microsoft/OpenXR-SDK-VisualStudio/blob/master/loader/openxr_loader_uwp.vcxproj (renamed to openxr_loader.dll)

r? @jdm

@Manishearth Manishearth force-pushed the openxr-cleaned branch from c68559c to 752bd05 Aug 9, 2019
@Manishearth Manishearth force-pushed the openxr-cleaned branch from 752bd05 to 0b35337 Aug 9, 2019
@Manishearth Manishearth force-pushed the openxr-cleaned branch from 0b35337 to dbf8253 Aug 9, 2019
@jdm
Copy link
Member

jdm commented Aug 9, 2019

It looks like if servo/openxrs@e8b301a is the only commit needed then we could just update to a more recent version from upstream openxrs, right?

@Manishearth
Copy link
Member Author

Manishearth commented Aug 9, 2019

In theory, yes, but this week i don't trust linkers, build systems, native code, SDKs, and most of all myself; so I'm going to try that update tomorrow and see how that goes. What we have here definitely works.

@jdm
Copy link
Member

jdm commented Aug 9, 2019

So, to be clear about the missing blitting piece: can we spell out what's expected? We have a GL texture, a GL handle, and we have a D3D swapchain image. The sample code gets the swapchain image and then does a bunch of d3d rendering. How do we bridge this gap?

@jdm
jdm approved these changes Aug 9, 2019
webxr/openxr/mod.rs Outdated Show resolved Hide resolved
@Manishearth Manishearth force-pushed the openxr-cleaned branch from dbf8253 to aa08371 Aug 9, 2019
@Manishearth
Copy link
Member Author

Manishearth commented Aug 9, 2019

We have two D3D swapchain images, one for each eye. We have a single GL texture that contains the data for both eyes. We need to blit each half of the GL texture to the respective D3D swapchain image.

This does feel like an extra blit but it isn't, I was told that the HL2 openxr implementation prefers split textures and if you give it a single combined texture it will internally blit anyway (whereas webxr requires a combined texture). It's easier to then just blit here, as the alternative route requires threading the acquired image back through Servo script so GL can render directly to it, which would be annoying.

I'd already discussed this with @paulrouget last week, I think he said this should be fairly simple. I just don't understand DX enough to know how to do it here.

@Manishearth
Copy link
Member Author

Manishearth commented Aug 9, 2019

@bors-servo r=jdm

@bors-servo
Copy link
Contributor

bors-servo commented Aug 9, 2019

📌 Commit aa08371 has been approved by jdm

bors-servo added a commit that referenced this pull request Aug 9, 2019
OpenXR backend

This enters immersive mode without erroring, however doesn't yet render anything. I'm waiting for @paulrouget to write the code that blits the two subregions of the supplied openGL/angle texture into the swapchain-supplied D3D surfaces.

To work properly this needs the `hl` branch on servo/openxrs, and also the DLL built by https://github.com/microsoft/OpenXR-SDK-VisualStudio/blob/master/loader/openxr_loader_uwp.vcxproj (renamed to `openxr_loader.dll`)

r? @jdm
@bors-servo
Copy link
Contributor

bors-servo commented Aug 9, 2019

Testing commit aa08371 with merge 95b32ca...

@jdm
Copy link
Member

jdm commented Aug 9, 2019

The bit I'm still unclear about is how we get the GL texture data into D3D. Since it's an ANGLE-based context, is this where we extract the D3D share handle and use that to draw the sub-parts of the texture to the D3D images?

@bors-servo
Copy link
Contributor

bors-servo commented Aug 9, 2019

☀️ Test successful - checks-travis
Approved by: jdm
Pushing 95b32ca to master...

@bors-servo bors-servo merged commit aa08371 into master Aug 9, 2019
5 checks passed
5 checks passed
Travis CI - Branch Build Passed
Details
Travis CI - Pull Request Build Passed
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
homu Test successful
Details
@Manishearth
Copy link
Member Author

Manishearth commented Aug 9, 2019

is this where we extract the D3D share handle and use that to draw the sub-parts of the texture to the D3D images?

Yes, because it's ANGLE backed we should be able to obtain the D3D texture id (or whatever it's called) and use that with D3D APIs.

@Manishearth Manishearth deleted the openxr-cleaned branch Aug 9, 2019
bors-servo added a commit to servo/servo that referenced this pull request Aug 12, 2019
Immersive WebXR on Hololens

This PR adds support to the OpenXR backend (servo/webxr#37) for Hololens. We support _entering_ immersive mode, but currently do nothing in immersive mode (servo/webxr#38, applying https://github.com/servo/webxr/tree/d3d11-draw should render some red).

This should be ready to land as-is aside from its dependency on #23922. It can be tested on https://manishearth.github.io/webgl-to-webxr/webxr-ar.html (make sure to click through the alerts).

This is based on #23922 .

This builds off of @paulrouget's work.

r? @jdm @paulrouget

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/23945)
<!-- Reviewable:end -->
bors-servo added a commit to servo/servo that referenced this pull request Aug 12, 2019
Immersive WebXR on Hololens

This PR adds support to the OpenXR backend (servo/webxr#37) for Hololens. We support _entering_ immersive mode, but currently do nothing in immersive mode (servo/webxr#38, applying https://github.com/servo/webxr/tree/d3d11-draw should render some red).

This should be ready to land as-is aside from its dependency on #23922. It can be tested on https://manishearth.github.io/webgl-to-webxr/webxr-ar.html (make sure to click through the alerts).

This is based on #23922 .

This builds off of @paulrouget's work.

r? @jdm @paulrouget

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/23945)
<!-- Reviewable:end -->
bors-servo added a commit to servo/servo that referenced this pull request Aug 12, 2019
Immersive WebXR on Hololens

This PR adds support to the OpenXR backend (servo/webxr#37) for Hololens. We support _entering_ immersive mode, but currently do nothing in immersive mode (servo/webxr#38, applying https://github.com/servo/webxr/tree/d3d11-draw should render some red).

This should be ready to land as-is aside from its dependency on #23922. It can be tested on https://manishearth.github.io/webgl-to-webxr/webxr-ar.html (make sure to click through the alerts).

This is based on #23922 .

This builds off of @paulrouget's work.

r? @jdm @paulrouget

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/23945)
<!-- Reviewable:end -->
bors-servo added a commit to servo/servo that referenced this pull request Aug 13, 2019
Immersive WebXR on Hololens

This PR adds support to the OpenXR backend (servo/webxr#37) for Hololens. We support _entering_ immersive mode, but currently do nothing in immersive mode (servo/webxr#38, applying https://github.com/servo/webxr/tree/d3d11-draw should render some red).

This should be ready to land as-is aside from its dependency on #23922. It can be tested on https://manishearth.github.io/webgl-to-webxr/webxr-ar.html (make sure to click through the alerts).

This is based on #23922 .

This builds off of @paulrouget's work.

r? @jdm @paulrouget

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/23945)
<!-- Reviewable:end -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.