Desktop: Implement GPU accelerated offscreen rendering and improve rendering efficency (#3056)

* WIP accelerade offscreen canvas implementation

* Implement vulkan dmabuf import

* Add fps printing

* Add feature gates

* Forgot to add file

* Experimental windows support

* Cast ptr to isize

* Remove testing chrome://flags url

* Experimental macos support for texture import

* Cleanup code and improve latency / frame pacing

* Add path for importing textures on windows through dx12

* Update doc comment

* Import textures through metal on macos

* Review cleanup

---------

Co-authored-by: Timon Schelling <me@timon.zip>
This commit is contained in:
Dennis Kobert
2025-08-21 16:05:25 +02:00
committed by Keavon Chambers
parent 97978c2491
commit e56f858ced
18 changed files with 1226 additions and 51 deletions

View File

@@ -232,7 +232,7 @@ impl GraphicsState {
self.bind_overlays_texture(texture);
}
pub(crate) fn render(&mut self) -> Result<(), wgpu::SurfaceError> {
pub(crate) fn render(&mut self, window: &Window) -> Result<(), wgpu::SurfaceError> {
if let Some(scene) = self.overlays_scene.take() {
self.render_overlays(scene);
}
@@ -275,6 +275,7 @@ impl GraphicsState {
}
}
self.context.queue.submit(std::iter::once(encoder.finish()));
window.pre_present_notify();
output.present();
Ok(())