Begin building OpenXr on Android [chromium/src : main]

27 views
Skip to first unread message

Alexander Cooper (Gerrit)

unread,
Apr 24, 2023, 4:59:27 PM4/24/23
to Kenneth Russell, chromium-a...@chromium.org, droger+w...@chromium.org, extension...@chromium.org, feature-v...@chromium.org, Findit

Attention is currently required from: Kenneth Russell.

Alexander Cooper would like Kenneth Russell to review this change.

View Change

Begin building OpenXr on Android

Refactors windows-specific code that has crept into the OpenXr classes
by currently wrapping most of them in ifdefs. In a few cases I've
extracted some classes to use temporarily to allow key methods to remain
visible for Android (BeginFrame and InitSession the most critical).
Some of these classes will change slightly with other refactor work that
was identified and some would be good candidates for future cleanup.

At the moment, OpenXr is not added as a supported runtime on Android,
this simply begins it building on Android. Future changes will hook up
the rest of the stack to consider/query for an OpenXr runtime.


Bug: 1435548
Change-Id: I9bdfe5938f3f08efbc62c8d40fe0ec0dc6a0754f
---
M DEPS
M components/webxr/DEPS
M content/browser/xr/service/vr_service_impl.cc
M device/vr/BUILD.gn
M device/vr/DEPS
M device/vr/android/DEPS
M device/vr/buildflags/buildflags.gni
A device/vr/openxr/android/openxr_graphics_binding_open_gles.cc
A device/vr/openxr/android/openxr_graphics_binding_open_gles.h
M device/vr/openxr/openxr_api_wrapper.cc
M device/vr/openxr/openxr_api_wrapper.h
M device/vr/openxr/openxr_extension_helper.cc
M device/vr/openxr/openxr_extension_helper.h
A device/vr/openxr/openxr_graphics_binding.h
M device/vr/openxr/openxr_platform.h
M device/vr/openxr/openxr_render_loop.cc
M device/vr/openxr/openxr_render_loop.h
M device/vr/openxr/openxr_statics.cc
M device/vr/openxr/openxr_statics.h
M device/vr/openxr/openxr_util.cc
M device/vr/openxr/openxr_util.h
M device/vr/openxr/test/fake_openxr_impl_api.cc
M device/vr/openxr/test/openxr_negotiate.h
M device/vr/openxr/test/openxr_test_helper.h
A device/vr/openxr/windows/openxr_graphics_binding_d3d11.cc
A device/vr/openxr/windows/openxr_graphics_binding_d3d11.h
M device/vr/windows/compositor_base.cc
M device/vr/windows/compositor_base.h
M third_party/openxr/BUILD.gn
29 files changed, 464 insertions(+), 160 deletions(-)


To view, visit change 4461233. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: newchange
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I9bdfe5938f3f08efbc62c8d40fe0ec0dc6a0754f
Gerrit-Change-Number: 4461233
Gerrit-PatchSet: 4
Gerrit-Owner: Alexander Cooper <alco...@chromium.org>
Gerrit-Reviewer: Alexander Cooper <alco...@chromium.org>
Gerrit-Reviewer: Findit <findit...@appspot.gserviceaccount.com>
Gerrit-Reviewer: Kenneth Russell <k...@chromium.org>
Gerrit-Attention: Kenneth Russell <k...@chromium.org>

Alexander Cooper (Gerrit)

unread,
Apr 24, 2023, 4:59:32 PM4/24/23
to chromium-a...@chromium.org, droger+w...@chromium.org, extension...@chromium.org, feature-v...@chromium.org, Kenneth Russell, Findit, Tricium, Chromium LUCI CQ, chromium...@chromium.org

Attention is currently required from: Kenneth Russell.

View Change

2 comments:

  • Patchset:

    • Patch Set #4:

      Ken, Hoping you can take a look at this open question/device/vr/DEPS before I send for review by my team.

  • File device/vr/openxr/openxr_platform.h:

    • Patch Set #1, Line 23: #include "third_party/khronos/EGL/egl.h"

      I'm not entirely sure that this is the right header to include here. @k...@chromium.org, do you have any guidance on this? When I try to include it as <EGL/egl.h> like the openxr-sdk-source does, I'm told that that path doesn't exist; and while it does seem to find it as "EGL/egl.h", the DEPs file is still unhappy and we don't seem to have that directory, so I'm unsure who I would add to look at it...

To view, visit change 4461233. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I9bdfe5938f3f08efbc62c8d40fe0ec0dc6a0754f
Gerrit-Change-Number: 4461233
Gerrit-PatchSet: 4
Gerrit-Owner: Alexander Cooper <alco...@chromium.org>
Gerrit-Reviewer: Alexander Cooper <alco...@chromium.org>
Gerrit-Reviewer: Findit <findit...@appspot.gserviceaccount.com>
Gerrit-Reviewer: Kenneth Russell <k...@chromium.org>
Gerrit-Attention: Kenneth Russell <k...@chromium.org>
Gerrit-Comment-Date: Mon, 24 Apr 2023 20:59:07 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No

