WebXR Layers: Fix clearOnAccess [chromium/src : main]

0 views
Skip to first unread message

Alexander Cooper (Gerrit)

unread,
Feb 3, 2026, 5:14:13 PM (11 days ago) Feb 3
to Yong Li (xWF), Brandon Jones, Evgenii Alekseev (xWF), Chromium LUCI CQ, chromium...@chromium.org, blink-...@chromium.org, feature-v...@chromium.org, jmedle...@chromium.org
Attention needed from Brandon Jones, Evgenii Alekseev (xWF) and Yong Li (xWF)

Alexander Cooper added 4 comments

Patchset-level comments
File-level comment, Patchset 1 (Latest):
Alexander Cooper . resolved

I'm a bit confused on the timing here, we're not clearing it on access we're clearing it at the end of access?

File third_party/blink/renderer/modules/xr/xr_swap_chain.h
Line 34, Patchset 1 (Latest): OnCurrentTextureProduced();
Alexander Cooper . unresolved

Maybe `OnTextureAccessed()` ? And maybe it should happen outside of the if? Otherwise, I think we aren't always clearing it?

File third_party/blink/renderer/modules/xr/xr_webgl_binding.cc
Line 132, Patchset 1 (Latest): // clear the old buffer.
Alexander Cooper . unresolved

Can you elaborate? Or maybe just indicate that it's because it'll handle the clearing? Even if it does, any harm in storing it?

