Fix forward of 6ef64ae3ee: the raster-state test's depth bias clamp refusal is below the floor
6ef64ae3eemade `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 at36e763e80e). 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 one149088bd0): metal::state's 6 tests pass, encoder_raster_state_needs_its_features among them; clippy -p metal2vulkan --all-targets --all-features -D warnings 0.
This commit is contained in:
1 parent
62b3e5a250
commit
ab8277a560
1 file changed
+16
-2
@@ -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!(
|
||||
|
||||
Reference in new issue
Block a user