Preprocessor: UINT_MAX is translated to constant incorrectly.
authorRex Xu <rex.xu@amd.com>
Tue, 6 Sep 2016 05:46:12 +0000 (13:46 +0800)
committerRex Xu <rex.xu@amd.com>
Fri, 9 Sep 2016 09:06:15 +0000 (17:06 +0800)
Test/baseResults/spv.int64.frag.out
Test/baseResults/spv.uint.frag.out
Test/spv.int64.frag
Test/spv.uint.frag
glslang/MachineIndependent/preprocessor/PpTokens.cpp

index b7d8ce9..d65d994 100644 (file)
@@ -8,7 +8,7 @@ Linked fragment stage:
 Missing functionality: shader int64
 // Module Version 10000
 // Generated by (magic number): 80001
-// Id's are bound by 478
+// Id's are bound by 480
 
                               Capability Shader
                               Capability Float64
@@ -24,631 +24,635 @@ Missing functionality: shader int64
                               Name 8  "typeCast("
                               Name 10  "operators("
                               Name 12  "builtinFuncs("
-                              Name 16  "i64"
-                              Name 24  "Uniforms"
-                              MemberName 24(Uniforms) 0  "index"
-                              Name 26  ""
-                              Name 33  "indexable"
-                              Name 38  "u64"
-                              Name 47  "indexable"
-                              Name 52  "i64v"
-                              Name 56  "bv"
-                              Name 65  "u64v"
-                              Name 74  "iv"
-                              Name 81  "uv"
-                              Name 89  "fv"
-                              Name 95  "dv"
-                              Name 132  "u64v"
-                              Name 137  "i64"
-                              Name 157  "i"
-                              Name 164  "uv"
-                              Name 216  "b"
-                              Name 276  "i64v"
-                              Name 279  "i64"
-                              Name 289  "u64v"
-                              Name 291  "u64"
-                              Name 363  "dv"
-                              Name 382  "iv"
-                              Name 387  "uv"
-                              Name 391  "bv"
-                              Name 452  "Block"
-                              MemberName 452(Block) 0  "i64v"
-                              MemberName 452(Block) 1  "u64"
-                              Name 454  "block"
-                              MemberDecorate 24(Uniforms) 0 Offset 0
-                              Decorate 24(Uniforms) Block
-                              Decorate 26 DescriptorSet 0
-                              Decorate 26 Binding 0
-                              MemberDecorate 452(Block) 0 Offset 0
-                              MemberDecorate 452(Block) 1 Offset 24
-                              Decorate 452(Block) Block
-                              Decorate 454(block) DescriptorSet 0
-                              Decorate 454(block) Binding 1
-                              Decorate 455 SpecId 100
-                              Decorate 456 SpecId 101
-                              Decorate 457 SpecId 102
-                              Decorate 458 SpecId 103
-                              Decorate 459 SpecId 104
+                              Name 16  "u64Max"
+                              Name 20  "i64"
+                              Name 28  "Uniforms"
+                              MemberName 28(Uniforms) 0  "index"
+                              Name 30  ""
+                              Name 37  "indexable"
+                              Name 41  "u64"
+                              Name 49  "indexable"
+                              Name 54  "i64v"
+                              Name 58  "bv"
+                              Name 67  "u64v"
+                              Name 76  "iv"
+                              Name 83  "uv"
+                              Name 91  "fv"
+                              Name 97  "dv"
+                              Name 134  "u64v"
+                              Name 139  "i64"
+                              Name 159  "i"
+                              Name 166  "uv"
+                              Name 218  "b"
+                              Name 278  "i64v"
+                              Name 281  "i64"
+                              Name 291  "u64v"
+                              Name 293  "u64"
+                              Name 365  "dv"
+                              Name 384  "iv"
+                              Name 389  "uv"
+                              Name 393  "bv"
+                              Name 454  "Block"
+                              MemberName 454(Block) 0  "i64v"
+                              MemberName 454(Block) 1  "u64"
+                              Name 456  "block"
+                              MemberDecorate 28(Uniforms) 0 Offset 0
+                              Decorate 28(Uniforms) Block
+                              Decorate 30 DescriptorSet 0
+                              Decorate 30 Binding 0
+                              MemberDecorate 454(Block) 0 Offset 0
+                              MemberDecorate 454(Block) 1 Offset 24
+                              Decorate 454(Block) Block
+                              Decorate 456(block) DescriptorSet 0
+                              Decorate 456(block) Binding 1
+                              Decorate 457 SpecId 100
+                              Decorate 458 SpecId 101
+                              Decorate 459 SpecId 102
+                              Decorate 460 SpecId 103
+                              Decorate 461 SpecId 104
                2:             TypeVoid
                3:             TypeFunction 2
