tests::engine_typed_clamp: the resources of a kernel that reads its grid position take a zero dispatch region
The new sized-array fixture test's kernel reads [[thread_position_in_grid]], so its plan declares a DispatchRegion push field, which the shared resources helper refused (the translator suite at 26d6ebe604 failed that test at the helper's panic, before any run). Zero push bytes are one region at the grid's origin, as engine_absent_value_arguments fills it.
This commit is contained in:
1 parent
e7a959befb
commit
f891a2d20b
1 file changed
+3
@@ -97,6 +97,8 @@ fn slot(index: u32) -> ResourceSlot {
|
||||
}
|
||||
|
||||
/// `threads` threads along x (`local` the workgroup's shape), and buffer `i` holding `bufs[i]`.
|
||||
/// Zero push bytes: each buffer is bound at its start, and a dispatch region (a kernel that reads
|
||||
/// its grid position) is one region at the grid's origin.
|
||||
fn resources(plan: &Plan, local: (u64, u64), bufs: &[Vec<u32>]) -> Resources {
|
||||
let mut s = BTreeMap::new();
|
||||
s.insert(SpecKey::LocalSize(Axis::X), local.0);
|
||||
@@ -109,6 +111,7 @@ fn resources(plan: &Plan, local: (u64, u64), bufs: &[Vec<u32>]) -> Resources {
|
||||
(PushField::SlotBindOffset(_), PushLoc::Push { offset }) => {
|
||||
push[offset as usize..offset as usize + 4].fill(0)
|
||||
}
|
||||
(PushField::DispatchRegion, PushLoc::Push { .. }) => {}
|
||||
other => panic!("unexpected push field {other:?}"),
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user