2021-11-06 10:52:07 +11:00
|
|
|
# Build file for shaders.
|
|
|
|
|
|
|
|
# You must have Vulkan tools in your path, or patch here.
|
|
|
|
|
|
|
|
glslang_validator = glslangValidator
|
|
|
|
spirv_cross = spirv-cross
|
2021-11-12 06:48:58 +11:00
|
|
|
dxc = dxc
|
2021-11-06 10:52:07 +11:00
|
|
|
|
2021-11-12 01:59:27 +11:00
|
|
|
# See https://github.com/KhronosGroup/SPIRV-Cross/issues/1248 for
|
|
|
|
# why we set this.
|
|
|
|
msl_flags = --msl-decoration-binding
|
|
|
|
|
2021-11-06 10:52:07 +11:00
|
|
|
rule glsl
|
2021-11-07 10:08:43 +11:00
|
|
|
command = $glslang_validator $flags -V -o $out $in
|
2021-11-06 10:52:07 +11:00
|
|
|
|
|
|
|
rule hlsl
|
|
|
|
command = $spirv_cross --hlsl $in --output $out
|
|
|
|
|
2021-11-12 06:48:58 +11:00
|
|
|
rule dxil
|
|
|
|
command = $dxc -T cs_6_0 $in -Fo $out
|
|
|
|
|
2021-11-06 10:52:07 +11:00
|
|
|
rule msl
|
2021-11-12 01:59:27 +11:00
|
|
|
command = $spirv_cross --msl $in --output $out $msl_flags
|
2021-11-06 10:52:07 +11:00
|
|
|
|
2021-11-11 09:56:00 +11:00
|
|
|
build gen/clear.spv: glsl clear.comp
|
|
|
|
build gen/clear.hlsl: hlsl gen/clear.spv
|
2021-11-12 06:48:58 +11:00
|
|
|
build gen/clear.dxil: dxil gen/clear.hlsl
|
2021-11-11 09:56:00 +11:00
|
|
|
build gen/clear.msl: msl gen/clear.spv
|
|
|
|
|
2021-11-06 10:52:07 +11:00
|
|
|
build gen/prefix.spv: glsl prefix.comp
|
|
|
|
build gen/prefix.hlsl: hlsl gen/prefix.spv
|
2021-11-12 06:48:58 +11:00
|
|
|
build gen/prefix.dxil: dxil gen/prefix.hlsl
|
2021-11-06 10:52:07 +11:00
|
|
|
build gen/prefix.msl: msl gen/prefix.spv
|
2021-11-07 10:08:43 +11:00
|
|
|
|
2021-11-12 06:47:46 +11:00
|
|
|
build gen/prefix_atomic.spv: glsl prefix.comp
|
|
|
|
flags = -DATOMIC
|
|
|
|
build gen/prefix_atomic.hlsl: hlsl gen/prefix_atomic.spv
|
|
|
|
build gen/prefix_atomic.dxil: dxil gen/prefix_atomic.hlsl
|
|
|
|
build gen/prefix_atomic.msl: msl gen/prefix_atomic.spv
|
|
|
|
|
|
|
|
build gen/prefix_vkmm.spv: glsl prefix.comp
|
|
|
|
flags = -DATOMIC -DVKMM
|
|
|
|
# Vulkan memory model doesn't translate
|
|
|
|
|
2021-11-07 10:08:43 +11:00
|
|
|
build gen/prefix_reduce.spv: glsl prefix_reduce.comp
|
|
|
|
build gen/prefix_reduce.hlsl: hlsl gen/prefix_reduce.spv
|
2021-11-12 06:48:58 +11:00
|
|
|
build gen/prefix_reduce.dxil: dxil gen/prefix_reduce.hlsl
|
2021-11-07 10:08:43 +11:00
|
|
|
build gen/prefix_reduce.msl: msl gen/prefix_reduce.spv
|
|
|
|
|
|
|
|
build gen/prefix_root.spv: glsl prefix_scan.comp
|
|
|
|
flags = -DROOT
|
|
|
|
build gen/prefix_root.hlsl: hlsl gen/prefix_root.spv
|
2021-11-12 06:48:58 +11:00
|
|
|
build gen/prefix_root.dxil: dxil gen/prefix_root.hlsl
|
2021-11-07 10:08:43 +11:00
|
|
|
build gen/prefix_root.msl: msl gen/prefix_root.spv
|
|
|
|
|
|
|
|
build gen/prefix_scan.spv: glsl prefix_scan.comp
|
|
|
|
build gen/prefix_scan.hlsl: hlsl gen/prefix_scan.spv
|
2021-11-12 06:48:58 +11:00
|
|
|
build gen/prefix_scan.dxil: dxil gen/prefix_scan.hlsl
|
2021-11-07 10:08:43 +11:00
|
|
|
build gen/prefix_scan.msl: msl gen/prefix_scan.spv
|
2021-11-12 11:17:04 +11:00
|
|
|
|
|
|
|
build gen/message_passing.spv: glsl message_passing.comp
|
|
|
|
build gen/message_passing.hlsl: hlsl gen/message_passing.spv
|
|
|
|
build gen/message_passing.dxil: dxil gen/message_passing.hlsl
|
|
|
|
build gen/message_passing.msl: msl gen/message_passing.spv
|
|
|
|
|
|
|
|
build gen/message_passing_vkmm.spv: glsl message_passing.comp
|
|
|
|
flags = -DVKMM
|
2021-11-07 15:03:20 +11:00
|
|
|
|
|
|
|
build gen/linkedlist.spv: glsl linkedlist.comp
|
|
|
|
build gen/linkedlist.hlsl: hlsl gen/linkedlist.spv
|
|
|
|
build gen/linkedlist.dxil: dxil gen/linkedlist.hlsl
|
|
|
|
build gen/linkedlist.msl: msl gen/linkedlist.spv
|