Add HLSL SPIR-V tool scripts

This commit is contained in:
Meta Vens 2026-06-10 21:30:49 +01:00
commit 2c9f81fbf1
4 changed files with 117 additions and 0 deletions

View file

@ -72,6 +72,22 @@ cargo test --manifest-path native/cultmath-core/Cargo.toml
cargo build --release --manifest-path native/cultmath-core/Cargo.toml
```
## Shader Tooling
CultMath keeps portable DXC outside git under `.tools/`:
```powershell
.\tools\get-dxc.ps1
.\tools\compile-hlsl-spirv.ps1 `
-ShaderPath E:\Projects\Odin\crates\muninn-move-tracker\shaders\MoveSphereCandidate.comp.hlsl `
-OutputPath E:\Projects\Odin\crates\muninn-move-tracker\artifacts\shader\MoveSphereCandidate.comp.spv `
-IncludePath E:\Projects\CultMath\shaders
```
DXC emits Vulkan SPIR-V with `-spirv`. `-TargetEnv vulkan1.2` is exposed by the
script, but the current Windows DXC release compiled this shader successfully
with DXC's default Vulkan target while rejecting the dotted target-env value.
## Doctrine
The goal is mechanical sympathy between CPU-side authoring, native kernels, and