Kenneth Russell (Gerrit)

unread,
Apr 24, 2023, 5:57:13 PM4/24/23
to Brandon Jones, chromium-a...@chromium.org, droger+w...@chromium.org, extension...@chromium.org, feature-v...@chromium.org, Alexander Cooper, Findit

Attention is currently required from: Alexander Cooper, Brandon Jones.

Kenneth Russell would like Brandon Jones to review this change authored by Alexander Cooper.

To view, visit change 4461233. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: newchange
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I9bdfe5938f3f08efbc62c8d40fe0ec0dc6a0754f
Gerrit-Change-Number: 4461233
Gerrit-PatchSet: 4
Gerrit-Owner: Alexander Cooper <alco...@chromium.org>
Gerrit-Reviewer: Alexander Cooper <alco...@chromium.org>
Gerrit-Reviewer: Brandon Jones <baj...@chromium.org>
Gerrit-Reviewer: Findit <findit...@appspot.gserviceaccount.com>
Gerrit-Reviewer: Kenneth Russell <k...@chromium.org>
Gerrit-Attention: Brandon Jones <baj...@chromium.org>
Gerrit-Attention: Alexander Cooper <alco...@chromium.org>

Kenneth Russell (Gerrit)

unread,
Apr 24, 2023, 5:57:18 PM4/24/23
to Alexander Cooper, chromium-a...@chromium.org, droger+w...@chromium.org, extension...@chromium.org, feature-v...@chromium.org, Brandon Jones, Findit, Tricium, Chromium LUCI CQ, chromium...@chromium.org

Attention is currently required from: Alexander Cooper, Brandon Jones.

View Change

1 comment:

  • Patchset:

    • Patch Set #4:

      Brandon, would you be able to do the primary review of this CL?

To view, visit change 4461233. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I9bdfe5938f3f08efbc62c8d40fe0ec0dc6a0754f
Gerrit-Change-Number: 4461233
Gerrit-PatchSet: 4
Gerrit-Owner: Alexander Cooper <alco...@chromium.org>
Gerrit-Reviewer: Alexander Cooper <alco...@chromium.org>
Gerrit-Reviewer: Brandon Jones <baj...@chromium.org>
Gerrit-Reviewer: Findit <findit...@appspot.gserviceaccount.com>
Gerrit-Reviewer: Kenneth Russell <k...@chromium.org>
Gerrit-Attention: Brandon Jones <baj...@chromium.org>
Gerrit-Attention: Alexander Cooper <alco...@chromium.org>
Gerrit-Comment-Date: Mon, 24 Apr 2023 21:56:36 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No

Alexander Cooper (Gerrit)

unread,
Apr 24, 2023, 6:01:20 PM4/24/23
to chromium-a...@chromium.org, droger+w...@chromium.org, extension...@chromium.org, feature-v...@chromium.org, Brandon Jones, Kenneth Russell, Findit, Tricium, Chromium LUCI CQ, chromium...@chromium.org

Attention is currently required from: Brandon Jones, Kenneth Russell.

View Change

1 comment:

  • Patchset:

    • Patch Set #4:

      Brandon, would you be able to do the primary review of this CL?

    • I've chatted a bit with Brandon offline and we weren't sure if using the Dependency this way was expected. Essentially the third_party openxr_platform file requires EGL types to be defined and I'm unsure of the right way to add that inclusion since <EGL/egl.h> seems to not exist. See the comment in device/vr/openxr/openxr_platform.h for more context.

To view, visit change 4461233. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I9bdfe5938f3f08efbc62c8d40fe0ec0dc6a0754f
Gerrit-Change-Number: 4461233
Gerrit-PatchSet: 4
Gerrit-Owner: Alexander Cooper <alco...@chromium.org>
Gerrit-Reviewer: Alexander Cooper <alco...@chromium.org>
Gerrit-Reviewer: Brandon Jones <baj...@chromium.org>
Gerrit-Reviewer: Findit <findit...@appspot.gserviceaccount.com>
Gerrit-Reviewer: Kenneth Russell <k...@chromium.org>
Gerrit-Attention: Brandon Jones <baj...@chromium.org>
Gerrit-Attention: Kenneth Russell <k...@chromium.org>
Gerrit-Comment-Date: Mon, 24 Apr 2023 22:01:12 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Kenneth Russell <k...@chromium.org>

Kenneth Russell (Gerrit)

unread,
Apr 24, 2023, 6:03:48 PM4/24/23
to Alexander Cooper, chromium-a...@chromium.org, droger+w...@chromium.org, extension...@chromium.org, feature-v...@chromium.org, Brandon Jones, Findit, Tricium, Chromium LUCI CQ, chromium...@chromium.org

Attention is currently required from: Brandon Jones, Kenneth Russell.

View Change

