Introduction to Glslang
The Glslang package contains an
frontend and validator for OpenGL, OpenGL ES, and Vulkan shaders.
Glslang Dependencies
Required
CMake-3.31.0 and SPIRV-Tools-1.3.296.0
Installation of Glslang
Install Glslang by running the
following commands:
mkdir build &&
cd build &&
cmake -D CMAKE_INSTALL_PREFIX=/usr \
-D CMAKE_BUILD_TYPE=Release \
-D ALLOW_EXTERNAL_SPIRV_TOOLS=ON \
-D BUILD_SHARED_LIBS=ON \
-D GLSLANG_TESTS=ON \
-G Ninja .. &&
ninja
To test the results, issue: ninja
test.
Now, as the root
user:
ninja install
32-bit Installation of Glslang
First clean the build directory:
rm -rf *
Install lib32-Glslang by running
the following commands:
CC="gcc -m32" CXX="g++ -m32" \
PKG_CONFIG_PATH=/usr/lib32/pkgconfig \
cmake -D CMAKE_INSTALL_PREFIX=/usr \
-D CMAKE_INSTALL_LIBDIR=lib32 \
-D CMAKE_BUILD_TYPE=Release \
-D ALLOW_EXTERNAL_SPIRV_TOOLS=ON \
-D BUILD_SHARED_LIBS=ON \
-D GLSLANG_TESTS=ON \
-G Ninja .. &&
ninja
Now, as the root
user:
DESTDIR=$PWD/DESTDIR ninja install &&
cp -vr DESTDIR/usr/lib32/* /usr/lib32 &&
rm -rf DESTDIR &&
ldconfig
Command Explanations
-D
ALLOW_EXTERNAL_SPIRV_TOOLS=ON
: This switch allows the
build system to use the system-installed copy of SPIRV-Tools-1.3.296.0, instead of
downloading and installing it's own copy.
-D BUILD_SHARED_LIBS=ON
:
This switch builds shared versions of the libraries, and does not
install static versions of them.
-D GLSLANG_TESTS=ON
: This
switch builds the tests for the package.
Contents
Installed Programs:
glslang, glslang-validator (symlink to
glslang), and spirv-remap
Installed Libraries:
libglslang.so,
libglslang-default-resource-limits.so, libSPIRV.so, and
libSPVRemapper.so
Installed Directories:
/usr/include/glslang and
/usr/lib/cmake/glslang
Short Descriptions
glslang
|
provides a front end and validator for OpenGL, OpenGL ES,
and Vulkan shaders
|
libglslang.so
|
contains functions that provide a front-end and validator
for OpenGL, OpenGL ES, and Vulkan shaders to other
programs
|
libSPIRV.so
|
provides a front-end and generator for SPIR-V binaries
|
libSPVRemapper.so
|
provides a remapper for SPIR-V binaries
|