Translator: object and mesh functions take their SIMD groups from the task and mesh stages' own subgroup facts
What: the profile's subgroup model now records the task and mesh stages (SubgroupModel::object
and ::mesh), read like the other stages from subgroupSupportedStages, the device's operation
classes, requiredSubgroupSizeStages under subgroupSizeControl, and the size range.
computeFullSubgroups gives full subgroups to the compute, task and mesh stages, as Vulkan says
("requiring full subgroups in compute, mesh, or task shaders"). STAGE_BITS names the two stages,
so a module's SubgroupStage and RequiredSubgroupSizeStage properties for them are in the enabled
capabilities. The stand-in that answered "no subgroups" for both stages (UNMODELED_STAGE) is
deleted.
subgroup::tier, width_needs, requirement and quad_free treat object and mesh functions as they
treat kernels (Stage::has_workgroup):
- full subgroups and a pinned 32 (Direct), or 64 or 128 split into 32-lane clusters;
- a local size multiple of that size, which dispatch::plan_kernel already states as
RuntimeFact::LocalSizeConstraint for the flattened form;
- quads tiered as cross-lane quad operations;
- a quad-only function at the size the stage gives.
The emulated tier stays the kernels' alone. An object or mesh stage that pins no size and runs
below 32 lanes (lavapipe) refuses a SIMD-group function as Unsupported{SimdWidth}, naming
subgroupSizeControl, the stage's RequiredSubgroupSizeStage and its maxSubgroupSize. Quad
instructions stay kernel-only (lower::simd), so an object or mesh quad is a shuffle, and the
requirement derivation still asks subgroupQuadOperationsInAllStages of a quad instruction in the
task and mesh stages.
Why: conditions 2 and 3 of the planner's ruling on the mesh build. An object or mesh function's
SIMD groups run on the native subgroup. Its workgroup is its pipeline's stated maximum (the
condition 4 commit), made a multiple of the subgroup size, and the invocations past a draw's
threadgroup are not live, so a partial SIMD group has Metal's inactive lanes; no threadgroup
size is refused for not being whole SIMD groups. The planner ruled (a) for lavapipe: the typed
device-lack refusal, decided by those queries alone, with no emulated tier. Main fires that
ruling's trigger: a real card's profile that lists the mesh extension but lacks size control
for the task or mesh stage.
The stage facts extend the existing subgroup queries to two more stages; no form is added.
Every profile's fingerprint changes with its subgroup model. SEMANTICS_VERSION 2367 (a
placeholder for the number at landing): object and mesh functions of SIMD-group operations
compile where they were refused.
Tests: the parent's red test passes. The tier golden table gains the object and mesh columns:
- Direct on the AMD, Arc and RTX 50 profiles;
- a width refusal on lavapipe;
- missing operations where the device lists neither stage (Iris Xe, UHD 770, Pascal, MoltenVK,
the runtime floor).
The invariants hold for object and mesh as for kernels.
object_and_mesh_stages_read_their_own_subgroup_facts checks the three queries apart on the
780M's description:
- a mesh stage outside requiredSubgroupSizeStages takes two 32-lane clusters of its 64 lanes
while the task stage pins 32;
- without computeFullSubgroups both are refused naming it;
- without the task stage listed, an object function is refused naming it while a mesh function
keeps Direct.
The narrow-subgroup and quad-only tests cover the two stages.
docs/API.md's mesh pipelines section states the stages' SIMD groups, the refusal and the quads.
runtime-sources.sha256 is re-pinned.
Reuse: the shape of this change was read in PR 25's device/subgroup.rs and device/derive.rs
(the model's two stages, STAGE_BITS, has_workgroup in tier, width_needs, requirement and
quad_free). Not taken: its change to the quad-instruction requirement, which would have dropped
subgroupQuadOperationsInAllStages for the task and mesh stages against Vulkan's "restricted to
fragment and compute stages", and its fixture and refusal.
Verified: see the job named below.
This commit is contained in:
1 parent
4cac67a58a
commit
763caf0270
6 files changed
+212
-74
No files matched your search
+15
-6
@@ -1179,12 +1179,21 @@ an object function (a mesh draw's pieces take the two draw features). A device w
|
||||
them (MoltenVK, older ANV) refuses the pipeline and each of its object and mesh functions
|
||||
(`Unsupported{MeshShading}`, naming what it lacks).
|
||||
|
||||
An object or mesh function that calls a SIMD-group, quad-group or SIMD-group matrix function is
|
||||
refused on every device (`Unsupported{SubgroupOperations}`, `QuadOperations` or `SimdgroupMatrix`,
|
||||
naming the stage's `VkProperty::SubgroupStage`), a device that lists the task and mesh stages in
|
||||
`subgroupSupportedStages` included: the translator models no subgroup facts for those stages. Metal
|
||||
gives both stages `[[thread_index_in_simdgroup]]`, which compiles, the lane derived from the linear
|
||||
thread index as a kernel's is.
|
||||
An object or mesh function's SIMD groups run on its stage's own subgroups, as a kernel's run on
|
||||
the compute stage's, read from Vulkan's task and mesh stage facts: the stage in
|
||||
`subgroupSupportedStages` with the operations' classes, full subgroups (`computeFullSubgroups`,
|
||||
which Vulkan gives the compute, task and mesh stages), and either 32 lanes pinned (the stage in
|
||||
`requiredSubgroupSizeStages` under `subgroupSizeControl`) or 64 or 128 lanes split into 32-lane
|
||||
clusters. Its workgroup, the pipeline's stated maximum, is then made a multiple of that size,
|
||||
rounded up (`RuntimeFact::LocalSizeConstraint`): the invocations past a draw's threadgroup are
|
||||
not live, so a partial SIMD group has Metal's inactive lanes. A function whose only cross-lane operations stay inside their
|
||||
quads runs at the size the stage gives, as such a kernel does. Where the stage pins no size and
|
||||
runs subgroups below 32 lanes (lavapipe), a SIMD-group function is refused
|
||||
(`Unsupported{SimdWidth}`, naming `subgroupSizeControl`, the stage's
|
||||
`VkProperty::RequiredSubgroupSizeStage` and its `maxSubgroupSize`): object and mesh functions have
|
||||
no emulated tier. A quad operation in either stage is a shuffle, never a quad instruction, so
|
||||
neither stage needs `subgroupQuadOperationsInAllStages`. A SIMD-group matrix function in either
|
||||
stage is refused as not implemented (`Unsupported{SimdgroupMatrix}`), as outside kernels.
|
||||
|
||||
The mesh lowering is only compiled and validated: no mesh draw it makes has been compared with
|
||||
Metal on a GPU, and the runtime makes no mesh pipeline (its README's known gaps of render pipeline
|
||||
|
||||
Reference in new issue
Block a user