ADD: shader compile script

This commit is contained in:
2025-12-21 01:10:45 +09:00
parent 249c78b2aa
commit a3c0029723
4 changed files with 158 additions and 12 deletions

View File

@@ -23,7 +23,8 @@
- Shaders
- CMake compiles GLSL via `glslangValidator` to SPIRV targeting Vulkan 1.2:
- Files under `shaders/*.vert|*.frag|*.comp` are rebuilt on `cmake --build`.
- Windows helper: `./compile_shaders.ps1` uses `glslc` with `--target-env=vulkan1.3` and supports additional stages (mesh/task/ray tracing).
- Helper: `./compile_shaders.py --config Debug|Release` uses `glslc` with `--target-env=vulkan1.3` and supports additional stages (mesh/task/ray tracing).
- Windows shim: `./compile_shaders.ps1 -Config Debug|Release` (calls the Python script).
- Ensure `glslangValidator`/`glslc` is on `PATH`. See `docs/SHADERS.md`.
- Windows SDK note
@@ -41,4 +42,3 @@
- Validation Layers
- Enabled in Debug (`kUseValidationLayers = true` in `src/core/config.h`).
- Disable by building Release or toggling the flag during local experimentation.

View File

@@ -5,8 +5,9 @@
- Build integration
- CMake invokes `glslangValidator -V` for `*.vert`, `*.frag`, `*.comp` targeting Vulkan 1.2.
- Windows PowerShell helper `compile_shaders.ps1` uses `glslc` targeting Vulkan 1.3 and supports additional stages:
- Helper `compile_shaders.py` uses `glslc` targeting Vulkan 1.3 and supports additional stages:
- `.mesh` (`-fshader-stage=mesh`), `.task`, and ray tracing stages (`.rgen`, `.rmiss`, `.rchit`, `.rahit`, `.rint`, `.rcall`).
- Windows shim: `compile_shaders.ps1 -Config Debug|Release|RelWithDebInfo`.
- Keep `glslangValidator`/`glslc` on `PATH` and ensure your Vulkan SDK is installed.
- Hot reload
@@ -55,4 +56,3 @@ GLSL Includes
| `input_structures.glsl` | SceneData UBO, material bindings, light structs |
| `lighting_common.glsl` | BRDF evaluation, point light helpers |
| `ibl_common.glsl` | IBL split-sum, SH irradiance |