File third_party/blink/renderer/modules/xr/xr_webgl_swap_chain.cc
Line 156, Patchset 1 (Latest): if (descriptor().clear_on_access) {
Alexander Cooper . unresolved

Doesn't seem right? It may not have been accessed here?

Open in Gerrit

Related details

Attention is currently required from:
  • Brandon Jones
  • Evgenii Alekseev (xWF)
  • Yong Li (xWF)
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: Iecefa85004a2db8bcb74541963442ef2667e9c59
Gerrit-Change-Number: 7541834
Gerrit-PatchSet: 1
Gerrit-Owner: Yong Li (xWF) <yyon...@google.com>
Gerrit-Reviewer: Alexander Cooper <alco...@chromium.org>
Gerrit-Reviewer: Brandon Jones <baj...@chromium.org>
Gerrit-Reviewer: Evgenii Alekseev (xWF) <eale...@google.com>
Gerrit-Reviewer: Yong Li (xWF) <yyon...@google.com>
Gerrit-Attention: Yong Li (xWF) <yyon...@google.com>
Gerrit-Attention: Brandon Jones <baj...@chromium.org>
Gerrit-Attention: Evgenii Alekseev (xWF) <eale...@google.com>
Gerrit-Comment-Date: Tue, 03 Feb 2026 22:14:01 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Yong Li (xWF) (Gerrit)

unread,
Feb 4, 2026, 9:11:10 AM (11 days ago) Feb 4
to Alexander Cooper, Brandon Jones, Evgenii Alekseev (xWF), Chromium LUCI CQ, chromium...@chromium.org, blink-...@chromium.org, feature-v...@chromium.org, jmedle...@chromium.org
Attention needed from Alexander Cooper, Brandon Jones and Evgenii Alekseev (xWF)

Yong Li (xWF) added 3 comments

File third_party/blink/renderer/modules/xr/xr_swap_chain.h
Line 34, Patchset 1 (Latest): OnCurrentTextureProduced();
Alexander Cooper . unresolved

Maybe `OnTextureAccessed()` ? And maybe it should happen outside of the if? Otherwise, I think we aren't always clearing it?

Yong Li (xWF)

This is for the shared image swapchain. In that case the texture is reset after each frame. Moving it out of the if will make it called too frequently

File third_party/blink/renderer/modules/xr/xr_webgl_binding.cc
Line 132, Patchset 1 (Latest): // clear the old buffer.
Alexander Cooper . unresolved

Can you elaborate? Or maybe just indicate that it's because it'll handle the clearing? Even if it does, any harm in storing it?

Yong Li (xWF)

The texture array wrapper will clear the buffer. The original swap chain will always be fully rewritten from the wrapper. This is only about performance.

File third_party/blink/renderer/modules/xr/xr_webgl_swap_chain.cc
Line 156, Patchset 1 (Latest): if (descriptor().clear_on_access) {
Alexander Cooper . unresolved

Doesn't seem right? It may not have been accessed here?

Yong Li (xWF)

Yeah, I do see the currently solution is confusing. Basically this CL uses different strategy for shared image swapchain and others.

I will try to unify the 2 solutions.

Open in Gerrit

Related details

Attention is currently required from:
  • Alexander Cooper
  • Brandon Jones
  • Evgenii Alekseev (xWF)
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: Iecefa85004a2db8bcb74541963442ef2667e9c59
Gerrit-Change-Number: 7541834
Gerrit-PatchSet: 1
Gerrit-Owner: Yong Li (xWF) <yyon...@google.com>
Gerrit-Reviewer: Alexander Cooper <alco...@chromium.org>
Gerrit-Reviewer: Brandon Jones <baj...@chromium.org>
Gerrit-Reviewer: Evgenii Alekseev (xWF) <eale...@google.com>
Gerrit-Reviewer: Yong Li (xWF) <yyon...@google.com>
Gerrit-Attention: Brandon Jones <baj...@chromium.org>
Gerrit-Attention: Alexander Cooper <alco...@chromium.org>
Gerrit-Attention: Evgenii Alekseev (xWF) <eale...@google.com>
Gerrit-Comment-Date: Wed, 04 Feb 2026 14:11:05 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Alexander Cooper <alco...@chromium.org>
satisfied_requirement
unsatisfied_requirement
open
diffy

Yong Li (xWF) (Gerrit)

unread,
Feb 4, 2026, 11:26:44 AM (11 days ago) Feb 4
to Alexander Cooper, Brandon Jones, Evgenii Alekseev (xWF), Chromium LUCI CQ, chromium...@chromium.org, blink-...@chromium.org, feature-v...@chromium.org, jmedle...@chromium.org
Attention needed from Alexander Cooper, Brandon Jones and Evgenii Alekseev (xWF)

Yong Li (xWF) added 2 comments

File third_party/blink/renderer/modules/xr/xr_swap_chain.h
Line 34, Patchset 1: OnCurrentTextureProduced();
Alexander Cooper . resolved

Maybe `OnTextureAccessed()` ? And maybe it should happen outside of the if? Otherwise, I think we aren't always clearing it?

Yong Li (xWF)

This is for the shared image swapchain. In that case the texture is reset after each frame. Moving it out of the if will make it called too frequently

Yong Li (xWF)

Got a new solution

File third_party/blink/renderer/modules/xr/xr_webgl_swap_chain.cc
Line 156, Patchset 1: if (descriptor().clear_on_access) {
Alexander Cooper . resolved

Doesn't seem right? It may not have been accessed here?

Yong Li (xWF)

Yeah, I do see the currently solution is confusing. Basically this CL uses different strategy for shared image swapchain and others.

I will try to unify the 2 solutions.

Yong Li (xWF)

Done

Gerrit-Comment-Date: Wed, 04 Feb 2026 16:26:39 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Yong Li (xWF) <yyon...@google.com>
Comment-In-Reply-To: Alexander Cooper <alco...@chromium.org>
satisfied_requirement
unsatisfied_requirement
open
diffy

Alexander Cooper (Gerrit)

unread,
Feb 4, 2026, 1:06:24 PM (11 days ago) Feb 4
to Yong Li (xWF), Brandon Jones, Evgenii Alekseev (xWF), Chromium LUCI CQ, chromium...@chromium.org, blink-...@chromium.org, feature-v...@chromium.org, jmedle...@chromium.org
Attention needed from Brandon Jones, Evgenii Alekseev (xWF) and Yong Li (xWF)

Alexander Cooper voted and added 3 comments

Votes added by Alexander Cooper

Code-Review+1

3 comments

Patchset-level comments
File-level comment, Patchset 2 (Latest):
Alexander Cooper . resolved

LGTM

File third_party/blink/renderer/modules/xr/xr_webgl_binding.cc
Line 132, Patchset 1: // clear the old buffer.
Alexander Cooper . unresolved

Can you elaborate? Or maybe just indicate that it's because it'll handle the clearing? Even if it does, any harm in storing it?

Yong Li (xWF)

The texture array wrapper will clear the buffer. The original swap chain will always be fully rewritten from the wrapper. This is only about performance.

Alexander Cooper

Will this boolean be used if the texture type is texture array? If not, maybe worth just setting it anyway.

File third_party/blink/renderer/modules/xr/xr_webgl_cubemap_swap_chain.cc
Line 117, Patchset 2 (Latest): // Copy the wrapped swap chain's descriptor and divide its width by the
// number of requested layers.
Alexander Cooper . unresolved

outdated comment

Open in Gerrit

Related details

Attention is currently required from:
  • Brandon Jones
  • Evgenii Alekseev (xWF)
  • Yong Li (xWF)
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement satisfiedCode-Owners
  • requirement is not 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: Iecefa85004a2db8bcb74541963442ef2667e9c59
Gerrit-Change-Number: 7541834
Gerrit-PatchSet: 2
Gerrit-Owner: Yong Li (xWF) <yyon...@google.com>
Gerrit-Reviewer: Alexander Cooper <alco...@chromium.org>
Gerrit-Reviewer: Brandon Jones <baj...@chromium.org>
Gerrit-Reviewer: Evgenii Alekseev (xWF) <eale...@google.com>
Gerrit-Reviewer: Yong Li (xWF) <yyon...@google.com>
Gerrit-Attention: Yong Li (xWF) <yyon...@google.com>
Gerrit-Attention: Brandon Jones <baj...@chromium.org>
Gerrit-Attention: Evgenii Alekseev (xWF) <eale...@google.com>
Gerrit-Comment-Date: Wed, 04 Feb 2026 18:06:11 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
satisfied_requirement
unsatisfied_requirement
open
diffy

Yong Li (xWF) (Gerrit)

unread,
Feb 4, 2026, 1:19:12 PM (11 days ago) Feb 4
to Alexander Cooper, Brandon Jones, Evgenii Alekseev (xWF), Chromium LUCI CQ, chromium...@chromium.org, blink-...@chromium.org, feature-v...@chromium.org, jmedle...@chromium.org
Attention needed from Alexander Cooper, Brandon Jones and Evgenii Alekseev (xWF)

Yong Li (xWF) added 1 comment

File third_party/blink/renderer/modules/xr/xr_webgl_binding.cc
Line 132, Patchset 1: // clear the old buffer.
Alexander Cooper . unresolved

Can you elaborate? Or maybe just indicate that it's because it'll handle the clearing? Even if it does, any harm in storing it?

Yong Li (xWF)

The texture array wrapper will clear the buffer. The original swap chain will always be fully rewritten from the wrapper. This is only about performance.

Alexander Cooper

Will this boolean be used if the texture type is texture array? If not, maybe worth just setting it anyway.

Yong Li (xWF)

the texture array swapchain will set the clear_on_access to init->clearOnAccess(). I will update the comments to make it more clear.

Open in Gerrit

Related details

Attention is currently required from:
  • Alexander Cooper
  • Brandon Jones
  • Evgenii Alekseev (xWF)
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement satisfiedCode-Owners
  • requirement is not 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: Iecefa85004a2db8bcb74541963442ef2667e9c59
Gerrit-Change-Number: 7541834
Gerrit-PatchSet: 2
Gerrit-Owner: Yong Li (xWF) <yyon...@google.com>
Gerrit-Reviewer: Alexander Cooper <alco...@chromium.org>
Gerrit-Reviewer: Brandon Jones <baj...@chromium.org>
Gerrit-Reviewer: Evgenii Alekseev (xWF) <eale...@google.com>
Gerrit-Reviewer: Yong Li (xWF) <yyon...@google.com>
Gerrit-Attention: Brandon Jones <baj...@chromium.org>
Gerrit-Attention: Alexander Cooper <alco...@chromium.org>
Gerrit-Attention: Evgenii Alekseev (xWF) <eale...@google.com>
Gerrit-Comment-Date: Wed, 04 Feb 2026 18:19:04 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Alexander Cooper (Gerrit)

unread,
Feb 4, 2026, 2:13:34 PM (10 days ago) Feb 4
to Yong Li (xWF), Brandon Jones, Evgenii Alekseev (xWF), Chromium LUCI CQ, chromium...@chromium.org, blink-...@chromium.org, feature-v...@chromium.org, jmedle...@chromium.org
Attention needed from Brandon Jones, Evgenii Alekseev (xWF) and Yong Li (xWF)

Alexander Cooper voted and added 2 comments

Votes added by Alexander Cooper

Code-Review+1

2 comments

File third_party/blink/renderer/modules/xr/xr_webgl_binding.cc
Line 132, Patchset 1: // clear the old buffer.
Alexander Cooper . resolved

Can you elaborate? Or maybe just indicate that it's because it'll handle the clearing? Even if it does, any harm in storing it?

Yong Li (xWF)

The texture array wrapper will clear the buffer. The original swap chain will always be fully rewritten from the wrapper. This is only about performance.

Alexander Cooper

Will this boolean be used if the texture type is texture array? If not, maybe worth just setting it anyway.

Yong Li (xWF)

the texture array swapchain will set the clear_on_access to init->clearOnAccess(). I will update the comments to make it more clear.

Alexander Cooper

Done

File third_party/blink/renderer/modules/xr/xr_webgl_cubemap_swap_chain.cc
Line 117, Patchset 2: // Copy the wrapped swap chain's descriptor and divide its width by the

// number of requested layers.
Alexander Cooper . resolved

outdated comment

Alexander Cooper

Done

Open in Gerrit

Related details

Attention is currently required from:
  • Brandon Jones
  • Evgenii Alekseev (xWF)
  • Yong Li (xWF)
Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement satisfiedCode-Owners
    • requirement is not 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: Iecefa85004a2db8bcb74541963442ef2667e9c59
    Gerrit-Change-Number: 7541834
    Gerrit-PatchSet: 3
    Gerrit-Owner: Yong Li (xWF) <yyon...@google.com>
    Gerrit-Reviewer: Alexander Cooper <alco...@chromium.org>
    Gerrit-Reviewer: Brandon Jones <baj...@chromium.org>
    Gerrit-Reviewer: Evgenii Alekseev (xWF) <eale...@google.com>
    Gerrit-Reviewer: Yong Li (xWF) <yyon...@google.com>
    Gerrit-Attention: Yong Li (xWF) <yyon...@google.com>
    Gerrit-Attention: Brandon Jones <baj...@chromium.org>
    Gerrit-Attention: Evgenii Alekseev (xWF) <eale...@google.com>
    Gerrit-Comment-Date: Wed, 04 Feb 2026 19:13:21 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Brandon Jones (Gerrit)

    unread,
    Feb 5, 2026, 12:36:41 PM (10 days ago) Feb 5
    to Yong Li (xWF), Alexander Cooper, Evgenii Alekseev (xWF), Chromium LUCI CQ, chromium...@chromium.org, blink-...@chromium.org, feature-v...@chromium.org, jmedle...@chromium.org
    Attention needed from Evgenii Alekseev (xWF) and Yong Li (xWF)

    Brandon Jones voted and added 1 comment

    Votes added by Brandon Jones

    Code-Review+1

    1 comment

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

    LGTM, thank you!

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Evgenii Alekseev (xWF)
    • Yong Li (xWF)
    Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement 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: Iecefa85004a2db8bcb74541963442ef2667e9c59
      Gerrit-Change-Number: 7541834
      Gerrit-PatchSet: 3
      Gerrit-Owner: Yong Li (xWF) <yyon...@google.com>
      Gerrit-Reviewer: Alexander Cooper <alco...@chromium.org>
      Gerrit-Reviewer: Brandon Jones <baj...@chromium.org>
      Gerrit-Reviewer: Evgenii Alekseev (xWF) <eale...@google.com>
      Gerrit-Reviewer: Yong Li (xWF) <yyon...@google.com>
      Gerrit-Attention: Yong Li (xWF) <yyon...@google.com>
      Gerrit-Attention: Evgenii Alekseev (xWF) <eale...@google.com>
      Gerrit-Comment-Date: Thu, 05 Feb 2026 17:36:30 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: Yes
      satisfied_requirement
      open
      diffy

      Yong Li (xWF) (Gerrit)

      unread,
      Feb 5, 2026, 12:39:15 PM (10 days ago) Feb 5
      to Brandon Jones, Alexander Cooper, Evgenii Alekseev (xWF), Chromium LUCI CQ, chromium...@chromium.org, blink-...@chromium.org, feature-v...@chromium.org, jmedle...@chromium.org
      Attention needed from Evgenii Alekseev (xWF)

      Yong Li (xWF) voted Commit-Queue+2

      Commit-Queue+2
      Open in Gerrit

      Related details

      Attention is currently required from:
      • Evgenii Alekseev (xWF)
      Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement 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: Iecefa85004a2db8bcb74541963442ef2667e9c59
      Gerrit-Change-Number: 7541834
      Gerrit-PatchSet: 3
      Gerrit-Owner: Yong Li (xWF) <yyon...@google.com>
      Gerrit-Reviewer: Alexander Cooper <alco...@chromium.org>
      Gerrit-Reviewer: Brandon Jones <baj...@chromium.org>
      Gerrit-Reviewer: Evgenii Alekseev (xWF) <eale...@google.com>
      Gerrit-Reviewer: Yong Li (xWF) <yyon...@google.com>
      Gerrit-Attention: Evgenii Alekseev (xWF) <eale...@google.com>
      Gerrit-Comment-Date: Thu, 05 Feb 2026 17:39:07 +0000
      Gerrit-HasComments: No
      Gerrit-Has-Labels: Yes
      satisfied_requirement
      open
      diffy

      Chromium LUCI CQ (Gerrit)

      unread,
      Feb 5, 2026, 12:42:49 PM (10 days ago) Feb 5
      to Yong Li (xWF), Brandon Jones, Alexander Cooper, Evgenii Alekseev (xWF), chromium...@chromium.org, blink-...@chromium.org, feature-v...@chromium.org, jmedle...@chromium.org

      Chromium LUCI CQ submitted the change

      Change information

      Commit message:
      WebXR Layers: Fix clearOnAccess

      Clear buffers only when clearOnAccess is true.
      Bug: 480928724
      Change-Id: Iecefa85004a2db8bcb74541963442ef2667e9c59
      Reviewed-by: Alexander Cooper <alco...@chromium.org>
      Reviewed-by: Brandon Jones <baj...@chromium.org>
      Commit-Queue: Yong Li (xWF) <yyon...@google.com>
      Cr-Commit-Position: refs/heads/main@{#1580196}
      Files:
      • M third_party/blink/renderer/modules/xr/xr_layer_init.idl
      • M third_party/blink/renderer/modules/xr/xr_swap_chain.h
      • M third_party/blink/renderer/modules/xr/xr_webgl_binding.cc
      • M third_party/blink/renderer/modules/xr/xr_webgl_binding.h
      • M third_party/blink/renderer/modules/xr/xr_webgl_cubemap_swap_chain.cc
      • M third_party/blink/renderer/modules/xr/xr_webgl_cubemap_swap_chain.h
      • M third_party/blink/renderer/modules/xr/xr_webgl_swap_chain.cc
      • M third_party/blink/renderer/modules/xr/xr_webgl_swap_chain.h
      • M third_party/blink/renderer/modules/xr/xr_webgl_texture_array_swap_chain.cc
      • M third_party/blink/renderer/modules/xr/xr_webgl_texture_array_swap_chain.h
      Change size: M
      Delta: 10 files changed, 65 insertions(+), 29 deletions(-)
      Branch: refs/heads/main
      Submit Requirements:
      • requirement satisfiedCode-Review: +1 by Brandon Jones, +1 by Alexander Cooper
      Open in Gerrit
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: merged
      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: Iecefa85004a2db8bcb74541963442ef2667e9c59
      Gerrit-Change-Number: 7541834
      Gerrit-PatchSet: 4
      Gerrit-Owner: Yong Li (xWF) <yyon...@google.com>
      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: Evgenii Alekseev (xWF) <eale...@google.com>
      Gerrit-Reviewer: Yong Li (xWF) <yyon...@google.com>
      open
      diffy
      satisfied_requirement
      Reply all
      Reply to author
      Forward
      0 new messages