WebXR: add enforcement for opaque textures [chromium/src : main]

0 views
Skip to first unread message

Piotr Bialecki (Gerrit)

unread,
Jun 24, 2022, 12:54:05 PM6/24/22
to Brandon Jones, blink-...@chromium.org

Attention is currently required from: Brandon Jones.

Piotr Bialecki would like Brandon Jones to review this change.

View Change

WebXR: add enforcement for opaque textures

This should implement the limitations that are introduced by the concept
of opaque textures. For details, see:
https://www.w3.org/TR/webxrlayers-1/#xropaquetextures

Bug: 1104340
Change-Id: Ibae7457646aadea5cf26479ffb051eaedfad1294
---
M third_party/blink/renderer/modules/webgl/webgl2_rendering_context_base.cc
M third_party/blink/renderer/modules/webgl/webgl_rendering_context_base.cc
M third_party/blink/renderer/modules/webgl/webgl_rendering_context_base.h
M third_party/blink/renderer/modules/webgl/webgl_texture.h
M third_party/blink/renderer/modules/webgl/webgl_unowned_texture.h
5 files changed, 170 insertions(+), 14 deletions(-)


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

Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Ibae7457646aadea5cf26479ffb051eaedfad1294
Gerrit-Change-Number: 3712481
Gerrit-PatchSet: 5
Gerrit-Owner: Piotr Bialecki <bia...@chromium.org>
Gerrit-Reviewer: Brandon Jones <baj...@chromium.org>
Gerrit-Reviewer: Piotr Bialecki <bia...@chromium.org>
Gerrit-Attention: Brandon Jones <baj...@chromium.org>
Gerrit-MessageType: newchange

Piotr Bialecki (Gerrit)

unread,
Jun 24, 2022, 12:54:09 PM6/24/22
to blink-...@chromium.org, Brandon Jones, Chromium LUCI CQ, chromium...@chromium.org

Attention is currently required from: Brandon Jones.

View Change

1 comment:

  • Patchset:

    • Patch Set #5:

      bajones@, PTAL when you have a moment. I intend the changes to only affect opaque textures - tests will likely have to happen in raw camera access API WPTs, unless you have some advice on how this could be tested now.

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

Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Ibae7457646aadea5cf26479ffb051eaedfad1294
Gerrit-Change-Number: 3712481
Gerrit-PatchSet: 5
Gerrit-Owner: Piotr Bialecki <bia...@chromium.org>
Gerrit-Reviewer: Brandon Jones <baj...@chromium.org>
Gerrit-Reviewer: Piotr Bialecki <bia...@chromium.org>
Gerrit-Attention: Brandon Jones <baj...@chromium.org>
Gerrit-Comment-Date: Fri, 24 Jun 2022 16:54:03 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment

Brandon Jones (Gerrit)

unread,
Jun 27, 2022, 12:18:13 PM6/27/22
to Piotr Bialecki, blink-...@chromium.org, Chromium LUCI CQ, chromium...@chromium.org

Attention is currently required from: Piotr Bialecki.

View Change

3 comments:

  • Patchset:

    • Patch Set #5:

      Logic looks good across the board, but I feel like the CL could be quite a bit more compact if we shifted where the validation was happening.

  • File third_party/blink/renderer/modules/webgl/webgl_rendering_context_base.cc:

    • Patch Set #5, Line 2397: } else if (tex->IsOpaqueTexture()) {

      Could this check be added to `ValidateTexture2DBinding` instead, with an arg that could be passed into that method that indicates if opaque textures are allowed or not? (Defaulted to false, possibly, since it seems like texture operations that allow opaque textures are the minority.)

    • Patch Set #5, Line 5417: if (auto* tex = ValidateTexImageBinding(params); !tex) {

      `ValidateTexImageBinding` calls into `ValidateTexture2DBinding`, and every single usage of `ValidateTexImageBinding` also blocks opaque textures, so if the opaque check is added to `ValidateTexture2DBinding` then you'd get this behavior for free.

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

Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Ibae7457646aadea5cf26479ffb051eaedfad1294
Gerrit-Change-Number: 3712481
Gerrit-PatchSet: 5
Gerrit-Owner: Piotr Bialecki <bia...@chromium.org>
Gerrit-Reviewer: Brandon Jones <baj...@chromium.org>
Gerrit-Reviewer: Piotr Bialecki <bia...@chromium.org>
Gerrit-Attention: Piotr Bialecki <bia...@chromium.org>
Gerrit-Comment-Date: Mon, 27 Jun 2022 16:18:05 +0000

Piotr Bialecki (Gerrit)

unread,
Jun 27, 2022, 8:11:35 PM6/27/22
to blink-...@chromium.org, Brandon Jones, Chromium LUCI CQ, chromium...@chromium.org

Attention is currently required from: Brandon Jones.

Patch set 8:Commit-Queue +1

View Change

