Commit Graph

17 Commits

Author SHA1 Message Date
2b3a27c49d make_game: ignore vulkaninfo output after a failed probe 2026-11-29 04:04:54 +00:00
d0ab80c095 make_game: a CPU Vulkan device does not decide the wave64 emulation
--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>
2026-11-26 09:12:03 -05:00
6dda0630bd make_game: --mesh-compute on by itself on Intel's Windows Vulkan driver, whose mesh draws crash (BUILD-2202) (#6789)
Squash-merged after diff review of PR #6789
2026-11-23 12:33:00 -06:00
c646bf8367 Speed up make_game by overlapping stages and showing progress. (#1797)
Squash-merged after diff review of PR #1797
2026-11-23 09:32:22 -06:00
5d7d68ddf4 Merge pull request #2508 from whoalin1 2026-11-22 13:15:49 -05:00
1064a48b09 make_game: expose maxPushConstantsSize and auto-enable --pc-tail-ubo
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>
2026-11-22 19:17:34 +02:00
d811bde9fa fix: use native wave64 on AMD Windows RDNA1 (BUILD-629) 2026-11-22 18:45:41 +02:00
d625f4fd12 make_game: check the RDNA2 wave64 guard before vulkaninfo 2026-11-22 12:22:18 -03:00
2538803660 make_game: reject cached wave64 emulation on AMD Windows RDNA2 2026-11-22 12:05:19 -03:00
9eb822f2ff Merge pull request #1708 from Ash Hopkins 2026-11-22 08:38:37 -05:00
95a89a75d3 make_game: --wave64-emulate auto leaves emulation off on RDNA2 under the AMD Windows driver (#857)
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>
2026-11-22 14:15:04 +01:00
2af78ff42d make_game.py: a layered driver's nested deviceName is not another GPU
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.
2026-11-22 13:04:16 +00:00
19da21ec23 vk_subgroup_info.py: retry partial device enumeration 2026-11-22 00:20:29 +01:00
e19df2b0d4 make_game.py: read vulkaninfo's subgroup size per device; vk_subgroup_info.py refuses 32-bit Python
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-21 23:31:41 +01:00
738192451a tests: keep_emulated follows auto only
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-21 23:25:02 +01:00
b946e90ba2 make_game.py: wave64 mode survives a kill after the merge; auto keeps emulated shaders; stricter auto detection
- 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>
2026-11-21 23:20:19 +01:00
6f6ffffa8d make_game.py: --wave64-emulate auto|on|off, on for GPUs without 64-wide subgroups (SHADER-11)
#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>
2026-11-22 08:24:30 +11:00