Open Bug 1882960 Opened 7 months ago Updated 4 months ago

Rendering WebGPU with offscreen canvas seems to have no effect

Categories

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

Firefox 125
defect

Tracking

()

REOPENED

People

(Reporter: tenghong.yap, Unassigned)

References

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

Details

Attachments

(3 files)

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36

Steps to reproduce:

I have a small WebAssembly App which perform the WebGPU render call in the worker thread using a offscreen canvas.
The rendered offscreen canvas is then transferred over to a '2D' context offscreen canvas for Image data extraction.
The extracted Image data is then post over to main thread for display.

Actual results:

Image is not shown on the main thread canvas.
The Image data extracted from the '2D' context offscreen canvas shows no data within the result array.

Expected results:

Image should shown on the main thread canvas
The Image data extracted should contain data.

Similar code behavior is implemented on "webgpu in a worker" sample.
The sample also shows nothing is rendered
https://webgpu.github.io/webgpu-samples/samples/worker

Tested on Firefox Browser Nightly
125.0a1 (2024-02-29) (64-bit)

This is a dupe of bug 1818042, so I'll close in favor of that. However, I'm sure that the repro steps will be appreciated there, still; dupes usually get checked for functionality like this. Having a concrete way to test whether we're actually unblocking user code is great!

Thanks for taking the time to file this. 🙂

Status: UNCONFIRMED → RESOLVED
Closed: 7 months ago
Duplicate of bug: webgpu-workers
Resolution: --- → DUPLICATE

Ah, and in the meantime: does setting dom.webgpu.workers.enabled in about:config unblock this?

Flags: needinfo?(tenghong.yap)

Enabling dom.webgpu.workers.enabled, allows the worker to access the webgpu adaptor via navigator.gpu. However it's does not provide any gpu information and nothing seems to be rendered onto the offscreen canvas from the worker thread.

Flags: needinfo?(tenghong.yap)

Reopening this since there's a report of something not working correctly with the worker pref flipped. Andrew, when you have a chance can you take a look?

Severity: -- → S3
Status: RESOLVED → REOPENED
No longer duplicate of bug: webgpu-workers
Ever confirmed: true
Flags: needinfo?(aosmond)
Resolution: DUPLICATE → ---

tenghong.yap, are you able to run the same workload correctly outside of a worker context? I'm trying to figure out if maybe this is a bug that will happen between OffscreenCanvas and WebGPU anywhere, or only in worker contexts.

Flags: needinfo?(tenghong.yap)

Erich, It seems the bug happens on OffscreenCanvas instead.
I did some modification to allow the render to be done on the main html (instead of spawning a worker to render), the image data retrieve from the 2D Context remains empty

Flags: needinfo?(tenghong.yap)

In that case, I see no reason to involve Andrew (yet), since this issue does not seem specific to workers.

Flags: needinfo?(aosmond)
Priority: -- → P2
No longer blocks: webgpu-workers
Depends on: webgpu-workers, 1885402
Summary: Rendering WebGPU in Worker Threads with offscreen canvas → Rendering WebGPU with offscreen canvas seems to have no effect

Is there any updates with regards, to this issue?

Flags: needinfo?(egubler)

tenghong.yap: I suspect we will need to fix bug 1885402, which is regression introduced by changes for bug 1883810.

Actually, I'm curious: Can you reproduce this issue in a build prior to the fix for bug 1883810 (viz., using date 2024-03-12 or earlier with mozregression, i.e,, mozregression --launch 2024-03-12)?

Flags: needinfo?(egubler) → needinfo?(tenghong.yap)
Attached image Capture.PNG

As per request, I did a regression check on from 2024-03-12 to 2023-12-20. None of the versions worked.
Do note that the version used when the issue was first reported was 125.0a1 (2024-02-29) (64-bit)
Hence I am not too sure if the bugfix you mention was the one to introduce the regression.

Flags: needinfo?(tenghong.yap)

I have also attach the build which only run offscreen canvas on the main html.
Hope this help if your testing to figure out what have cause the issue.
You can do a simple "python3 -m http.server" to host the app, for the testing

Hi, Is there any update or estimation when this would be schedule to be fix?

tenghong.yap: Unfortunately, no. The WebGPU team still has quite a few P1s and other higher priority tasks to deal with before we get to the OffscreenCanvas API. Updates will happen here as work begins on it.

Erich Gubler: Noted Thanks for the update! Can't wait to see OffscreenCanvas work with WebGPU on Firefox soon

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: