forked from 1b-agent/fieldcraft-upstream
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:
1 parent
b905f1bc89
commit
c6bc4d2ba0
5 files changed
+24
-5
No files matched your search
@@ -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 {
|
||||
|
||||
Reference in new issue
Block a user