Open Bug 1977241 Opened 6 months ago Updated 2 months ago

Categories

(Core :: Graphics: WebGPU, defect, P3)

defect

Tracking

()

People

(Reporter: ErichDonGubler, Unassigned)

References

(Blocks 1 open bug, )

Details

No description provided.

Symptoms on macOS: WebGPU reports an internal error with the message Texture view format Rgba8UnormSrgb is not storage bindable to the web console.

Symptoms on Windows: panic on GPUCommandEncoder.finish like this one with the message GraphicsCommandList::close failed: The parameter is incorrect. (0x80070057).

The error under macOS is interesting. The code is not trying to write to a texture view with Rgba8UnormSrgb format, but to a texture that has that format as one of its viewFormats. Maybe a solution would be to specify the view format explicitly when creating the texture view? I'll play with that to see if that helps.

Regardless, this code is still in development and may not be correct, but Firefox should not crash!

Providing the non-srgb format explicitly in the call to createView does not seem to solve the problem.

What the application is trying to do is to use linear filtering when creating the mipmap chain. For this it creates a texture with:

                format: "rgba8unorm",
                viewFormats: ["rgba8unorm", "rgba8unorm-srgb"]

When sampling the texture it creates a view with the sRGB format, and when using it for storage it creates a view with the non-sRGB format. A workaround would be to use non-sRGB views in both cases and perform the sRGB to linear conversion in the shader manually, but it's faster and convenient to rely on the hardware sRGB conversion.

Fixing Bug 1825419 would probably have helped diagnose this.

See Also: → 1825419
Blocks: webgpu-apps

P3: popular demo

Priority: -- → P3

I just wanted to check in to see if there's been any progress on this issue.

This bug can now be reproduced using the GLTF three.js example in the spark.js repository:

https://github.com/ludicon/spark.js

I'm not able to reproduce this issue on Firefox Nightly as of 2025-10-29. Ignacio, are you able to reproduce, still?

Flags: needinfo?(castano)

Ah, I'm able to reproduce this with Spark⚡ AVIF portions of the demo on first load, but not on subsequent navigations between them. I'm also not getting a crash anymore in Windows. 🤔

Yes, it appears that Firefox on windows does not crash anymore!

However, it doesn't yet produce the expected output, neither on windows, nor on macOS.

In the first example (that used to crash) the expected result is a stretched Netflix thumbnail. This example is scaling the input texture to a multiple of 4 and encoding the result to BC7/ASTC. The resizing kernel needs to write to an sRGB texture through a non-srgb texture view.

In the Spark GLTF demo the problem is the same. The albedo/diffuse texture is missing, because albedo is stored in sRGB color space and the mipmap generation kernel needs to write to an sRGB texture through a non-srgb texture view.

In this case, you can see the following messages in the console:

Uncaptured WebGPU error: Texture view format Rgba8UnormSrgb is not storage bindable
Uncaptured WebGPU error: TextureView with '' label is invalid
Uncaptured WebGPU error: In a pass parameter, caused by: Encoder is invalid

There are various ways I could work around this issue (perform sRGB conversion manually in the shader, or use fragment shaders instead of compute). I'm intentionally leaving this as is for now in order to have a repro case and improve Firefox's WebGPU conformance (WebKit and Chromium handle this correctly already).

Flags: needinfo?(castano)
You need to log in before you can comment on or make changes to this bug.