1 comment:

  • File device/vr/openxr/openxr_platform.h:

    • I'm not entirely sure that this is the right header to include here. @kbr@chromium. […]

      Have you investigated adding the `khronos_headers` config from third_party/khronos/BUILD.gn into the appropriate build target here in `device/vr`? I think that's how several other portions of Chromium gain access to these headers explicitly.

To view, visit change 4461233. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I9bdfe5938f3f08efbc62c8d40fe0ec0dc6a0754f
Gerrit-Change-Number: 4461233
Gerrit-PatchSet: 4
Gerrit-Owner: Alexander Cooper <alco...@chromium.org>
Gerrit-Reviewer: Alexander Cooper <alco...@chromium.org>
Gerrit-Reviewer: Brandon Jones <baj...@chromium.org>
Gerrit-Reviewer: Findit <findit...@appspot.gserviceaccount.com>
Gerrit-Reviewer: Kenneth Russell <k...@chromium.org>
Gerrit-Attention: Brandon Jones <baj...@chromium.org>
Gerrit-Attention: Kenneth Russell <k...@chromium.org>
Gerrit-Comment-Date: Mon, 24 Apr 2023 22:03:39 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Alexander Cooper <alco...@chromium.org>

Alexander Cooper (Gerrit)

unread,
Apr 24, 2023, 6:23:54 PM4/24/23
to chromium-a...@chromium.org, droger+w...@chromium.org, extension...@chromium.org, feature-v...@chromium.org, Brandon Jones, Kenneth Russell, Findit, Tricium, Chromium LUCI CQ, chromium...@chromium.org

Attention is currently required from: Brandon Jones, Kenneth Russell.

View Change

