Restore functionality of GPU infrastructure (#1797)

* Update gpu nodes to compile again

Restructure `gpu-executor` and `wgpu-executor`

And libssl to nix shell

Fix graphene-cli and add half percision color format

Fix texture scaling

Remove vulkan executor

Fix compile errors

Improve execution request deduplication

* Fix warnings

* Fix graph compile issues

* Code review

* Remove test file

* Fix lint

* Wip make node futures send

* Make futures Send on non wasm targets

* Fix warnings

* Fix nested use of block_on

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
This commit is contained in:
Dennis Kobert
2024-07-15 13:14:48 +00:00
committed by GitHub
co-authored by Keavon Chambers
parent 59a943f42f
commit 212f08c6c8
66 changed files with 1572 additions and 1577 deletions
+56 -58
View File
@@ -410,78 +410,76 @@ mod test {
assert_eq!(layers_after_copy[5], shape_id);
}
#[test]
#[tokio::test]
/// This test will fail when you make changes to the underlying serialization format for a document.
fn check_if_demo_art_opens() {
futures::executor::block_on(async {
use crate::messages::layout::utility_types::widget_prelude::*;
async fn check_if_demo_art_opens() {
use crate::messages::layout::utility_types::widget_prelude::*;
let print_problem_to_terminal_on_failure = |value: &String| {
println!();
println!("-------------------------------------------------");
println!("Failed test due to receiving a DisplayDialogError while loading a Graphite demo file.");
println!();
println!("DisplayDialogError details:");
println!();
println!("Description: {value}");
println!("-------------------------------------------------");
println!();
let print_problem_to_terminal_on_failure = |value: &String| {
println!();
println!("-------------------------------------------------");
println!("Failed test due to receiving a DisplayDialogError while loading a Graphite demo file.");
println!();
println!("DisplayDialogError details:");
println!();
println!("Description: {value}");
println!("-------------------------------------------------");
println!();
panic!()
};
panic!()
};
init_logger();
let mut editor = Editor::create();
init_logger();
let mut editor = Editor::create();
// UNCOMMENT THIS FOR RUNNING UNDER MIRI
//
// let files = [
// include_str!("../../demo-artwork/isometric-fountain.graphite"),
// include_str!("../../demo-artwork/just-a-potted-cactus.graphite"),
// include_str!("../../demo-artwork/procedural-string-lights.graphite"),
// include_str!("../../demo-artwork/red-dress.graphite"),
// include_str!("../../demo-artwork/valley-of-spires.graphite"),
// ];
// for (id, document_serialized_content) in files.iter().enumerate() {
// let document_name = format!("document {id}");
// UNCOMMENT THIS FOR RUNNING UNDER MIRI
//
// let files = [
// include_str!("../../demo-artwork/isometric-fountain.graphite"),
// include_str!("../../demo-artwork/just-a-potted-cactus.graphite"),
// include_str!("../../demo-artwork/procedural-string-lights.graphite"),
// include_str!("../../demo-artwork/red-dress.graphite"),
// include_str!("../../demo-artwork/valley-of-spires.graphite"),
// ];
// for (id, document_serialized_content) in files.iter().enumerate() {
// let document_name = format!("document {id}");
for (document_name, _, file_name) in crate::messages::dialog::simple_dialogs::ARTWORK {
let document_serialized_content = std::fs::read_to_string(format!("../demo-artwork/{file_name}")).unwrap();
for (document_name, _, file_name) in crate::messages::dialog::simple_dialogs::ARTWORK {
let document_serialized_content = std::fs::read_to_string(format!("../demo-artwork/{file_name}")).unwrap();
assert_eq!(
document_serialized_content.lines().count(),
1,
"Demo artwork '{document_name}' has more than 1 line (remember to open and re-save it in Graphite)",
);
assert_eq!(
document_serialized_content.lines().count(),
1,
"Demo artwork '{document_name}' has more than 1 line (remember to open and re-save it in Graphite)",
);
let responses = editor.handle_message(PortfolioMessage::OpenDocumentFile {
document_name: document_name.into(),
document_serialized_content: document_serialized_content.into(),
});
let responses = editor.handle_message(PortfolioMessage::OpenDocumentFile {
document_name: document_name.into(),
document_serialized_content,
});
// Check if the graph renders
let portfolio = &mut editor.dispatcher.message_handlers.portfolio_message_handler;
portfolio
.executor
.submit_node_graph_evaluation(portfolio.documents.get_mut(&portfolio.active_document_id.unwrap()).unwrap(), glam::UVec2::ONE)
.expect("submit_node_graph_evaluation failed");
crate::node_graph_executor::run_node_graph().await;
let mut messages = VecDeque::new();
editor.poll_node_graph_evaluation(&mut messages).expect("Graph should render");
// Check if the graph renders
let portfolio = &mut editor.dispatcher.message_handlers.portfolio_message_handler;
portfolio
.executor
.submit_node_graph_evaluation(portfolio.documents.get_mut(&portfolio.active_document_id.unwrap()).unwrap(), glam::UVec2::ONE, true)
.expect("submit_node_graph_evaluation failed");
crate::node_graph_executor::run_node_graph().await;
let mut messages = VecDeque::new();
editor.poll_node_graph_evaluation(&mut messages).expect("Graph should render");
for response in responses {
// Check for the existence of the file format incompatibility warning dialog after opening the test file
if let FrontendMessage::UpdateDialogColumn1 { layout_target: _, diff } = response {
if let DiffUpdate::SubLayout(sub_layout) = &diff[0].new_value {
if let LayoutGroup::Row { widgets } = &sub_layout[0] {
if let Widget::TextLabel(TextLabel { value, .. }) = &widgets[0].widget {
print_problem_to_terminal_on_failure(value);
}
for response in responses {
// Check for the existence of the file format incompatibility warning dialog after opening the test file
if let FrontendMessage::UpdateDialogColumn1 { layout_target: _, diff } = response {
if let DiffUpdate::SubLayout(sub_layout) = &diff[0].new_value {
if let LayoutGroup::Row { widgets } = &sub_layout[0] {
if let Widget::TextLabel(TextLabel { value, .. }) = &widgets[0].widget {
print_problem_to_terminal_on_failure(value);
}
}
}
}
}
});
}
}
}