mirror of
https://github.com/glfs-book/glfs.git
synced 2025-07-22 01:12:59 +00:00
359 lines
11 KiB
XML
359 lines
11 KiB
XML
<?xml version="1.0" encoding="UTF-8"?>
|
|
<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
|
|
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
|
|
<!ENTITY % general-entities SYSTEM "../../general.ent">
|
|
%general-entities;
|
|
|
|
<!ENTITY vk-common "vulkan-sdk-&vulkan-sdk;">
|
|
<!ENTITY kg-url "https://github.com/KhronosGroup/">
|
|
]>
|
|
|
|
<sect1 id="vulkan-sdk" xreflabel="Vulkan-SDK-&vulkan-sdk;">
|
|
<?dbhtml filename="vulkan-sdk.html"?>
|
|
|
|
<title>Vulkan-SDK-&vulkan-sdk;</title>
|
|
|
|
<indexterm zone="vulkan-sdk">
|
|
<primary sortas="a-vulkan-sdk">Vulkan-SDK</primary>
|
|
</indexterm>
|
|
|
|
<sect2 role="package">
|
|
<title>Introduction to Vulkan-SDK</title>
|
|
|
|
<para>
|
|
This page covers the installation of the Vulkan headers and the loader,
|
|
the SPIR-V headers and tools, and the glslang compiler.
|
|
</para>
|
|
|
|
<para>
|
|
Vulkan is a graphics API that allows a wealth of control over how each
|
|
step is handled in the graphics pipeline. It is used by Steam's Proton
|
|
and <xref linkend="dxvk"/>. OpenGL is much higher level and often leads
|
|
to worse performance. However, it is up to the developer to implement
|
|
either. This SDK doesn't provide any Vulkan driver, just what is needed
|
|
for Vulkan applications and drivers.
|
|
</para>
|
|
|
|
<para>
|
|
The SPIR-V tools process SPIR-V modules, often attributed to shader
|
|
code/binaries. Khronos APIs, like OpenGL and Vulkan, make use of them.
|
|
The tooling provides a base other applications can use to convert to and
|
|
from.
|
|
</para>
|
|
|
|
<para>
|
|
Glslang is a reference compiler and validator for the GLSL (OpenGL Shader
|
|
Language). It is one of the compilers that can convert SPIR-V, such as
|
|
GLSL to SPIR-V. In some cases, packages can compile shaders and turn
|
|
them into header files which get included by a C/C++ file(s). In OpenGL,
|
|
this process doesn't need glslang at all as OpenGL functions directory
|
|
can compile shaders from a string and be binded for execution on every
|
|
frame. With Vulkan, a separate shader compiler is needed to facilitate
|
|
shader compilation.
|
|
</para>
|
|
|
|
&long-build-time;
|
|
|
|
<bridgehead renderas="sect3">Vulkan-SDK Dependencies</bridgehead>
|
|
|
|
<bridgehead renderas="sect4">Required</bridgehead>
|
|
<para role="required">
|
|
<xref linkend="cmake"/> and <xref linkend="xorg7-lib"/>
|
|
</para>
|
|
|
|
<bridgehead renderas="sect4">Recommended</bridgehead>
|
|
<para role="recommended">
|
|
<xref linkend="wayland"/>
|
|
</para>
|
|
|
|
<bridgehead renderas="sect3">BLFS Equivalent Packages</bridgehead>
|
|
<para>This combined page installs what would be in BLFS:</para>
|
|
<itemizedlist>
|
|
<listitem><para>
|
|
<ulink url="&blfs-svn;/x/vulkan-headers.html">Vulkan-Headers</ulink>
|
|
</para></listitem>
|
|
<listitem><para>
|
|
<ulink url="&blfs-svn;/x/vulkan-loader.html">Vulkan-Loader</ulink>
|
|
</para></listitem>
|
|
<listitem><para>
|
|
<ulink url="&blfs-svn;/general/spirv-headers.html">SPIRV-Headers</ulink>
|
|
</para></listitem>
|
|
<listitem><para>
|
|
<ulink url="&blfs-svn;/general/spirv-tools.html">SPIRV-Tools</ulink>
|
|
</para></listitem>
|
|
<listitem><para>
|
|
<ulink url="&blfs-svn;/x/glslang.html">Glslang</ulink>
|
|
</para></listitem>
|
|
</itemizedlist>
|
|
|
|
</sect2>
|
|
|
|
<sect2>
|
|
<title>Downloading Vulkan-SDK</title>
|
|
|
|
<para>
|
|
First, create a list of files to be downloaded:
|
|
</para>
|
|
|
|
<screen><userinput>cat > &vk-common;-list << "EOF"
|
|
<literal>Vulkan-Headers/archive/&vk-common;/Vulkan-Headers-&vk-common;.tar.gz
|
|
Vulkan-Loader/archive/&vk-common;/Vulkan-Loader-&vk-common;.tar.gz
|
|
SPIRV-Headers/archive/&vk-common;/SPIRV-Headers-&vk-common;.tar.gz
|
|
SPIRV-Tools/archive/&vk-common;/SPIRV-Tools-&vk-common;.tar.gz
|
|
glslang/archive/&vk-common;/glslang-&vk-common;.tar.gz</literal>
|
|
EOF</userinput></screen>
|
|
|
|
<para>
|
|
To download the needed files using <xref linkend='wget'/>,
|
|
use the following commands:
|
|
</para>
|
|
|
|
<screen><userinput>mkdir &vk-common; &&
|
|
cd &vk-common; &&
|
|
grep -v '^#' ../&vk-common;-list | wget -i- -c \
|
|
-B &kg-url;</userinput></screen>
|
|
|
|
</sect2>
|
|
|
|
<sect2 role="installation">
|
|
<title>Installation of Vulkan-SDK</title>
|
|
|
|
&as_root;
|
|
|
|
<para>
|
|
First, start a subshell that will exit on error:
|
|
</para>
|
|
|
|
<screen><userinput>bash -e</userinput></screen>
|
|
|
|
<para>
|
|
Install all of the packages by running the following commands:
|
|
</para>
|
|
|
|
<screen><userinput>for package in {Vulkan-{Headers,Loader},SPIRV-{Headers,Tools},glslang}
|
|
do
|
|
longpackage=$package-&vk-common;.tar.?z*
|
|
packagedir=${longpackage%.tar.?z*}
|
|
tar -xf $longpackage
|
|
pushd $packagedir
|
|
mkdir build
|
|
cd build
|
|
case $package in
|
|
SPIRV-Tools )
|
|
cmake -D CMAKE_INSTALL_PREFIX=/usr \
|
|
-D CMAKE_BUILD_TYPE=Release \
|
|
-D SPIRV_WERROR=OFF \
|
|
-D BUILD_SHARED_LIBS=ON \
|
|
-D SPIRV_TOOLS_BUILD_STATIC=OFF \
|
|
-D SPIRV-Headers_SOURCE_DIR=/usr \
|
|
-G Ninja ..
|
|
;;
|
|
glslang )
|
|
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=OFF \
|
|
-G Ninja ..
|
|
;;
|
|
* )
|
|
cmake -D CMAKE_INSTALL_PREFIX=/usr \
|
|
-D CMAKE_BUILD_TYPE=Release \
|
|
-D CMAKE_SKIP_INSTALL_RPATH=ON \
|
|
-G Ninja ..
|
|
;;
|
|
esac
|
|
ninja
|
|
as_root ninja install
|
|
popd
|
|
rm -rf $packagedir
|
|
done</userinput></screen>
|
|
|
|
<para>For multilib:</para>
|
|
|
|
<screen><userinput>for package in {Vulkan-Loader,SPIRV-Tools,glslang}
|
|
do
|
|
longpackage=$package-&vk-common;.tar.?z*
|
|
packagedir=${longpackage%.tar.?z*}
|
|
tar -xf $longpackage
|
|
pushd $packagedir
|
|
mkdir build
|
|
cd build
|
|
case $package in
|
|
SPIRV-Tools )
|
|
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 SPIRV_WERROR=OFF \
|
|
-D BUILD_SHARED_LIBS=ON \
|
|
-D SPIRV_TOOLS_BUILD_STATIC=OFF \
|
|
-D SPIRV-Headers_SOURCE_DIR=/usr \
|
|
-G Ninja ..
|
|
;;
|
|
glslang )
|
|
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=OFF \
|
|
-G Ninja ..
|
|
;;
|
|
* )
|
|
ASFLAGS+=" --32" CFLAGS+=" -m32" \
|
|
CXXFLAGS+=" -m32" \
|
|
PKG_CONFIG_PATH=/usr/lib32/pkgconfig \
|
|
cmake -D CMAKE_INSTALL_PREFIX=/usr \
|
|
-D CMAKE_INSTALL_LIBDIR=lib32 \
|
|
-D CMAKE_BUILD_TYPE=Release \
|
|
-D CMAKE_SKIP_INSTALL_RPATH=ON \
|
|
-G Ninja ..
|
|
;;
|
|
esac
|
|
ninja
|
|
DESTDIR=$PWD/DESTDIR ninja install
|
|
as_root cp -Rv DESTDIR/usr/lib32/* /usr/lib32
|
|
rm -rf DESTDIR
|
|
as_root /sbin/ldconfig
|
|
popd
|
|
rm -rf $packagedir
|
|
done</userinput></screen>
|
|
|
|
<para>
|
|
Finally, exit the shell that was started earlier:
|
|
</para>
|
|
|
|
<screen><userinput>exit</userinput></screen>
|
|
|
|
</sect2>
|
|
|
|
<sect2 role="content">
|
|
<title>Contents</title>
|
|
|
|
<segmentedlist>
|
|
<segtitle>Installed Programs</segtitle>
|
|
<segtitle>Installed Libraries</segtitle>
|
|
<segtitle>Installed Directories</segtitle>
|
|
|
|
<seglistitem>
|
|
<seg>
|
|
glslang,
|
|
glslang-validator (symlink to glslang),
|
|
spirv-as,
|
|
spirv-cfg,
|
|
spirv-dis,
|
|
spirv-lesspipe.sh,
|
|
spirv-link,
|
|
spirv-lint,
|
|
spirv-objdump,
|
|
spirv-opt,
|
|
spirv-reduce,
|
|
spirv-remap, and
|
|
spirv-val
|
|
</seg>
|
|
<seg>
|
|
libglslang,
|
|
libglslang-default-resource-limits,
|
|
libSPIRV,
|
|
libSPIRV-Tools-diff,
|
|
libSPIRV-Tools-link,
|
|
libSPIRV-Tools-lint,
|
|
libSPIRV-Tools-opt,
|
|
libSPIRV-Tools-reduce,
|
|
libSPIRV-Tools-shared,
|
|
libSPIRV-Tools,
|
|
libSPVRemapper, and
|
|
libvulkan
|
|
</seg>
|
|
<seg>
|
|
/usr/include/glslang,
|
|
/usr/include/spirv,
|
|
/usr/include/spirv-tools,
|
|
/usr/include/vk_video,
|
|
/usr/include/vulkan,
|
|
/usr/lib/cmake/glslang,
|
|
/usr/lib/cmake/SPIRV-Tools,
|
|
/usr/lib/cmake/VulkanLoader,
|
|
/usr/share/cmake/VulkanHeaders,
|
|
/usr/share/cmake/SPIRV-Headers, and
|
|
/usr/share/vulkan
|
|
</seg>
|
|
</seglistitem>
|
|
</segmentedlist>
|
|
|
|
<variablelist>
|
|
<bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
|
<?dbfo list-presentation="list"?>
|
|
<?dbhtml list-presentation="table"?>
|
|
|
|
<varlistentry id="glslang">
|
|
<term><command>glslang</command></term>
|
|
<listitem>
|
|
<para>
|
|
is a reference GLSL and SPIR-V shader compiler
|
|
</para>
|
|
<indexterm zone="vulkan-sdk glslang">
|
|
<primary sortas="b-glslang">glslang</primary>
|
|
</indexterm>
|
|
</listitem>
|
|
</varlistentry>
|
|
|
|
<varlistentry id="libglslang">
|
|
<term><filename class="libraryfile">libglslang</filename></term>
|
|
<listitem>
|
|
<para>
|
|
contains backend functions for the <command>glslang</command>
|
|
frontend
|
|
</para>
|
|
<indexterm zone="vulkan-sdk libglslang">
|
|
<primary sortas="c-libglslang">libglslang</primary>
|
|
</indexterm>
|
|
</listitem>
|
|
</varlistentry>
|
|
|
|
<varlistentry id="libSPIRV">
|
|
<term><filename class="libraryfile">libSPIRV</filename></term>
|
|
<listitem>
|
|
<para>
|
|
processes and generates SPIR-V binaries
|
|
</para>
|
|
<indexterm zone="vulkan-sdk libSPIRV">
|
|
<primary sortas="c-libSPIRV">libSPIRV</primary>
|
|
</indexterm>
|
|
</listitem>
|
|
</varlistentry>
|
|
|
|
<varlistentry id="libSPIRV-Tools">
|
|
<term><filename class="libraryfile">libSPIRV-Tools</filename></term>
|
|
<listitem>
|
|
<para>
|
|
contains functions for processing SPIR-V modules
|
|
</para>
|
|
<indexterm zone="vulkan-sdk libSPIRV-Tools">
|
|
<primary sortas="c-libSPIRV-Tools">libSPIRV-Tools</primary>
|
|
</indexterm>
|
|
</listitem>
|
|
</varlistentry>
|
|
|
|
<varlistentry id="libvulkan">
|
|
<term><filename class="libraryfile">libvulkan</filename></term>
|
|
<listitem>
|
|
<para>
|
|
provides the Vulkan API and core support for graphics drivers
|
|
</para>
|
|
<indexterm zone="vulkan-sdk libvulkan">
|
|
<primary sortas="c-libvulkan">libvulkan</primary>
|
|
</indexterm>
|
|
</listitem>
|
|
</varlistentry>
|
|
|
|
</variablelist>
|
|
|
|
</sect2>
|
|
|
|
</sect1>
|