cmake: pass LEONIDA_SPIRV_TOOLS to the subgroup shader build #123

Closed
Andretuta wants to merge 1 commit from upstream-pr/123 into main
Andretuta commented 2026-11-24 02:23:33 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by Andretuta on 2026-11-24T02:23:33Z.


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.

<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5464885845 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/123). Originally posted by [Andretuta](https://github.com/Andretuta) on 2026-11-24T02:23:33Z. --- > 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.
MoonEyes commented 2026-11-30 18:59:06 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-30T18:59:06Z.


Superseded by current main: subgroup shader build now passes LEONIDA_SPIRV_TOOLS and computes the tools directory when its custom command is enabled.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7288664646 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/123#issuecomment-7288664646). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-11-30T18:59:06Z. --- Superseded by current main: subgroup shader build now passes LEONIDA_SPIRV_TOOLS and computes the tools directory when its custom command is enabled.
MoonEyes commented 2026-11-30 18:59:13 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-30T18:59:13Z.


Superseded by current main; the subgroup shader command now passes the SPIRV-Tools directory.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7288667471 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/123#issuecomment-7288667471). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-11-30T18:59:13Z. --- Superseded by current main; the subgroup shader command now passes the SPIRV-Tools directory.

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
ProjectLeonida/mandy!123
No description provided.