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
| Name |
Last commit
|
Last update |
|---|---|---|
| .. | ||
| 100.frag.out | Loading commit data... | |
| 100Limits.vert.out | Loading commit data... | |
| 100LimitsConf.vert.out | Loading commit data... | |
| 100scope.vert.out | Loading commit data... | |
| 110scope.vert.out | Loading commit data... | |
| 120.frag.out | Loading commit data... | |
| 120.vert.out | Loading commit data... | |
| 130.frag.out | Loading commit data... | |
| 130.vert.out | Loading commit data... | |
| 140.frag.out | Loading commit data... | |
| 140.vert.out | Loading commit data... | |
| 150.frag.out | Loading commit data... | |
| 150.geom.out | Loading commit data... | |
| 150.tesc.out | Loading commit data... | |
| 150.vert.out | Loading commit data... | |
| 300.frag.out | Loading commit data... | |
| 300.vert.out | Loading commit data... | |
| 300BuiltIns.frag.out | Loading commit data... | |
| 300block.frag.out | Loading commit data... | |
| 300layout.frag.out | Loading commit data... | |
| 300layout.vert.out | Loading commit data... | |
| 300link.frag.out | Loading commit data... | |
| 300link2.frag.out | Loading commit data... | |
| 300link3.frag.out | Loading commit data... | |
| 300operations.frag.out | Loading commit data... | |
| 300scope.vert.out | Loading commit data... | |
| 310.comp.out | Loading commit data... | |
| 310.frag.out | Loading commit data... | |
| 310.geom.out | Loading commit data... | |
| 310.tesc.out | Loading commit data... | |
| 310.tese.out | Loading commit data... | |
| 310.vert.out | Loading commit data... | |
| 310AofA.vert.out | Loading commit data... | |
| 310implicitSizeArrayError.vert.out | Loading commit data... | |
| 330.frag.out | Loading commit data... | |
| 330comp.frag.out | Loading commit data... | |
| 400.frag.out | Loading commit data... | |
| 400.geom.out | Loading commit data... | |
| 400.tesc.out | Loading commit data... | |
| 400.tese.out | Loading commit data... | |
| 410.geom.out | Loading commit data... | |
| 410.tesc.out | Loading commit data... | |
| 420.frag.out | Loading commit data... | |
| 420.geom.out | Loading commit data... | |
| 420.tesc.out | Loading commit data... | |
| 420.tese.out | Loading commit data... | |
| 420.vert.out | Loading commit data... | |
| 420_size_gl_in.geom.out | Loading commit data... | |
| 430.comp.out | Loading commit data... | |
| 430.vert.out | Loading commit data... | |
| 430AofA.frag.out | Loading commit data... | |
| 430scope.vert.out | Loading commit data... | |
| 440.frag.out | Loading commit data... | |
| 440.vert.out | Loading commit data... | |
| 450.comp.out | Loading commit data... | |
| 450.frag.out | Loading commit data... | |
| 450.geom.out | Loading commit data... | |
| 450.tesc.out | Loading commit data... | |
| 450.tese.out | Loading commit data... | |
| 450.vert.out | Loading commit data... | |
| Operations.frag.out | Loading commit data... | |
| aggOps.frag.out | Loading commit data... | |
| always-discard.frag.out | Loading commit data... | |
| always-discard2.frag.out | Loading commit data... | |
| array.frag.out | Loading commit data... | |
| array100.frag.out | Loading commit data... | |
| atomic_uint.frag.out | Loading commit data... | |
| badChars.frag.out | Loading commit data... | |
| comment.frag.out | Loading commit data... | |
| conditionalDiscard.frag.out | Loading commit data... | |
| constErrors.frag.out | Loading commit data... | |
| constFold.frag.out | Loading commit data... | |
| conversion.frag.out | Loading commit data... | |
| cppComplexExpr.vert.out | Loading commit data... | |
| cppIndent.vert.out | Loading commit data... | |
| cppNest.vert.out | Loading commit data... | |
| cppSimple.vert.out | Loading commit data... | |
| dataOut.frag.out | Loading commit data... | |
| dataOutIndirect.frag.out | Loading commit data... | |
| dce.frag.out | Loading commit data... | |
| decls.frag.out | Loading commit data... | |
| deepRvalue.frag.out | Loading commit data... | |
| depthOut.frag.out | Loading commit data... | |
| discard-dce.frag.out | Loading commit data... | |
| doWhileLoop.frag.out | Loading commit data... | |
| earlyReturnDiscard.frag.out | Loading commit data... | |
| empty.frag.out | Loading commit data... | |
| errors.frag.out | Loading commit data... | |
| flowControl.frag.out | Loading commit data... | |
| forLoop.frag.out | Loading commit data... | |
| forwardRef.frag.out | Loading commit data... | |
| functionCall.frag.out | Loading commit data... | |
| functionSemantics.frag.out | Loading commit data... | |
| length.frag.out | Loading commit data... | |
| lineContinuation.vert.out | Loading commit data... | |
| lineContinuation100.vert.out | Loading commit data... | |
| link1.frag.out | Loading commit data... | |
| localAggregates.frag.out | Loading commit data... | |
| loops.frag.out | Loading commit data... | |
| loopsArtificial.frag.out | Loading commit data... | |
| mains1.frag.out | Loading commit data... | |
| matrix.frag.out | Loading commit data... | |
| matrix2.frag.out | Loading commit data... | |
| matrixError.vert.out | Loading commit data... | |
| max_vertices_0.geom.out | Loading commit data... | |
| newTexture.frag.out | Loading commit data... | |
| noMain.vert.out | Loading commit data... | |
| nonSquare.vert.out | Loading commit data... | |
| nonVulkan.frag.out | Loading commit data... | |
| numeral.frag.out | Loading commit data... | |
| pointCoord.frag.out | Loading commit data... | |
| precision.frag.out | Loading commit data... | |
| precision.vert.out | Loading commit data... | |
| prepost.frag.out | Loading commit data... | |
| preprocessor.cpp_style___FILE__.vert.err | Loading commit data... | |
| preprocessor.cpp_style___FILE__.vert.out | Loading commit data... | |
| preprocessor.cpp_style_line_directive.vert.err | Loading commit data... | |
| preprocessor.cpp_style_line_directive.vert.out | Loading commit data... | |
| preprocessor.defined.vert.err | Loading commit data... | |
| preprocessor.defined.vert.out | Loading commit data... | |
| preprocessor.edge_cases.vert.err | Loading commit data... | |
| preprocessor.edge_cases.vert.out | Loading commit data... | |
| preprocessor.errors.vert.err | Loading commit data... | |
| preprocessor.errors.vert.out | Loading commit data... | |
| preprocessor.extensions.vert.err | Loading commit data... | |
| preprocessor.extensions.vert.out | Loading commit data... | |
| preprocessor.function_macro.vert.err | Loading commit data... | |
| preprocessor.function_macro.vert.out | Loading commit data... | |
| preprocessor.include.disabled.vert.err | Loading commit data... | |
| preprocessor.include.disabled.vert.out | Loading commit data... | |
| preprocessor.include.enabled.vert.err | Loading commit data... | |
| preprocessor.include.enabled.vert.out | Loading commit data... | |
| preprocessor.line.frag.err | Loading commit data... | |
| preprocessor.line.frag.out | Loading commit data... | |
| preprocessor.line.vert.err | Loading commit data... | |
| preprocessor.line.vert.out | Loading commit data... | |
| preprocessor.many.endif.vert.err | Loading commit data... | |
| preprocessor.many.endif.vert.out | Loading commit data... | |
| preprocessor.pragma.vert.err | Loading commit data... | |
| preprocessor.pragma.vert.out | Loading commit data... | |
| preprocessor.simple.vert.err | Loading commit data... | |
| preprocessor.simple.vert.out | Loading commit data... | |
| preprocessor.success_if_parse_would_fail.vert.err | Loading commit data... | |
| preprocessor.success_if_parse_would_fail.vert.out | Loading commit data... | |
| recurse1.vert.out | Loading commit data... | |
| reflection.vert.out | Loading commit data... | |
| sample.frag.out | Loading commit data... | |
| sample.vert.out | Loading commit data... | |
| simpleFunctionCall.frag.out | Loading commit data... | |
| specExamples.frag.out | Loading commit data... | |
| specExamples.vert.out | Loading commit data... | |
| spv.100ops.frag.out | Loading commit data... | |
| spv.130.frag.out | Loading commit data... | |
| spv.140.frag.out | Loading commit data... | |
| spv.150.geom.out | Loading commit data... | |
| spv.150.vert.out | Loading commit data... | |
| spv.300BuiltIns.vert.out | Loading commit data... | |
| spv.300layout.frag.out | Loading commit data... | |
| spv.300layout.vert.out | Loading commit data... | |
| spv.300layoutp.vert.out | Loading commit data... | |
| spv.310.comp.out | Loading commit data... | |
| spv.330.geom.out | Loading commit data... | |
| spv.400.frag.out | Loading commit data... | |
| spv.400.tesc.out | Loading commit data... | |
| spv.400.tese.out | Loading commit data... | |
| spv.420.geom.out | Loading commit data... | |
| spv.430.vert.out | Loading commit data... | |
| spv.AofA.frag.out | Loading commit data... | |
| spv.Operations.frag.out | Loading commit data... | |
| spv.accessChain.frag.out | Loading commit data... | |
| spv.aggOps.frag.out | Loading commit data... | |
| spv.always-discard.frag.out | Loading commit data... | |
| spv.always-discard2.frag.out | Loading commit data... | |
| spv.atomic.comp.out | Loading commit data... | |
| spv.bitCast.frag.out | Loading commit data... | |
| spv.bool.vert.out | Loading commit data... | |
| spv.boolInBlock.frag.out | Loading commit data... | |
| spv.branch-return.vert.out | Loading commit data... | |
| spv.conditionalDiscard.frag.out | Loading commit data... | |
| spv.conversion.frag.out | Loading commit data... | |
| spv.dataOut.frag.out | Loading commit data... | |
| spv.dataOutIndirect.frag.out | Loading commit data... | |
| spv.dataOutIndirect.vert.out | Loading commit data... | |
| spv.deepRvalue.frag.out | Loading commit data... | |
| spv.depthOut.frag.out | Loading commit data... | |
| spv.discard-dce.frag.out | Loading commit data... | |
| spv.do-simple.vert.out | Loading commit data... | |
| spv.do-while-continue-break.vert.out | Loading commit data... | |
| spv.doWhileLoop.frag.out | Loading commit data... | |
| spv.double.comp.out | Loading commit data... | |
| spv.earlyReturnDiscard.frag.out | Loading commit data... | |
| spv.flowControl.frag.out | Loading commit data... | |
| spv.for-complex-condition.vert.out | Loading commit data... | |
| spv.for-continue-break.vert.out | Loading commit data... | |
| spv.for-nobody.vert.out | Loading commit data... | |
| spv.for-notest.vert.out | Loading commit data... | |
| spv.for-simple.vert.out | Loading commit data... | |
| spv.forLoop.frag.out | Loading commit data... | |
| spv.forwardFun.frag.out | Loading commit data... | |
| spv.functionCall.frag.out | Loading commit data... | |
| spv.functionSemantics.frag.out | Loading commit data... | |
| spv.image.frag.out | Loading commit data... | |
| spv.intOps.vert.out | Loading commit data... | |
| spv.interpOps.frag.out | Loading commit data... | |
| spv.layoutNested.vert.out | Loading commit data... | |
| spv.length.frag.out | Loading commit data... | |
| spv.localAggregates.frag.out | Loading commit data... | |
| spv.loops.frag.out | Loading commit data... | |
| spv.loopsArtificial.frag.out | Loading commit data... | |
| spv.matFun.vert.out | Loading commit data... | |
| spv.matrix.frag.out | Loading commit data... | |
| spv.matrix2.frag.out | Loading commit data... | |
| spv.memoryQualifier.frag.out | Loading commit data... | |
| spv.merge-unreachable.frag.out | Loading commit data... | |
| spv.newTexture.frag.out | Loading commit data... | |
| spv.noDeadDecorations.vert.out | Loading commit data... | |
| spv.nonSquare.vert.out | Loading commit data... | |
| spv.precision.frag.out | Loading commit data... | |
| spv.prepost.frag.out | Loading commit data... | |
| spv.pushConstant.vert.out | Loading commit data... | |
| spv.qualifiers.vert.out | Loading commit data... | |
| spv.queryL.frag.out | Loading commit data... | |
| spv.separate.frag.out | Loading commit data... | |
| spv.set.vert.out | Loading commit data... | |
| spv.shiftOps.frag.out | Loading commit data... | |
| spv.shortCircuit.frag.out | Loading commit data... | |
| spv.simpleFunctionCall.frag.out | Loading commit data... | |
| spv.simpleMat.vert.out | Loading commit data... | |
| spv.sparseTexture.frag.out | Loading commit data... | |
| spv.sparseTextureClamp.frag.out | Loading commit data... | |
| spv.specConstant.comp.out | Loading commit data... | |
| spv.specConstant.vert.out | Loading commit data... | |
| spv.specConstantComposite.vert.out | Loading commit data... | |
| spv.structAssignment.frag.out | Loading commit data... | |
| spv.structDeref.frag.out | Loading commit data... | |
| spv.structure.frag.out | Loading commit data... | |
| spv.subpass.frag.out | Loading commit data... | |
| spv.switch.frag.out | Loading commit data... | |
| spv.swizzle.frag.out | Loading commit data... | |
| spv.test.frag.out | Loading commit data... | |
| spv.test.vert.out | Loading commit data... | |
| spv.texture.frag.out | Loading commit data... | |
| spv.texture.vert.out | Loading commit data... | |
| spv.types.frag.out | Loading commit data... | |
| spv.uint.frag.out | Loading commit data... | |
| spv.uniformArray.frag.out | Loading commit data... | |
| spv.variableArrayIndex.frag.out | Loading commit data... | |
| spv.varyingArray.frag.out | Loading commit data... | |
| spv.varyingArrayIndirect.frag.out | Loading commit data... | |
| spv.voidFunction.frag.out | Loading commit data... | |
| spv.while-continue-break.vert.out | Loading commit data... | |
| spv.while-simple.vert.out | Loading commit data... | |
| spv.whileLoop.frag.out | Loading commit data... | |
| structAssignment.frag.out | Loading commit data... | |
| structDeref.frag.out | Loading commit data... | |
| structure.frag.out | Loading commit data... | |
| switch.frag.out | Loading commit data... | |
| swizzle.frag.out | Loading commit data... | |
| syntaxError.frag.out | Loading commit data... | |
| test.conf | Loading commit data... | |
| test.frag.out | Loading commit data... | |
| texture.frag.out | Loading commit data... | |
| tokenLength.vert.out | Loading commit data... | |
| types.frag.out | Loading commit data... | |
| uint.frag.out | Loading commit data... | |
| uniformArray.frag.out | Loading commit data... | |
| variableArrayIndex.frag.out | Loading commit data... | |
| varyingArray.frag.out | Loading commit data... | |
| varyingArrayIndirect.frag.out | Loading commit data... | |
| versionsClean.frag.out | Loading commit data... | |
| versionsClean.vert.out | Loading commit data... | |
| versionsErrors.frag.out | Loading commit data... | |
| versionsErrors.vert.out | Loading commit data... | |
| voidFunction.frag.out | Loading commit data... | |
| vulkan.comp.out | Loading commit data... | |
| vulkan.frag.out | Loading commit data... | |
| vulkan.vert.out | Loading commit data... | |
| whileLoop.frag.out | Loading commit data... |