cmake: pass LEONIDA_SPIRV_TOOLS to the subgroup shader build #123

Open
github-bot wants to merge 1 commit from github-bot/gh-123 into main AGit
Owner

@⁠Andretuta on GitHub · 2026-11-24 02:23 UTC · original
ubiquitarianism:old-pr/9858 → main · +7 −2 · 1 files · 1 commits · draft

Carried over from old PR 9858 by Nevrche in the original Leonida repository, which went private on 23 Nov 2026. The code is the branch old-pr/9858, exactly that PR's last commit. All carried-over PRs are listed in #17.
Opened as a draft, and the CI runs the opening started were cancelled so 250 PRs don't fill the queue. Re-run CI here when you review it.
Nevrche: this is your work. Feel free to take it over, by pushing to the branch or opening your own PR and closing this one.


Original description (mentions and #N references are disabled; the numbers refer to the old repository):

What

d3d12_subgroup_test translates four shaders through test/shaders/build.py, which runs spirv-as. Every other shader-test block passes LEONIDA_SPIRV_TOOLS, which build.py prepends to PATH; the subgroup block did not. A configure with -DLEONIDA_SPIRV_AS=<path> but without VulkanSDK\Bin on PATH therefore failed at build time with:

spirv-as not found; install SPIRV-Tools (spirv-as, spirv-val) and put it on PATH

Fix

Compute LEONIDA_SPIRV_TOOLS_NATIVE outside the M1.5 guard (whenever spirv-as is found) and pass it in the subgroup custom command.

Tested

Windows 10 Pro 22H2 (19045), MSVC 19.44.35230, VS 2022 generator, RelWithDebInfo, Vulkan SDK 1.4.363.0, llvm-mc 21.1.8, with VulkanSDK\Bin not on PATH:

  • configure + cmake --build runtime/build --target d3d12_subgroup_test succeeds, all four variants translated;
  • ctest -R ^d3d12_subgroup$ passes (1.89 s).

Note on the current main

Tested on 31276208. At the current main (7e39a81ea) this machine cannot build gta6rt_d3d12_com at all, in a clean build directory:

  • d3d12_vulkan_device.cpp(10001): DescriptorHeap has no constructor taking (state, desc, console_address, console_size);
  • (10002): Device::identity is private;
  • d3d12_xs_device.cpp(1606): rt::d3d12::create_console_descriptor_heap is not declared there (the file does not include d3d12_com.h).

That is unrelated to this change (it touches only runtime/CMakeLists.txt), but it is why CI may be red here.

AI-assisted.

**@⁠Andretuta** on GitHub · 2026-11-24 02:23 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/123) `ubiquitarianism:old-pr/9858` → `main` · +7 −2 · 1 files · 1 commits · draft > Carried over from **old PR 9858** by `Nevrche` in the original Leonida repository, which went private on 23 Nov 2026. The code is the branch `old-pr/9858`, exactly that PR's last commit. All carried-over PRs are listed in #17. > Opened as a draft, and the CI runs the opening started were cancelled so 250 PRs don't fill the queue. Re-run CI here when you review it. > `Nevrche`: this is your work. Feel free to take it over, by pushing to the branch or opening your own PR and closing this one. --- Original description (mentions and `#N` references are disabled; the numbers refer to the old repository): ## What `d3d12_subgroup_test` translates four shaders through `test/shaders/build.py`, which runs `spirv-as`. Every other shader-test block passes `LEONIDA_SPIRV_TOOLS`, which `build.py` prepends to `PATH`; the subgroup block did not. A configure with `-DLEONIDA_SPIRV_AS=<path>` but without `VulkanSDK\Bin` on `PATH` therefore failed at build time with: ``` spirv-as not found; install SPIRV-Tools (spirv-as, spirv-val) and put it on PATH ``` ## Fix Compute `LEONIDA_SPIRV_TOOLS_NATIVE` outside the M1.5 guard (whenever `spirv-as` is found) and pass it in the subgroup custom command. ## Tested Windows 10 Pro 22H2 (19045), MSVC 19.44.35230, VS 2022 generator, RelWithDebInfo, Vulkan SDK 1.4.363.0, llvm-mc 21.1.8, with `VulkanSDK\Bin` **not** on `PATH`: - configure + `cmake --build runtime/build --target d3d12_subgroup_test` succeeds, all four variants translated; - `ctest -R ^d3d12_subgroup$` passes (1.89 s). ## Note on the current `main` Tested on `31276208`. At the current `main` (`7e39a81ea`) this machine cannot build `gta6rt_d3d12_com` at all, in a clean build directory: - `d3d12_vulkan_device.cpp(10001)`: `DescriptorHeap` has no constructor taking `(state, desc, console_address, console_size)`; - `(10002)`: `Device::identity` is private; - `d3d12_xs_device.cpp(1606)`: `rt::d3d12::create_console_descriptor_heap` is not declared there (the file does not include `d3d12_com.h`). That is unrelated to this change (it touches only `runtime/CMakeLists.txt`), but it is why CI may be red here. AI-assisted.
d3d12_subgroup_test translates cs_w64x_readlane, cs_wqm_w32 and
ps_w64x_readlane through test/shaders/build.py, which runs spirv-as. Every
other shader-test block passes LEONIDA_SPIRV_TOOLS so build.py puts the SDK
tools on PATH; the subgroup block did not, so a configure with only
-DLEONIDA_SPIRV_AS=<path> (VulkanSDK\Bin not on PATH) still failed the build
with "spirv-as not found; install SPIRV-Tools (spirv-as, spirv-val) and put it
on PATH".

Compute the tools folder outside the M1.5 guard, so it is set whenever
spirv-as is found, and pass it to the subgroup command.

Tested on Windows 10 19045 with the Vulkan SDK's Bin absent from PATH:
configure and `cmake --build runtime/build --target d3d12_subgroup_test`
succeed (four shader variants translated) and `ctest -R ^d3d12_subgroup$`
passes in 1.89 s. Found while building the seven shader tests with llvm-mc
21.1.8.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 08:45:14 +00:00
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/123/head:github-bot/gh-123'
git switch 'github-bot/gh-123'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-123'
git switch 'github-bot/gh-123'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-123'
git switch 'github-bot/gh-123'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-123'
git switch 'main'
git merge --squash 'github-bot/gh-123'
git switch 'main'
git merge --ff-only 'github-bot/gh-123'
git switch 'main'
git merge 'github-bot/gh-123'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.