-              14:             TypeInt 64 1
-              15:             TypePointer Function 14(int)
-              17:             TypeInt 32 0
-              18:     17(int) Constant 3
-              19:             TypeArray 14(int) 18
-              20:     14(int) Constant 4008636143 4008636142
-              21:     14(int) Constant 4294967295 4294967295
-              22:     14(int) Constant 0 1
-              23:          19 ConstantComposite 20 21 22
-    24(Uniforms):             TypeStruct 17(int)
-              25:             TypePointer Uniform 24(Uniforms)
-              26:     25(ptr) Variable Uniform
-              27:             TypeInt 32 1
-              28:     27(int) Constant 0
-              29:             TypePointer Uniform 17(int)
-              32:             TypePointer Function 19
-              36:             TypeInt 64 0
-              37:             TypePointer Function 36(int)
-              39:             TypeArray 36(int) 18
-              40:     36(int) Constant 4294967295 4294967295
-              41:     36(int) Constant 0 1
-              42:     36(int) Constant 4294967295 1
-              43:          39 ConstantComposite 40 41 42
-              46:             TypePointer Function 39
-              50:             TypeVector 14(int) 2
-              51:             TypePointer Function 50(ivec2)
-              53:             TypeBool
-              54:             TypeVector 53(bool) 2
-              55:             TypePointer Function 54(bvec2)
-              58:     14(int) Constant 0 0
-              59:     14(int) Constant 1 0
-              60:   50(ivec2) ConstantComposite 58 58
-              61:   50(ivec2) ConstantComposite 59 59
-              63:             TypeVector 36(int) 2
-              64:             TypePointer Function 63(ivec2)
-              67:     36(int) Constant 0 0
-              68:     36(int) Constant 1 0
-              69:   63(ivec2) ConstantComposite 67 67
-              70:   63(ivec2) ConstantComposite 68 68
-              72:             TypeVector 27(int) 2
-              73:             TypePointer Function 72(ivec2)
-              79:             TypeVector 17(int) 2
-              80:             TypePointer Function 79(ivec2)
-              86:             TypeFloat 32
-              87:             TypeVector 86(float) 2
-              88:             TypePointer Function 87(fvec2)
-              92:             TypeFloat 64
-              93:             TypeVector 92(float) 2
-              94:             TypePointer Function 93(fvec2)
-             130:             TypeVector 36(int) 3
-             131:             TypePointer Function 130(ivec3)
-             134:             TypeVector 14(int) 3
-             156:             TypePointer Function 27(int)
-             162:             TypeVector 17(int) 3
-             163:             TypePointer Function 162(ivec3)
-             197:             TypeVector 27(int) 3
-             200:     17(int) Constant 1
-             201:             TypePointer Function 17(int)
-             207:     17(int) Constant 2
-             215:             TypePointer Function 53(bool)
-             217:     17(int) Constant 0
-             287:   50(ivec2) ConstantComposite 21 21
-             296:  130(ivec3) ConstantComposite 67 67 67
-             338:    53(bool) ConstantTrue
-             345:    53(bool) ConstantFalse
-             346:   54(bvec2) ConstantComposite 345 345
-             358:             TypeVector 53(bool) 3
-             359:  358(bvec3) ConstantComposite 345 345 345
-             361:             TypeVector 92(float) 3
-             362:             TypePointer Function 361(fvec3)
-             367:             TypePointer Function 92(float)
-             378:     27(int) Constant 1
-             379:     27(int) Constant 2
-             380:   72(ivec2) ConstantComposite 378 379
-             385:   79(ivec2) ConstantComposite 207 18
-             390:             TypePointer Function 358(bvec3)
-      452(Block):             TypeStruct 134(ivec3) 36(int)
-             453:             TypePointer Uniform 452(Block)
-      454(block):    453(ptr) Variable Uniform
-             455:     14(int) SpecConstant 4294967286 4294967295
-             456:     36(int) SpecConstant 20 0
-             457:     27(int) SpecConstant 4294967291
-             458:     17(int) SpecConstant 4
-             459:    53(bool) SpecConstantTrue
-             460:    53(bool) SpecConstantOp 171 455 67
-             461:    53(bool) SpecConstantOp 171 456 67
-             462:     14(int) SpecConstantOp 169 459 59 58
-             463:     36(int) SpecConstantOp 169 459 68 67
-             464:     27(int) SpecConstantOp 114 455
-             465:     14(int) SpecConstantOp 114 457
-             466:     17(int) SpecConstantOp 113 456
-             467:     36(int) SpecConstantOp 113 458
-             468:     14(int) SpecConstantOp 128 456 67
-             469:     36(int) SpecConstantOp 128 455 67
-             470:     17(int) SpecConstantOp 113 456
-             471:     27(int) SpecConstantOp 128 470 217
-             472:     14(int) SpecConstantOp 114 457
-             473:     36(int) SpecConstantOp 128 472 67
-             474:     27(int) SpecConstantOp 114 455
-             475:     17(int) SpecConstantOp 128 474 217
-             476:     36(int) SpecConstantOp 113 458
-             477:     14(int) SpecConstantOp 128 476 67
+              14:             TypeInt 64 0
+              15:             TypePointer Private 14(int)
+      16(u64Max):     15(ptr) Variable Private
+              17:     14(int) Constant 4294967295 4294967295
+              18:             TypeInt 64 1
+              19:             TypePointer Function 18(int)
+              21:             TypeInt 32 0
+              22:     21(int) Constant 3
+              23:             TypeArray 18(int) 22
+              24:     18(int) Constant 4008636143 4008636142
+              25:     18(int) Constant 4294967295 4294967295
+              26:     18(int) Constant 0 1
+              27:          23 ConstantComposite 24 25 26
+    28(Uniforms):             TypeStruct 21(int)
+              29:             TypePointer Uniform 28(Uniforms)
+              30:     29(ptr) Variable Uniform
+              31:             TypeInt 32 1
+              32:     31(int) Constant 0
+              33:             TypePointer Uniform 21(int)
+              36:             TypePointer Function 23
+              40:             TypePointer Function 14(int)
+              42:             TypeArray 14(int) 22
+              43:     14(int) Constant 0 1
+              44:     14(int) Constant 4294967295 1
+              45:          42 ConstantComposite 17 43 44
+              48:             TypePointer Function 42
+              52:             TypeVector 18(int) 2
+              53:             TypePointer Function 52(ivec2)
+              55:             TypeBool
+              56:             TypeVector 55(bool) 2
+              57:             TypePointer Function 56(bvec2)
+              60:     18(int) Constant 0 0
+              61:     18(int) Constant 1 0
+              62:   52(ivec2) ConstantComposite 60 60
+              63:   52(ivec2) ConstantComposite 61 61
+              65:             TypeVector 14(int) 2
+              66:             TypePointer Function 65(ivec2)
+              69:     14(int) Constant 0 0
+              70:     14(int) Constant 1 0
+              71:   65(ivec2) ConstantComposite 69 69
+              72:   65(ivec2) ConstantComposite 70 70
+              74:             TypeVector 31(int) 2
+              75:             TypePointer Function 74(ivec2)
+              81:             TypeVector 21(int) 2
+              82:             TypePointer Function 81(ivec2)
+              88:             TypeFloat 32
+              89:             TypeVector 88(float) 2
+              90:             TypePointer Function 89(fvec2)
+              94:             TypeFloat 64
+              95:             TypeVector 94(float) 2
+              96:             TypePointer Function 95(fvec2)
+             132:             TypeVector 14(int) 3
+             133:             TypePointer Function 132(ivec3)
+             136:             TypeVector 18(int) 3
+             158:             TypePointer Function 31(int)
+             164:             TypeVector 21(int) 3
+             165:             TypePointer Function 164(ivec3)
+             199:             TypeVector 31(int) 3
+             202:     21(int) Constant 1
+             203:             TypePointer Function 21(int)
+             209:     21(int) Constant 2
+             217:             TypePointer Function 55(bool)
+             219:     21(int) Constant 0
+             289:   52(ivec2) ConstantComposite 25 25
+             298:  132(ivec3) ConstantComposite 69 69 69
+             340:    55(bool) ConstantTrue
+             347:    55(bool) ConstantFalse
+             348:   56(bvec2) ConstantComposite 347 347
+             360:             TypeVector 55(bool) 3
+             361:  360(bvec3) ConstantComposite 347 347 347
+             363:             TypeVector 94(float) 3
+             364:             TypePointer Function 363(fvec3)
+             369:             TypePointer Function 94(float)
+             380:     31(int) Constant 1
+             381:     31(int) Constant 2
+             382:   74(ivec2) ConstantComposite 380 381
+             387:   81(ivec2) ConstantComposite 209 22
+             392:             TypePointer Function 360(bvec3)
+      454(Block):             TypeStruct 136(ivec3) 14(int)
+             455:             TypePointer Uniform 454(Block)
+      456(block):    455(ptr) Variable Uniform
+             457:     18(int) SpecConstant 4294967286 4294967295
+             458:     14(int) SpecConstant 20 0
+             459:     31(int) SpecConstant 4294967291
+             460:     21(int) SpecConstant 4
+             461:    55(bool) SpecConstantTrue
+             462:    55(bool) SpecConstantOp 171 457 69
+             463:    55(bool) SpecConstantOp 171 458 69
+             464:     18(int) SpecConstantOp 169 461 61 60
+             465:     14(int) SpecConstantOp 169 461 70 69
+             466:     31(int) SpecConstantOp 114 457
+             467:     18(int) SpecConstantOp 114 459
+             468:     21(int) SpecConstantOp 113 458
+             469:     14(int) SpecConstantOp 113 460
+             470:     18(int) SpecConstantOp 128 458 69
+             471:     14(int) SpecConstantOp 128 457 69
+             472:     21(int) SpecConstantOp 113 458
+             473:     31(int) SpecConstantOp 128 472 219
+             474:     18(int) SpecConstantOp 114 459
+             475:     14(int) SpecConstantOp 128 474 69
+             476:     31(int) SpecConstantOp 114 457
+             477:     21(int) SpecConstantOp 128 476 219
+             478:     14(int) SpecConstantOp 113 460
+             479:     18(int) SpecConstantOp 128 478 69
          4(main):           2 Function None 3
                5:             Label
