Integrate Android mesh manager into OpenXR device and scene understanding [chromium/src : main]

0 views
Skip to first unread message

Brandon Jones (Gerrit)

unread,
Mar 5, 2026, 4:39:28 PM (10 days ago) Mar 5
to Adam Ren (xWF), Code Review Nudger, Alexander Cooper, David Li, AyeAye, feature-v...@chromium.org
Attention needed from Adam Ren (xWF) and Alexander Cooper

Brandon Jones added 2 comments

Patchset-level comments
File-level comment, Patchset 9 (Latest):
Brandon Jones . resolved

Oops! Sorry, I didn't realize that I missed reviewing this patch in the middle of the rest of them.

File device/vr/openxr/openxr_api_wrapper.cc
Line 440, Patchset 9 (Latest): if (!mesh_manager_) {
Brandon Jones . unresolved

Why do we have two different paths for getting a mesh manager?

EDIT: Okay, I see that there's a fallback mesh manager here that constructs the meshes from the hit test planes. It would be useful to have a comment here and maybe elsewhere explaining the difference between the two.

Open in Gerrit

Related details

Attention is currently required from:
  • Adam Ren (xWF)
  • Alexander Cooper
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I3c4d0710ac744695752be71c70e8d77f2fe7f5b0
Gerrit-Change-Number: 7579918
Gerrit-PatchSet: 9
Gerrit-Owner: Adam Ren (xWF) <ada...@google.com>
Gerrit-Reviewer: Alexander Cooper <alco...@chromium.org>
Gerrit-Reviewer: Brandon Jones <baj...@chromium.org>
Gerrit-CC: Code Review Nudger <android-build...@prod.google.com>
Gerrit-CC: David Li <dav...@google.com>
Gerrit-Attention: Adam Ren (xWF) <ada...@google.com>
Gerrit-Attention: Alexander Cooper <alco...@chromium.org>
Gerrit-Comment-Date: Thu, 05 Mar 2026 21:39:17 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Adam Ren (xWF) (Gerrit)

unread,
Mar 11, 2026, 2:47:42 AM (5 days ago) Mar 11
to Brandon Jones, Code Review Nudger, Alexander Cooper, David Li, AyeAye, feature-v...@chromium.org
Attention needed from Alexander Cooper and Brandon Jones

Adam Ren (xWF) added 1 comment

File device/vr/openxr/openxr_api_wrapper.cc
Line 440, Patchset 9: if (!mesh_manager_) {
Brandon Jones . resolved

Why do we have two different paths for getting a mesh manager?

EDIT: Okay, I see that there's a fallback mesh manager here that constructs the meshes from the hit test planes. It would be useful to have a comment here and maybe elsewhere explaining the difference between the two.

Adam Ren (xWF)

Thanks Brandon, it has been added.

Open in Gerrit

Related details

Attention is currently required from:
  • Alexander Cooper
  • Brandon Jones
Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I3c4d0710ac744695752be71c70e8d77f2fe7f5b0
    Gerrit-Change-Number: 7579918
    Gerrit-PatchSet: 11
    Gerrit-Owner: Adam Ren (xWF) <ada...@google.com>
    Gerrit-Reviewer: Alexander Cooper <alco...@chromium.org>
    Gerrit-Reviewer: Brandon Jones <baj...@chromium.org>
    Gerrit-CC: Code Review Nudger <android-build...@prod.google.com>
    Gerrit-CC: David Li <dav...@google.com>
    Gerrit-Attention: Brandon Jones <baj...@chromium.org>
    Gerrit-Attention: Alexander Cooper <alco...@chromium.org>
    Gerrit-Comment-Date: Wed, 11 Mar 2026 06:47:34 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Brandon Jones <baj...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Alexander Cooper (Gerrit)

    unread,
    Mar 12, 2026, 5:13:36 PM (3 days ago) Mar 12
    to Adam Ren (xWF), Brandon Jones, Code Review Nudger, David Li, AyeAye, extension...@chromium.org, chromium-a...@chromium.org, feature-v...@chromium.org
    Attention needed from Adam Ren (xWF) and Brandon Jones

    Alexander Cooper added 11 comments

    File device/vr/openxr/android/openxr_scene_understanding_manager_android.h
    Line 36, Patchset 14 (Latest): OpenXrMeshManager* GetMeshManager() override;
    Alexander Cooper . unresolved

    I'm not seeing any reason that the MeshManager needs to be included in the SceneUnderstandingManagerAndroid? From my talks with the OpenXR team, the extensions that are supported by this manager are deprecated and so we'd likely remove this in the future. As mentioned before, it may result in some more complex logic, but we shouldn't tie the mesh stuff to this manager.

    File device/vr/openxr/android/openxr_scene_understanding_manager_android.cc
    Line 30, Patchset 14 (Latest): : mojo_space_(mojo_space), view_space_(view_space) {
    Alexander Cooper . unresolved

    I don't see why this needs to be a member variable if this *does* need to stick around in this class.

    File device/vr/openxr/msft/openxr_scene_understanding_manager_msft.cc
    Line 68, Patchset 14 (Latest): // TODO: Implement MSFT mesh manager support in future CL
    Alexander Cooper . unresolved

    TODO's should have bugs associated, and TBH, I don't think this even needs a TODO?

    File device/vr/openxr/openxr_api_wrapper.cc
    Line 437, Patchset 14 (Latest): // Prefer the scene understanding manager's mesh manager when available.
    if (scene_understanding_manager_) {
    if (auto* mesh_manager = scene_understanding_manager_->GetMeshManager()) {
    return mesh_manager;
    }
    }

    // Fallback: use mesh_manager_.
    if (!mesh_manager_) {
    XrSpace view_space = GetReferenceSpace(mojom::XRReferenceSpaceType::kViewer);
    if (view_space != XR_NULL_HANDLE) {
    mesh_manager_ = extension_helper_->CreateMeshManager(
    session_, local_space_, view_space);
    }
    Alexander Cooper . unresolved

    Ideally we just assign this item as part of the setup steps rather than having this logic here, TBH this is the logic that should probably be hidden in the ExtensionHelper::CreateMeshManager class. Note that creating it here is essentially lazy creation which we don't want anymore, as it could mean that we'd not create a mesh_manager_ if it was required.

    Line 557, Patchset 14 (Latest): // requested, use CreateMeshManager directly to avoid CHECK failure in
    // CreateSceneUnderstandingManager.
    Alexander Cooper . unresolved

    We should elaborate on what that is/why it's there not just that there's a CHECK failure.

    Line 574, Patchset 14 (Latest): XrSpace view_space = GetReferenceSpace(mojom::XRReferenceSpaceType::kViewer);
    Alexander Cooper . unresolved

    Why does the mesh manager need view space? That could be passed in on a per-frame basis, as it's often not something we've created by this point.

    File device/vr/openxr/openxr_spatial_framework_manager.h
    Line 38, Patchset 14 (Latest): OpenXrMeshManager* GetMeshManager() override;
    Alexander Cooper . unresolved

    ISTM that this is getting tied to the OpenXRSceneUnderstandingManager from the simplification that the SpatialFrameworkManager *is* a SceneUnderstandingManager, and that is perhaps an assumption we should work to break. I guess I'm not sure how we'd do meshes for the MSFT extension if that needs to be incorporated in it's framework, but I don't think the other approach you've created for meshes *requires* that it be part of the Android SceneUnderstandingManager?

    The original purpose of the SceneUnderstandingManager was to ensure that the "managers" or "features" that needed to be guaranteed that the same underlying system was being used could be guaranteed to be used (e.g. Planes/Hit-Tests/Anchors all interact with each other at a low-level). I don't think that's the state for the SceneUnderstandingManager *in general*, though the spatial entities one obviously still uses the same framework and falls-back to using plane data?

    A full split of how spatial entites stuff is handled is an unfair split to ask of you, so probably worth a bug to be filed; but we shouldn't e.g. shoe-horn the other feature into the OpenXrSceneUnderstandingManagerANDROID (which is really meant to be the XR_ANDROID trackables framework), just because of it. We should leverage some separate fallback logic for it's creation based on e.g. that knowledge.

    File device/vr/openxr/openxr_spatial_framework_manager.cc
    Line 312, Patchset 14 (Latest): // TODO: MESH_DETECTION should have its own ::IsSupported check
    // (e.g. OpenXrMeshManager::IsSupported()).
    Alexander Cooper . unresolved

    Please do this before landing

    File device/vr/openxr/openxr_spatial_mesh_manager.h
    Line 61, Patchset 14 (Latest): std::optional<device::Pose> TryGetMojoFromMesh(uint64_t mesh_id) const;
    Alexander Cooper . unresolved

    MeshId, never use the bare uint64_t for IDs. (And below)

    File device/vr/openxr/openxr_spatial_mesh_manager.cc
    Line 20, Patchset 14 (Latest):const char* AlignmentToString(XrSpatialPlaneAlignmentEXT alignment) {
    switch (alignment) {
    case XR_SPATIAL_PLANE_ALIGNMENT_HORIZONTAL_UPWARD_EXT:
    return "HORIZONTAL_UP";
    case XR_SPATIAL_PLANE_ALIGNMENT_HORIZONTAL_DOWNWARD_EXT:
    return "HORIZONTAL_DOWN";
    case XR_SPATIAL_PLANE_ALIGNMENT_VERTICAL_EXT:
    return "VERTICAL";
    case XR_SPATIAL_PLANE_ALIGNMENT_ARBITRARY_EXT:
    return "ARBITRARY";
    default:
    return "UNKNOWN";
    }
    }
    Alexander Cooper . unresolved

    Just print the number or convert it to the mojo type and print that number. In general this just increases the binary size for debug data.

    Line 96, Patchset 14 (Latest): // TODO: Consider merging OpenXrSpatialMeshManager into OpenXrSpatialPlaneManager
    // since mesh detection here is tightly coupled with plane tracking (Mesh2D is a
    // component of XR_SPATIAL_CAPABILITY_PLANE_TRACKING_EXT). If a more general
    // mesh manager is needed later, it can be created separately and receive a
    // reference to the plane manager.
    Alexander Cooper . unresolved

    I think we should just do this now, as there's a *lot* of duplicated logic with the plane tracking code here.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Adam Ren (xWF)
    • Brandon Jones
    Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement is not satisfiedCode-Owners
      • requirement is not satisfiedCode-Review
      • requirement is not satisfiedNo-Unresolved-Comments
      • requirement is not satisfiedReview-Enforcement
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: comment
      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: I3c4d0710ac744695752be71c70e8d77f2fe7f5b0
      Gerrit-Change-Number: 7579918
      Gerrit-PatchSet: 14
      Gerrit-Owner: Adam Ren (xWF) <ada...@google.com>
      Gerrit-Reviewer: Alexander Cooper <alco...@chromium.org>
      Gerrit-Reviewer: Brandon Jones <baj...@chromium.org>
      Gerrit-CC: Code Review Nudger <android-build...@prod.google.com>
      Gerrit-CC: David Li <dav...@google.com>
      Gerrit-Attention: Adam Ren (xWF) <ada...@google.com>
      Gerrit-Attention: Brandon Jones <baj...@chromium.org>
      Gerrit-Comment-Date: Thu, 12 Mar 2026 21:13:24 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Adam Ren (xWF) (Gerrit)

      unread,
      Mar 15, 2026, 4:42:40 AM (20 hours ago) Mar 15
      to Brandon Jones, Code Review Nudger, Alexander Cooper, David Li, AyeAye, extension...@chromium.org, chromium-a...@chromium.org, feature-v...@chromium.org
      Attention needed from Alexander Cooper and Brandon Jones

      Adam Ren (xWF) added 11 comments

      File device/vr/openxr/android/openxr_scene_understanding_manager_android.h
      Line 36, Patchset 14: OpenXrMeshManager* GetMeshManager() override;
      Alexander Cooper . resolved

      I'm not seeing any reason that the MeshManager needs to be included in the SceneUnderstandingManagerAndroid? From my talks with the OpenXR team, the extensions that are supported by this manager are deprecated and so we'd likely remove this in the future. As mentioned before, it may result in some more complex logic, but we shouldn't tie the mesh stuff to this manager.

      Adam Ren (xWF)

      Sure, it has been removed from android manager.

      File device/vr/openxr/android/openxr_scene_understanding_manager_android.cc
      Line 30, Patchset 14: : mojo_space_(mojo_space), view_space_(view_space) {
      Alexander Cooper . resolved

      I don't see why this needs to be a member variable if this *does* need to stick around in this class.

      Adam Ren (xWF)

      It was kept for optimization purpose so that the queried submeshes can be centered around the user's view_space. I have switched to use "passing in on a per-frame basis"

      File device/vr/openxr/msft/openxr_scene_understanding_manager_msft.cc
      Line 68, Patchset 14: // TODO: Implement MSFT mesh manager support in future CL
      Alexander Cooper . resolved

      TODO's should have bugs associated, and TBH, I don't think this even needs a TODO?

      Adam Ren (xWF)

      Yes, it has been removed.

      File device/vr/openxr/openxr_api_wrapper.cc
      Line 437, Patchset 14: // Prefer the scene understanding manager's mesh manager when available.

      if (scene_understanding_manager_) {
      if (auto* mesh_manager = scene_understanding_manager_->GetMeshManager()) {
      return mesh_manager;
      }
      }

      // Fallback: use mesh_manager_.
      if (!mesh_manager_) {
      XrSpace view_space = GetReferenceSpace(mojom::XRReferenceSpaceType::kViewer);
      if (view_space != XR_NULL_HANDLE) {
      mesh_manager_ = extension_helper_->CreateMeshManager(
      session_, local_space_, view_space);
      }
      Alexander Cooper . resolved

      Ideally we just assign this item as part of the setup steps rather than having this logic here, TBH this is the logic that should probably be hidden in the ExtensionHelper::CreateMeshManager class. Note that creating it here is essentially lazy creation which we don't want anymore, as it could mean that we'd not create a mesh_manager_ if it was required.

      Adam Ren (xWF)

      Done

      Line 557, Patchset 14: // requested, use CreateMeshManager directly to avoid CHECK failure in
      // CreateSceneUnderstandingManager.
      Alexander Cooper . resolved

      We should elaborate on what that is/why it's there not just that there's a CHECK failure.

      Adam Ren (xWF)

      No scene understanding manager involvement, no comment about CHECK failures. This review comment is already resolved by the changes we made.

      Line 574, Patchset 14: XrSpace view_space = GetReferenceSpace(mojom::XRReferenceSpaceType::kViewer);
      Alexander Cooper . resolved

      Why does the mesh manager need view space? That could be passed in on a per-frame basis, as it's often not something we've created by this point.

      Adam Ren (xWF)

      Done

      File device/vr/openxr/openxr_spatial_framework_manager.h
      Line 38, Patchset 14: OpenXrMeshManager* GetMeshManager() override;
      Alexander Cooper . resolved

      ISTM that this is getting tied to the OpenXRSceneUnderstandingManager from the simplification that the SpatialFrameworkManager *is* a SceneUnderstandingManager, and that is perhaps an assumption we should work to break. I guess I'm not sure how we'd do meshes for the MSFT extension if that needs to be incorporated in it's framework, but I don't think the other approach you've created for meshes *requires* that it be part of the Android SceneUnderstandingManager?

      The original purpose of the SceneUnderstandingManager was to ensure that the "managers" or "features" that needed to be guaranteed that the same underlying system was being used could be guaranteed to be used (e.g. Planes/Hit-Tests/Anchors all interact with each other at a low-level). I don't think that's the state for the SceneUnderstandingManager *in general*, though the spatial entities one obviously still uses the same framework and falls-back to using plane data?

      A full split of how spatial entites stuff is handled is an unfair split to ask of you, so probably worth a bug to be filed; but we shouldn't e.g. shoe-horn the other feature into the OpenXrSceneUnderstandingManagerANDROID (which is really meant to be the XR_ANDROID trackables framework), just because of it. We should leverage some separate fallback logic for it's creation based on e.g. that knowledge.

      Adam Ren (xWF)

      Acknowledged. In this CL, mesh has been fully decoupled from OpenXRSceneUnderstandingManagerAndroid — it's now created and owned standalone by OpenXrApiWrapper. Filed bug b/492887842 to track splitting mesh out of the spatial framework in a future CL.

      File device/vr/openxr/openxr_spatial_framework_manager.cc
      Line 312, Patchset 14: // TODO: MESH_DETECTION should have its own ::IsSupported check
      // (e.g. OpenXrMeshManager::IsSupported()).
      Alexander Cooper . resolved

      Please do this before landing

      Adam Ren (xWF)

      Done

      File device/vr/openxr/openxr_spatial_mesh_manager.h
      Line 61, Patchset 14: std::optional<device::Pose> TryGetMojoFromMesh(uint64_t mesh_id) const;
      Alexander Cooper . resolved

      MeshId, never use the bare uint64_t for IDs. (And below)

      Adam Ren (xWF)

      Done

      File device/vr/openxr/openxr_spatial_mesh_manager.cc
      Line 20, Patchset 14:const char* AlignmentToString(XrSpatialPlaneAlignmentEXT alignment) {

      switch (alignment) {
      case XR_SPATIAL_PLANE_ALIGNMENT_HORIZONTAL_UPWARD_EXT:
      return "HORIZONTAL_UP";
      case XR_SPATIAL_PLANE_ALIGNMENT_HORIZONTAL_DOWNWARD_EXT:
      return "HORIZONTAL_DOWN";
      case XR_SPATIAL_PLANE_ALIGNMENT_VERTICAL_EXT:
      return "VERTICAL";
      case XR_SPATIAL_PLANE_ALIGNMENT_ARBITRARY_EXT:
      return "ARBITRARY";
      default:
      return "UNKNOWN";
      }
      }
      Alexander Cooper . resolved

      Just print the number or convert it to the mojo type and print that number. In general this just increases the binary size for debug data.

      Adam Ren (xWF)

      Done

      Line 96, Patchset 14: // TODO: Consider merging OpenXrSpatialMeshManager into OpenXrSpatialPlaneManager

      // since mesh detection here is tightly coupled with plane tracking (Mesh2D is a
      // component of XR_SPATIAL_CAPABILITY_PLANE_TRACKING_EXT). If a more general
      // mesh manager is needed later, it can be created separately and receive a
      // reference to the plane manager.
      Alexander Cooper . resolved

      I think we should just do this now, as there's a *lot* of duplicated logic with the plane tracking code here.

      Adam Ren (xWF)

      The spatial entity mesh API is still not fully ready. I'd prefer to defer this merge. If the mesh2D component ends up working differently than expected, we'd have to undo the merge.

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Alexander Cooper
      • Brandon Jones
      Submit Requirements:
        • requirement satisfiedCode-Coverage
        • requirement is not satisfiedCode-Owners
        • requirement is not satisfiedCode-Review
        • requirement is not satisfiedReview-Enforcement
        Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
        Gerrit-MessageType: comment
        Gerrit-Project: chromium/src
        Gerrit-Branch: main
        Gerrit-Change-Id: I3c4d0710ac744695752be71c70e8d77f2fe7f5b0
        Gerrit-Change-Number: 7579918
        Gerrit-PatchSet: 20
        Gerrit-Owner: Adam Ren (xWF) <ada...@google.com>
        Gerrit-Reviewer: Alexander Cooper <alco...@chromium.org>
        Gerrit-Reviewer: Brandon Jones <baj...@chromium.org>
        Gerrit-CC: Code Review Nudger <android-build...@prod.google.com>
        Gerrit-CC: David Li <dav...@google.com>
        Gerrit-Attention: Brandon Jones <baj...@chromium.org>
        Gerrit-Attention: Alexander Cooper <alco...@chromium.org>
        Gerrit-Comment-Date: Sun, 15 Mar 2026 08:42:28 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No
        Comment-In-Reply-To: Alexander Cooper <alco...@chromium.org>
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy
        Reply all
        Reply to author
        Forward
        0 new messages