Translator: a kernel's floor tail returns at entry again; a render stage's folds into its other pushed fields
Since059835018aevery stage folded its tail's test into each other pushed field through a select. A kernel's entry also returns invocations before its body where its dispatch passes its grid (dispatch::emit_entry), so a return at entry is a kernel's own shape, and the selects cost kernels on three vendors. A fragment stage has no other return at its entry; AMD's open driver (AMDVLK 2025.Q2.1) died making one whose body ran under the never-taken return, which is what the fold removed. Now the stage kind decides it, the same on every device: - Stage::Kernel loads its push fields in placement order, then returns where the tail holds what the consumer never pushes (EmitCx::emit_tail_guard, lower::push::return_never_pushed), as before059835018a. The tail's read is in the first block, and everything the kernel does after the return depends on it. - A render pipeline's stage (vertex, fragment, object, mesh) keeps the fold as shipped (EmitCx::fold_tail, lower::push::fold_never_pushed): no branch on the tail. - EmitCx::tail_test reads the tail and makes its test for both; load_fields loads the fields a filter takes, in placement order. - Docs: lower/push.rs, lower/emit.rs, the arena test's module doc, docs/API.md section 5. Same pushed bytes, same placement, no interface change.
This commit is contained in:
1 parent
c2d505c30c
commit
3a4fe0d314
4 files changed
+105
-51
No files matched your search
+5
-4
@@ -169,10 +169,11 @@ and so do the command line, the compile worker and every validation tool. It hol
|
||||
zero word `PushField::TailWord` at `PushPlacement::tail_word`, with which its `push_range` ends;
|
||||
a function that pushes one field of 8 bytes or fewer has none. A driver that uploads a stage's
|
||||
push bytes up to the highest one the stage reads then holds every load it widens from the other
|
||||
fields. The function reads its tail at its start, and each of its other pushed fields reads as
|
||||
null where the tail holds what the consumer never pushes there (a tail word other than zero,
|
||||
bounds whose two words are both all ones, a zero-range address of all ones), so the consumer
|
||||
pushes the tail word zero with the other fields; the bytes of the hole are not read. A kernel that reads a grid builtin reads `PushField::DispatchRegion` on
|
||||
fields. The function reads its tail at its start and tests whether it holds what the consumer
|
||||
never pushes there (a tail word other than zero, bounds whose two words are both all ones, a
|
||||
zero-range address of all ones): a kernel returns there, and in a render pipeline's function
|
||||
each of its other pushed fields reads as null there, with no branch. So the consumer pushes the
|
||||
tail word zero with the other fields; the bytes of the hole are not read. A kernel that reads a grid builtin reads `PushField::DispatchRegion` on
|
||||
every dispatch: a dispatch the host knows states Metal's grid and its piece's first threadgroup
|
||||
there, and an indirect dispatch a zero grid, whose kernel takes `NumWorkgroups` times its
|
||||
workgroup size. It reads its first threadgroup from every region (0 where the
|
||||
|
||||
Reference in new issue
Block a user