+                              Store 16(u64Max) 17
                               Return
                               FunctionEnd
      6(literal():           2 Function None 3
                7:             Label
-         16(i64):     15(ptr) Variable Function
-   33(indexable):     32(ptr) Variable Function
-         38(u64):     37(ptr) Variable Function
-   47(indexable):     46(ptr) Variable Function
-              30:     29(ptr) AccessChain 26 28
-              31:     17(int) Load 30
-                              Store 33(indexable) 23
-              34:     15(ptr) AccessChain 33(indexable) 31
-              35:     14(int) Load 34
-                              Store 16(i64) 35
-              44:     29(ptr) AccessChain 26 28
-              45:     17(int) Load 44
-                              Store 47(indexable) 43
-              48:     37(ptr) AccessChain 47(indexable) 45
-              49:     36(int) Load 48
-                              Store 38(u64) 49
+         20(i64):     19(ptr) Variable Function
+   37(indexable):     36(ptr) Variable Function
+         41(u64):     40(ptr) Variable Function
+   49(indexable):     48(ptr) Variable Function
+              34:     33(ptr) AccessChain 30 32
+              35:     21(int) Load 34
+                              Store 37(indexable) 27
+              38:     19(ptr) AccessChain 37(indexable) 35
+              39:     18(int) Load 38
+                              Store 20(i64) 39
+              46:     33(ptr) AccessChain 30 32
+              47:     21(int) Load 46
+                              Store 49(indexable) 45
+              50:     40(ptr) AccessChain 49(indexable) 47
+              51:     14(int) Load 50
+                              Store 41(u64) 51
                               Return
                               FunctionEnd
     8(typeCast():           2 Function None 3
                9:             Label
-        52(i64v):     51(ptr) Variable Function
-          56(bv):     55(ptr) Variable Function
-        65(u64v):     64(ptr) Variable Function
-          74(iv):     73(ptr) Variable Function
-          81(uv):     80(ptr) Variable Function
-          89(fv):     88(ptr) Variable Function
-          95(dv):     94(ptr) Variable Function
-              57:   54(bvec2) Load 56(bv)
-              62:   50(ivec2) Select 57 61 60
-                              Store 52(i64v) 62
-              66:   54(bvec2) Load 56(bv)
-              71:   63(ivec2) Select 66 70 69
-                              Store 65(u64v) 71
-              75:   72(ivec2) Load 74(iv)
-              76:   50(ivec2) SConvert 75
-                              Store 52(i64v) 76
-              77:   50(ivec2) Load 52(i64v)
-              78:   72(ivec2) SConvert 77
-                              Store 74(iv) 78
-              82:   79(ivec2) Load 81(uv)
-              83:   63(ivec2) UConvert 82
-                              Store 65(u64v) 83
-              84:   63(ivec2) Load 65(u64v)
-              85:   79(ivec2) UConvert 84
-                              Store 81(uv) 85
-              90:   50(ivec2) Load 52(i64v)
-              91:   87(fvec2) ConvertSToF 90
-                              Store 89(fv) 91
-              96:   50(ivec2) Load 52(i64v)
-              97:   93(fvec2) ConvertSToF 96
-                              Store 95(dv) 97
-              98:   63(ivec2) Load 65(u64v)
-              99:   87(fvec2) ConvertUToF 98
-                              Store 89(fv) 99
-             100:   63(ivec2) Load 65(u64v)
-             101:   93(fvec2) ConvertUToF 100
-                              Store 95(dv) 101
-             102:   87(fvec2) Load 89(fv)
-             103:   50(ivec2) ConvertFToS 102
-                              Store 52(i64v) 103
-             104:   93(fvec2) Load 95(dv)
-             105:   50(ivec2) ConvertFToS 104
-                              Store 52(i64v) 105
-             106:   87(fvec2) Load 89(fv)
-             107:   63(ivec2) ConvertFToU 106
-                              Store 65(u64v) 107
-             108:   93(fvec2) Load 95(dv)
-             109:   63(ivec2) ConvertFToU 108
-                              Store 65(u64v) 109
-             110:   50(ivec2) Load 52(i64v)
-             111:   54(bvec2) INotEqual 110 69
-                              Store 56(bv) 111
-             112:   63(ivec2) Load 65(u64v)
-             113:   54(bvec2) INotEqual 112 69
-                              Store 56(bv) 113
-             114:   50(ivec2) Load 52(i64v)
-             115:   63(ivec2) Bitcast 114
-                              Store 65(u64v) 115
-             116:   63(ivec2) Load 65(u64v)
-             117:   50(ivec2) Bitcast 116
-                              Store 52(i64v) 117
-             118:   50(ivec2) Load 52(i64v)
-             119:   72(ivec2) SConvert 118
-             120:   79(ivec2) Bitcast 119
-                              Store 81(uv) 120
-             121:   79(ivec2) Load 81(uv)
-             122:   63(ivec2) UConvert 121
-             123:   50(ivec2) Bitcast 122
-                              Store 52(i64v) 123
-             124:   63(ivec2) Load 65(u64v)
-             125:   79(ivec2) UConvert 124
-             126:   72(ivec2) Bitcast 125
-                              Store 74(iv) 126
-             127:   72(ivec2) Load 74(iv)
-             128:   50(ivec2) SConvert 127
-             129:   63(ivec2) Bitcast 128
-                              Store 65(u64v) 129
+        54(i64v):     53(ptr) Variable Function
+          58(bv):     57(ptr) Variable Function
+        67(u64v):     66(ptr) Variable Function
+          76(iv):     75(ptr) Variable Function
+          83(uv):     82(ptr) Variable Function
+          91(fv):     90(ptr) Variable Function
+          97(dv):     96(ptr) Variable Function
+              59:   56(bvec2) Load 58(bv)
+              64:   52(ivec2) Select 59 63 62
+                              Store 54(i64v) 64
+              68:   56(bvec2) Load 58(bv)
+              73:   65(ivec2) Select 68 72 71
+                              Store 67(u64v) 73
+              77:   74(ivec2) Load 76(iv)
+              78:   52(ivec2) SConvert 77
+                              Store 54(i64v) 78
+              79:   52(ivec2) Load 54(i64v)
+              80:   74(ivec2) SConvert 79
+                              Store 76(iv) 80
+              84:   81(ivec2) Load 83(uv)
+              85:   65(ivec2) UConvert 84
+                              Store 67(u64v) 85
+              86:   65(ivec2) Load 67(u64v)
+              87:   81(ivec2) UConvert 86
+                              Store 83(uv) 87
+              92:   52(ivec2) Load 54(i64v)
+              93:   89(fvec2) ConvertSToF 92
+                              Store 91(fv) 93
+              98:   52(ivec2) Load 54(i64v)
+              99:   95(fvec2) ConvertSToF 98
+                              Store 97(dv) 99
+             100:   65(ivec2) Load 67(u64v)
+             101:   89(fvec2) ConvertUToF 100
+                              Store 91(fv) 101
+             102:   65(ivec2) Load 67(u64v)
+             103:   95(fvec2) ConvertUToF 102
+                              Store 97(dv) 103
+             104:   89(fvec2) Load 91(fv)
+             105:   52(ivec2) ConvertFToS 104
+                              Store 54(i64v) 105
+             106:   95(fvec2) Load 97(dv)
+             107:   52(ivec2) ConvertFToS 106
+                              Store 54(i64v) 107
+             108:   89(fvec2) Load 91(fv)
+             109:   65(ivec2) ConvertFToU 108
+                              Store 67(u64v) 109
+             110:   95(fvec2) Load 97(dv)
+             111:   65(ivec2) ConvertFToU 110
+                              Store 67(u64v) 111
+             112:   52(ivec2) Load 54(i64v)
+             113:   56(bvec2) INotEqual 112 71
+                              Store 58(bv) 113
+             114:   65(ivec2) Load 67(u64v)
+             115:   56(bvec2) INotEqual 114 71
+                              Store 58(bv) 115
+             116:   52(ivec2) Load 54(i64v)
+             117:   65(ivec2) Bitcast 116
+                              Store 67(u64v) 117
+             118:   65(ivec2) Load 67(u64v)
+             119:   52(ivec2) Bitcast 118
+                              Store 54(i64v) 119
+             120:   52(ivec2) Load 54(i64v)
+             121:   74(ivec2) SConvert 120
+             122:   81(ivec2) Bitcast 121
+                              Store 83(uv) 122
+             123:   81(ivec2) Load 83(uv)
+             124:   65(ivec2) UConvert 123
+             125:   52(ivec2) Bitcast 124
+                              Store 54(i64v) 125
+             126:   65(ivec2) Load 67(u64v)
+             127:   81(ivec2) UConvert 126
+             128:   74(ivec2) Bitcast 127
+                              Store 76(iv) 128
+             129:   74(ivec2) Load 76(iv)
+             130:   52(ivec2) SConvert 129
+             131:   65(ivec2) Bitcast 130
+                              Store 67(u64v) 131
                               Return
                               FunctionEnd
   10(operators():           2 Function None 3
               11:             Label
-       132(u64v):    131(ptr) Variable Function
-        137(i64):     15(ptr) Variable Function
-          157(i):    156(ptr) Variable Function
-         164(uv):    163(ptr) Variable Function
-          216(b):    215(ptr) Variable Function
-             133:  130(ivec3) Load 132(u64v)
-             135:  134(ivec3) CompositeConstruct 59 59 59
-             136:  130(ivec3) IAdd 133 135
-                              Store 132(u64v) 136
-             138:     14(int) Load 137(i64)
-             139:     14(int) ISub 138 59
-                              Store 137(i64) 139
-             140:     14(int) Load 137(i64)
-             141:     14(int) IAdd 140 59
-                              Store 137(i64) 141
-             142:  130(ivec3) Load 132(u64v)
-             143:  134(ivec3) CompositeConstruct 59 59 59
-             144:  130(ivec3) ISub 142 143
-                              Store 132(u64v) 144
-             145:  130(ivec3) Load 132(u64v)
-             146:  130(ivec3) Not 145
-                              Store 132(u64v) 146
-             147:     14(int) Load 137(i64)
-                              Store 137(i64) 147
-             148:  130(ivec3) Load 132(u64v)
-             149:  130(ivec3) SNegate 148
-                              Store 132(u64v) 149
-             150:     14(int) Load 137(i64)
-             151:     14(int) Load 137(i64)
-             152:     14(int) IAdd 151 150
-                              Store 137(i64) 152
-             153:  130(ivec3) Load 132(u64v)
-             154:  130(ivec3) Load 132(u64v)
-             155:  130(ivec3) ISub 154 153
-                              Store 132(u64v) 155
-             158:     27(int) Load 157(i)
-             159:     14(int) SConvert 158
-             160:     14(int) Load 137(i64)
-             161:     14(int) IMul 160 159
-                              Store 137(i64) 161
-             165:  162(ivec3) Load 164(uv)
-             166:  130(ivec3) UConvert 165
-             167:  130(ivec3) Load 132(u64v)
-             168:  130(ivec3) UDiv 167 166
-                              Store 132(u64v) 168
-             169:     27(int) Load 157(i)
-             170:     14(int) SConvert 169
-             171:     36(int) Bitcast 170
-             172:  130(ivec3) Load 132(u64v)
-             173:  130(ivec3) CompositeConstruct 171 171 171
-             174:  130(ivec3) UMod 172 173
-                              Store 132(u64v) 174
-             175:  130(ivec3) Load 132(u64v)
-             176:  162(ivec3) Load 164(uv)
-             177:  130(ivec3) UConvert 176
-             178:  130(ivec3) IAdd 175 177
-                              Store 132(u64v) 178
-             179:     14(int) Load 137(i64)
-             180:     27(int) Load 157(i)
-             181:     14(int) SConvert 180
-             182:     14(int) ISub 179 181
-                              Store 137(i64) 182
-             183:  130(ivec3) Load 132(u64v)
-             184:  162(ivec3) Load 164(uv)
-             185:  130(ivec3) UConvert 184
-             186:  130(ivec3) IMul 183 185
-                              Store 132(u64v) 186
-             187:     14(int) Load 137(i64)
-             188:     27(int) Load 157(i)
-             189:     14(int) SConvert 188
-             190:     14(int) IMul 187 189
-                              Store 137(i64) 190
-             191:     14(int) Load 137(i64)
-             192:     27(int) Load 157(i)
-             193:     14(int) SConvert 192
-             194:     14(int) SMod 191 193
-                              Store 137(i64) 194
-             195:     27(int) Load 157(i)
-             196:  130(ivec3) Load 132(u64v)
-             198:  197(ivec3) CompositeConstruct 195 195 195
-             199:  130(ivec3) ShiftLeftLogical 196 198
-                              Store 132(u64v) 199
-             202:    201(ptr) AccessChain 164(uv) 200
-             203:     17(int) Load 202
-             204:     14(int) Load 137(i64)
-             205:     14(int) ShiftRightArithmetic 204 203
-                              Store 137(i64) 205
-             206:     14(int) Load 137(i64)
-             208:     37(ptr) AccessChain 132(u64v) 207
-             209:     36(int) Load 208
-             210:     14(int) ShiftLeftLogical 206 209
-                              Store 137(i64) 210
-             211:  130(ivec3) Load 132(u64v)
-             212:     14(int) Load 137(i64)
-             213:  134(ivec3) CompositeConstruct 212 212 212
-             214:  130(ivec3) ShiftLeftLogical 211 213
-                              Store 132(u64v) 214
-             218:     37(ptr) AccessChain 132(u64v) 217
-             219:     36(int) Load 218
-             220:     14(int) Load 137(i64)
-             221:     36(int) Bitcast 220
-             222:    53(bool) INotEqual 219 221
-                              Store 216(b) 222
-             223:     14(int) Load 137(i64)
-             224:     36(int) Bitcast 223
-             225:     37(ptr) AccessChain 132(u64v) 217
-             226:     36(int) Load 225
-             227:    53(bool) IEqual 224 226
-                              Store 216(b) 227
-             228:     37(ptr) AccessChain 132(u64v) 217
-             229:     36(int) Load 228
-             230:    201(ptr) AccessChain 164(uv) 200
-             231:     17(int) Load 230
-             232:     36(int) UConvert 231
-             233:    53(bool) UGreaterThan 229 232
-                              Store 216(b) 233
-             234:     14(int) Load 137(i64)
-             235:     27(int) Load 157(i)
-             236:     14(int) SConvert 235
-             237:    53(bool) SLessThan 234 236
-                              Store 216(b) 237
-             238:     37(ptr) AccessChain 132(u64v) 200
-             239:     36(int) Load 238
-             240:    201(ptr) AccessChain 164(uv) 217
-             241:     17(int) Load 240
-             242:     36(int) UConvert 241
-             243:    53(bool) UGreaterThanEqual 239 242
-                              Store 216(b) 243
-             244:     14(int) Load 137(i64)
-             245:     27(int) Load 157(i)
-             246:     14(int) SConvert 245
-             247:    53(bool) SLessThanEqual 244 246
-                              Store 216(b) 247
-             248:     27(int) Load 157(i)
-             249:     14(int) SConvert 248
-             250:     36(int) Bitcast 249
-             251:  130(ivec3) Load 132(u64v)
-             252:  130(ivec3) CompositeConstruct 250 250 250
-             253:  130(ivec3) BitwiseOr 251 252
-                              Store 132(u64v) 253
-             254:     14(int) Load 137(i64)
-             255:     27(int) Load 157(i)
-             256:     14(int) SConvert 255
-             257:     14(int) BitwiseOr 254 256
-                              Store 137(i64) 257
-             258:     27(int) Load 157(i)
-             259:     14(int) SConvert 258
-             260:     14(int) Load 137(i64)
-             261:     14(int) BitwiseAnd 260 259
-                              Store 137(i64) 261
-             262:  130(ivec3) Load 132(u64v)
-             263:  162(ivec3) Load 164(uv)
-             264:  130(ivec3) UConvert 263
-             265:  130(ivec3) BitwiseAnd 262 264
-                              Store 132(u64v) 265
-             266:     14(int) Load 137(i64)
-             267:     36(int) Bitcast 266
-             268:  130(ivec3) Load 132(u64v)
-             269:  130(ivec3) CompositeConstruct 267 267 267
-             270:  130(ivec3) BitwiseXor 268 269
-                              Store 132(u64v) 270
-             271:  130(ivec3) Load 132(u64v)
-             272:     14(int) Load 137(i64)
-             273:     36(int) Bitcast 272
-             274:  130(ivec3) CompositeConstruct 273 273 273
-             275:  130(ivec3) BitwiseXor 271 274
-                              Store 132(u64v) 275
+       134(u64v):    133(ptr) Variable Function
+        139(i64):     19(ptr) Variable Function
+          159(i):    158(ptr) Variable Function
+         166(uv):    165(ptr) Variable Function
+          218(b):    217(ptr) Variable Function
+             135:  132(ivec3) Load 134(u64v)
+             137:  136(ivec3) CompositeConstruct 61 61 61
+             138:  132(ivec3) IAdd 135 137
+                              Store 134(u64v) 138
+             140:     18(int) Load 139(i64)
+             141:     18(int) ISub 140 61
+                              Store 139(i64) 141
+             142:     18(int) Load 139(i64)
+             143:     18(int) IAdd 142 61
+                              Store 139(i64) 143
+             144:  132(ivec3) Load 134(u64v)
+             145:  136(ivec3) CompositeConstruct 61 61 61
+             146:  132(ivec3) ISub 144 145
+                              Store 134(u64v) 146
+             147:  132(ivec3) Load 134(u64v)
+             148:  132(ivec3) Not 147
+                              Store 134(u64v) 148
+             149:     18(int) Load 139(i64)
+                              Store 139(i64) 149
+             150:  132(ivec3) Load 134(u64v)
+             151:  132(ivec3) SNegate 150
+                              Store 134(u64v) 151
+             152:     18(int) Load 139(i64)
+             153:     18(int) Load 139(i64)
+             154:     18(int) IAdd 153 152
+                              Store 139(i64) 154
+             155:  132(ivec3) Load 134(u64v)
+             156:  132(ivec3) Load 134(u64v)
+             157:  132(ivec3) ISub 156 155
+                              Store 134(u64v) 157
+             160:     31(int) Load 159(i)
+             161:     18(int) SConvert 160
+             162:     18(int) Load 139(i64)
+             163:     18(int) IMul 162 161
+                              Store 139(i64) 163
+             167:  164(ivec3) Load 166(uv)
+             168:  132(ivec3) UConvert 167
+             169:  132(ivec3) Load 134(u64v)
+             170:  132(ivec3) UDiv 169 168
+                              Store 134(u64v) 170
+             171:     31(int) Load 159(i)
+             172:     18(int) SConvert 171
+             173:     14(int) Bitcast 172
+             174:  132(ivec3) Load 134(u64v)
+             175:  132(ivec3) CompositeConstruct 173 173 173
+             176:  132(ivec3) UMod 174 175
+                              Store 134(u64v) 176
+             177:  132(ivec3) Load 134(u64v)
+             178:  164(ivec3) Load 166(uv)
+             179:  132(ivec3) UConvert 178
+             180:  132(ivec3) IAdd 177 179
+                              Store 134(u64v) 180
+             181:     18(int) Load 139(i64)
+             182:     31(int) Load 159(i)
+             183:     18(int) SConvert 182
+             184:     18(int) ISub 181 183
+                              Store 139(i64) 184
+             185:  132(ivec3) Load 134(u64v)
+             186:  164(ivec3) Load 166(uv)
+             187:  132(ivec3) UConvert 186
+             188:  132(ivec3) IMul 185 187
+                              Store 134(u64v) 188
+             189:     18(int) Load 139(i64)
+             190:     31(int) Load 159(i)
+             191:     18(int) SConvert 190
+             192:     18(int) IMul 189 191
+                              Store 139(i64) 192
+             193:     18(int) Load 139(i64)
+             194:     31(int) Load 159(i)
+             195:     18(int) SConvert 194
+             196:     18(int) SMod 193 195
+                              Store 139(i64) 196
+             197:     31(int) Load 159(i)
+             198:  132(ivec3) Load 134(u64v)
+             200:  199(ivec3) CompositeConstruct 197 197 197
+             201:  132(ivec3) ShiftLeftLogical 198 200
+                              Store 134(u64v) 201
+             204:    203(ptr) AccessChain 166(uv) 202
+             205:     21(int) Load 204
+             206:     18(int) Load 139(i64)
+             207:     18(int) ShiftRightArithmetic 206 205
+                              Store 139(i64) 207
+             208:     18(int) Load 139(i64)
+             210:     40(ptr) AccessChain 134(u64v) 209
+             211:     14(int) Load 210
+             212:     18(int) ShiftLeftLogical 208 211
+                              Store 139(i64) 212
+             213:  132(ivec3) Load 134(u64v)
+             214:     18(int) Load 139(i64)
+             215:  136(ivec3) CompositeConstruct 214 214 214
+             216:  132(ivec3) ShiftLeftLogical 213 215
+                              Store 134(u64v) 216
+             220:     40(ptr) AccessChain 134(u64v) 219
+             221:     14(int) Load 220
+             222:     18(int) Load 139(i64)
+             223:     14(int) Bitcast 222
+             224:    55(bool) INotEqual 221 223
+                              Store 218(b) 224
+             225:     18(int) Load 139(i64)
+             226:     14(int) Bitcast 225
+             227:     40(ptr) AccessChain 134(u64v) 219
+             228:     14(int) Load 227
+             229:    55(bool) IEqual 226 228
+                              Store 218(b) 229
+             230:     40(ptr) AccessChain 134(u64v) 219
+             231:     14(int) Load 230
+             232:    203(ptr) AccessChain 166(uv) 202
+             233:     21(int) Load 232
+             234:     14(int) UConvert 233
+             235:    55(bool) UGreaterThan 231 234
+                              Store 218(b) 235
+             236:     18(int) Load 139(i64)
+             237:     31(int) Load 159(i)
+             238:     18(int) SConvert 237
+             239:    55(bool) SLessThan 236 238
+                              Store 218(b) 239
+             240:     40(ptr) AccessChain 134(u64v) 202
+             241:     14(int) Load 240
+             242:    203(ptr) AccessChain 166(uv) 219
+             243:     21(int) Load 242
+             244:     14(int) UConvert 243
+             245:    55(bool) UGreaterThanEqual 241 244
+                              Store 218(b) 245
+             246:     18(int) Load 139(i64)
+             247:     31(int) Load 159(i)
+             248:     18(int) SConvert 247
+             249:    55(bool) SLessThanEqual 246 248
+                              Store 218(b) 249
+             250:     31(int) Load 159(i)
+             251:     18(int) SConvert 250
+             252:     14(int) Bitcast 251
+             253:  132(ivec3) Load 134(u64v)
+             254:  132(ivec3) CompositeConstruct 252 252 252
+             255:  132(ivec3) BitwiseOr 253 254
+                              Store 134(u64v) 255
+             256:     18(int) Load 139(i64)
+             257:     31(int) Load 159(i)
+             258:     18(int) SConvert 257
+             259:     18(int) BitwiseOr 256 258
+                              Store 139(i64) 259
+             260:     31(int) Load 159(i)
+             261:     18(int) SConvert 260
+             262:     18(int) Load 139(i64)
+             263:     18(int) BitwiseAnd 262 261
+                              Store 139(i64) 263
+             264:  132(ivec3) Load 134(u64v)
+             265:  164(ivec3) Load 166(uv)
+             266:  132(ivec3) UConvert 265
+             267:  132(ivec3) BitwiseAnd 264 266
+                              Store 134(u64v) 267
+             268:     18(int) Load 139(i64)
+             269:     14(int) Bitcast 268
+             270:  132(ivec3) Load 134(u64v)
+             271:  132(ivec3) CompositeConstruct 269 269 269
+             272:  132(ivec3) BitwiseXor 270 271
+                              Store 134(u64v) 272
+             273:  132(ivec3) Load 134(u64v)
+             274:     18(int) Load 139(i64)
+             275:     14(int) Bitcast 274
+             276:  132(ivec3) CompositeConstruct 275 275 275
+             277:  132(ivec3) BitwiseXor 273 276
+                              Store 134(u64v) 277
                               Return
                               FunctionEnd
 12(builtinFuncs():           2 Function None 3
               13:             Label
-       276(i64v):     51(ptr) Variable Function
-        279(i64):     15(ptr) Variable Function
-       289(u64v):    131(ptr) Variable Function
-        291(u64):     37(ptr) Variable Function
-         363(dv):    362(ptr) Variable Function
-         382(iv):     73(ptr) Variable Function
-         387(uv):     80(ptr) Variable Function
-         391(bv):    390(ptr) Variable Function
-             277:   50(ivec2) Load 276(i64v)
-             278:   50(ivec2) ExtInst 1(GLSL.std.450) 5(SAbs) 277
-                              Store 276(i64v) 278
-             280:     14(int) Load 279(i64)
-             281:     14(int) ExtInst 1(GLSL.std.450) 7(SSign) 280
-                              Store 279(i64) 281
-             282:   50(ivec2) Load 276(i64v)
-             283:     14(int) Load 279(i64)
-             284:   50(ivec2) CompositeConstruct 283 283
-             285:   50(ivec2) ExtInst 1(GLSL.std.450) 39(SMin) 282 284
-                              Store 276(i64v) 285
-             286:   50(ivec2) Load 276(i64v)
-             288:   50(ivec2) ExtInst 1(GLSL.std.450) 39(SMin) 286 287
-                              Store 276(i64v) 288
-             290:  130(ivec3) Load 289(u64v)
-             292:     36(int) Load 291(u64)
-             293:  130(ivec3) CompositeConstruct 292 292 292
-             294:  130(ivec3) ExtInst 1(GLSL.std.450) 38(UMin) 290 293
-                              Store 289(u64v) 294
-             295:  130(ivec3) Load 289(u64v)
-             297:  130(ivec3) ExtInst 1(GLSL.std.450) 38(UMin) 295 296
-                              Store 289(u64v) 297
-             298:   50(ivec2) Load 276(i64v)
-             299:     14(int) Load 279(i64)
-             300:   50(ivec2) CompositeConstruct 299 299
-             301:   50(ivec2) ExtInst 1(GLSL.std.450) 42(SMax) 298 300
-                              Store 276(i64v) 301
-             302:   50(ivec2) Load 276(i64v)
-             303:   50(ivec2) ExtInst 1(GLSL.std.450) 42(SMax) 302 287
-                              Store 276(i64v) 303
-             304:  130(ivec3) Load 289(u64v)
-             305:     36(int) Load 291(u64)
-             306:  130(ivec3) CompositeConstruct 305 305 305
-             307:  130(ivec3) ExtInst 1(GLSL.std.450) 41(UMax) 304 306
-                              Store 289(u64v) 307
-             308:  130(ivec3) Load 289(u64v)
-             309:  130(ivec3) ExtInst 1(GLSL.std.450) 41(UMax) 308 296
-                              Store 289(u64v) 309
-             310:   50(ivec2) Load 276(i64v)
-             311:     14(int) Load 279(i64)
-             312:     14(int) SNegate 311
-             313:     14(int) Load 279(i64)
-             314:   50(ivec2) CompositeConstruct 312 312
-             315:   50(ivec2) CompositeConstruct 313 313
-             316:   50(ivec2) ExtInst 1(GLSL.std.450) 45(SClamp) 310 314 315
-                              Store 276(i64v) 316
-             317:   50(ivec2) Load 276(i64v)
-             318:   50(ivec2) Load 276(i64v)
-             319:   50(ivec2) SNegate 318
-             320:   50(ivec2) Load 276(i64v)
-             321:   50(ivec2) ExtInst 1(GLSL.std.450) 45(SClamp) 317 319 320
-                              Store 276(i64v) 321
-             322:  130(ivec3) Load 289(u64v)
-             323:     36(int) Load 291(u64)
-             324:     36(int) SNegate 323
-             325:     36(int) Load 291(u64)
-             326:  130(ivec3) CompositeConstruct 324 324 324
-             327:  130(ivec3) CompositeConstruct 325 325 325
-             328:  130(ivec3) ExtInst 1(GLSL.std.450) 44(UClamp) 322 326 327
-                              Store 289(u64v) 328
-             329:  130(ivec3) Load 289(u64v)
-             330:  130(ivec3) Load 289(u64v)
-             331:  130(ivec3) SNegate 330
-             332:  130(ivec3) Load 289(u64v)
-             333:  130(ivec3) ExtInst 1(GLSL.std.450) 44(UClamp) 329 331 332
-                              Store 289(u64v) 333
-             334:     15(ptr) AccessChain 276(i64v) 217
-             335:     14(int) Load 334
-             336:     15(ptr) AccessChain 276(i64v) 200
-             337:     14(int) Load 336
-             339:     14(int) Select 338 337 335
-                              Store 279(i64) 339
-             340:     14(int) Load 279(i64)
-             341:   50(ivec2) CompositeConstruct 340 340
-             342:     14(int) Load 279(i64)
-             343:     14(int) SNegate 342
-             344:   50(ivec2) CompositeConstruct 343 343
-             347:   50(ivec2) Select 346 344 341
-                              Store 276(i64v) 347
-             348:     37(ptr) AccessChain 289(u64v) 217
-             349:     36(int) Load 348
-             350:     37(ptr) AccessChain 289(u64v) 200
-             351:     36(int) Load 350
-             352:     36(int) Select 338 351 349
-                              Store 291(u64) 352
-             353:     36(int) Load 291(u64)
-             354:  130(ivec3) CompositeConstruct 353 353 353
-             355:     36(int) Load 291(u64)
-             356:     36(int) SNegate 355
-             357:  130(ivec3) CompositeConstruct 356 356 356
-             360:  130(ivec3) Select 359 357 354
-                              Store 289(u64v) 360
-             364:  361(fvec3) Load 363(dv)
-             365:   93(fvec2) VectorShuffle 364 364 0 1
-             366:   50(ivec2) Bitcast 365
-                              Store 276(i64v) 366
-             368:    367(ptr) AccessChain 363(dv) 207
-             369:   92(float) Load 368
-             370:     36(int) Bitcast 369
-             371:     37(ptr) AccessChain 289(u64v) 217
-                              Store 371 370
-             372:   50(ivec2) Load 276(i64v)
-             373:   93(fvec2) Bitcast 372
-             374:  361(fvec3) Load 363(dv)
-             375:  361(fvec3) VectorShuffle 374 373 3 4 2
-                              Store 363(dv) 375
-             376:  130(ivec3) Load 289(u64v)
-             377:  361(fvec3) Bitcast 376
-                              Store 363(dv) 377
-             381:     14(int) ExtInst 1(GLSL.std.450) 0(Unknown) 380
-                              Store 279(i64) 381
-             383:     14(int) Load 279(i64)
-             384:   72(ivec2) ExtInst 1(GLSL.std.450) 0(Unknown) 383
-                              Store 382(iv) 384
-             386:     36(int) ExtInst 1(GLSL.std.450) 0(Unknown) 385
-                              Store 291(u64) 386
-             388:     36(int) Load 291(u64)
-             389:   79(ivec2) ExtInst 1(GLSL.std.450) 0(Unknown) 388
-                              Store 387(uv) 389
-             392:  130(ivec3) Load 289(u64v)
-             393:     36(int) Load 291(u64)
-             394:  130(ivec3) CompositeConstruct 393 393 393
-             395:  358(bvec3) ULessThan 392 394
-                              Store 391(bv) 395
-             396:   50(ivec2) Load 276(i64v)
-             397:     14(int) Load 279(i64)
-             398:   50(ivec2) CompositeConstruct 397 397
-             399:   54(bvec2) SLessThan 396 398
-             400:  358(bvec3) Load 391(bv)
-             401:  358(bvec3) VectorShuffle 400 399 3 4 2
-                              Store 391(bv) 401
-             402:  130(ivec3) Load 289(u64v)
-             403:     36(int) Load 291(u64)
-             404:  130(ivec3) CompositeConstruct 403 403 403
-             405:  358(bvec3) ULessThanEqual 402 404
-                              Store 391(bv) 405
-             406:   50(ivec2) Load 276(i64v)
-             407:     14(int) Load 279(i64)
-             408:   50(ivec2) CompositeConstruct 407 407
-             409:   54(bvec2) SLessThanEqual 406 408
-             410:  358(bvec3) Load 391(bv)
-             411:  358(bvec3) VectorShuffle 410 409 3 4 2
-                              Store 391(bv) 411
-             412:  130(ivec3) Load 289(u64v)
-             413:     36(int) Load 291(u64)
-             414:  130(ivec3) CompositeConstruct 413 413 413
-             415:  358(bvec3) UGreaterThan 412 414
-                              Store 391(bv) 415
-             416:   50(ivec2) Load 276(i64v)
-             417:     14(int) Load 279(i64)
-             418:   50(ivec2) CompositeConstruct 417 417
-             419:   54(bvec2) SGreaterThan 416 418
-             420:  358(bvec3) Load 391(bv)
-             421:  358(bvec3) VectorShuffle 420 419 3 4 2
-                              Store 391(bv) 421
-             422:  130(ivec3) Load 289(u64v)
-             423:     36(int) Load 291(u64)
-             424:  130(ivec3) CompositeConstruct 423 423 423
-             425:  358(bvec3) UGreaterThanEqual 422 424
-                              Store 391(bv) 425
-             426:   50(ivec2) Load 276(i64v)
-             427:     14(int) Load 279(i64)
-             428:   50(ivec2) CompositeConstruct 427 427
-             429:   54(bvec2) SGreaterThanEqual 426 428
-             430:  358(bvec3) Load 391(bv)
-             431:  358(bvec3) VectorShuffle 430 429 3 4 2
-                              Store 391(bv) 431
-             432:  130(ivec3) Load 289(u64v)
-             433:     36(int) Load 291(u64)
-             434:  130(ivec3) CompositeConstruct 433 433 433
-             435:  358(bvec3) IEqual 432 434
-                              Store 391(bv) 435
-             436:   50(ivec2) Load 276(i64v)
-             437:     14(int) Load 279(i64)
-             438:   50(ivec2) CompositeConstruct 437 437
-             439:   54(bvec2) IEqual 436 438
-             440:  358(bvec3) Load 391(bv)
-             441:  358(bvec3) VectorShuffle 440 439 3 4 2
-                              Store 391(bv) 441
-             442:  130(ivec3) Load 289(u64v)
-             443:     36(int) Load 291(u64)
-             444:  130(ivec3) CompositeConstruct 443 443 443
-             445:  358(bvec3) INotEqual 442 444
-                              Store 391(bv) 445
-             446:   50(ivec2) Load 276(i64v)
-             447:     14(int) Load 279(i64)
-             448:   50(ivec2) CompositeConstruct 447 447
-             449:   54(bvec2) INotEqual 446 448
-             450:  358(bvec3) Load 391(bv)
-             451:  358(bvec3) VectorShuffle 450 449 3 4 2
-                              Store 391(bv) 451
+       278(i64v):     53(ptr) Variable Function
+        281(i64):     19(ptr) Variable Function
+       291(u64v):    133(ptr) Variable Function
+        293(u64):     40(ptr) Variable Function
+         365(dv):    364(ptr) Variable Function
+         384(iv):     75(ptr) Variable Function
+         389(uv):     82(ptr) Variable Function
+         393(bv):    392(ptr) Variable Function
+             279:   52(ivec2) Load 278(i64v)
+             280:   52(ivec2) ExtInst 1(GLSL.std.450) 5(SAbs) 279
+                              Store 278(i64v) 280
+             282:     18(int) Load 281(i64)
+             283:     18(int) ExtInst 1(GLSL.std.450) 7(SSign) 282
+                              Store 281(i64) 283
+             284:   52(ivec2) Load 278(i64v)
+             285:     18(int) Load 281(i64)
+             286:   52(ivec2) CompositeConstruct 285 285
+             287:   52(ivec2) ExtInst 1(GLSL.std.450) 39(SMin) 284 286
+                              Store 278(i64v) 287
+             288:   52(ivec2) Load 278(i64v)
+             290:   52(ivec2) ExtInst 1(GLSL.std.450) 39(SMin) 288 289
+                              Store 278(i64v) 290
+             292:  132(ivec3) Load 291(u64v)
+             294:     14(int) Load 293(u64)
+             295:  132(ivec3) CompositeConstruct 294 294 294
+             296:  132(ivec3) ExtInst 1(GLSL.std.450) 38(UMin) 292 295
+                              Store 291(u64v) 296
+             297:  132(ivec3) Load 291(u64v)
+             299:  132(ivec3) ExtInst 1(GLSL.std.450) 38(UMin) 297 298
+                              Store 291(u64v) 299
+             300:   52(ivec2) Load 278(i64v)
+             301:     18(int) Load 281(i64)
+             302:   52(ivec2) CompositeConstruct 301 301
+             303:   52(ivec2) ExtInst 1(GLSL.std.450) 42(SMax) 300 302
+                              Store 278(i64v) 303
+             304:   52(ivec2) Load 278(i64v)
+             305:   52(ivec2) ExtInst 1(GLSL.std.450) 42(SMax) 304 289
+                              Store 278(i64v) 305
+             306:  132(ivec3) Load 291(u64v)
+             307:     14(int) Load 293(u64)
+             308:  132(ivec3) CompositeConstruct 307 307 307
+             309:  132(ivec3) ExtInst 1(GLSL.std.450) 41(UMax) 306 308
+                              Store 291(u64v) 309
+             310:  132(ivec3) Load 291(u64v)
+             311:  132(ivec3) ExtInst 1(GLSL.std.450) 41(UMax) 310 298
+                              Store 291(u64v) 311
+             312:   52(ivec2) Load 278(i64v)
+             313:     18(int) Load 281(i64)
+             314:     18(int) SNegate 313
+             315:     18(int) Load 281(i64)
+             316:   52(ivec2) CompositeConstruct 314 314
+             317:   52(ivec2) CompositeConstruct 315 315
+             318:   52(ivec2) ExtInst 1(GLSL.std.450) 45(SClamp) 312 316 317
+                              Store 278(i64v) 318
+             319:   52(ivec2) Load 278(i64v)
+             320:   52(ivec2) Load 278(i64v)
+             321:   52(ivec2) SNegate 320
+             322:   52(ivec2) Load 278(i64v)
+             323:   52(ivec2) ExtInst 1(GLSL.std.450) 45(SClamp) 319 321 322
+                              Store 278(i64v) 323
+             324:  132(ivec3) Load 291(u64v)
+             325:     14(int) Load 293(u64)
+             326:     14(int) SNegate 325
+             327:     14(int) Load 293(u64)
+             328:  132(ivec3) CompositeConstruct 326 326 326
+             329:  132(ivec3) CompositeConstruct 327 327 327
+             330:  132(ivec3) ExtInst 1(GLSL.std.450) 44(UClamp) 324 328 329
+                              Store 291(u64v) 330
+             331:  132(ivec3) Load 291(u64v)
+             332:  132(ivec3) Load 291(u64v)
+             333:  132(ivec3) SNegate 332
+             334:  132(ivec3) Load 291(u64v)
+             335:  132(ivec3) ExtInst 1(GLSL.std.450) 44(UClamp) 331 333 334
+                              Store 291(u64v) 335
+             336:     19(ptr) AccessChain 278(i64v) 219
+             337:     18(int) Load 336
+             338:     19(ptr) AccessChain 278(i64v) 202
+             339:     18(int) Load 338
+             341:     18(int) Select 340 339 337
+                              Store 281(i64) 341
+             342:     18(int) Load 281(i64)
+             343:   52(ivec2) CompositeConstruct 342 342
+             344:     18(int) Load 281(i64)
+             345:     18(int) SNegate 344
+             346:   52(ivec2) CompositeConstruct 345 345
+             349:   52(ivec2) Select 348 346 343
+                              Store 278(i64v) 349
+             350:     40(ptr) AccessChain 291(u64v) 219
+             351:     14(int) Load 350
+             352:     40(ptr) AccessChain 291(u64v) 202
+             353:     14(int) Load 352
+             354:     14(int) Select 340 353 351
+                              Store 293(u64) 354
+             355:     14(int) Load 293(u64)
+             356:  132(ivec3) CompositeConstruct 355 355 355
+             357:     14(int) Load 293(u64)
+             358:     14(int) SNegate 357
+             359:  132(ivec3) CompositeConstruct 358 358 358
+             362:  132(ivec3) Select 361 359 356
+                              Store 291(u64v) 362
+             366:  363(fvec3) Load 365(dv)
+             367:   95(fvec2) VectorShuffle 366 366 0 1
+             368:   52(ivec2) Bitcast 367
+                              Store 278(i64v) 368
+             370:    369(ptr) AccessChain 365(dv) 209
+             371:   94(float) Load 370
+             372:     14(int) Bitcast 371
+             373:     40(ptr) AccessChain 291(u64v) 219
+                              Store 373 372
+             374:   52(ivec2) Load 278(i64v)
+             375:   95(fvec2) Bitcast 374
+             376:  363(fvec3) Load 365(dv)
+             377:  363(fvec3) VectorShuffle 376 375 3 4 2
+                              Store 365(dv) 377
+             378:  132(ivec3) Load 291(u64v)
+             379:  363(fvec3) Bitcast 378
+                              Store 365(dv) 379
+             383:     18(int) ExtInst 1(GLSL.std.450) 0(Unknown) 382
+                              Store 281(i64) 383
+             385:     18(int) Load 281(i64)
+             386:   74(ivec2) ExtInst 1(GLSL.std.450) 0(Unknown) 385
+                              Store 384(iv) 386
+             388:     14(int) ExtInst 1(GLSL.std.450) 0(Unknown) 387
+                              Store 293(u64) 388
+             390:     14(int) Load 293(u64)
+             391:   81(ivec2) ExtInst 1(GLSL.std.450) 0(Unknown) 390
+                              Store 389(uv) 391
+             394:  132(ivec3) Load 291(u64v)
+             395:     14(int) Load 293(u64)
+             396:  132(ivec3) CompositeConstruct 395 395 395
+             397:  360(bvec3) ULessThan 394 396
+                              Store 393(bv) 397
+             398:   52(ivec2) Load 278(i64v)
+             399:     18(int) Load 281(i64)
+             400:   52(ivec2) CompositeConstruct 399 399
+             401:   56(bvec2) SLessThan 398 400
+             402:  360(bvec3) Load 393(bv)
+             403:  360(bvec3) VectorShuffle 402 401 3 4 2
+                              Store 393(bv) 403
+             404:  132(ivec3) Load 291(u64v)
+             405:     14(int) Load 293(u64)
+             406:  132(ivec3) CompositeConstruct 405 405 405
+             407:  360(bvec3) ULessThanEqual 404 406
+                              Store 393(bv) 407
+             408:   52(ivec2) Load 278(i64v)
+             409:     18(int) Load 281(i64)
+             410:   52(ivec2) CompositeConstruct 409 409
+             411:   56(bvec2) SLessThanEqual 408 410
+             412:  360(bvec3) Load 393(bv)
+             413:  360(bvec3) VectorShuffle 412 411 3 4 2
+                              Store 393(bv) 413
+             414:  132(ivec3) Load 291(u64v)
+             415:     14(int) Load 293(u64)
+             416:  132(ivec3) CompositeConstruct 415 415 415
+             417:  360(bvec3) UGreaterThan 414 416
+                              Store 393(bv) 417
+             418:   52(ivec2) Load 278(i64v)
+             419:     18(int) Load 281(i64)
+             420:   52(ivec2) CompositeConstruct 419 419
+             421:   56(bvec2) SGreaterThan 418 420
+             422:  360(bvec3) Load 393(bv)
+             423:  360(bvec3) VectorShuffle 422 421 3 4 2
+                              Store 393(bv) 423
+             424:  132(ivec3) Load 291(u64v)
+             425:     14(int) Load 293(u64)
+             426:  132(ivec3) CompositeConstruct 425 425 425
+             427:  360(bvec3) UGreaterThanEqual 424 426
+                              Store 393(bv) 427
+             428:   52(ivec2) Load 278(i64v)
+             429:     18(int) Load 281(i64)
+             430:   52(ivec2) CompositeConstruct 429 429
+             431:   56(bvec2) SGreaterThanEqual 428 430
+             432:  360(bvec3) Load 393(bv)
+             433:  360(bvec3) VectorShuffle 432 431 3 4 2
+                              Store 393(bv) 433
+             434:  132(ivec3) Load 291(u64v)
+             435:     14(int) Load 293(u64)
+             436:  132(ivec3) CompositeConstruct 435 435 435
+             437:  360(bvec3) IEqual 434 436
+                              Store 393(bv) 437
+             438:   52(ivec2) Load 278(i64v)
+             439:     18(int) Load 281(i64)
+             440:   52(ivec2) CompositeConstruct 439 439
+             441:   56(bvec2) IEqual 438 440
+             442:  360(bvec3) Load 393(bv)
+             443:  360(bvec3) VectorShuffle 442 441 3 4 2
+                              Store 393(bv) 443
+             444:  132(ivec3) Load 291(u64v)
+             445:     14(int) Load 293(u64)
+             446:  132(ivec3) CompositeConstruct 445 445 445
+             447:  360(bvec3) INotEqual 444 446
+                              Store 393(bv) 447
+             448:   52(ivec2) Load 278(i64v)
+             449:     18(int) Load 281(i64)
+             450:   52(ivec2) CompositeConstruct 449 449
+             451:   56(bvec2) INotEqual 448 450
+             452:  360(bvec3) Load 393(bv)
+             453:  360(bvec3) VectorShuffle 452 451 3 4 2
+                              Store 393(bv) 453
                               Return
                               FunctionEnd
index 7d934ff..6682e7c 100755 (executable)
@@ -7,12 +7,12 @@ Linked fragment stage:
 
 // Module Version 10000
 // Generated by (magic number): 80001
-// Id's are bound by 207
+// Id's are bound by 213
 
                               Capability Shader
                1:             ExtInstImport  "GLSL.std.450"
                               MemoryModel Logical GLSL450
-                              EntryPoint Fragment 4  "main" 15 68 77 200 202 204
+                              EntryPoint Fragment 4  "main" 15 68 77 206 208 210
                               ExecutionMode 4 OriginUpperLeft
                               Source ESSL 310
                               Name 4  "main"
@@ -33,10 +33,10 @@ Linked fragment stage:
                               Name 154  "mask2"
                               Name 156  "mask3"
                               Name 160  "mask4"
-                              Name 200  "f"
-                              Name 202  "v"
-                              Name 204  "i"
-                              Name 206  "b"
+                              Name 206  "f"
+                              Name 208  "v"
+                              Name 210  "i"
+                              Name 212  "b"
                               Decorate 8(count) RelaxedPrecision
                               Decorate 12(u) RelaxedPrecision
                               Decorate 15(t) RelaxedPrecision
@@ -138,11 +138,13 @@ Linked fragment stage:
                               Decorate 196 RelaxedPrecision
                               Decorate 197 RelaxedPrecision
                               Decorate 198 RelaxedPrecision
-                              Decorate 200(f) RelaxedPrecision
-                              Decorate 202(v) RelaxedPrecision
-                              Decorate 202(v) Flat
-                              Decorate 204(i) RelaxedPrecision
-                              Decorate 204(i) Flat
+                              Decorate 202 RelaxedPrecision
+                              Decorate 203 RelaxedPrecision
+                              Decorate 206(f) RelaxedPrecision
+                              Decorate 208(v) RelaxedPrecision
+                              Decorate 208(v) Flat
+                              Decorate 210(i) RelaxedPrecision
+                              Decorate 210(i) Flat
                2:             TypeVoid
                3:             TypeFunction 2
                6:             TypeInt 32 1
@@ -193,14 +195,16 @@ Linked fragment stage:
              155:     10(int) Constant 2576
              158:      6(int) Constant 4
              161:     10(int) Constant 2737
-             199:             TypePointer Input 74(float)
-          200(f):    199(ptr) Variable Input
-             201:             TypePointer Input 66(ivec4)
-          202(v):    201(ptr) Variable Input
-             203:             TypePointer Input 6(int)
-          204(i):    203(ptr) Variable Input
-             205:             TypePointer Private 22(bool)
-          206(b):    205(ptr) Variable Private
+             199:     10(int) Constant 4294967295
+             200:             TypePointer Output 10(int)
+             205:             TypePointer Input 74(float)
+          206(f):    205(ptr) Variable Input
+             207:             TypePointer Input 66(ivec4)
+          208(v):    207(ptr) Variable Input
+             209:             TypePointer Input 6(int)
+          210(i):    209(ptr) Variable Input
+             211:             TypePointer Private 22(bool)
+          212(b):    211(ptr) Variable Private
          4(main):           2 Function None 3
                5:             Label
         8(count):      7(ptr) Variable Function
@@ -434,5 +438,10 @@ Linked fragment stage:
              197:   66(ivec4) Load 68(c)
              198:   66(ivec4) IAdd 197 196
                               Store 68(c) 198
+             201:    200(ptr) AccessChain 68(c) 103
+             202:     10(int) Load 201
+             203:     10(int) IAdd 202 199
+             204:    200(ptr) AccessChain 68(c) 103
+                              Store 204 203
                               Return
                               FunctionEnd
index c21ce35..8021b7e 100644 (file)
@@ -258,4 +258,7 @@ const uint64_t i_to_u64 = uint64_t(si);
 \r
 // uint <-> int64\r
 const uint    i64_to_u = uint(si64);\r
-const int64_t u_to_i64 = int64_t(su);
\ No newline at end of file
+const int64_t u_to_i64 = int64_t(su);\r
+\r
+#define UINT64_MAX  18446744073709551615ul\r
+uint64_t u64Max = UINT64_MAX;\r
index 92a8f96..853de7c 100644 (file)
@@ -95,5 +95,8 @@ void main()
     if ((mask1 ^ mask4) == 0xA10u)\r
         count *= 7;  // 341413380\r
 \r
-    c += uvec4(count); \r
+    c += uvec4(count);\r
+\r
+    #define UINT_MAX  4294967295u\r
+    c.x += UINT_MAX;\r
 }\r
index 1e1b0a2..f5a0513 100644 (file)
@@ -224,7 +224,6 @@ int TPpContext::ReadToken(TokenStream *pTok, TPpToken *ppToken)
             ppToken->dval = atof(ppToken->name);
             break;
         case PpAtomConstInt:
-        case PpAtomConstUint:
             if (len > 0 && tokenText[0] == '0') {
                 if (len > 1 && (tokenText[1] == 'x' || tokenText[1] == 'X'))
                     ppToken->ival = strtol(ppToken->name, 0, 16);
@@ -233,8 +232,16 @@ int TPpContext::ReadToken(TokenStream *pTok, TPpToken *ppToken)
             } else
                 ppToken->ival = atoi(ppToken->name);
             break;
+        case PpAtomConstUint:
+            if (len > 0 && tokenText[0] == '0') {
+                if (len > 1 && (tokenText[1] == 'x' || tokenText[1] == 'X'))
+                    ppToken->ival = (int)strtoul(ppToken->name, 0, 16);
+                else
+                    ppToken->ival = (int)strtoul(ppToken->name, 0, 8);
+            } else
+                ppToken->ival = (int)strtoul(ppToken->name, 0, 10);
+            break;
         case PpAtomConstInt64:
-        case PpAtomConstUint64:
             if (len > 0 && tokenText[0] == '0') {
                 if (len > 1 && (tokenText[1] == 'x' || tokenText[1] == 'X'))
                     ppToken->i64val = strtoll(ppToken->name, nullptr, 16);
@@ -243,6 +250,15 @@ int TPpContext::ReadToken(TokenStream *pTok, TPpToken *ppToken)
             } else
                 ppToken->i64val = atoll(ppToken->name);
             break;
+        case PpAtomConstUint64:
+            if (len > 0 && tokenText[0] == '0') {
+                if (len > 1 && (tokenText[1] == 'x' || tokenText[1] == 'X'))
+                    ppToken->i64val = (long long)strtoull(ppToken->name, nullptr, 16);
+                else
+                    ppToken->i64val = (long long)strtoull(ppToken->name, nullptr, 8);
+            } else
+                ppToken->i64val = (long long)strtoull(ppToken->name, 0, 10);
+            break;
         }
     }