Integrate raw WGPU textures into Vello rendering pipeline (#1897)

* WIP

* Introduce `Raster` enum and plumb texture injection to vello

* Use correct texture formas for usage in vello

* Add missing cache implementations

* Update vello image override api

* Use git version of vello

* Fix type for upload texture node

* Improve crash resiliance

* Fix warnings

* Remove unused node impls
This commit is contained in:
Dennis Kobert 2024-08-06 12:58:22 +02:00 committed by GitHub
parent 25a82d100f
commit e46af89708
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
19 changed files with 341 additions and 215 deletions

View file

@ -52,8 +52,6 @@ web-sys = { workspace = true, features = [
# Optional workspace dependencies
ron = { workspace = true, optional = true }
[profile.release]
debug = true
[package.metadata.wasm-pack.profile.dev]
wasm-opt = false

View file

@ -948,10 +948,10 @@ fn set_timeout(f: &Closure<dyn FnMut()>, delay: Duration) {
}
/// Provides access to the `Editor` by calling the given closure with it as an argument.
fn editor<T>(callback: impl FnOnce(&mut editor::application::Editor) -> T) -> T {
fn editor<T: Default>(callback: impl FnOnce(&mut editor::application::Editor) -> T) -> T {
EDITOR.with(|editor| {
let mut guard = editor.lock();
let Ok(Some(ref mut editor)) = guard.as_deref_mut() else { panic!("Failed to borrow the editor") };
let mut guard = editor.try_lock();
let Ok(Some(ref mut editor)) = guard.as_deref_mut() else { return T::default() };
callback(editor)
})
@ -961,7 +961,7 @@ fn editor<T>(callback: impl FnOnce(&mut editor::application::Editor) -> T) -> T
pub(crate) fn editor_and_handle(mut callback: impl FnMut(&mut Editor, &mut EditorHandle)) {
EDITOR_HANDLE.with(|editor_handle| {
editor(|editor| {
let mut guard = editor_handle.lock();
let mut guard = editor_handle.try_lock();
let Ok(Some(ref mut editor_handle)) = guard.as_deref_mut() else {
log::error!("Failed to borrow editor handle");
return;
@ -979,7 +979,9 @@ async fn poll_node_graph_evaluation() {
return;
}
editor::node_graph_executor::run_node_graph().await;
if !editor::node_graph_executor::run_node_graph().await {
return;
};
editor_and_handle(|editor, handle| {
let mut messages = VecDeque::new();