Files
rive-cpp/build/rebuild_shaders.sh
JoshJRive 473f030658 fix(vulkan): get MSAA working on systems without ClipDistance support (#10624) d1c02a29aa
Referencing ClipDistance (via gl_ClipDistance) in a SPIR-V shader, even if it is in a specialization branch that is not taken, is a validation error on systems that don't support ClipDistance. To get around this, there are now noclipdistance variations of the shaders that use it, and they (along with the MSAA shaders that never use ClipDistance) all define `DISABLE_CLIP_RECT_FOR_VULKAN_MSAA`, which ensures that it never tries to compile it in except where it matters.

Co-authored-by: Josh Jersild <joshua@rive.app>
2025-09-23 19:34:09 +00:00

32 lines
803 B
Bash

if [ -z "$RIVE_RENDERER_DIR" ]; then
echo "RIVE_RENDERER_DIR environment variable needs to be set for rebuild_shaders to run"
exit 1
fi
echo $RIVE_RENDERER_DIR
pushd $RIVE_RENDERER_DIR > /dev/null
echo Entered dir: $RIVE_RENDERER_DIR
# Clean old shader files
dst_shader_dir=$1
echo Cleaning dir: $dst_shader_dir
rm -r $dst_shader_dir
make_flags="--human-readable"
# Find ply
curr_dir=`pwd`
found_ply_dir=`find ${curr_dir} -type d -wholename "*/dependencies/*/ply-*/src" -print`
if [ -n "$found_ply_dir" ]; then
echo found ply: $found_ply_dir
make_flags="-p ${found_ply_dir} ${make_flags}"
fi
# Invoke make
make -C ./src/shaders -j32 OUT=$dst_shader_dir FLAGS="${make_flags}" spirv-binary
echo Exiting dir: $RIVE_RENDERER_DIR
# Done
popd > /dev/null
echo Done compiling shaders.