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

37
Cargo.lock generated
View File

@@ -2077,14 +2077,19 @@ dependencies = [
name = "graphite-desktop"
version = "0.1.0"
dependencies = [
"ash",
"bytemuck",
"cef",
"core-foundation",
"derivative",
"dirs",
"futures",
"glam",
"graphite-desktop-wrapper",
"include_dir",
"libc",
"objc2-io-surface",
"objc2-metal 0.3.1",
"open",
"rfd",
"ron",
@@ -2093,6 +2098,7 @@ dependencies = [
"tracing-subscriber",
"vello",
"wgpu",
"windows",
"winit",
]
@@ -3489,7 +3495,7 @@ dependencies = [
"block2 0.5.1",
"objc2 0.5.2",
"objc2-foundation 0.2.2",
"objc2-metal",
"objc2-metal 0.2.2",
]
[[package]]
@@ -3544,6 +3550,19 @@ dependencies = [
"objc2-core-foundation",
]
[[package]]
name = "objc2-io-surface"
version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7282e9ac92529fa3457ce90ebb15f4ecbc383e8338060960760fa2cf75420c3c"
dependencies = [
"bitflags 2.9.1",
"libc",
"objc2 0.6.1",
"objc2-core-foundation",
"objc2-foundation 0.3.1",
]
[[package]]
name = "objc2-link-presentation"
version = "0.2.2"
@@ -3568,6 +3587,20 @@ dependencies = [
"objc2-foundation 0.2.2",
]
[[package]]
name = "objc2-metal"
version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7f246c183239540aab1782457b35ab2040d4259175bd1d0c58e46ada7b47a874"
dependencies = [
"bitflags 2.9.1",
"block2 0.6.1",
"dispatch2",
"objc2 0.6.1",
"objc2-core-foundation",
"objc2-foundation 0.3.1",
]
[[package]]
name = "objc2-quartz-core"
version = "0.2.2"
@@ -3578,7 +3611,7 @@ dependencies = [
"block2 0.5.1",
"objc2 0.5.2",
"objc2-foundation 0.2.2",
"objc2-metal",
"objc2-metal 0.2.2",
]
[[package]]