Bool -> uint/int with OpSpecConstantOp OpSelect instruction. uint <-> int conversion with OpSpecConstantOp OpIAdd instruction. Note, implicit conversion: `const uint = an_int_spec_constant` is not supported. Explicit type casting is required: `const uint = uint(an_int_spec_constant)`
168 lines
8.0 KiB
Plaintext
168 lines
8.0 KiB
Plaintext
spv.specConstantOperations.vert
|
|
Warning, version 450 is not yet complete; most version-specific features are present, but some are missing.
|
|
|
|
|
|
Linked vertex stage:
|
|
|
|
|
|
// Module Version 10000
|
|
// Generated by (magic number): 80001
|
|
// Id's are bound by 134
|
|
|
|
Capability Shader
|
|
1: ExtInstImport "GLSL.std.450"
|
|
MemoryModel Logical GLSL450
|
|
EntryPoint Vertex 4 "main"
|
|
Source GLSL 450
|
|
Name 4 "main"
|
|
Name 8 "non_const_array_size_from_spec_const("
|
|
Name 11 "i"
|
|
Name 27 "array"
|
|
Decorate 19 SpecId 201
|
|
Decorate 40 SpecId 200
|
|
Decorate 42 SpecId 202
|
|
Decorate 43 SpecId 203
|
|
2: TypeVoid
|
|
3: TypeFunction 2
|
|
6: TypeInt 32 1
|
|
7: TypeFunction 6(int)
|
|
10: TypePointer Function 6(int)
|
|
12: 6(int) Constant 0
|
|
19: 6(int) SpecConstant 10
|
|
20: 6(int) Constant 2
|
|
21: 6(int) SpecConstantOp 128 19 20
|
|
22: TypeBool
|
|
24: 6(int) SpecConstantOp 128 19 20
|
|
25: TypeArray 6(int) 24
|
|
26: TypePointer Function 25
|
|
29: 6(int) Constant 1023
|
|
32: 6(int) Constant 1
|
|
34: 6(int) SpecConstantOp 128 19 32
|
|
39: TypeFloat 32
|
|
40: 39(float) SpecConstant 1078530010
|
|
41: TypeInt 32 0
|
|
42: 41(int) SpecConstant 100
|
|
43: 6(int) SpecConstant 4294967286
|
|
44: 41(int) Constant 0
|
|
45: 22(bool) SpecConstantOp 171 19 44
|
|
46: 22(bool) SpecConstantOp 171 42 44
|
|
47: 6(int) SpecConstantOp 169 45 32 12
|
|
48: 41(int) Constant 1
|
|
49: 41(int) SpecConstantOp 169 45 48 44
|
|
50: 41(int) SpecConstantOp 128 43 44
|
|
51: 6(int) SpecConstantOp 128 42 12
|
|
52: 6(int) SpecConstantOp 126 19
|
|
53: 6(int) SpecConstantOp 200 19
|
|
54: 6(int) SpecConstantOp 128 19 20
|
|
55: 6(int) SpecConstantOp 128 19 20
|
|
56: 6(int) Constant 3
|
|
57: 6(int) SpecConstantOp 130 55 56
|
|
58: 6(int) Constant 4
|
|
59: 6(int) SpecConstantOp 130 54 58
|
|
60: 6(int) SpecConstantOp 132 43 20
|
|
61: 41(int) Constant 2
|
|
62: 41(int) SpecConstantOp 132 42 61
|
|
63: 6(int) Constant 5
|
|
64: 6(int) SpecConstantOp 135 60 63
|
|
65: 41(int) Constant 5
|
|
66: 41(int) SpecConstantOp 134 62 65
|
|
67: 6(int) SpecConstantOp 139 43 58
|
|
68: 41(int) Constant 4
|
|
69: 41(int) SpecConstantOp 137 42 68
|
|
70: 6(int) SpecConstantOp 132 43 56
|
|
71: 6(int) SpecConstantOp 135 70 63
|
|
72: 6(int) Constant 10
|
|
73: 6(int) SpecConstantOp 195 43 72
|
|
74: 6(int) Constant 20
|
|
75: 41(int) SpecConstantOp 194 42 74
|
|
76: 6(int) SpecConstantOp 196 43 32
|
|
77: 41(int) SpecConstantOp 196 42 20
|
|
78: 6(int) Constant 256
|
|
79: 6(int) SpecConstantOp 197 43 78
|
|
80: 41(int) Constant 512
|
|
81: 41(int) SpecConstantOp 198 42 80
|
|
82: 22(bool) SpecConstantOp 177 19 43
|
|
83: 22(bool) SpecConstantOp 170 42 42
|
|
84: 22(bool) SpecConstantOp 173 19 43
|
|
85: TypeVector 6(int) 4
|
|
86: 6(int) Constant 30
|
|
87: 85(ivec4) SpecConstantComposite 74 86 19 19
|
|
88: TypeVector 41(int) 4
|
|
89: 41(int) Constant 4294967295
|
|
90: 41(int) Constant 4294967294
|
|
91: 88(ivec4) SpecConstantComposite 42 42 89 90
|
|
92: TypeVector 39(float) 4
|
|
93: 39(float) Constant 1067450368
|
|
94: 92(fvec4) SpecConstantComposite 40 93 40 93
|
|
95: TypeVector 22(bool) 4
|
|
96: 88(ivec4) ConstantComposite 44 44 44 44
|
|
97: 95(bvec4) SpecConstantOp 171 87 96
|
|
98: 95(bvec4) SpecConstantOp 171 91 96
|
|
99: 85(ivec4) ConstantComposite 12 12 12 12
|
|
100: 85(ivec4) ConstantComposite 32 32 32 32
|
|
101: 85(ivec4) SpecConstantOp 169 97 100 99
|
|
102: 88(ivec4) ConstantComposite 48 48 48 48
|
|
103: 88(ivec4) SpecConstantOp 169 97 102 96
|
|
104: 88(ivec4) SpecConstantOp 128 87 96
|
|
105: 85(ivec4) SpecConstantOp 128 91 99
|
|
106: 85(ivec4) SpecConstantOp 200 87
|
|
107: 85(ivec4) SpecConstantOp 126 87
|
|
108: 85(ivec4) ConstantComposite 20 20 20 20
|
|
109: 85(ivec4) SpecConstantOp 128 87 108
|
|
110: 85(ivec4) SpecConstantOp 128 87 108
|
|
111: 85(ivec4) ConstantComposite 56 56 56 56
|
|
112: 85(ivec4) SpecConstantOp 130 110 111
|
|
113: 85(ivec4) ConstantComposite 58 58 58 58
|
|
114: 85(ivec4) SpecConstantOp 130 112 113
|
|
115: 85(ivec4) SpecConstantOp 132 87 108
|
|
116: 85(ivec4) ConstantComposite 63 63 63 63
|
|
117: 85(ivec4) SpecConstantOp 135 115 116
|
|
118: 85(ivec4) SpecConstantOp 139 87 113
|
|
119: 85(ivec4) ConstantComposite 72 72 72 72
|
|
120: 85(ivec4) SpecConstantOp 195 87 119
|
|
121: 85(ivec4) SpecConstantOp 196 87 108
|
|
122: 6(int) Constant 1024
|
|
123: 85(ivec4) ConstantComposite 122 122 122 122
|
|
124: 85(ivec4) SpecConstantOp 197 87 123
|
|
125: 41(int) Constant 2048
|
|
126: 88(ivec4) ConstantComposite 125 125 125 125
|
|
127: 88(ivec4) SpecConstantOp 198 91 126
|
|
128: 6(int) SpecConstantOp 81 87 0
|
|
129: TypeVector 6(int) 2
|
|
130: 129(ivec2) SpecConstantOp 79 87 87 1(GLSL.std.450) 0
|
|
131: TypeVector 6(int) 3
|
|
132: 131(ivec3) SpecConstantOp 79 87 87 2 1(GLSL.std.450) 0
|
|
133: 85(ivec4) SpecConstantOp 79 87 87 1(GLSL.std.450) 2 0 3
|
|
4(main): 2 Function None 3
|
|
5: Label
|
|
Return
|
|
FunctionEnd
|
|
8(non_const_array_size_from_spec_const(): 6(int) Function None 7
|
|
9: Label
|
|
11(i): 10(ptr) Variable Function
|
|
27(array): 26(ptr) Variable Function
|
|
Store 11(i) 12
|
|
Branch 13
|
|
13: Label
|
|
LoopMerge 15 16 None
|
|
Branch 17
|
|
17: Label
|
|
18: 6(int) Load 11(i)
|
|
23: 22(bool) SLessThan 18 21
|
|
BranchConditional 23 14 15
|
|
14: Label
|
|
28: 6(int) Load 11(i)
|
|
30: 10(ptr) AccessChain 27(array) 28
|
|
Store 30 29
|
|
Branch 16
|
|
16: Label
|
|
31: 6(int) Load 11(i)
|
|
33: 6(int) IAdd 31 32
|
|
Store 11(i) 33
|
|
Branch 13
|
|
15: Label
|
|
35: 10(ptr) AccessChain 27(array) 34
|
|
36: 6(int) Load 35
|
|
ReturnValue 36
|
|
FunctionEnd
|