Package spirv-reflect for building shaders
Usually not available in Linux Distributions as it isn't customary to package the SDK but only the bits needed as separate packages. Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
This commit is contained in:
parent
663982e503
commit
bbd888b3f3
1
.gitignore
vendored
1
.gitignore
vendored
@ -20,6 +20,7 @@ libraries/source/cxxtest-4.4/*
|
|||||||
libraries/source/fcollada/*
|
libraries/source/fcollada/*
|
||||||
libraries/source/nvtt/*
|
libraries/source/nvtt/*
|
||||||
libraries/source/spidermonkey/*
|
libraries/source/spidermonkey/*
|
||||||
|
libraries/source/spirv-reflect/*
|
||||||
!libraries/source/**/build.sh
|
!libraries/source/**/build.sh
|
||||||
!libraries/source/**/patches/
|
!libraries/source/**/patches/
|
||||||
|
|
||||||
|
@ -24,6 +24,7 @@ esac
|
|||||||
without_nvtt=false
|
without_nvtt=false
|
||||||
with_system_nvtt=false
|
with_system_nvtt=false
|
||||||
with_system_mozjs=false
|
with_system_mozjs=false
|
||||||
|
with_spirv_reflect=false
|
||||||
|
|
||||||
JOBS=${JOBS:="-j2"}
|
JOBS=${JOBS:="-j2"}
|
||||||
|
|
||||||
@ -32,6 +33,7 @@ for i in "$@"; do
|
|||||||
--without-nvtt) without_nvtt=true ;;
|
--without-nvtt) without_nvtt=true ;;
|
||||||
--with-system-nvtt) with_system_nvtt=true ;;
|
--with-system-nvtt) with_system_nvtt=true ;;
|
||||||
--with-system-mozjs) with_system_mozjs=true ;;
|
--with-system-mozjs) with_system_mozjs=true ;;
|
||||||
|
--with-spirv-reflect) with_spirv_reflect=true ;;
|
||||||
-j*) JOBS=$i ;;
|
-j*) JOBS=$i ;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
@ -67,5 +69,8 @@ if [ "$with_system_mozjs" = "false" ]; then
|
|||||||
cp source/spidermonkey/bin/* ../binaries/system/
|
cp source/spidermonkey/bin/* ../binaries/system/
|
||||||
fi
|
fi
|
||||||
echo
|
echo
|
||||||
|
if [ "$with_spirv_reflect" = "true" ]; then
|
||||||
|
./source/spirv-reflect/build.sh || die "spirv-reflect build failed"
|
||||||
|
fi
|
||||||
|
|
||||||
echo "Done."
|
echo "Done."
|
||||||
|
35
libraries/source/spirv-reflect/build.sh
Executable file
35
libraries/source/spirv-reflect/build.sh
Executable file
@ -0,0 +1,35 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
set -e
|
||||||
|
|
||||||
|
cd "$(dirname "$0")"
|
||||||
|
|
||||||
|
PV=1.3.290.0
|
||||||
|
LIB_VERSION=${PV}
|
||||||
|
|
||||||
|
if [ -e .already-built ] && [ "$(cat .already-built || true)" = "${LIB_VERSION}" ]; then
|
||||||
|
echo "spirv-reflect is already up to date."
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
|
# fetch
|
||||||
|
if [ ! -e "vulkan-sdk-${PV}.tar.gz" ]; then
|
||||||
|
curl -fLo "vulkan-sdk-${PV}.tar.gz" \
|
||||||
|
"https://github.com/KhronosGroup/SPIRV-Reflect/archive/refs/tags/vulkan-sdk-${PV}.tar.gz"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# unpack
|
||||||
|
rm -Rf "SPIRV-Reflect-vulkan-sdk-${PV}"
|
||||||
|
tar xf "vulkan-sdk-${PV}.tar.gz"
|
||||||
|
|
||||||
|
# configure
|
||||||
|
cmake -B build -S "SPIRV-Reflect-vulkan-sdk-${PV}" \
|
||||||
|
-DCMAKE_INSTALL_PREFIX="$(realpath . || true)"
|
||||||
|
|
||||||
|
# build
|
||||||
|
cmake --build build
|
||||||
|
|
||||||
|
# install
|
||||||
|
rm -Rf bin
|
||||||
|
cmake --install build
|
||||||
|
|
||||||
|
echo "${LIB_VERSION}" >.already-built
|
Loading…
Reference in New Issue
Block a user