Open Bug 1880601 Opened 9 months ago Updated 8 months ago

[WebGPU] With readback, rendering is not updated on a Babylon.js demo (https://playground.babylonjs.com/#BCU1XR#0)

Categories

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

defect

Tracking

()

People

(Reporter: sotaro, Unassigned)

References

(Depends on 1 open bug, Blocks 3 open bugs)

Details

Attachments

(2 files)

Use latest Nightly, by default readback for present is enabled by default.
go to https://playground.babylonjs.com/#BCU1XR#0
From the top right, select "WEBGPU"

The rendering of the demo was not updated.

Blocks: webgpu-apps
Blocks: 1879694

With latest nightly the problem is addressed for me.

Status: NEW → RESOLVED
Closed: 9 months ago
Resolution: --- → WORKSFORME

I have the Nightly with buildid https://hg.mozilla.org/mozilla-central/rev/f8dd4015fa59fee3a1a74c00cd2393a9578e49f0 . I can still repro this bug and bug 1879694

Flags: needinfo?(sotaro.ikeda.g)

OK, thank you.

Status: RESOLVED → REOPENED
Flags: needinfo?(sotaro.ikeda.g)
Resolution: WORKSFORME → ---

Babylon version 5.7.1.1 does not show this bug. But the "Latest" version of babylon (V6.4.3 as of 22Feb2024) does show this behaviour.
Versions of babylon can be toggled from the menu at the top-right.

(In reply to Mayank Bansal from comment #2)

I have the Nightly with buildid https://hg.mozilla.org/mozilla-central/rev/f8dd4015fa59fee3a1a74c00cd2393a9578e49f0 . I can still repro this bug and bug 1879694

Sorry, I forgot to change from WebGL2 to WebGPU.

Flags: needinfo?(egubler)
Severity: -- → S3
Flags: needinfo?(egubler)
Attached file logout with nightly

During loading the site, logout had "Device::create_shader_module error".

:ErichDonGubler, can you comment to comment6?

Flags: needinfo?(egubler)

:sotaro: If you examine the shader compilation message emitted at the error level in the console, you'll see:

Shader '' parsing error: expected global item ('struct', 'const', 'var', 'alias', ';', 'fn') or the end of the file, found 'diagnostic'
  ┌─ wgsl:1:1
  │
1 │ diagnostic(off, derivative_uniformity);
  │ ^^^^^^^^^^ expected global item ('struct', 'const', 'var', 'alias', ';', 'fn') or the end of the file

I just filed bug 1882800 to track this particular issue, which is that diagnostic filters are not implemented in naga (which backs WebGPU's shader compilation). It should be possible to remove diagnostic filter statements and, since webgpu-uniformity-analysis is not implemented yet and things otherwise should Just Work™.

I'll see if I can reproduce this issue on modified source. We might want to create our own MRE in order to keep working on this.

Depends on: 1882800
Flags: needinfo?(egubler)
Assignee: nobody → egubler
Status: REOPENED → ASSIGNED

Passing investigation on to :sotaro.

Assignee: egubler → sotaro.ikeda.g

With the STR, log out also had the following error message. It might be related to Bug 1827116.


[ERROR wgpu_core::device::global] Device::create_shader_module error:
Shader '' parsing error: unknown type: 'texture_external'
┌─ wgsl:3:45

3 │ @group(0) @binding(1) var videoTexture: texture_external;
│ ^^^^^^^^^^^^^^^^ unknown type

:ErichDonGubler, is there an issue of wgpu for 'texture_external'?

Flags: needinfo?(egubler)

:sotaro: There is, and that bug is webgpu-external-textures. However, I don't think that the flickering in the OP of this bug is a blocker, since the 5.71.1 version of the demo works on both readback and non-readback paths?

Flags: needinfo?(egubler)

From Bug 1879694 Comment 11, the flickering did not happen when external texture is not recycled. The rendering was displayed momentarily at first and the rest of the time, the rendering was white. The flickering seemed happen by showing old obsoleted WebGPU contents.

From the above, with "Latest" version of babylon, rendering seemed not updated when creating shader module was failed.

With Attachment 9391932 [details] [diff], different external texture is used for each readback. With it, the rendering was displayed momentarily at first and the rest of the time, the rendering was white.

It also seemed to say that rendering of WebGPU seemed not updated when creating shader module was failed.

My investigation was completed. Reassign to :ErichDonGubler.

Assignee: sotaro.ikeda.g → egubler

(In reply to Erich Gubler [:ErichDonGubler] from comment #12)

:sotaro: There is, and that bug is webgpu-external-textures. However, I don't think that the flickering in the OP of this bug is a blocker, since the 5.71.1 version of the demo works on both readback and non-readback paths?

Yea, it should not be a blocker of Bug 1843891. It seems like a problem of latest Babylon.
The problem seemed to happen when shader compile failed.

Bug 1885490 is going to add a way to disable RemoteTexture recycling for WebGPU. It could be used to check if obsoleted content caused the flickering.

The remaining scope of this issue is: we're not sure why BabylonJS isn't trying to render after shader compilation fails. We believe that some changes to shaders related to bug 1882800 are causing us to reject standards-compliant shaders, which BabylonJS doesn't attempt to recover from. Triaging as a P2, to match bug 1882800.

Un-assigning from myself, since I'm not putting active effort into investigating this, ATM.

Assignee: egubler → nobody
Status: ASSIGNED → NEW
Priority: -- → P2
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: