Cache Vello render output as stitchable textures (#3722)

* WIP render caching

* Hook up render cache to render pipeline

* Fixed offsets

* Initial cleanup

* Integrate cache with context invalidation

* Cleanup

* Improve rounding and reduce tile size to fix vello not rendering

* Include pointer position in cache key

* Avoid unwraps and zero sized textures

* Destroy textures after blitting to surface

* Fix context dependencies

* Exclude footprint from render params

* Batch animation frame messages

* Add vello max render size to preference dialogue

* Remove unused import

* Reorder vello preference

* Clean up preferences dialog

* Apply review suggestions

* Cap max render region size

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
This commit is contained in:
Dennis Kobert
2026-02-22 10:12:50 +00:00
committed by GitHub
co-authored by Keavon Chambers
parent 5aca75dcbd
commit 0531769c41
19 changed files with 839 additions and 104 deletions
+11 -11
View File
@@ -202,20 +202,20 @@ impl EditorHandle {
if !EDITOR_HAS_CRASHED.load(Ordering::SeqCst) {
handle(|handle| {
// Process all messages that have been queued up
let messages = MESSAGE_BUFFER.take();
for message in messages {
handle.dispatch(message);
}
handle.dispatch(InputPreprocessorMessage::CurrentTime {
timestamp: js_sys::Date::now() as u64,
});
handle.dispatch(AnimationMessage::IncrementFrameCounter);
let mut messages = MESSAGE_BUFFER.take();
messages.push(
InputPreprocessorMessage::CurrentTime {
timestamp: js_sys::Date::now() as u64,
}
.into(),
);
messages.push(AnimationMessage::IncrementFrameCounter.into());
// Used by auto-panning, but this could possibly be refactored in the future, see:
// <https://github.com/GraphiteEditor/Graphite/pull/2562#discussion_r2041102786>
handle.dispatch(BroadcastMessage::TriggerEvent(EventMessage::AnimationFrame));
messages.push(BroadcastMessage::TriggerEvent(EventMessage::AnimationFrame).into());
handle.dispatch(Message::Batched { messages: messages.into() });
});
}