SPV: Emit names of specialization constants

This commit is contained in:
Endre Oma 2017-01-31 21:08:19 +01:00
parent 7e134cdfbe
commit ad58d45437
9 changed files with 192 additions and 157 deletions

View file

@ -12,33 +12,44 @@ Warning, version 400 is not yet complete; most version-specific features are pre
EntryPoint Vertex 4 "main" 20 22 28 53
Source GLSL 400
Name 4 "main"
Name 9 "arraySize"
Name 14 "foo(vf4[s1516];"
Name 13 "p"
Name 17 "builtin_spec_constant("
Name 20 "color"
Name 22 "ucol"
Name 28 "size"
Name 30 "spBool"
Name 34 "scale"
Name 39 "spDouble"
Name 40 "spFloat"
Name 47 "param"
Name 50 "dupArraySize"
Name 53 "dupUcol"
Name 60 "spDupBool"
Name 63 "dupScale"
Name 67 "spDupDouble"
Name 68 "spDupFloat"
Name 76 "result"
Decorate 9 SpecId 16
Decorate 30 SpecId 17
Decorate 34 SpecId 22
Decorate 39 SpecId 19
Decorate 40 SpecId 18
Decorate 50 SpecId 116
Decorate 60 SpecId 117
Decorate 63 SpecId 122
Decorate 67 SpecId 119
Decorate 68 SpecId 118
Decorate 77 SpecId 24
Name 77 "gl_MaxImageUnits"
Decorate 9(arraySize) SpecId 16
Decorate 30(spBool) SpecId 17
Decorate 34(scale) SpecId 22
Decorate 39(spDouble) SpecId 19
Decorate 40(spFloat) SpecId 18
Decorate 50(dupArraySize) SpecId 116
Decorate 60(spDupBool) SpecId 117
Decorate 63(dupScale) SpecId 122
Decorate 67(spDupDouble) SpecId 119
Decorate 68(spDupFloat) SpecId 118
Decorate 77(gl_MaxImageUnits) SpecId 24
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32
7: TypeVector 6(float) 4
8: TypeInt 32 1
9: 8(int) SpecConstant 5
10: TypeArray 7(fvec4) 9
9(arraySize): 8(int) SpecConstant 5
10: TypeArray 7(fvec4) 9(arraySize)
11: TypePointer Function 10
12: TypeFunction 2 11(ptr)
16: TypeFunction 8(int)
@ -51,41 +62,41 @@ Warning, version 400 is not yet complete; most version-specific features are pre
27: TypePointer Output 8(int)
28(size): 27(ptr) Variable Output
29: TypeBool
30: 29(bool) SpecConstantTrue
30(spBool): 29(bool) SpecConstantTrue
33: TypeInt 32 0
34: 33(int) SpecConstant 2
34(scale): 33(int) SpecConstant 2
38: TypeFloat 64
39: 38(float) SpecConstant 1413754136 1074340347
40: 6(float) SpecConstant 1078523331
41: 38(float) SpecConstantOp 115 40
50: 8(int) SpecConstant 12
51: TypeArray 7(fvec4) 50
39(spDouble): 38(float) SpecConstant 1413754136 1074340347
40(spFloat): 6(float) SpecConstant 1078523331
41: 38(float) SpecConstantOp 115 40(spFloat)
50(dupArraySize): 8(int) SpecConstant 12
51: TypeArray 7(fvec4) 50(dupArraySize)
52: TypePointer Input 51
53(dupUcol): 52(ptr) Variable Input
60: 29(bool) SpecConstantTrue
63: 33(int) SpecConstant 2
67: 38(float) SpecConstant 1413754136 1074340347
68: 6(float) SpecConstant 1078523331
69: 38(float) SpecConstantOp 115 68
60(spDupBool): 29(bool) SpecConstantTrue
63(dupScale): 33(int) SpecConstant 2
67(spDupDouble): 38(float) SpecConstant 1413754136 1074340347
68(spDupFloat): 6(float) SpecConstant 1078523331
69: 38(float) SpecConstantOp 115 68(spDupFloat)
75: TypePointer Function 8(int)
77: 8(int) SpecConstant 8
77(gl_MaxImageUnits): 8(int) SpecConstant 8
4(main): 2 Function None 3
5: Label
47(param): 11(ptr) Variable Function
25: 24(ptr) AccessChain 22(ucol) 23
26: 7(fvec4) Load 25
Store 20(color) 26
Store 28(size) 9
Store 28(size) 9(arraySize)
SelectionMerge 32 None
BranchConditional 30 31 32
BranchConditional 30(spBool) 31 32
31: Label
35: 6(float) ConvertUToF 34
35: 6(float) ConvertUToF 34(scale)
36: 7(fvec4) Load 20(color)
37: 7(fvec4) VectorTimesScalar 36 35
Store 20(color) 37
Branch 32
32: Label
42: 38(float) FDiv 39 41
42: 38(float) FDiv 39(spDouble) 41
43: 6(float) FConvert 42
44: 7(fvec4) Load 20(color)
45: 7(fvec4) CompositeConstruct 43 43 43 43
@ -105,18 +116,18 @@ Warning, version 400 is not yet complete; most version-specific features are pre
57: 7(fvec4) FAdd 56 55
Store 20(color) 57
58: 8(int) Load 28(size)
59: 8(int) IAdd 58 50
59: 8(int) IAdd 58 50(dupArraySize)
Store 28(size) 59
SelectionMerge 62 None
BranchConditional 60 61 62
BranchConditional 60(spDupBool) 61 62
61: Label
64: 6(float) ConvertUToF 63
64: 6(float) ConvertUToF 63(dupScale)
65: 7(fvec4) Load 20(color)
66: 7(fvec4) VectorTimesScalar 65 64
Store 20(color) 66
Branch 62
62: Label
70: 38(float) FDiv 67 69
70: 38(float) FDiv 67(spDupDouble) 69
71: 6(float) FConvert 70
72: 7(fvec4) Load 20(color)
73: 7(fvec4) CompositeConstruct 71 71 71 71
@ -127,7 +138,7 @@ Warning, version 400 is not yet complete; most version-specific features are pre
17(builtin_spec_constant(): 8(int) Function None 16
18: Label
76(result): 75(ptr) Variable Function
Store 76(result) 77
Store 76(result) 77(gl_MaxImageUnits)
78: 8(int) Load 76(result)
ReturnValue 78
FunctionEnd