Files
metal2vulkan/docs
Anees Iqbal 9609083aa2 Walk object and mesh functions predicated at their barriers, and partial object threadgroups from their threads
What: the divergent-barrier pass (lower::simd::divergent::barriers) now covers
object and mesh functions as it covers kernels: a workgroup barrier in a block
Uniformity does not prove uniform makes the body walk predicated, so every
invocation reaches it. Every object function now runs a drawMeshThreads
partial object threadgroup (lower::mesh::plan_partial_groups no longer
excludes a body with a barrier; RuntimeFact::PartialObjectThreadgroups). One
whose body holds any workgroup barrier is walked predicated
(Predication::partial_groups) from live = KernelDecl::live, the invocation
being one of its threadgroup's threads (dispatch::emit_entry computes it in
the entry block and hands it to the walk through
CodeEmitter::entry_live/EmitCx::entry_live), so the invocations past a
partial threadgroup's threads reach every barrier, and loop vote, as
invocations that returned at entry, and run no other instruction of the body:
no load, store or atomic of theirs is made. A body without a barrier keeps its
early return. The vote word an object function's walk takes counts in its
ObjectThreadgroupArena fact, which the binder checks with the encoder's
lengths; where the word does not fit and the barriers are uniform, the
function runs no partial threadgroup (the binder refuses such a draw as
before).

Why: an object function with a threadgroup barrier on a partial object
threadgroup was refused (NotImplemented(MeshShading), a FAST-PATHS known gap),
which kept the Metal3 mesh shading row false on every device; and an object
or mesh function's barrier after a divergent early return or under a
thread-dependent condition stood in non-uniform control flow, which Vulkan
leaves undefined (an Intel GPU hangs on it).

Docs: FAST-PATHS' known gap is gone; render/mesh.rs, bind/graphics.rs and the
fact's docs say what runs. The Metal3 mesh feature rows
(families/features.rs) lose their not_implemented(MeshShading), and the
families test now expects the mesh shading row exact where the device runs
the stages natively or as compute work.

Tests: engine_mesh_barriers (new, over the owned fixture
mesh_partial_barrier): every object function and the divergent mesh function
predicated on every committed profile, their bodies' barriers all uniform by
spirv::testing::barriers::workgroup_barriers_of (new: the check of a called
body); partial draws instantiate; and the interpreter runs each emulated
object function's partial and whole draws under BarrierRule::Vulkan giving
the predicated reading. The old
a_partial_object_threadgroup_of_a_body_with_a_barrier_is_not_implemented is
replaced by a_partial_object_threadgroup_of_a_body_with_a_barrier_draws.
SEMANTICS_VERSION 1973. Verification in the following commits' potluck runs.

(cherry picked from commit 65660d13d001484e444c0f89b268f92b847976b1)
2026-11-05 21:13:13 -08:00
..