glslang/SPIRV
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
..
CMakeLists.txt Implement inReadableOrder(). 2016-01-19 10:11:34 -05:00
disassemble.cpp Merge pull request #174 from mgadams/alias_proto_warnings 2016-02-24 21:43:59 -07:00
disassemble.h Move to revision 31 of SPIR-V. 2015-08-06 22:55:01 -06:00
doc.cpp SPV: Implement Vulkan version of GLSL (KHR_vulkan_glsl). 2016-02-15 21:46:55 -07:00
doc.h Fix warnings/errors for strict aliasing & function prototypes 2016-02-23 12:17:11 -05:00
GLSL.std.450.h SPV: Implement Vulkan version of GLSL (KHR_vulkan_glsl). 2016-02-15 21:46:55 -07:00
GlslangToSpv.cpp Support specialization composite constants 2016-03-24 18:04:00 -04:00
GlslangToSpv.h Updated command-line options, adding -o for saving binaries, -G for OpenGL SPIR-V validation, -v etc. 2015-07-12 19:28:10 -06:00
InReadableOrder.cpp Fix compilation issues with MSVC 2010 2016-02-23 22:17:38 +01:00
spirv.hpp SPV: Implement Vulkan version of GLSL (KHR_vulkan_glsl). 2016-02-15 21:46:55 -07:00
SpvBuilder.cpp Change to traditional 'for' loop 2016-03-09 21:40:41 -05:00
SpvBuilder.h Remove decoration of undefined IDs 2016-03-09 19:54:03 -05:00
spvIR.h Remove decoration of undefined IDs 2016-03-09 19:54:03 -05:00
SPVRemapper.cpp SPV: Implement Vulkan version of GLSL (KHR_vulkan_glsl). 2016-02-15 21:46:55 -07:00
SPVRemapper.h spirv-remap: Fixed strings not at end of operands, fixed L/S defect 2016-02-01 16:44:57 -07:00