yum-mirror/slang

Making it easier to work with shaders

git clone https://git.yummers.dev/yum-mirror/slang

Ellie HermaszewskaUse gmake2 as a premake target over gmake (#2587)c5895fb0b

master
2.1 KiB65 linesraw

Slang Glslang Generated

This directory holds files that are generated that are needed to build glslang. The github repository that holds slangs current version of glslang is

https://github.com/shader-slang/glslang

Building glslang depends on the submodules

  • external/spirv-headers
  • external/spirv-tools

The following are not submodules files, and are produces elsewhere and placed in the slang project.

  • external/spirv-tools-generated
  • external/glslang-generated

Updating glslang

On Linux, you can run the external/bump-glslang.sh script.

On any platform, you can follow the below instructions:

To get the latest version of one of the submodules you can use

% git pull origin master

Make sure you have compatible versions of 'external/spirv-header', 'external/spirv-tools' and 'glslang' before you start!

In the context of Slang we build glslang as a Slang specific shared library/dll. The library is built from a project created by the regular Slang premake. That process is discussed later as there are a bunch of other steps that need to be completed before we can create the Slang glslang project and build it.

First we need to create the build_info.h file in glslang. We can do this from the command line via (assuming we are in the Slang root directory).

% cd external/glslang
% python build_info.py . -i build_info.h.tmpl -o ../glslang-generated/glslang/build_info.h

The glslang project is dependent on 'spirv-tools', so the next step is to set them up. How to do this is described in the README.md file in the external/spirv-tools-generated folder.

Creating and building the Slang glslang project

In normal operation premake5.lua does not build glslang because it is a slow process, so it must be specified explicitly on the command line for premake.

For Visual Studio

% premake vs2015 --build-glslang=true

For gcc or clang (add -cc=clang)

% premake gmake2 --build-glslang=true

Then just build Slang as usual in visual studio, or from the linux command line for example

% make config=release_x64
% make config=release_x86
1Slang Glslang Generated
2=======================
3
4This directory holds files that are generated that are needed to build glslang. The github repository that holds slangs current version of glslang is 
5
6https://github.com/shader-slang/glslang
7
8Building glslang depends on the submodules
9
10* external/spirv-headers
11* external/spirv-tools
12
13The following are not submodules files, and are produces elsewhere and placed in the slang project.
14
15* external/spirv-tools-generated
16* external/glslang-generated
17
18Updating glslang
19----------------
20
21*On Linux, you can run the [`external/bump-glslang.sh`](../bump-glslang.sh) script.*
22
23*On any platform, you can follow the below instructions:*
24
25To get the latest version of one of the submodules you can use
26
27```
28% git pull origin master
29```
30
31Make sure you have compatible versions of 'external/spirv-header', 'external/spirv-tools' and 'glslang' before you start!
32
33In the context of Slang we build glslang as a Slang specific shared library/dll. The library is built from a project created by the regular Slang premake. That process is discussed later as there are a bunch of other steps that need to be completed before we can create the Slang glslang project and build it. 
34
35First we need to create the `build_info.h` file in glslang. We can do this from the command line via (assuming we are in the Slang root directory). 
36
37```
38% cd external/glslang
39% python build_info.py . -i build_info.h.tmpl -o ../glslang-generated/glslang/build_info.h
40```
41
42The glslang project is dependent on 'spirv-tools', so the next step is to set them up. How to do this is described in the README.md file in the `external/spirv-tools-generated` folder. 
43
44## Creating and building the Slang glslang project
45
46In normal operation `premake5.lua` does not build glslang because it is a slow process, so it must be specified explicitly on the command line for `premake`. 
47
48For Visual Studio 
49
50```
51% premake vs2015 --build-glslang=true
52```
53
54For gcc or clang (add -cc=clang)
55
56```
57% premake gmake2 --build-glslang=true
58```
59
60Then just build Slang as usual in visual studio, or from the linux command line for example
61
62```
63% make config=release_x64
64% make config=release_x86
65```