2 comments:

  • Patchset:

    • Patch Set #4:

      I've chatted a bit with Brandon offline and we weren't sure if using the Dependency this way was exp […]

      Brandon can certainly review the rest of the CL (as a WebXR Owner); but the part I actually needed your review on was device/vr/DEPS (note that there's already a matching DEP being removed in device/vr/android and it is essentially being moved up a level). Usage is in openxr_render_loop (though not really fully used yet), and there was the question about how best to address the need to have EGL defined in device/vr/openxr/openxr_platform.h, which is currently using the third_party/khronos:khronos_header configs. (I attempted to use ui/gl/gl_bindings.h, but got redefinition errors in some of the other files).

  • File device/vr/openxr/openxr_platform.h:

    • Have you investigated adding the `khronos_headers` config from third_party/khronos/BUILD. […]

      That seemed to work; I tried to get them via ui/gl/gl_bindings instead, but hit some redefinition errors in some of the other files.

To view, visit change 4461233. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I9bdfe5938f3f08efbc62c8d40fe0ec0dc6a0754f
Gerrit-Change-Number: 4461233
Gerrit-PatchSet: 4
Gerrit-Owner: Alexander Cooper <alco...@chromium.org>
Gerrit-Reviewer: Alexander Cooper <alco...@chromium.org>
Gerrit-Reviewer: Brandon Jones <baj...@chromium.org>
Gerrit-Reviewer: Findit <findit...@appspot.gserviceaccount.com>
Gerrit-Reviewer: Kenneth Russell <k...@chromium.org>
Gerrit-Attention: Brandon Jones <baj...@chromium.org>
Gerrit-Attention: Kenneth Russell <k...@chromium.org>
Gerrit-Comment-Date: Mon, 24 Apr 2023 22:23:47 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Alexander Cooper <alco...@chromium.org>
Comment-In-Reply-To: Kenneth Russell <k...@chromium.org>

Findit (Gerrit)

unread,
Apr 24, 2023, 7:25:09 PM4/24/23
to Alexander Cooper, chromium-a...@chromium.org, droger+w...@chromium.org, extension...@chromium.org, feature-v...@chromium.org, Brandon Jones, Kenneth Russell, Tricium, Chromium LUCI CQ, chromium...@chromium.org

Attention is currently required from: Brandon Jones, Kenneth Russell.

This change meets the code coverage requirements.

Patch set 5:Code-Coverage +1

View Change

    To view, visit change 4461233. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I9bdfe5938f3f08efbc62c8d40fe0ec0dc6a0754f
    Gerrit-Change-Number: 4461233
    Gerrit-PatchSet: 5
    Gerrit-Owner: Alexander Cooper <alco...@chromium.org>
    Gerrit-Reviewer: Alexander Cooper <alco...@chromium.org>
    Gerrit-Reviewer: Brandon Jones <baj...@chromium.org>
    Gerrit-Reviewer: Findit <findit...@appspot.gserviceaccount.com>
    Gerrit-Reviewer: Kenneth Russell <k...@chromium.org>
    Gerrit-Attention: Brandon Jones <baj...@chromium.org>
    Gerrit-Attention: Kenneth Russell <k...@chromium.org>
    Gerrit-Comment-Date: Mon, 24 Apr 2023 23:24:48 +0000
    Gerrit-HasComments: No
    Gerrit-Has-Labels: Yes

    Brandon Jones (Gerrit)

    unread,
    Apr 27, 2023, 12:07:30 PM4/27/23
    to Alexander Cooper, chromium-a...@chromium.org, droger+w...@chromium.org, extension...@chromium.org, feature-v...@chromium.org, Findit, Kenneth Russell, Tricium, Chromium LUCI CQ, chromium...@chromium.org

    Attention is currently required from: Alexander Cooper, Kenneth Russell.

    View Change

    9 comments:

    • Patchset:

      • Patch Set #6:

        Going forward I'd like to see a lot less #ifs sprinkled throughout the code, but as a first step of a larger refactor it's fine.

    • File device/vr/openxr/android/openxr_graphics_binding_open_gles.cc:

      • Patch Set #6, Line 45: color_swapchain_images.emplace_back();

        Shouldn't this be emplacing... something? Like the texture handle in the D3D version of the class?

    • File device/vr/openxr/openxr_api_wrapper.h:

      • Patch Set #6, Line 53: // and D3D11Fence for each D3D11 texture in the vector.

        Nit: Might want to remove/relocate the D3D references in comments like these as well.

      • Patch Set #6, Line 72: };

        Feels like this is an good opportunity to have an abstract SwapChainInfo class with platform-specific inherited types. In fact, might even be something that gets defined in openxr_graphics_binding.h, since it seems like it's going to be tightly associated with that.

    • File device/vr/openxr/openxr_api_wrapper.cc:

      • Patch Set #6, Line 749: #endif

        Is this code that could live in the OpenXrGraphicsBinding? Feels like trying to shift a fair amount of the platform-specific graphics code into that class would be a good trend.

      • Patch Set #6, Line 771: #endif

        Similarly, feels like this logic could comfortably reside in the OpenXrGraphicsBinding too. (Probably applies to several other code snippets in this file as well.)

    • File device/vr/openxr/openxr_graphics_binding.h:

      • Patch Set #6, Line 22: virtual const void* get() const = 0;

        Having this method just named `get()` threw me off a little, especially because it just returns a void pointer. I think the intent is to treat it like a smart pointer, the class as a whole doesn't quite act that way.

        Naming it something like `graphics_binding()` or `GetGraphicsBinding()` would probably help readability a bit.

    • File device/vr/openxr/openxr_render_loop.cc:

      • Patch Set #6, Line 67: texture_helper_.SetBackbuffer(swap_chain_info->d3d11_texture.get());

        It's a bit unfortunate that these types of calls are sprinkled all throughout the code, but I understand the refactoring is an ongoing process.

        Do you think that Android will end up having it's own `texture_helper_`? If not, I think it would be appropriate to rename texture_helper_ to something like d3d_texture_helper_ to help emphasize that it's a windows-only utility.

    • File device/vr/windows/compositor_base.cc:

      • Patch Set #6, Line 604: #endif

        Can we reduce the number of #ifs here by structuring it like so?

        ```
        #if win
        if(no_submit) {
        ...
        } else {
        copy_successful = ...
        }
        #endif
          if(copy_successful) {
        ...
        }
        ```

    To view, visit change 4461233. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I9bdfe5938f3f08efbc62c8d40fe0ec0dc6a0754f
    Gerrit-Change-Number: 4461233
    Gerrit-PatchSet: 6
    Gerrit-Owner: Alexander Cooper <alco...@chromium.org>
    Gerrit-Reviewer: Alexander Cooper <alco...@chromium.org>
    Gerrit-Reviewer: Brandon Jones <baj...@chromium.org>
    Gerrit-Reviewer: Findit <findit...@appspot.gserviceaccount.com>
    Gerrit-Reviewer: Kenneth Russell <k...@chromium.org>
    Gerrit-Attention: Alexander Cooper <alco...@chromium.org>
    Gerrit-Attention: Kenneth Russell <k...@chromium.org>
    Gerrit-Comment-Date: Thu, 27 Apr 2023 16:07:20 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No

    Piotr Bialecki (Gerrit)

    unread,
    Apr 27, 2023, 1:56:28 PM4/27/23
    to Alexander Cooper, chromium-a...@chromium.org, droger+w...@chromium.org, extension...@chromium.org, feature-v...@chromium.org, Findit, Brandon Jones, Kenneth Russell, Tricium, Chromium LUCI CQ, chromium...@chromium.org

    Attention is currently required from: Alexander Cooper, Kenneth Russell.

    View Change

    6 comments:

    • Patchset:

    • File DEPS:

    • File device/vr/openxr/android/openxr_graphics_binding_open_gles.h:

      • Patch Set #6, Line 26: XrGraphicsBindingOpenGLESAndroidKHR

        Also initialize pointers to nullptr here? I'm not sure what c++ will do with them if we aren't explicit...

    • File device/vr/openxr/openxr_util.cc:

      • Patch Set #6, Line 125:

         // Since the OpenXR backend only knows how to draw with D3D11 at the moment,
        // the XR_KHR_D3D11_ENABLE_EXTENSION_NAME is required.

        Nit: update.

    • File device/vr/openxr/windows/openxr_graphics_binding_d3d11.h:

    • File device/vr/openxr/windows/openxr_graphics_binding_d3d11.cc:

    To view, visit change 4461233. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I9bdfe5938f3f08efbc62c8d40fe0ec0dc6a0754f
    Gerrit-Change-Number: 4461233
    Gerrit-PatchSet: 6
    Gerrit-Owner: Alexander Cooper <alco...@chromium.org>
    Gerrit-Reviewer: Alexander Cooper <alco...@chromium.org>
    Gerrit-Reviewer: Brandon Jones <baj...@chromium.org>
    Gerrit-Reviewer: Findit <findit...@appspot.gserviceaccount.com>
    Gerrit-Reviewer: Kenneth Russell <k...@chromium.org>
    Gerrit-CC: Piotr Bialecki <bia...@chromium.org>
    Gerrit-Attention: Alexander Cooper <alco...@chromium.org>
    Gerrit-Attention: Kenneth Russell <k...@chromium.org>
    Gerrit-Comment-Date: Thu, 27 Apr 2023 17:56:16 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No

    Alexander Cooper (Gerrit)

    unread,
    Apr 27, 2023, 5:13:29 PM4/27/23
    to chromium-a...@chromium.org, droger+w...@chromium.org, extension...@chromium.org, feature-v...@chromium.org, Piotr Bialecki, Findit, Brandon Jones, Kenneth Russell, Tricium, Chromium LUCI CQ, chromium...@chromium.org

    Attention is currently required from: Brandon Jones, Kenneth Russell, Piotr Bialecki.

    View Change

    16 comments:

    • Patchset:

      • Patch Set #6:

        Going forward I'd like to see a lot less #ifs sprinkled throughout the code, but as a first step of […]

        Yeah, agreed. The ultimate goal as we progress through this work will be to identify places where the #ifs can be abstracted to a platform-specific implementation of some type. Partially this is an attempt at doing the basic chunks of work and then creating areas where I could maybe parallelize some of the other work.

    • Patchset:

      • Patch Set #7:

        Some good feedback on reducing ifdefs by consolidating some of the render logic. I'd like to tackle that as part of a more wholistic rendering-focused refactor/pass at implementing the Android renderer so that I can get a clearer idea of what a good API shape would be.

    • File DEPS:

      • Done

    • File device/vr/openxr/android/openxr_graphics_binding_open_gles.h:

      • Also initialize pointers to nullptr here? I'm not sure what c++ will do with them if we aren't expli […]

        Done

    • File device/vr/openxr/android/openxr_graphics_binding_open_gles.cc:

      • Shouldn't this be emplacing... […]

        In a future change it likely will. For now it's just invoking the default constructor on SwapChainInfo.

    • File device/vr/openxr/openxr_api_wrapper.h:

      • Patch Set #6, Line 53: // and D3D11Fence for each D3D11 texture in the vector.

        Nit: Might want to remove/relocate the D3D references in comments like these as well.

      • I moved the comment down to the members.

      • Feels like this is an good opportunity to have an abstract SwapChainInfo class with platform-specifi […]

        The biggest issue that I have with that vs. if-def'd types on a concrete class (though maybe it shouldn't be) is the additional boilerplate to do the typecast.

        At any rate; though I haven't filed a bug on this, I'd like to defer this to the TODO at the top of the struct 😊 LMK if you agree and I can file a bug to capture this as an option during that refactor.

    • File device/vr/openxr/openxr_api_wrapper.cc:

      • Is this code that could live in the OpenXrGraphicsBinding? Feels like trying to shift a fair amount […]

        That seems reasonable, we also don't seem to always forward it. I may defer that to a later change if you don't object.

      • Similarly, feels like this logic could comfortably reside in the OpenXrGraphicsBinding too. […]

        Hmm, I could certainly move the "WaitOnFence" stuff that calls this into the OpenXrGraphicsBinding which would allow that to move, but there's some trickiness with storing the fence if we want to keep it somewhere (though we don't actually guarantee that the fence is associated with the same image here...) I think I'd like to take a pass at all of the rendering stuff separately and more wholistically as part of a future change. My goal with this change was essentially to allow building for Android and to abstract just the things that were trivially easy to "implement" on Android that were required to call the various methods so that they *could* all theoretically be called.

    • File device/vr/openxr/openxr_graphics_binding.h:

      • Having this method just named `get()` threw me off a little, especially because it just returns a vo […]

        Yeah, I think that was my original intent (e.g. it was just a way to abstract out the struct we need to pass to XrSessionCreateInfo.next); but even before your suggestions to abstract more work into here (which I'll likely do) it grew a little beyond that. I've renamed it to `GetSessionCreateInfo()`

    • File device/vr/openxr/openxr_render_loop.cc:

      • It's a bit unfortunate that these types of calls are sprinkled all throughout the code, but I unders […]

        I'd like to defer a decision on texture_helper_ for the time being. I'm not sure if I want the graphics binding to become graphics helper or if we want a separate texture_helper, and I think I'll have more clarity once I try to get things rendering on Android.

    • File device/vr/openxr/openxr_util.cc:

      • Patch Set #6, Line 125:

         // Since the OpenXR backend only knows how to draw with D3D11 at the moment,
        // the XR_KHR_D3D11_ENABLE_EXTENSION_NAME is required.

        Nit: update.

      • Moved. Leaving open because there's another change I need to check this on lower down too.

    • File device/vr/openxr/windows/openxr_graphics_binding_d3d11.h:

      • Done

    • File device/vr/openxr/windows/openxr_graphics_binding_d3d11.cc:

      • Probably existing. but Fixed.

      • Patch Set #6, Line 45: CHECK(color_swapchain == XR_NULL_HANDLE);

        Pretty certain this mistaken CHECK is the cause of the test failures, switched to !=

    • File device/vr/windows/compositor_base.cc:

      • Can we reduce the number of #ifs here by structuring it like so? […]

        The yak would like to thank you for it's nice new trim.

    To view, visit change 4461233. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I9bdfe5938f3f08efbc62c8d40fe0ec0dc6a0754f
    Gerrit-Change-Number: 4461233
    Gerrit-PatchSet: 7
    Gerrit-Owner: Alexander Cooper <alco...@chromium.org>
    Gerrit-Reviewer: Alexander Cooper <alco...@chromium.org>
    Gerrit-Reviewer: Brandon Jones <baj...@chromium.org>
    Gerrit-Reviewer: Findit <findit...@appspot.gserviceaccount.com>
    Gerrit-Reviewer: Kenneth Russell <k...@chromium.org>
    Gerrit-CC: Piotr Bialecki <bia...@chromium.org>
    Gerrit-Attention: Brandon Jones <baj...@chromium.org>
    Gerrit-Attention: Piotr Bialecki <bia...@chromium.org>
    Gerrit-Attention: Kenneth Russell <k...@chromium.org>
    Gerrit-Comment-Date: Thu, 27 Apr 2023 21:13:21 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Brandon Jones <baj...@chromium.org>
    Comment-In-Reply-To: Piotr Bialecki <bia...@chromium.org>

    Brandon Jones (Gerrit)

    unread,
    Apr 27, 2023, 5:51:45 PM4/27/23
    to Alexander Cooper, chromium-a...@chromium.org, droger+w...@chromium.org, extension...@chromium.org, feature-v...@chromium.org, Piotr Bialecki, Findit, Kenneth Russell, Tricium, Chromium LUCI CQ, chromium...@chromium.org

    Attention is currently required from: Alexander Cooper, Kenneth Russell, Piotr Bialecki.

    Patch set 7:Code-Review +1

    View Change

    5 comments:

    • Patchset:

    • File device/vr/openxr/openxr_api_wrapper.h:

      • Patch Set #6, Line 72: };

        The biggest issue that I have with that vs. […]

        That's fine. Let's get it captured in a bug and defer this and other larger refactors below to a follow up.

    • File device/vr/openxr/openxr_api_wrapper.cc:

      • That seems reasonable, we also don't seem to always forward it. […]

        Acknowledged

      • Hmm, I could certainly move the "WaitOnFence" stuff that calls this into the OpenXrGraphicsBinding w […]

        Acknowledged

    • File device/vr/openxr/openxr_render_loop.cc:

      • I'd like to defer a decision on texture_helper_ for the time being. […]

        Acknowledged

    To view, visit change 4461233. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I9bdfe5938f3f08efbc62c8d40fe0ec0dc6a0754f
    Gerrit-Change-Number: 4461233
    Gerrit-PatchSet: 7
    Gerrit-Owner: Alexander Cooper <alco...@chromium.org>
    Gerrit-Reviewer: Alexander Cooper <alco...@chromium.org>
    Gerrit-Reviewer: Brandon Jones <baj...@chromium.org>
    Gerrit-Reviewer: Findit <findit...@appspot.gserviceaccount.com>
    Gerrit-Reviewer: Kenneth Russell <k...@chromium.org>
    Gerrit-CC: Piotr Bialecki <bia...@chromium.org>
    Gerrit-Attention: Piotr Bialecki <bia...@chromium.org>
    Gerrit-Attention: Alexander Cooper <alco...@chromium.org>
    Gerrit-Attention: Kenneth Russell <k...@chromium.org>
    Gerrit-Comment-Date: Thu, 27 Apr 2023 21:51:06 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    Comment-In-Reply-To: Brandon Jones <baj...@chromium.org>
    Comment-In-Reply-To: Alexander Cooper <alco...@chromium.org>

    Viatcheslav Ostapenko (Gerrit)

    unread,
    Apr 28, 2023, 12:44:07 PM4/28/23
    to Alexander Cooper, chromium-a...@chromium.org, droger+w...@chromium.org, extension...@chromium.org, feature-v...@chromium.org, Brandon Jones, Piotr Bialecki, Findit, Kenneth Russell, Tricium, Chromium LUCI CQ, chromium...@chromium.org

    Attention is currently required from: Alexander Cooper, Kenneth Russell, Piotr Bialecki.

    View Change

    1 comment:

    To view, visit change 4461233. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I9bdfe5938f3f08efbc62c8d40fe0ec0dc6a0754f
    Gerrit-Change-Number: 4461233
    Gerrit-PatchSet: 7
    Gerrit-Owner: Alexander Cooper <alco...@chromium.org>
    Gerrit-Reviewer: Alexander Cooper <alco...@chromium.org>
    Gerrit-Reviewer: Brandon Jones <baj...@chromium.org>
    Gerrit-Reviewer: Findit <findit...@appspot.gserviceaccount.com>
    Gerrit-Reviewer: Kenneth Russell <k...@chromium.org>
    Gerrit-CC: Piotr Bialecki <bia...@chromium.org>
    Gerrit-CC: Viatcheslav Ostapenko <sl.ost...@samsung.com>
    Gerrit-Attention: Piotr Bialecki <bia...@chromium.org>
    Gerrit-Attention: Alexander Cooper <alco...@chromium.org>
    Gerrit-Attention: Kenneth Russell <k...@chromium.org>
    Gerrit-Comment-Date: Fri, 28 Apr 2023 16:43:57 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No

    Alexander Cooper (Gerrit)

    unread,
    Apr 28, 2023, 2:51:33 PM4/28/23
    to Geoff Lang, chromium-a...@chromium.org, droger+w...@chromium.org, extension...@chromium.org, feature-v...@chromium.org, Brandon Jones, Findit, Kenneth Russell

    Attention is currently required from: Brandon Jones, Geoff Lang, Kenneth Russell, Piotr Bialecki.

    Alexander Cooper would like Geoff Lang to review this change.

    View Change

    29 files changed, 551 insertions(+), 214 deletions(-)


    To view, visit change 4461233. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-MessageType: newchange
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I9bdfe5938f3f08efbc62c8d40fe0ec0dc6a0754f
    Gerrit-Change-Number: 4461233
    Gerrit-PatchSet: 9
    Gerrit-Owner: Alexander Cooper <alco...@chromium.org>
    Gerrit-Reviewer: Alexander Cooper <alco...@chromium.org>
    Gerrit-Reviewer: Brandon Jones <baj...@chromium.org>
    Gerrit-Reviewer: Findit <findit...@appspot.gserviceaccount.com>
    Gerrit-Reviewer: Geoff Lang <geof...@chromium.org>
    Gerrit-Reviewer: Kenneth Russell <k...@chromium.org>
    Gerrit-CC: Piotr Bialecki <bia...@chromium.org>
    Gerrit-CC: Viatcheslav Ostapenko <sl.ost...@samsung.com>
    Gerrit-Attention: Brandon Jones <baj...@chromium.org>
    Gerrit-Attention: Piotr Bialecki <bia...@chromium.org>
    Gerrit-Attention: Geoff Lang <geof...@chromium.org>
    Gerrit-Attention: Kenneth Russell <k...@chromium.org>

    Alexander Cooper (Gerrit)

    unread,
    Apr 28, 2023, 2:51:39 PM4/28/23
    to chromium-a...@chromium.org, droger+w...@chromium.org, extension...@chromium.org, feature-v...@chromium.org, Geoff Lang, Viatcheslav Ostapenko, Brandon Jones, Piotr Bialecki, Findit, Kenneth Russell, Tricium, Chromium LUCI CQ, chromium...@chromium.org

    Attention is currently required from: Brandon Jones, Geoff Lang, Kenneth Russell, Piotr Bialecki.

    Patch set 9:Auto-Submit +1

    View Change

    1 comment:

    • Patchset:

      • Patch Set #9:

        Geoff could I get a +1 for the (moved) ui/gl DEP (from device/vr/android to device/vr)? I think Ken had intended to just stamp after Brandon's +1, but he looks to be OOO today.

    To view, visit change 4461233. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I9bdfe5938f3f08efbc62c8d40fe0ec0dc6a0754f
    Gerrit-Change-Number: 4461233
    Gerrit-PatchSet: 9
    Gerrit-Owner: Alexander Cooper <alco...@chromium.org>
    Gerrit-Reviewer: Alexander Cooper <alco...@chromium.org>
    Gerrit-Reviewer: Brandon Jones <baj...@chromium.org>
    Gerrit-Reviewer: Findit <findit...@appspot.gserviceaccount.com>
    Gerrit-Reviewer: Geoff Lang <geof...@chromium.org>
    Gerrit-Reviewer: Kenneth Russell <k...@chromium.org>
    Gerrit-CC: Piotr Bialecki <bia...@chromium.org>
    Gerrit-CC: Viatcheslav Ostapenko <sl.ost...@samsung.com>
    Gerrit-Attention: Brandon Jones <baj...@chromium.org>
    Gerrit-Attention: Piotr Bialecki <bia...@chromium.org>
    Gerrit-Attention: Geoff Lang <geof...@chromium.org>
    Gerrit-Attention: Kenneth Russell <k...@chromium.org>
    Gerrit-Comment-Date: Fri, 28 Apr 2023 18:51:30 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes

    Geoff Lang (Gerrit)

    unread,
    May 1, 2023, 11:21:34 AM5/1/23
    to Alexander Cooper, chromium-a...@chromium.org, droger+w...@chromium.org, extension...@chromium.org, feature-v...@chromium.org, Viatcheslav Ostapenko, Brandon Jones, Piotr Bialecki, Findit, Kenneth Russell, Tricium, Chromium LUCI CQ, chromium...@chromium.org

    Attention is currently required from: Alexander Cooper, Brandon Jones, Kenneth Russell, Piotr Bialecki.

    Patch set 9:Code-Review +1Commit-Queue +2

    View Change

      To view, visit change 4461233. To unsubscribe, or for help writing mail filters, visit settings.

      Gerrit-MessageType: comment
      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: I9bdfe5938f3f08efbc62c8d40fe0ec0dc6a0754f
      Gerrit-Change-Number: 4461233
      Gerrit-PatchSet: 9
      Gerrit-Owner: Alexander Cooper <alco...@chromium.org>
      Gerrit-Reviewer: Alexander Cooper <alco...@chromium.org>
      Gerrit-Reviewer: Brandon Jones <baj...@chromium.org>
      Gerrit-Reviewer: Findit <findit...@appspot.gserviceaccount.com>
      Gerrit-Reviewer: Geoff Lang <geof...@chromium.org>
      Gerrit-Reviewer: Kenneth Russell <k...@chromium.org>
      Gerrit-CC: Piotr Bialecki <bia...@chromium.org>
      Gerrit-CC: Viatcheslav Ostapenko <sl.ost...@samsung.com>
      Gerrit-Attention: Brandon Jones <baj...@chromium.org>
      Gerrit-Attention: Piotr Bialecki <bia...@chromium.org>
      Gerrit-Attention: Alexander Cooper <alco...@chromium.org>
      Gerrit-Attention: Kenneth Russell <k...@chromium.org>
      Gerrit-Comment-Date: Mon, 01 May 2023 15:21:18 +0000
      Gerrit-HasComments: No
      Gerrit-Has-Labels: Yes

      Chromium LUCI CQ (Gerrit)

      unread,
      May 1, 2023, 1:45:42 PM5/1/23
      to Alexander Cooper, chromium-a...@chromium.org, droger+w...@chromium.org, extension...@chromium.org, feature-v...@chromium.org, Geoff Lang, Viatcheslav Ostapenko, Brandon Jones, Piotr Bialecki, Findit, Kenneth Russell, Tricium, chromium...@chromium.org

      Chromium LUCI CQ submitted this change.

      View Change

      Approvals: Brandon Jones: Looks good to me Geoff Lang: Looks good to me; Commit Alexander Cooper: Send CL to CQ automatically after approval
      Begin building OpenXr on Android

      Refactors windows-specific code that has crept into the OpenXr classes
      by currently wrapping most of them in ifdefs. In a few cases I've
      extracted some classes to use temporarily to allow key methods to remain
      visible for Android (BeginFrame and InitSession the most critical).
      Some of these classes will change slightly with other refactor work that
      was identified and some would be good candidates for future cleanup.

      At the moment, OpenXr is not added as a supported runtime on Android,
      this simply begins it building on Android. Future changes will hook up
      the rest of the stack to consider/query for an OpenXr runtime.


      Bug: 1435548
      Change-Id: I9bdfe5938f3f08efbc62c8d40fe0ec0dc6a0754f
      Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4461233
      Auto-Submit: Alexander Cooper <alco...@chromium.org>
      Reviewed-by: Brandon Jones <baj...@chromium.org>
      Commit-Queue: Geoff Lang <geof...@chromium.org>
      Reviewed-by: Geoff Lang <geof...@chromium.org>
      Cr-Commit-Position: refs/heads/main@{#1137896}

      To view, visit change 4461233. To unsubscribe, or for help writing mail filters, visit settings.

      Gerrit-MessageType: merged
      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: I9bdfe5938f3f08efbc62c8d40fe0ec0dc6a0754f
      Gerrit-Change-Number: 4461233
      Gerrit-PatchSet: 10
      Gerrit-Owner: Alexander Cooper <alco...@chromium.org>
      Gerrit-Reviewer: Alexander Cooper <alco...@chromium.org>
      Gerrit-Reviewer: Brandon Jones <baj...@chromium.org>
      Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
      Gerrit-Reviewer: Findit <findit...@appspot.gserviceaccount.com>
      Gerrit-Reviewer: Geoff Lang <geof...@chromium.org>
      Gerrit-Reviewer: Kenneth Russell <k...@chromium.org>
      Reply all
      Reply to author
      Forward
      0 new messages