Skip to content

webgpu: Fix HTML event loop integration#33673

Closed
sagudev wants to merge 2 commits into
servo:mainfrom
sagudev:gpucanvas-html-integration
Closed

webgpu: Fix HTML event loop integration#33673
sagudev wants to merge 2 commits into
servo:mainfrom
sagudev:gpucanvas-html-integration

Conversation

@sagudev

@sagudev sagudev commented Oct 6, 2024

Copy link
Copy Markdown
Member

@sagudev sagudev added the A-content/webgpu The WebGPU implementation. label Oct 6, 2024
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
@sagudev sagudev force-pushed the gpucanvas-html-integration branch from e501d72 to cd206c4 Compare October 16, 2024 05:27
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
@sagudev

sagudev commented Oct 16, 2024

Copy link
Copy Markdown
Member Author

Per webgpu spec:

When updating the rendering of a WebGPU canvas (an HTMLCanvasElement or an OffscreenCanvas with a placeholder canvas element) with a GPUCanvasContext context, which occurs before getting the canvas’s image contents

but this is not happening in servo:

GetCurrentTexture
canvas_data_source
update_rendering_of_webgpu_canvas
send_swap_chain_present
GetCurrentTexture
canvas_data_source
update_rendering_of_webgpu_canvas
send_swap_chain_present

I think update_rendering_of_webgpu_canvas should happen before canvas_data_source. cc @gterzian

@gterzian

Copy link
Copy Markdown
Member

I think update_rendering_of_webgpu_canvas should happen before canvas_data_source.

As per the spec, I think we should do layout only at the end of the "update the rendering", but currently we do it in multiple places, and problably also before update_rendering_of_webgpu_canvas is called into. canvas_data_source is called as part of layout right?

@sagudev

sagudev commented Oct 17, 2024

Copy link
Copy Markdown
Member Author

I think update_rendering_of_webgpu_canvas should happen before canvas_data_source.

As per the spec, I think we should do layout only at the end of the "update the rendering", but currently we do it in multiple places, and problably also before update_rendering_of_webgpu_canvas is called into. canvas_data_source is called as part of layout right?

I think so. We cannot really fix HTML event loop integration of webgpu until HTML event loop is fixed.

@sagudev

sagudev commented Dec 15, 2024

Copy link
Copy Markdown
Member Author

Closed in favor of #34631

@sagudev sagudev closed this Dec 15, 2024
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

None yet

Development

Successfully merging this pull request may close these issues.

webgpu: Update HTML event loop integration

2 participants