[blink][xr] Separate camera texture processing from OnFrameEnd() [chromium/src : main]

0 views
Skip to first unread message

Mingjing Zhang (Gerrit)

unread,
Mar 10, 2026, 8:25:46 AM (6 days ago) Mar 10
to Vasiliy Telezhnikov, Chromium LUCI CQ, chromium...@chromium.org, blink-...@chromium.org, feature-v...@chromium.org
Attention needed from Vasiliy Telezhnikov

Mingjing Zhang added 1 comment

File third_party/blink/renderer/modules/xr/xr_render_state.cc
Line 145, Patchset 2 (Latest): base_layer_->SubmitLayer();
Mingjing Zhang . unresolved

Note: this separation is more involved than the `OnFrameStart()` case. In the old `OnFrameEnd()`, the camera texture related code happens before `SubmitLayer()`, so when I isolated the camera texture code, I need to also isolate the `SubmitLayer()` code into a separate function to ensure the code execution order.

Open in Gerrit

Related details

Attention is currently required from:
  • Vasiliy Telezhnikov
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: I5ce682cefad25fda75f94b5f2bbe63cf45d94e11
Gerrit-Change-Number: 7638003
Gerrit-PatchSet: 2
Gerrit-Owner: Mingjing Zhang <mjz...@chromium.org>
Gerrit-Reviewer: Mingjing Zhang <mjz...@chromium.org>
Gerrit-Reviewer: Vasiliy Telezhnikov <vas...@chromium.org>
Gerrit-Attention: Vasiliy Telezhnikov <vas...@chromium.org>
Gerrit-Comment-Date: Tue, 10 Mar 2026 12:25:24 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Vasiliy Telezhnikov (Gerrit)

unread,
Mar 10, 2026, 3:36:50 PM (5 days ago) Mar 10
to Mingjing Zhang, Chromium LUCI CQ, chromium...@chromium.org, blink-...@chromium.org, feature-v...@chromium.org
Attention needed from Mingjing Zhang

Vasiliy Telezhnikov voted and added 3 comments

Votes added by Vasiliy Telezhnikov

Code-Review+1

3 comments

Patchset-level comments
File-level comment, Patchset 2 (Latest):
Vasiliy Telezhnikov . resolved

lgtm % nit, thanks.

File third_party/blink/renderer/modules/xr/xr_render_state.cc
Line 145, Patchset 2 (Latest): base_layer_->SubmitLayer();
Mingjing Zhang . unresolved

Note: this separation is more involved than the `OnFrameStart()` case. In the old `OnFrameEnd()`, the camera texture related code happens before `SubmitLayer()`, so when I isolated the camera texture code, I need to also isolate the `SubmitLayer()` code into a separate function to ensure the code execution order.

Vasiliy Telezhnikov

I think ordering doesn't really matter, so we could call `OnFrameEndForCamera` before `OnFrameEnd`.

Maybe we should land this CL (% another comment) as is and then in a separate CL reorder `OnFrameEndWithoutSubmit` and `OnFrameEndForCamera` (with a kill-switch if you prefer).

After that we can merge `OnFrameEndWithoutSubmit()` and `SubmitLayer()` (eventually).

But this won't block us moving `OnFrameStartForCamera` and `OnFrameEndForCamera` to XRRenderState with relevant variables.

File third_party/blink/renderer/modules/xr/xr_webgl_layer.cc
Line 447, Patchset 2 (Latest): if (camera_image_texture_scoped_access_) {
gpu::SharedImageTexture::ScopedAccess::EndAccess(
std::move(camera_image_texture_scoped_access_));
camera_image_shared_image_texture_.reset();
}
Vasiliy Telezhnikov . unresolved

nit: I think we should move this too. Ordering wise it wil stay the same, `OnFrameEndWithoutSubmit` will call only the part above if session ended and return early and `OnFrameEndForCamera` would call camera part and return early.

Open in Gerrit

Related details

