--wave64-emulate auto took the smallest maxSubgroupSize over every device
vulkaninfo lists. On a machine with llvmpipe installed beside AMD GPUs
that run wave64 natively (RX 7900 XTX and an RDNA2 iGPU, RADV), the
shaders stage logged "smallest maximum subgroup size is 8" and emulated
all 23,841 wave64 shaders.
The runtime ranks a CPU device below every GPU
(runtime/src/vulkan_device_filter.h, tools/vk_subgroup_info.py
device_rank), so it never runs the shaders there while a GPU exists.
max_subgroup_decider() reads each device's deviceType beside its
deviceName (text and --json output) and leaves CPU devices out unless no
other device is listed. The log names the device that decided and the
devices left out.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Read VkPhysicalDeviceProperties.limits.maxPushConstantsSize (offset 328 on
64-bit) in tools/vk_subgroup_info.py and expose it as max_push_constants_size.
Add --pc-tail-ubo to make_game.py's forwarded translator fallback flags (so it
reaches translate(), fspx_shaders(), preflight(), and spirv/translator_flags.txt)
and enable it automatically for the shaders stage when the GPU the runtime would
use reports maxPushConstantsSize below what the shaders need (144 bytes, or 152
with --mesh-compute).
Co-Authored-By: Gemini 4 Neon <noreply@google.com>
AMD's Windows shader compiler for RDNA2 crashes (access violation in
vkCreateComputePipelines) on many --wave64-emulate compute shaders with LDS
(#857). auto turns emulation on when any device is 32-wide, so an Intel iGPU
next to an RX 6000 card gets emulated modules, and the runtime then runs them on
the RX 6000.
tools/vk_subgroup_info.py now reports vendor_id, device_id, driver_id and
rdna2_amd_windows for the runtime's GPU (RDNA2 by PCI device ID, AMD proprietary
driver). auto leaves emulation off when that GPU is one and runs wave64
natively; on and off are unchanged.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
smallest_max_subgroup splits vulkaninfo's output at each deviceName. Vulkan 1.4 drivers that report
VK_KHR_maintenance7's layered APIs print a second, deeper-indented deviceName for the same GPU (MoltenVK:
the Metal device) before the subgroup block, in both the text and the --json output, so the first "device"
had no maxSubgroupSize and the size read as unknown. Only the least indented deviceName now starts a
device. With MoltenVK 1.4.2 on an Apple M2 Max the auto mode read "unknown"; it now reads 32 (emulation
stays on either way on Apple GPUs, but a layered driver with 64-wide subgroups would have been misread).
New tests with both layouts.
AI-assisted. No game files.
- The mode file is written before the translation starts (index.json is absent
then), not after it: a stop between the merge and the old write left an index
with no mode, which counted as "off" and either re-translated hours of work
or passed emulated shaders off as native.
- auto keeps shaders that were translated with emulation when this run would
not emulate (a GPU asleep or hidden, vulkaninfo missing): they are exact on
every GPU. An explicit --wave64-emulate off still translates natively.
- auto turns emulation on when tools/vk_subgroup_info.py says the runtime's GPU
can't be made to run compute and mesh 64-wide (subgroupSizeControl, both stage
bits: vk_pipeline_check's can_require_sg); it never turns it off.
- smallest_max_subgroup gives None (unknown, so on) when a device prints no
subgroup size instead of leaving it out of the minimum.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
#152 added rdna2spirv.py --wave64-emulate (wave64 compute and mesh shaders exact on any
subgroup size), but the build never passed it, so 32-wide GPUs (NVIDIA, Intel) got the
native translation.
- auto (default) reads the smallest maxSubgroupSize from vulkaninfo and turns emulation on
below 64, or when vulkaninfo is missing or tells nothing (the emulated output is exact
everywhere). on and off are taken as given.
- The mode used is written to spirv/wave64_emulate.txt; a change translates again. A folder
without the file counts as off, which is how it was made.
- translate() passes the flag to every shard.
- Tests: tests/test_make_game_wave64.py (new), resume and argparse tests extended.
AI-assisted (Claude Code).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>