Commit Graph

4 Commits

Author SHA1 Message Date
42374fb2bc Recognize the documented wave64 exchange mode 2026-11-24 02:56:33 +05:30
74ab61efaa fix(subgroup_size): guard 64-bit invocation product overflow and zero local_size_x 2026-11-22 12:08:32 -03:00
36998edb14 Runtime: a default subgroup size that is the wanted one is device_default, not unavailable
Where the size cannot be required (the stage is not in requiredSubgroupSizeStages,
or subgroupSizeControl is off) but the device default is the wanted size, the
shader works as it is. The decision now says device_default (not guaranteed
stable, but not inexact and not logged as such); only a different default stays
unavailable. The REQUIRE_FULL_SUBGROUPS citations are corrected: the feature rule
is VUID-VkPipelineShaderStageCreateInfo-flags-02785, the stage rule flags-08988
(flags-02784 is the ALLOW_VARYING feature rule).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-22 13:05:41 +01:00
98aca391ca Runtime: decide the subgroup size a pipeline stage asks for
decide_subgroup_size() maps a shader index entry and the device's subgroup
size properties to what a stage should request: nothing for an emulated
shader, VkPipelineShaderStageRequiredSubgroupSizeCreateInfo with the size the
translation assumed (64 for wave64, 32 otherwise) where the feature is on, the
stage is in requiredSubgroupSizeStages, the size is a power of two within
[min, max] and the workgroup fits size * maxComputeWorkgroupSubgroups, and
REQUIRE_FULL_SUBGROUPS for compute when computeFullSubgroups is on and local X
is a multiple of the size. A device with one size that is the wanted one needs
nothing; otherwise the size is reported unavailable.

subgroup_size_test checks it against AMD-like, NVIDIA-like and old-RADV
properties, the limits, and the resulting create-info chain.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-22 13:05:10 +01:00