mirror of
https://github.com/storytold/photocraft.git
synced 2026-12-02 06:20:48 +01:00
test(ui-egui): canvas_16f and rotation preview tests run on the app's wgpu device (#6454)
Both harnesses built their device with egui_kittest's .wgpu() (egui's default limits) instead of gpu_canvas::wgpu_setup() (the adapter's own limits, what the app requests), as #5954 fixed for the background_redraw and navigator tests. On that device: - canvas_16f's sixteen_bit_gradient_on_screen and thirty_two_bit_preview_exposes_values_above_one panicked in egui-wgpu ("Failed to create staging buffer for index data", renderer.rs:984), every run, single-threaded too; - arbitrary_rotation_preview's two tests failed "the fixture must use the GPU canvas". Both binaries pass on the app's device.
This commit is contained in:
1 parent
58f855a40f
commit
d12be8ecd0
2 files changed
+28
-18
No files matched your search
@@ -11,14 +11,19 @@ type Harness = egui_kittest::Harness<'static, PhotocraftApp>;
|
||||
|
||||
fn harness() -> Option<Harness> {
|
||||
let built = std::panic::catch_unwind(|| {
|
||||
egui_kittest::Harness::builder().with_size(egui::vec2(1280.0, 800.0)).with_pixels_per_point(1.0).with_max_steps(64).wgpu().build_eframe(|cc| {
|
||||
PhotocraftApp::setup_context(&cc.egui_ctx, Default::default());
|
||||
let mut app = PhotocraftApp::new(photocraft_engine::Session::new(), Default::default());
|
||||
if let Some(rs) = cc.wgpu_render_state.as_ref() {
|
||||
app.set_wgpu(rs.clone());
|
||||
}
|
||||
app
|
||||
})
|
||||
egui_kittest::Harness::builder()
|
||||
.with_size(egui::vec2(1280.0, 800.0))
|
||||
.with_pixels_per_point(1.0)
|
||||
.with_max_steps(64)
|
||||
.wgpu_setup(photocraft_ui_egui::gpu_canvas::wgpu_setup())
|
||||
.build_eframe(|cc| {
|
||||
PhotocraftApp::setup_context(&cc.egui_ctx, Default::default());
|
||||
let mut app = PhotocraftApp::new(photocraft_engine::Session::new(), Default::default());
|
||||
if let Some(rs) = cc.wgpu_render_state.as_ref() {
|
||||
app.set_wgpu(rs.clone());
|
||||
}
|
||||
app
|
||||
})
|
||||
});
|
||||
match built {
|
||||
Ok(h) => Some(h),
|
||||
|
||||
@@ -181,16 +181,21 @@ fn screen(doc: Document, setup: &[(&str, serde_json::Value)], name: &str) -> Opt
|
||||
let ok2 = ok.clone();
|
||||
let setup: Vec<(String, serde_json::Value)> = setup.iter().map(|(a, b)| (a.to_string(), b.clone())).collect();
|
||||
let built = std::panic::catch_unwind(std::panic::AssertUnwindSafe(move || {
|
||||
egui_kittest::Harness::builder().with_size(egui::vec2(1000.0, 700.0)).with_pixels_per_point(1.0).with_max_steps(64).wgpu().build_eframe(move |cc| {
|
||||
PhotocraftApp::setup_context(&cc.egui_ctx, Default::default());
|
||||
let mut app = PhotocraftApp::new(photocraft_engine::Session::new(), Default::default());
|
||||
if let Some(rs) = cc.wgpu_render_state.as_ref() {
|
||||
ok2.store(gpu_canvas::supports_f16_canvas(&rs.adapter) && std::env::var("PHOTOCRAFT_CANVAS_F16").as_deref() != Ok("0"), Ordering::SeqCst);
|
||||
app.set_wgpu(rs.clone());
|
||||
}
|
||||
app.session.open_document(doc, None);
|
||||
app
|
||||
})
|
||||
egui_kittest::Harness::builder()
|
||||
.with_size(egui::vec2(1000.0, 700.0))
|
||||
.with_pixels_per_point(1.0)
|
||||
.with_max_steps(64)
|
||||
.wgpu_setup(gpu_canvas::wgpu_setup())
|
||||
.build_eframe(move |cc| {
|
||||
PhotocraftApp::setup_context(&cc.egui_ctx, Default::default());
|
||||
let mut app = PhotocraftApp::new(photocraft_engine::Session::new(), Default::default());
|
||||
if let Some(rs) = cc.wgpu_render_state.as_ref() {
|
||||
ok2.store(gpu_canvas::supports_f16_canvas(&rs.adapter) && std::env::var("PHOTOCRAFT_CANVAS_F16").as_deref() != Ok("0"), Ordering::SeqCst);
|
||||
app.set_wgpu(rs.clone());
|
||||
}
|
||||
app.session.open_document(doc, None);
|
||||
app
|
||||
})
|
||||
}));
|
||||
let Ok(mut harness) = built else {
|
||||
eprintln!("skipping: no GPU adapter");
|
||||
|
||||
Reference in new issue
Block a user