Attention is currently required from:
  • Mingjing Zhang
Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement 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: I5ce682cefad25fda75f94b5f2bbe63cf45d94e11
    Gerrit-Change-Number: 7638003
    Gerrit-PatchSet: 2
    Gerrit-Owner: Mingjing Zhang <mjz...@chromium.org>
    Gerrit-Reviewer: Mingjing Zhang <mjz...@chromium.org>
    Gerrit-Reviewer: Vasiliy Telezhnikov <vas...@chromium.org>
    Gerrit-Attention: Mingjing Zhang <mjz...@chromium.org>
    Gerrit-Comment-Date: Tue, 10 Mar 2026 19:36:45 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    Comment-In-Reply-To: Mingjing Zhang <mjz...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Mingjing Zhang (Gerrit)

    unread,
    Mar 11, 2026, 11:05:04 AM (5 days ago) Mar 11
    to Vasiliy Telezhnikov, Chromium LUCI CQ, chromium...@chromium.org, blink-...@chromium.org, feature-v...@chromium.org

    Mingjing Zhang added 2 comments

    File third_party/blink/renderer/modules/xr/xr_render_state.cc
    Line 145, Patchset 2: base_layer_->SubmitLayer();
    Mingjing Zhang . resolved

    Note: this separation is more involved than the `OnFrameStart()` case. In the old `OnFrameEnd()`, the camera texture related code happens before `SubmitLayer()`, so when I isolated the camera texture code, I need to also isolate the `SubmitLayer()` code into a separate function to ensure the code execution order.

    Vasiliy Telezhnikov

    I think ordering doesn't really matter, so we could call `OnFrameEndForCamera` before `OnFrameEnd`.

    Maybe we should land this CL (% another comment) as is and then in a separate CL reorder `OnFrameEndWithoutSubmit` and `OnFrameEndForCamera` (with a kill-switch if you prefer).

    After that we can merge `OnFrameEndWithoutSubmit()` and `SubmitLayer()` (eventually).

    But this won't block us moving `OnFrameStartForCamera` and `OnFrameEndForCamera` to XRRenderState with relevant variables.

    Mingjing Zhang

    Acknowledged

    File third_party/blink/renderer/modules/xr/xr_webgl_layer.cc
    Line 447, Patchset 2: if (camera_image_texture_scoped_access_) {

    gpu::SharedImageTexture::ScopedAccess::EndAccess(
    std::move(camera_image_texture_scoped_access_));
    camera_image_shared_image_texture_.reset();
    }
    Vasiliy Telezhnikov . resolved

    nit: I think we should move this too. Ordering wise it wil stay the same, `OnFrameEndWithoutSubmit` will call only the part above if session ended and return early and `OnFrameEndForCamera` would call camera part and return early.

    Mingjing Zhang

    Done

    Open in Gerrit

    Related details

    Attention set is empty
    Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement is not satisfiedCode-Owners
      • requirement satisfiedCode-Review
      • requirement 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: I5ce682cefad25fda75f94b5f2bbe63cf45d94e11
      Gerrit-Change-Number: 7638003
      Gerrit-PatchSet: 3
      Gerrit-Owner: Mingjing Zhang <mjz...@chromium.org>
      Gerrit-Reviewer: Mingjing Zhang <mjz...@chromium.org>
      Gerrit-Reviewer: Vasiliy Telezhnikov <vas...@chromium.org>
      Gerrit-Comment-Date: Wed, 11 Mar 2026 15:04:31 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Mingjing Zhang <mjz...@chromium.org>
      Comment-In-Reply-To: Vasiliy Telezhnikov <vas...@chromium.org>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Alexander Cooper (Gerrit)

      unread,
      Mar 12, 2026, 1:27:51 PM (3 days ago) Mar 12
      to Mingjing Zhang, Vasiliy Telezhnikov, Chromium LUCI CQ, chromium...@chromium.org, blink-...@chromium.org, feature-v...@chromium.org
      Attention needed from Mingjing Zhang

      Alexander Cooper added 3 comments

      Commit Message
      Line 9, Patchset 3 (Latest):Now that camera textures are only associated with the base layer, we
      no longer need the camera texture processing logic in OnFrameEnd() for
      non-base layer cases. In this CL, we extract the camera texture
      Alexander Cooper . unresolved

      I wonder if it wouldn't just be cleaner to pass a value when creating the base layer of if it needs to be concerned about the camera image or not, since not every session has the camera image, and I can imagine that in the future we may want to special case how the camera image is handled when we support e.g. not using the base layers but still providing the camera image.

      File third_party/blink/renderer/modules/xr/xr_render_state.cc
      Line 143, Patchset 3 (Latest): base_layer_->OnFrameEndWithoutSubmit();
      Alexander Cooper . unresolved

      The creation of this method doesn't seem documented, and I'm a bit confused why it is needed?

      File third_party/blink/renderer/modules/xr/xr_webgl_layer.cc
      Line 400, Patchset 3 (Latest): if (session()->ended()) {
      Alexander Cooper . unresolved

      Add comment about session end here as well.

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Mingjing Zhang
      Submit Requirements:
        • requirement satisfiedCode-Coverage
        • requirement is not satisfiedCode-Owners
        • requirement satisfiedCode-Review
        • requirement is not satisfiedNo-Unresolved-Comments
        • requirement 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: I5ce682cefad25fda75f94b5f2bbe63cf45d94e11
        Gerrit-Change-Number: 7638003
        Gerrit-PatchSet: 3
        Gerrit-Owner: Mingjing Zhang <mjz...@chromium.org>
        Gerrit-Reviewer: Alexander Cooper <alco...@chromium.org>
        Gerrit-Reviewer: Mingjing Zhang <mjz...@chromium.org>
        Gerrit-Reviewer: Vasiliy Telezhnikov <vas...@chromium.org>
        Gerrit-Attention: Mingjing Zhang <mjz...@chromium.org>
        Gerrit-Comment-Date: Thu, 12 Mar 2026 17:27:42 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy
        Reply all
        Reply to author
        Forward
        0 new messages