summaryrefslogtreecommitdiffstats
path: root/external/glslang-generated
diff options
context:
space:
mode:
authorjsmall-nvidia <jsmall@nvidia.com>2020-07-31 16:31:30 -0400
committerGitHub <noreply@github.com>2020-07-31 13:31:30 -0700
commit4549597709e29b85b5f95503f4f2258c16db12be (patch)
treeef9dd57c9975e928950e0289e017bf622bea9298 /external/glslang-generated
parentfc8b5758ca7a9b3aaf2f93d45ff570fab2a68bb8 (diff)
Upgrade to Glslang 11.0.0 (#1466)
* Fix premake5.lua so it uses the new path needed for OpenCLDebugInfo100.h * Keep including the includes directory. * Added the spirv-tools-generated files. * We don't need to include the spirv/unified1 path because the files needed are actually in the spirv-tools-generated folder. * Put the build_info.h glslang generated files in external/glslang-generated. Alter premake5.lua to pick up that header. * First pass at documenting how to build glslang and spirv-tools. * Improved glsl/spir-v tools README.md * Added revision.h * Change how gResources is calculated. Update about revision.h * Update docs a little. * Split out spirv-tools into a separate project for building glslang. This was not necessary on linux, but *is* necessary on windows, because there is a file disassemble.cpp in spirv-tools and in glslang, and this leads to VS choosing only one. With the separate library, the problem is resolved. * Fix direct-spirv-emit output. * Update to latest version of spirv headers and spirv-tools. * Upgrade submodule version of glslang in external. * Add fPIC to build options of slang-spirv-tools * Upgrade slang-binaries to have new glslang. * Fix issues with Windows slang-glslang binaries, via update of slang-binaries used. * Small improvements to glslang building process documentation. Co-authored-by: Tim Foley <tfoleyNV@users.noreply.github.com>
Diffstat (limited to 'external/glslang-generated')
-rw-r--r--external/glslang-generated/README.md60
-rw-r--r--external/glslang-generated/glslang/Include/revision.h3
-rw-r--r--external/glslang-generated/glslang/build_info.h62
3 files changed, 125 insertions, 0 deletions
diff --git a/external/glslang-generated/README.md b/external/glslang-generated/README.md
new file mode 100644
index 000000000..818605bdb
--- /dev/null
+++ b/external/glslang-generated/README.md
@@ -0,0 +1,60 @@
+Slang Glslang
+=============
+
+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
+
+* external/spirv-headers
+* external/spirv-tools
+
+These are not external projects but files produces elsewhere and placed in the slang project.
+
+* external/spirv-tools-generated
+* external/glslang-external
+
+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
+```
+
+Next we need to create glslang/Include/revision.h. In notes it seems like this may not be needed much longer, but was needed for this build. We run the l/unix shell script `make-revision`. On windows it worked fine within cygwin (and did the previous python step). We then copy the file to `external/glslang-generated/glslang/Include/revision.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 gmake --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
+``` \ No newline at end of file
diff --git a/external/glslang-generated/glslang/Include/revision.h b/external/glslang-generated/glslang/Include/revision.h
new file mode 100644
index 000000000..5ff65586b
--- /dev/null
+++ b/external/glslang-generated/glslang/Include/revision.h
@@ -0,0 +1,3 @@
+// This header is generated by the make-revision script.
+
+#define GLSLANG_PATCH_LEVEL 3195
diff --git a/external/glslang-generated/glslang/build_info.h b/external/glslang-generated/glslang/build_info.h
new file mode 100644
index 000000000..319bfa5f7
--- /dev/null
+++ b/external/glslang-generated/glslang/build_info.h
@@ -0,0 +1,62 @@
+// Copyright (C) 2020 The Khronos Group Inc.
+//
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions
+// are met:
+//
+// Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+// Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following
+// disclaimer in the documentation and/or other materials provided
+// with the distribution.
+//
+// Neither the name of The Khronos Group Inc. nor the names of its
+// contributors may be used to endorse or promote products derived
+// from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+// POSSIBILITY OF SUCH DAMAGE.
+
+#ifndef GLSLANG_BUILD_INFO
+#define GLSLANG_BUILD_INFO
+
+#define GLSLANG_VERSION_MAJOR 11
+#define GLSLANG_VERSION_MINOR 0
+#define GLSLANG_VERSION_PATCH 0
+#define GLSLANG_VERSION_FLAVOR ""
+
+#define GLSLANG_VERSION_GREATER_THAN(major, minor, patch) \
+ (((major) > GLSLANG_VERSION_MAJOR) || ((major) == GLSLANG_VERSION_MAJOR && \
+ (((minor) > GLSLANG_VERSION_MINOR) || ((minor) == GLSLANG_VERSION_MINOR && \
+ ((patch) > GLSLANG_VERSION_PATCH)))))
+
+#define GLSLANG_VERSION_GREATER_OR_EQUAL_TO(major, minor, patch) \
+ (((major) > GLSLANG_VERSION_MAJOR) || ((major) == GLSLANG_VERSION_MAJOR && \
+ (((minor) > GLSLANG_VERSION_MINOR) || ((minor) == GLSLANG_VERSION_MINOR && \
+ ((patch) >= GLSLANG_VERSION_PATCH)))))
+
+#define GLSLANG_VERSION_LESS_THAN(major, minor, patch) \
+ (((major) < GLSLANG_VERSION_MAJOR) || ((major) == GLSLANG_VERSION_MAJOR && \
+ (((minor) < GLSLANG_VERSION_MINOR) || ((minor) == GLSLANG_VERSION_MINOR && \
+ ((patch) < GLSLANG_VERSION_PATCH)))))
+
+#define GLSLANG_VERSION_LESS_OR_EQUAL_TO(major, minor, patch) \
+ (((major) < GLSLANG_VERSION_MAJOR) || ((major) == GLSLANG_VERSION_MAJOR && \
+ (((minor) < GLSLANG_VERSION_MINOR) || ((minor) == GLSLANG_VERSION_MINOR && \
+ ((patch) <= GLSLANG_VERSION_PATCH)))))
+
+#endif // GLSLANG_BUILD_INFO