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

@@ -1,9 +1,10 @@
$COMMON = @("--target-env=vulkan1.3", "-O", "-g", "-Werror", "-I", "shaders")
param(
[ValidateSet("Debug", "Release", "RelWithDebInfo")]
[string]$Config = "RelWithDebInfo",
[string]$Python = "python"
)
Get-ChildItem -Path "shaders" -Include *.frag,*.vert,*.comp,*.geom,*.tesc,*.tese,*.mesh,*.task,*.rgen,*.rint,*.rahit,*.rchit,*.rmiss,*.rcall -Recurse |
ForEach-Object {
$extra = @()
if ($_.Extension -eq ".mesh") { $extra += "-fshader-stage=mesh" }
elseif ($_.Extension -eq ".task") { $extra += "-fshader-stage=task" }
glslc $_.FullName @COMMON @extra -o "$($_.FullName).spv"
}
$script_dir = Split-Path -Parent $MyInvocation.MyCommand.Path
$py = Join-Path $script_dir "compile_shaders.py"
& $Python $py --config $Config