gfx-rs / wgpu

A cross-platform, safe, pure-Rust graphics API.
https://wgpu.rs
Apache License 2.0
12.76k stars 935 forks source link

Change pass execution API to work with deserializers #1004

Open kvark opened 4 years ago

kvark commented 4 years ago

Is your feature request related to a problem? Please describe. When implementing WebGPU behind a GPU process, we get the data serialized.

Describe the solution you'd like When "serialize-pass" feature is enabled, we'd want to be able to provide a Deserializer generic object into wgpu-core, and let it deserialize individual commands, possibly never reconstructing the whole ComputePass.

command_encoder_run_compute_pass_from_serde
command_encoder_run_render_pass_from_serde

Describe alternatives you've considered It would be a waste to try to allocate the storage, deserialize into it, only to pass it to wgpu.

Additional context Gecko and Servo would benefit from that

cwfitzgerald commented 2 years ago

@jimblandy is this still a problem?

jimblandy commented 2 years ago

This suggested optimization still applies to the current architecture.

sagudev commented 3 months ago

In servo we currently construct passes immediately (as we also relay on wgpu for Validate the encoder state) in webgpu thread (IPC message is sent for every pass command).