vello/piet-gpu/shader/build.ninja
Raph Levien 47f8812e2f Start work on new element pipeline
There's a bit of reorganizing as well. Shader stages are made available
from piet-gpu to the test rig, config is now a proper structure
(marshaled with bytemuck).

This commit just has the transform stage, which is a simple monoid scan
of affine transforms.

Progress toward #119
2021-11-24 08:01:43 -08:00

60 lines
1.9 KiB
GLSL

# Build file for shaders.
# You must have Vulkan tools in your path, or patch here.
glslang_validator = glslangValidator
spirv_cross = spirv-cross
dxc = dxc
# See https://github.com/KhronosGroup/SPIRV-Cross/issues/1248 for
# why we set this.
msl_flags = --msl-decoration-binding
rule glsl
command = $glslang_validator $flags -V -o $out $in
rule hlsl
command = $spirv_cross --hlsl $in --output $out
rule dxil
command = $dxc -T cs_6_0 $in -Fo $out
rule msl
command = $spirv_cross --msl $in --output $out $msl_flags
build elements.spv: glsl elements.comp | scene.h state.h annotated.h
build binning.spv: glsl binning.comp | annotated.h state.h bins.h setup.h
build tile_alloc.spv: glsl tile_alloc.comp | annotated.h tile.h setup.h
build path_coarse.spv: glsl path_coarse.comp | annotated.h pathseg.h tile.h setup.h
build backdrop.spv: glsl backdrop.comp | annotated.h tile.h setup.h
build backdrop_lg.spv: glsl backdrop.comp | annotated.h tile.h setup.h
flags = -DBACKDROP_DIST_FACTOR=4
build coarse.spv: glsl coarse.comp | annotated.h bins.h ptcl.h setup.h
build kernel4.spv: glsl kernel4.comp | ptcl.h setup.h
# New element pipeline follows
build gen/transform_reduce.spv: glsl transform_reduce.comp | scene.h setup.h mem.h
build gen/transform_reduce.hlsl: hlsl gen/transform_reduce.spv
build gen/transform_reduce.dxil: dxil gen/transform_reduce.hlsl
build gen/transform_reduce.msl: msl gen/transform_reduce.spv
build gen/transform_root.spv: glsl transform_scan.comp
flags = -DROOT
build gen/transform_root.hlsl: hlsl gen/transform_root.spv
build gen/transform_root.dxil: dxil gen/transform_root.hlsl
build gen/transform_root.msl: msl gen/transform_root.spv
build gen/transform_leaf.spv: glsl transform_leaf.comp | scene.h tile.h setup.h mem.h
build gen/transform_leaf.hlsl: hlsl gen/transform_leaf.spv
build gen/transform_leaf.dxil: dxil gen/transform_leaf.hlsl
build gen/transform_leaf.msl: msl gen/transform_leaf.spv