summaryrefslogtreecommitdiffstats
path: root/external/glslang-generated/README.md
blob: ec24497a8d6c16ce875d9e7569afb9a906b06162 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
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`](../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
```