Skip to content

Conversation

beaufortfrancois
Copy link
Collaborator

@beaufortfrancois beaufortfrancois commented Apr 17, 2025

This PR adds the possibility for users to pick bc4-r-unorm and astc-12x12-unorm brain images in the "Volume Rendering - Texture 3D" sample.

@beaufortfrancois
Copy link
Collaborator Author

FYI @mehmetoguzderin

@beaufortfrancois
Copy link
Collaborator Author

@mwyrzykowski I've noticed using the bc4-r-unorm texture format in this sample is causing the canvas camera to be stuck somehow... Is this a known issue with Safari Tech Preview or am I holding it wrong?

bc4-safari.mov

@mwyrzykowski
Copy link
Contributor

Ah looks like we were rejecting 3D compressed texture creation even when the extension was enabled, thanks for catching @beaufortfrancois

I suppose the sample could detect the validation error we generated but I addressed it with https://bugs.webkit.org/show_bug.cgi?id=291690:

Screen.Recording.2025-04-17.at.10.55.29.AM.mov

kainino0x added a commit to kainino0x/webgpu-samples that referenced this pull request Apr 17, 2025
These errors aren't supposed to happen in the samples, but if they do,
we want them to be visible. Otherwise they can only be seen in the dev
tools console, and sometimes you can't tell that the sample is
misbehaving, e.g.:
webgpu#501 (comment)
kainino0x added a commit to kainino0x/webgpu-samples that referenced this pull request Apr 17, 2025
These errors aren't supposed to happen in the samples, but if they do,
we want them to be visible. Otherwise they can only be seen in the dev
tools console, and sometimes you can't tell that the sample is
misbehaving, e.g.:
webgpu#501 (comment)
@kainino0x
Copy link
Collaborator

Ah looks like we were rejecting 3D compressed texture creation even when the extension was enabled, thanks for catching

@mwyrzykowski Is it firing the GPUDevice uncapturederror event? The samples are supposed to pop up a dialog if that happens.

@mwyrzykowski
Copy link
Contributor

Ah looks like we were rejecting 3D compressed texture creation even when the extension was enabled, thanks for catching

@mwyrzykowski Is it firing the GPUDevice uncapturederror event? The samples are supposed to pop up a dialog if that happens.

@kainino0x it appears the related CTS tests https://gpuweb.github.io/cts/standalone/?q=webgpu:api,validation,error_scope:* and https://gpuweb.github.io/cts/standalone/?q=webgpu:api,operation,uncapturederror:* are passing in WebKit as the pattern from https://www.w3.org/TR/webgpu/#example-bf3af559 works in WebKit

But the method used in the samples:

  device.onuncapturederror = (ev) => {
    fail(`Uncaptured error:\n${ev.error.message}`);
  };

does not. Replacing that with:

    device.addEventListener('uncapturederror', (ev) => {
        fail(`Uncaptured error:\n${ev.error.message}`);
    });

results in:
Screenshot 2025-04-17 at 5 14 42 PM

@beaufortfrancois
Copy link
Collaborator Author

@mwyrzykowski My understanding is that both device.onuncapturederror = ... and device.addEventListener('uncapturederror', ... should work. Is this an STP issue?

@kainino0x
Copy link
Collaborator

Thank you for investigating, Mike! Filed CTS bug gpuweb/cts#4361

beaufortfrancois pushed a commit that referenced this pull request Apr 18, 2025
These errors aren't supposed to happen in the samples, but if they do,
we want them to be visible. Otherwise they can only be seen in the dev
tools console, and sometimes you can't tell that the sample is
misbehaving, e.g.:
#501 (comment)
@beaufortfrancois beaufortfrancois changed the title Add BC4-unorm brain image Add bc4-r-unorm and astc-12x12-unorm brain images Apr 18, 2025
@beaufortfrancois
Copy link
Collaborator Author

@kainino0x I've added astc-12x12-unorm brain image as well in this PR.

@beaufortfrancois
Copy link
Collaborator Author

To illustrate the value of both formats, here's a Chromium DevTools network screenshot:

woohoo

@mwyrzykowski
Copy link
Contributor

@mwyrzykowski My understanding is that both device.onuncapturederror = ... and device.addEventListener('uncapturederror', ... should work. Is this an STP issue?

Yes, presumably so

@beaufortfrancois
Copy link
Collaborator Author

@mwyrzykowski My understanding is that both device.onuncapturederror = ... and device.addEventListener('uncapturederror', ... should work. Is this an STP issue?

Yes, presumably so

@mwyrzykowski I've tried https://red-triangle-webgpu.glitch.me/uncapturederror.html in Chrome, Firefox Nightly, and Safari Tech Preview.
Both Chrome and Firefox Nightly log "onuncapturederror" and "addEventListener("uncapturederror")" while Safari Tech Preview only logs "addEventListener("uncapturederror")"

@kainino0x kainino0x merged commit 292965f into webgpu:main Apr 18, 2025
1 check passed
@beaufortfrancois
Copy link
Collaborator Author

beaufortfrancois commented Apr 22, 2025 via email

@kainino0x
Copy link
Collaborator

The concerns there seem to be about brotli compression, but we only need decompression.

@beaufortfrancois
Copy link
Collaborator Author

According to whatwg/compression#34 (comment), Safari has Brotli support to Compression Streams by using Apple's Compression Framework. See WebKit/WebKit@0d3451c

@mdanowar3
Copy link

This is the most important part of the best interest way

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants