Disable Vello renderer checkbox in preferences if browser doesn't support WebGPU (#1844)

* Disable vello checkbox if no wgpu support is available

* Fix compile error

* Check wgpu status on every diagogue open

* Execute graph on settings change

* Remove tooltip and disabled status from settings category

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
This commit is contained in:
Dennis Kobert
2024-07-24 01:19:44 +02:00
committed by GitHub
parent 0893ac49a6
commit fad289804a
7 changed files with 39 additions and 18 deletions

View File

@@ -153,7 +153,15 @@ impl NodeRuntime {
}
pub async fn run(&mut self) {
// TODO: Currently we still render the document after we submit the node graph execution request. This should be avoided in the future.
if self.editor_api.application_io.is_none() {
self.editor_api = WasmEditorApi {
application_io: Some(WasmApplicationIo::new().await.into()),
font_cache: self.editor_api.font_cache.clone(),
node_graph_message_sender: Box::new(self.sender.clone()),
editor_preferences: Box::new(self.editor_preferences.clone()),
}
.into();
}
let mut font = None;
let mut preferences = None;
@@ -232,16 +240,6 @@ impl NodeRuntime {
}
async fn update_network(&mut self, graph: NodeNetwork) -> Result<(), String> {
if self.editor_api.application_io.is_none() {
self.editor_api = WasmEditorApi {
application_io: Some(WasmApplicationIo::new().await.into()),
font_cache: self.editor_api.font_cache.clone(),
node_graph_message_sender: Box::new(self.sender.clone()),
editor_preferences: Box::new(self.editor_preferences.clone()),
}
.into();
}
let scoped_network = wrap_network_in_scope(graph, self.editor_api.clone());
self.monitor_nodes = scoped_network
.recursive_nodes()