Tests: indexed patches beside instanced or scaled factors name their cause (red)

TessellationCause gains IndexedPatchFactors: a control-point index type
beside a per-instance factor step or a factor scale where pointers are
device addresses used directly. The link test asserts it for each such
pair on every committed profile of the identity domains, and that each
pair without the index type is planned. The address form's refusal
(pipeline/link/tessellation control_plan) still names no cause, so the
test fails.
This commit is contained in:
Anees Iqbal committed 2026-12-02 17:39:08 -08:00
1 parent 530fb4ea4c
commit 56a86dcc14
2 files changed
+42

No files matched your search

+5
View File
@@ -1217,6 +1217,11 @@ pub enum TessellationCause {
/// A post-tessellation vertex function's control-point input used other than as the operand of
/// a call to its control-point function, or that function called on another pointer.
ControlPointInput,
/// A control-point index type beside tessellation factors that step per instance or are
/// scaled, on a device whose pointers are device addresses used directly: there the
/// control-point indices' address takes the control stage's push words that hold the
/// factors' instance stride and scale.
IndexedPatchFactors,
/// A patch attribute that steps per instance at a rate above 1.
InstanceStepRate,
/// A patch input (a patch's or its control points' stage input) or a patch builtin (the
@@ -109,6 +109,43 @@ fn a_control_point_index_type_binds_its_index_buffer() {
}
}
/// Where pointers are device addresses used directly, the control-point indices' address takes
/// the control stage's push words that hold the factors' instance stride and scale: a
/// control-point index type beside a per-instance factor step or a factor scale is refused by that
/// structure (`IndexedPatchFactors`), and each of those without the index type is planned.
#[test]
fn indexed_patches_with_instanced_or_scaled_factors_name_their_cause_on_the_address_form() {
use crate::error::TessellationCause;
use crate::metal::TessellationFactorStepFunction as Step;
let mut tried = 0;
for (stem, p) in crate::spirv::testing::committed_profiles().expect("committed profiles") {
if !crate::lower::access::identity(&p) {
continue;
}
for (step, scale) in [
(Step::PerInstance, false),
(Step::PerPatchAndPerInstance, false),
(Step::PerPatch, true),
] {
let mut d = TessellationDescriptor {
factor_step_function: step,
factor_scale_enabled: scale,
..TessellationDescriptor::default()
};
control_plan(Some(&d), stage(), 1, &p)
.unwrap_or_else(|e| panic!("{stem}: {step:?}, scale {scale}: {e}"));
d.control_point_index_type = TessellationControlPointIndexType::UInt32;
assert_eq!(
control_plan(Some(&d), stage(), 1, &p).err(),
Some(Unsupported::tessellation(TessellationCause::IndexedPatchFactors).into()),
"{stem}: {step:?}, scale {scale}"
);
}
tried += 1;
}
assert!(tried > 0, "a committed profile takes the identity domains");
}
/// A factor maximum above the device's generation level needs the level.
#[test]
fn the_generation_level_is_refused_typed() {