mirror of
https://github.com/rive-app/rive-cpp.git
synced 2026-01-18 21:21:17 +01:00
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>
32 lines
803 B
Bash
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.
|