Rendering WebGPU with `OffscreenCanvas` seems to have no effect
Categories
(Core :: Graphics: WebGPU, defect, P1)
Tracking
()
People
(Reporter: tenghong.yap, Assigned: ErichDonGubler)
References
(Blocks 2 open bugs)
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)
| Assignee | ||
Comment 1•2 years ago
|
||
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. 🙂
| Assignee | ||
Comment 2•2 years ago
|
||
Ah, and in the meantime: does setting dom.webgpu.workers.enabled in about:config unblock this?
| Reporter | ||
Comment 3•2 years ago
|
||
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.
Comment 4•2 years ago
|
||
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?
| Assignee | ||
Comment 5•2 years ago
|
||
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.
| Reporter | ||
Comment 6•2 years ago
|
||
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
| Assignee | ||
Comment 7•2 years ago
|
||
In that case, I see no reason to involve Andrew (yet), since this issue does not seem specific to workers.
| Assignee | ||
Updated•2 years ago
|
| Reporter | ||
Comment 8•2 years ago
|
||
Is there any updates with regards, to this issue?
| Assignee | ||
Comment 9•2 years ago
•
|
||
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)?
| Reporter | ||
Comment 10•2 years ago
|
||
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.
| Reporter | ||
Comment 11•2 years ago
|
||
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
Updated•2 years ago
|
| Reporter | ||
Comment 12•2 years ago
|
||
Hi, Is there any update or estimation when this would be schedule to be fix?
| Assignee | ||
Comment 13•2 years ago
|
||
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.
| Reporter | ||
Comment 14•2 years ago
|
||
Erich Gubler: Noted Thanks for the update! Can't wait to see OffscreenCanvas work with WebGPU on Firefox soon
| Assignee | ||
Comment 15•1 year ago
|
||
Going to refine the scope of this bug to be that OffscreenCanvas doesn't seem to render when used as a color attachment. Changing to be a blocker for bug 1818042, rather than a dependency.
| Assignee | ||
Comment 16•1 year ago
|
||
To be clear: I can reproduce this without a worker context; just using OffscreenCanvas in the main thread of the content process also runs into this.
| Assignee | ||
Updated•1 year ago
|
| Assignee | ||
Updated•1 year ago
|
| Assignee | ||
Comment 17•1 year ago
|
||
tenghong.yap: I think this issue has been fixed in the latest Nightly. Can you confirm that this is working for you now?
Comment 18•1 year ago
|
||
Confirmed on linux
| Assignee | ||
Comment 19•1 year ago
|
||
Closing, then! 🙌🏻
Description
•