mirror of
https://github.com/servo/servo.git
synced 2025-09-27 23:30:08 +01:00
webgpu: Simplify presentation and handle cleared in script (#38717)
There are many important changes here: - Generalize the presentation buffer into standalone staging buffers that hold their own state. This allow them to be used by getImage. - Move all clear handling to the ScriptThread and send the configuration on each request present/getimage, thus avoiding any recreate/clearing messages. This means that we prepare staging buffers lazily, on the first request. Try run for this change: https://github.com/sagudev/servo/actions/runs/17341982368 Testing: This is covered by existing WebGPU CTS tests. There are some bad expectations updates, but they are also on main (presumably from last update the rendering work) although I think CTS is actually wrong (see https://github.com/gpuweb/cts/issues/4440). Fixes: #36820 Fixes: #37705 Fixes: #33368 (we now keep reference alive in hashmap) --------- Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
This commit is contained in:
parent
8d2723b2c9
commit
1f0f079203
29 changed files with 1023 additions and 935 deletions
|
@ -523,13 +523,9 @@ impl ExternalImageHandler for WebrenderExternalImageHandlers {
|
|||
},
|
||||
WebrenderImageHandlerType::WebGPU => {
|
||||
let (source, size) = self.webgpu_handler.as_mut().unwrap().lock(key.0);
|
||||
let buffer = match source {
|
||||
ExternalImageSource::RawData(b) => b,
|
||||
_ => panic!("Wrong type"),
|
||||
};
|
||||
ExternalImage {
|
||||
uv: TexelRect::new(0.0, size.height as f32, size.width as f32, 0.0),
|
||||
source: ExternalImageSource::RawData(buffer),
|
||||
source,
|
||||
}
|
||||
},
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue