Skip to content

webgpu: Fix HTML event loop integration#34631

Merged
sagudev merged 3 commits into
servo:mainfrom
sagudev:gpucanvas-html-integration2
Dec 17, 2024
Merged

webgpu: Fix HTML event loop integration#34631
sagudev merged 3 commits into
servo:mainfrom
sagudev:gpucanvas-html-integration2

Conversation

@sagudev

@sagudev sagudev commented Dec 15, 2024

Copy link
Copy Markdown
Member

rebase of #33673, now possible because of latest changes to update rendering stuff in servo.


Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
@sagudev sagudev added the A-content/webgpu The WebGPU implementation. label Dec 15, 2024
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
Comment thread components/script/dom/webgpu/gpucanvascontext.rs Outdated
@gterzian

Copy link
Copy Markdown
Member

Re this, note that we have now moved to almost only doing a single reflow at the end of update the rendering. See #31871

@@ -1621,6 +1621,9 @@ impl ScriptThread {

// TODO(#31871): Update the rendering: consolidate all reflow calls into one here?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: unrelated but this TODO can be removed now. Was missed previously.

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
@gterzian

Copy link
Copy Markdown
Member

For the worker part(do we have offscreen canvas working with webgpu yet?) I have filed #34637

@sagudev

sagudev commented Dec 16, 2024

Copy link
Copy Markdown
Member Author

For the worker part(do we have offscreen canvas working with webgpu yet?) I have filed #34637

IIRC all offscreen support is unfinished/disabled by default, so I didn't really bother with it. Workers are in same state too IIRC, but I might be wrong.

@sagudev sagudev marked this pull request as ready for review December 16, 2024 07:44
@sagudev sagudev requested a review from gterzian December 16, 2024 07:44

@gterzian gterzian left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@sagudev sagudev added this pull request to the merge queue Dec 17, 2024
Merged via the queue into servo:main with commit b7e528d Dec 17, 2024
@sagudev sagudev deleted the gpucanvas-html-integration2 branch December 17, 2024 07:00
sagudev added a commit to sagudev/servo that referenced this pull request Dec 19, 2024
{"fail_fast": false, "matrix": [{"name": "WebGPU CTS", "workflow": "linux", "wpt_layout": "2020", "profile": "production", "unit_tests": false, "bencher": false, "wpt_args": "_webgpu"}]}
@sagudev

sagudev commented Jun 25, 2025

Copy link
Copy Markdown
Member Author

I just checked and firefox does update the wr image (so update the rendering of context) as part of reflow/layout. So inverse of what we did here. cc @gterzian

@mrobinson

Copy link
Copy Markdown
Member

I just checked and firefox does update the wr image (so update the rendering of context) as part of reflow/layout. So inverse of what we did here. cc @gterzian

Funny timing of your comment as I just posted #37703, which consolidates all the canvas flushes into one place. I think it doesn't matter too much whether this happens in Window::reflow or ScriptThread::update_the_rendering (I have preference for the latter), but it does make sense that all canvases are flushed at the same time.

@sagudev

sagudev commented Jun 25, 2025

Copy link
Copy Markdown
Member Author

I actually think this should be done in reflow (step 22 of update the rendering). And yeah, I want to consolidate that too.

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

Labels

A-content/webgpu The WebGPU implementation.

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

webgpu: Update HTML event loop integration

4 participants