Switch from glslang to shaderc

This commit is contained in:
BtbN 2021-12-05 20:30:30 +01:00
parent 2d6767df32
commit 6c878d3f15
3 changed files with 53 additions and 34 deletions

View file

@ -1,32 +0,0 @@
#!/bin/bash
GLSLANG_REPO="https://github.com/KhronosGroup/glslang.git"
GLSLANG_COMMIT="d1608ab1ef17f1488bdcbfe11f2c3c96ac482fce"
ffbuild_enabled() {
[[ $ADDINS_STR == *4.4* ]] && return -1
return 0
}
ffbuild_dockerbuild() {
git-mini-clone "$GLSLANG_REPO" "$GLSLANG_COMMIT" glslang
cd glslang
python3 ./update_glslang_sources.py
mkdir build && cd build
cmake -DCMAKE_TOOLCHAIN_FILE="$FFBUILD_CMAKE_TOOLCHAIN" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="$FFBUILD_PREFIX" \
-DBUILD_SHARED_LIBS=OFF -DBUILD_EXTERNAL=ON -DBUILD_TESTING=OFF -DENABLE_CTEST=OFF \
-DENABLE_OPT=ON -DENABLE_HLSL=ON -DENABLE_GLSLANG_BINARIES=OFF ..
make -j$(nproc)
make install
}
ffbuild_configure() {
echo --enable-libglslang
}
ffbuild_unconfigure() {
echo --disable-libglslang
}

View file

@ -0,0 +1,50 @@
#!/bin/bash
SHADERC_REPO="https://github.com/google/shaderc.git"
SHADERC_COMMIT="657c5ed2ba1714c0430895a274a94d6f2aeeab85"
ffbuild_enabled() {
[[ $ADDINS_STR == *4.4* ]] && return -1
return 0
}
ffbuild_dockerbuild() {
git-mini-clone "$SHADERC_REPO" "$SHADERC_COMMIT" shaderc
cd shaderc
./utils/git-sync-deps
mkdir build && cd build
cmake -GNinja -DCMAKE_TOOLCHAIN_FILE="$FFBUILD_CMAKE_TOOLCHAIN" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="$FFBUILD_PREFIX" \
-DSHADERC_SKIP_TESTS=ON -DSHADERC_SKIP_EXAMPLES=ON -DSHADERC_SKIP_COPYRIGHT_CHECK=ON \
-DENABLE_EXCEPTIONS=ON -DENABLE_CTEST=OFF -DENABLE_GLSLANG_BINARIES=OFF -DSPIRV_SKIP_EXECUTABLES=ON \
-DSPIRV_TOOLS_BUILD_STATIC=ON -DBUILD_SHARED_LIBS=OFF ..
ninja -j$(nproc)
ninja install
# for some reason, this does not get installed...
cp libshaderc_util/libshaderc_util.a "$FFBUILD_PREFIX"/lib
echo "Libs: -lstdc++" >> "$FFBUILD_PREFIX"/lib/pkgconfig/shaderc_combined.pc
echo "Libs: -lstdc++" >> "$FFBUILD_PREFIX"/lib/pkgconfig/shaderc_static.pc
cp "$FFBUILD_PREFIX"/lib/pkgconfig/{shaderc_combined,shaderc}.pc
if [[ $TARGET == win* ]]; then
rm -r "$FFBUILD_PREFIX"/bin "$FFBUILD_PREFIX"/lib/*.dll.a
elif [[ $TARGET == linux* ]]; then
rm -r "$FFBUILD_PREFIX"/bin "$FFBUILD_PREFIX"/lib/*.so*
else
echo "Unknown target"
return -1
fi
}
ffbuild_configure() {
echo --enable-libshaderc
}
ffbuild_unconfigure() {
echo --disable-libshaderc
}

View file

@ -1,7 +1,7 @@
#!/bin/bash
PLACEBO_REPO="https://code.videolan.org/videolan/libplacebo.git"
PLACEBO_COMMIT="72cd260ad7d5aa564ff5e68caf16ec2633f3460e"
PLACEBO_COMMIT="5e8fdf2316c2d5531531a07c782410c860faaf18"
ffbuild_enabled() {
[[ $ADDINS_STR == *4.4* ]] && return -1
@ -21,7 +21,8 @@ ffbuild_dockerbuild() {
-Dvulkan=enabled
-Dvulkan-link=false
-Dvulkan-registry="$FFBUILD_PREFIX"/share/vulkan/registry/vk.xml
-Dglslang=enabled
-Dshaderc=enabled
-Dglslang=disabled
-Ddemos=false
-Dtests=false
-Dbench=false