2 comments:

  • File third_party/blink/renderer/modules/webgl/webgl_rendering_context_base.cc:

    • Could this check be added to `ValidateTexture2DBinding` instead, with an arg that could be passed in […]

      Added, but note that texStorage* calls we have did not have any validation done so we can't rely on any of the helpers (the validations would cause different errors being raised, which the conformance tests don't like).

    • `ValidateTexImageBinding` calls into `ValidateTexture2DBinding`, and every single usage of `Validate […]

      Done

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

Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Ibae7457646aadea5cf26479ffb051eaedfad1294
Gerrit-Change-Number: 3712481
Gerrit-PatchSet: 8
Gerrit-Owner: Piotr Bialecki <bia...@chromium.org>
Gerrit-Reviewer: Brandon Jones <baj...@chromium.org>
Gerrit-Reviewer: Piotr Bialecki <bia...@chromium.org>
Gerrit-Attention: Brandon Jones <baj...@chromium.org>
Gerrit-Comment-Date: Tue, 28 Jun 2022 00:11:25 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Comment-In-Reply-To: Brandon Jones <baj...@chromium.org>
Gerrit-MessageType: comment

Brandon Jones (Gerrit)

unread,
Jun 28, 2022, 11:56:26 AM6/28/22
to Piotr Bialecki, blink-...@chromium.org, Chromium LUCI CQ, chromium...@chromium.org

Attention is currently required from: Piotr Bialecki.

Patch set 8:Code-Review +1

View Change

1 comment:

  • Patchset:

    • Patch Set #8:

      Thanks for making the update! This LGTM now, it's certainly a lot less noisy.

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

Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Ibae7457646aadea5cf26479ffb051eaedfad1294
Gerrit-Change-Number: 3712481
Gerrit-PatchSet: 8
Gerrit-Owner: Piotr Bialecki <bia...@chromium.org>
Gerrit-Reviewer: Brandon Jones <baj...@chromium.org>
Gerrit-Reviewer: Piotr Bialecki <bia...@chromium.org>
Gerrit-Attention: Piotr Bialecki <bia...@chromium.org>
Gerrit-Comment-Date: Tue, 28 Jun 2022 15:56:18 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment

Piotr Bialecki (Gerrit)

unread,
Jun 28, 2022, 1:37:36 PM6/28/22
to blink-...@chromium.org, Brandon Jones, Chromium LUCI CQ, chromium...@chromium.org

Attention is currently required from: Piotr Bialecki.

Patch set 8:Commit-Queue +2

View Change

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

    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Ibae7457646aadea5cf26479ffb051eaedfad1294
    Gerrit-Change-Number: 3712481
    Gerrit-PatchSet: 8
    Gerrit-Owner: Piotr Bialecki <bia...@chromium.org>
    Gerrit-Reviewer: Brandon Jones <baj...@chromium.org>
    Gerrit-Reviewer: Piotr Bialecki <bia...@chromium.org>
    Gerrit-Attention: Piotr Bialecki <bia...@chromium.org>
    Gerrit-Comment-Date: Tue, 28 Jun 2022 17:37:28 +0000
    Gerrit-HasComments: No
    Gerrit-Has-Labels: Yes
    Gerrit-MessageType: comment

    Chromium LUCI CQ (Gerrit)

    unread,
    Jun 28, 2022, 1:42:46 PM6/28/22
    to Piotr Bialecki, blink-...@chromium.org, Brandon Jones, chromium...@chromium.org

    Chromium LUCI CQ submitted this change.

    View Change


    Approvals: Brandon Jones: Looks good to me Piotr Bialecki: Commit
    WebXR: add enforcement for opaque textures

    This should implement the limitations that are introduced by the concept
    of opaque textures. For details, see:
    https://www.w3.org/TR/webxrlayers-1/#xropaquetextures

    Bug: 1104340
    Change-Id: Ibae7457646aadea5cf26479ffb051eaedfad1294
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3712481
    Reviewed-by: Brandon Jones <baj...@chromium.org>
    Commit-Queue: Piotr Bialecki <bia...@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#1018755}
    ---
    M third_party/blink/renderer/modules/webgl/webgl2_rendering_context_base.cc
    M third_party/blink/renderer/modules/webgl/webgl2_rendering_context_base.h

    M third_party/blink/renderer/modules/webgl/webgl_rendering_context_base.cc
    M third_party/blink/renderer/modules/webgl/webgl_rendering_context_base.h
    M third_party/blink/renderer/modules/webgl/webgl_texture.h
    M third_party/blink/renderer/modules/webgl/webgl_unowned_texture.h
    6 files changed, 109 insertions(+), 20 deletions(-)


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

    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Ibae7457646aadea5cf26479ffb051eaedfad1294
    Gerrit-Change-Number: 3712481
    Gerrit-PatchSet: 9
    Gerrit-Owner: Piotr Bialecki <bia...@chromium.org>
    Gerrit-Reviewer: Brandon Jones <baj...@chromium.org>
    Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
    Gerrit-Reviewer: Piotr Bialecki <bia...@chromium.org>
    Gerrit-MessageType: merged
    Reply all
    Reply to author
    Forward
    0 new messages