ci: prove the lavapipe GPU path draws (FIELDCRAFT_REQUIRE_GPU=1)

The drawing tests skipped silently without an adapter. Under
FIELDCRAFT_REQUIRE_GPU=1 they fail instead, and the snapshot and MCP
screenshot tests require a GPU renderer. CI runs them with
FIELDCRAFT_GPU=software on lavapipe.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01UhhZMBTviDQxZvwnyP89fo
This commit is contained in:
jyvikoandClaude Opus 5.5 authored and Irakli Kourtis committed 2026-10-16 07:52:10 -04:00
1 parent b905f1bc89
commit c6bc4d2ba0
5 files changed
+24 -5

No files matched your search

+9
View File
@@ -46,6 +46,15 @@ impl Policy {
pub use crate::Tier;
/// Set to `1` where a GPU adapter must exist (CI with lavapipe): tests that draw then fail
/// instead of skipping when none is found, so the GPU path is proven to draw.
pub const REQUIRE_ENV: &str = "FIELDCRAFT_REQUIRE_GPU";
/// Whether [`REQUIRE_ENV`] is set to `1`.
pub fn gpu_required() -> bool {
std::env::var(REQUIRE_ENV).is_ok_and(|v| v.trim() == "1")
}
/// An adapter's tier and its rank within it (lower is better).
pub fn rank(t: wgpu::DeviceType) -> (Tier, u8) {
match t {