From ab8277a560eb3c8569fbdc582418b7175178a5f7 Mon Sep 17 00:00:00 2001 From: Anees Iqbal Date: Fri, 20 Nov 2026 22:09:33 -0800 Subject: [PATCH] Fix forward of 6ef64ae3ee: the raster-state test's depth bias clamp refusal is below the floor 6ef64ae3ee made `depthBiasClamp` a floor feature and the runtime-floor profile states it, so metal::state's encoder_raster_state_needs_its_features, which expected the floor to refuse a clamped depth bias, failed on development (suites m3-max-61762 at 36e763e80e). The floor now maps the clamp (enable, constant 1.0, clamp 0.5, slope 2.0), and the refusal naming DepthBiasClamp is asserted on runtime-floor without the feature, through a new committed_without helper beside committed. Test-only. Verified: m3-max-61817 at f05815ae66 (this change on e149088bd0): metal::state's 6 tests pass, encoder_raster_state_needs_its_features among them; clippy -p metal2vulkan --all-targets --all-features -D warnings 0. --- crates/metal2vulkan/src/metal/state.rs | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/crates/metal2vulkan/src/metal/state.rs b/crates/metal2vulkan/src/metal/state.rs index 31c34e01a..8f00edcf0 100644 --- a/crates/metal2vulkan/src/metal/state.rs +++ b/crates/metal2vulkan/src/metal/state.rs @@ -623,15 +623,24 @@ mod tests { } fn committed(name: &str) -> Device { - let (_, desc) = committed_descriptions() + committed_without(name, &[]) + } + + /// Committed profile `name`'s device with `withheld` removed from its description. + fn committed_without(name: &str, withheld: &[VkFeature]) -> Device { + let (_, mut desc) = committed_descriptions() .into_iter() .find(|(s, _)| s == name) .unwrap(); + for f in withheld { + assert!(desc.features.remove(f), "{name} has {f:?}"); + } Device::from_queries(desc, DevicePolicy::default()).unwrap() } /// The encoder's fill mode, depth clip mode, and depth bias clamp map where the device has - /// their features and are refused, naming the feature, where it does not. + /// their features and are refused, naming the feature, where it does not. The floor states + /// `depthBiasClamp`, so its refusal is on `runtime-floor` without it (below the floor). #[test] fn encoder_raster_state_needs_its_features() { let (floor, lavapipe) = (committed("runtime-floor"), committed("lavapipe")); @@ -702,6 +711,11 @@ mod tests { ); assert_eq!( depth_bias(triangles, 1.0, 2.0, 0.5, floor.profile()), + bias(true, 1.0, 0.5, 2.0) + ); + let below = committed_without("runtime-floor", &[VkFeature::DepthBiasClamp]); + assert_eq!( + depth_bias(triangles, 1.0, 2.0, 0.5, below.profile()), Err(needs(Feature::DepthBiasClamp, VkFeature::DepthBiasClamp)) ); assert_eq!(