glslang-zig/glslang/MachineIndependent
qining 0840838d17 Support specialization composite constants
Fix issue #163, support creation and reference of composite type
specialization constants.

e.g.:
```
layout(constant_id = 200) const float myfloat = 1.25;
layout(constant_id = 201) const int myint = 14;
struct structtype {
  float f;
  int i;
};
const structtype outer_struct_var = {myfloat, myint};
void main(){}
```
generated code (use glslangValidator):
```
// Module Version 10000
// Generated by (magic number): 80001
// Id's are bound by 12

                              Capability Shader
               1:             ExtInstImport  "GLSL.std.450"
                              MemoryModel Logical GLSL450
                              EntryPoint Vertex 4  "main"
                              Source GLSL 450
                              Name 4  "main"
                              Name 10  "structtype"
                              MemberName 10(structtype) 0  "f"
                              MemberName 10(structtype) 1  "i"
                              Decorate 7 SpecId 200
                              Decorate 9 SpecId 201
               2:             TypeVoid
               3:             TypeFunction 2
               6:             TypeFloat 32
               7:    6(float) SpecConstant 1067450368
               8:             TypeInt 32 1
               9:      8(int) SpecConstant 14
  10(structtype):             TypeStruct 6(float) 8(int)
              11:10(structtype) SpecConstantComposite 7 9
         4(main):           2 Function None 3
               5:             Label
                              Return
                              FunctionEnd
```

Rname two function names to match their functionalities.
1) Rename `GlslangToSpvTraverser::createSpvSpecConstant()` to
`createSpvConstant()`;
2) Rename `GlslangToSpvTraverser::createSpvConstant()` to
`createSpvConstantFromConstUnionArray()`

Add function `GlslangToSpvTraverser::createSpvConstantFromSubTree()` to
handle constant creation from sub trees (e.g.: specialization constants).

Related PR: #208
2016-03-24 18:04:00 -04:00
..
preprocessor Fixed compilation issue introduced by my last commit 2016-03-21 16:05:47 -04:00
Constant.cpp Fix warnings/errors for strict aliasing & function prototypes 2016-02-23 12:17:11 -05:00
gl_types.h Second round line ending clean up, from fresh round trip. 2015-06-26 16:42:50 -06:00
glslang.y SPV: Implement Vulkan version of GLSL (KHR_vulkan_glsl). 2016-02-15 21:46:55 -07:00
glslang_tab.cpp Commit bison-generated files from Windows GNU Bison 2.7 2016-02-28 09:15:31 +01:00
glslang_tab.cpp.h Commit bison-generated files from Windows GNU Bison 2.7 2016-02-28 09:15:31 +01:00
InfoSink.cpp Fix the few non-portable uses of "char" (where a -1 might be relevant): All uses of char are now either "int", "unsigned char" or char arrays for storing strings. Also, went to consistent "char* foo" coding convention. (There were only a few ambiguous uses.) 2014-02-18 23:37:57 +00:00
Initialize.cpp Fix warnings/errors for strict aliasing & function prototypes 2016-02-23 12:17:11 -05:00
Initialize.h SPV: Implement Vulkan version of GLSL (KHR_vulkan_glsl). 2016-02-15 21:46:55 -07:00
Intermediate.cpp Front-end: propagate specialization-constness through conversions and swizzles. 2016-03-20 18:45:23 -06:00
intermOut.cpp Front-end: Add specialization-constant subtrees for const variables/symbols. 2016-03-20 16:46:00 -06:00
IntermTraverse.cpp SPV: Implement Vulkan version of GLSL (KHR_vulkan_glsl). 2016-02-15 21:46:55 -07:00
limits.cpp Array of Array prep: Turn a batch of 0's into nullptr or UnsizedArraySize. 2015-08-09 18:15:25 -06:00
linkValidate.cpp SPV: Implement Vulkan version of GLSL (KHR_vulkan_glsl). 2016-02-15 21:46:55 -07:00
localintermediate.h Front-end: Add specialization-constant subtrees for const variables/symbols. 2016-03-20 16:46:00 -06:00
parseConst.cpp glslang: Fix over 100 warnings from MSVC warning level 4. 2015-05-15 17:30:55 +00:00
ParseHelper.cpp Support specialization composite constants 2016-03-24 18:04:00 -04:00
ParseHelper.h SPV: Implement Vulkan version of GLSL (KHR_vulkan_glsl). 2016-02-15 21:46:55 -07:00
PoolAlloc.cpp Support compilation via MinGW 2016-03-16 15:41:31 -04:00
reflection.cpp SPV: Fix array strides by explicitly computing them in the getBaseAlignment() algorithm. 2015-12-29 19:20:55 -07:00
reflection.h Fix g++ build break (portibility problems with stl hash). This partly turns off the stl improvements. 2015-07-20 02:06:22 -06:00
RemoveTree.cpp Improvement to the AST traversal infrastructure. 2014-01-11 19:29:55 +00:00
RemoveTree.h Put all glslang internals (but not the external interface) into the glslang namespace. 2013-08-29 00:39:25 +00:00
Scan.cpp Fix warnings/errors for strict aliasing & function prototypes 2016-02-23 12:17:11 -05:00
Scan.h Fixed compilation issue introduced by my last commit 2016-03-21 16:05:47 -04:00
ScanContext.h glslang: Fix over 100 warnings from MSVC warning level 4. 2015-05-15 17:30:55 +00:00
ShaderLang.cpp Updated the includer interface to allow relative includes. 2016-03-21 10:19:45 -04:00
SymbolTable.cpp Front-end: Add specialization-constant subtrees for const variables/symbols. 2016-03-20 16:46:00 -06:00
SymbolTable.h Front-end: Add specialization-constant subtrees for const variables/symbols. 2016-03-20 16:46:00 -06:00
Versions.cpp SPV: Implement Vulkan version of GLSL (KHR_vulkan_glsl). 2016-02-15 21:46:55 -07:00
Versions.h SPV: Implement Vulkan version of GLSL (KHR_vulkan_glsl). 2016-02-15 21:46:55 -07:00