Split loop header from condition testing for for/while loops.

This commit is contained in:
Dejan Mircevski 2016-01-20 11:51:43 -05:00
parent 7349eab099
commit 213bbbe4a7
14 changed files with 1905 additions and 1828 deletions

View File

@ -1391,12 +1391,22 @@ bool TGlslangToSpvTraverser::visitLoop(glslang::TVisit /* visit */, glslang::TIn
{ {
auto blocks = builder.makeNewLoop(); auto blocks = builder.makeNewLoop();
builder.createBranch(&blocks.head); builder.createBranch(&blocks.head);
// Spec requires back edges to target header blocks, and every header block
// must dominate its merge block. Make a header block first to ensure these
// conditions are met. By definition, it will contain OpLoopMerge, followed
// by a block-ending branch. But we don't want to put any other body/test
// instructions in it, since the body/test may have arbitrary instructions,
// including merges of its own.
builder.setBuildPoint(&blocks.head);
builder.createLoopMerge(&blocks.merge, &blocks.continue_target, spv::LoopControlMaskNone);
if (node->testFirst() && node->getTest()) { if (node->testFirst() && node->getTest()) {
builder.setBuildPoint(&blocks.head); spv::Block& test = builder.makeNewBlock();
builder.createBranch(&test);
builder.setBuildPoint(&test);
node->getTest()->traverse(this); node->getTest()->traverse(this);
spv::Id condition = spv::Id condition =
builder.accessChainLoad(convertGlslangToSpvType(node->getTest()->getType())); builder.accessChainLoad(convertGlslangToSpvType(node->getTest()->getType()));
builder.createLoopMerge(&blocks.merge, &blocks.continue_target, spv::LoopControlMaskNone);
builder.createConditionalBranch(condition, &blocks.body, &blocks.merge); builder.createConditionalBranch(condition, &blocks.body, &blocks.merge);
builder.setBuildPoint(&blocks.body); builder.setBuildPoint(&blocks.body);
@ -1411,14 +1421,6 @@ bool TGlslangToSpvTraverser::visitLoop(glslang::TVisit /* visit */, glslang::TIn
node->getTerminal()->traverse(this); node->getTerminal()->traverse(this);
builder.createBranch(&blocks.head); builder.createBranch(&blocks.head);
} else { } else {
// Spec requires back edges to target header blocks, and every header
// block must dominate its merge block. Make a header block first to
// ensure these conditions are met. By definition, it will contain
// OpLoopMerge, followed by a block-ending branch. But we don't want to
// put any other body instructions in it, since the body may have
// arbitrary instructions, including merges of its own.
builder.setBuildPoint(&blocks.head);
builder.createLoopMerge(&blocks.merge, &blocks.continue_target, spv::LoopControlMaskNone);
builder.createBranch(&blocks.body); builder.createBranch(&blocks.body);
breakForLoop.push(true); breakForLoop.push(true);

View File

@ -8,66 +8,68 @@ Linked vertex stage:
// Module Version 10000 // Module Version 10000
// Generated by (magic number): 80001 // Generated by (magic number): 80001
// Id's are bound by 39 // Id's are bound by 40
Capability Shader Capability Shader
1: ExtInstImport "GLSL.std.450" 1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450 MemoryModel Logical GLSL450
EntryPoint Vertex 4 "main" 24 27 33 38 EntryPoint Vertex 4 "main" 25 28 34 39
Source GLSL 130 Source GLSL 130
Name 4 "main" Name 4 "main"
Name 8 "i" Name 8 "i"
Name 24 "colorOut" Name 25 "colorOut"
Name 27 "color" Name 28 "color"
Name 33 "gl_Position" Name 34 "gl_Position"
Name 38 "gl_VertexID" Name 39 "gl_VertexID"
Decorate 33(gl_Position) BuiltIn Position Decorate 34(gl_Position) BuiltIn Position
Decorate 38(gl_VertexID) BuiltIn VertexId Decorate 39(gl_VertexID) BuiltIn VertexId
2: TypeVoid 2: TypeVoid
3: TypeFunction 2 3: TypeFunction 2
6: TypeInt 32 1 6: TypeInt 32 1
7: TypePointer Function 6(int) 7: TypePointer Function 6(int)
9: 6(int) Constant 1 9: 6(int) Constant 1
15: 6(int) Constant 5 16: 6(int) Constant 5
16: TypeBool 17: TypeBool
18: TypeFloat 32 19: TypeFloat 32
19: TypeVector 18(float) 4 20: TypeVector 19(float) 4
20: TypeInt 32 0 21: TypeInt 32 0
21: 20(int) Constant 6 22: 21(int) Constant 6
22: TypeArray 19(fvec4) 21 23: TypeArray 20(fvec4) 22
23: TypePointer Output 22 24: TypePointer Output 23
24(colorOut): 23(ptr) Variable Output 25(colorOut): 24(ptr) Variable Output
26: TypePointer Input 19(fvec4) 27: TypePointer Input 20(fvec4)
27(color): 26(ptr) Variable Input 28(color): 27(ptr) Variable Input
29: TypePointer Output 19(fvec4) 30: TypePointer Output 20(fvec4)
33(gl_Position): 29(ptr) Variable Output 34(gl_Position): 30(ptr) Variable Output
34: 6(int) Constant 2 35: 6(int) Constant 2
37: TypePointer Input 6(int) 38: TypePointer Input 6(int)
38(gl_VertexID): 37(ptr) Variable Input 39(gl_VertexID): 38(ptr) Variable Input
4(main): 2 Function None 3 4(main): 2 Function None 3
5: Label 5: Label
8(i): 7(ptr) Variable Function 8(i): 7(ptr) Variable Function
Store 8(i) 9 Store 8(i) 9
Branch 10 Branch 10
10: Label 10: Label
14: 6(int) Load 8(i)
17: 16(bool) SLessThan 14 15
LoopMerge 12 13 None LoopMerge 12 13 None
BranchConditional 17 11 12 Branch 14
14: Label
15: 6(int) Load 8(i)
18: 17(bool) SLessThan 15 16
BranchConditional 18 11 12
11: Label 11: Label
25: 6(int) Load 8(i) 26: 6(int) Load 8(i)
28: 19(fvec4) Load 27(color) 29: 20(fvec4) Load 28(color)
30: 29(ptr) AccessChain 24(colorOut) 25 31: 30(ptr) AccessChain 25(colorOut) 26
Store 30 28 Store 31 29
Branch 13 Branch 13
13: Label 13: Label
31: 6(int) Load 8(i) 32: 6(int) Load 8(i)
32: 6(int) IAdd 31 9 33: 6(int) IAdd 32 9
Store 8(i) 32 Store 8(i) 33
Branch 10 Branch 10
12: Label 12: Label
35: 29(ptr) AccessChain 24(colorOut) 34 36: 30(ptr) AccessChain 25(colorOut) 35
36: 19(fvec4) Load 35 37: 20(fvec4) Load 36
Store 33(gl_Position) 36 Store 34(gl_Position) 37
Return Return
FunctionEnd FunctionEnd

View File

@ -5,86 +5,88 @@ Linked vertex stage:
// Module Version 10000 // Module Version 10000
// Generated by (magic number): 80001 // Generated by (magic number): 80001
// Id's are bound by 47 // Id's are bound by 48
Capability Shader Capability Shader
1: ExtInstImport "GLSL.std.450" 1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450 MemoryModel Logical GLSL450
EntryPoint Vertex 4 "main" 45 46 EntryPoint Vertex 4 "main" 46 47
Source ESSL 300 Source ESSL 300
Name 4 "main" Name 4 "main"
Name 8 "i" Name 8 "i"
Name 18 "A" Name 19 "A"
Name 26 "B" Name 27 "B"
Name 28 "C" Name 29 "C"
Name 35 "D" Name 36 "D"
Name 37 "E" Name 38 "E"
Name 38 "F" Name 39 "F"
Name 42 "G" Name 43 "G"
Name 45 "gl_VertexID" Name 46 "gl_VertexID"
Name 46 "gl_InstanceID" Name 47 "gl_InstanceID"
Decorate 45(gl_VertexID) BuiltIn VertexId Decorate 46(gl_VertexID) BuiltIn VertexId
Decorate 46(gl_InstanceID) BuiltIn InstanceId Decorate 47(gl_InstanceID) BuiltIn InstanceId
2: TypeVoid 2: TypeVoid
3: TypeFunction 2 3: TypeFunction 2
6: TypeInt 32 1 6: TypeInt 32 1
7: TypePointer Function 6(int) 7: TypePointer Function 6(int)
9: 6(int) Constant 0 9: 6(int) Constant 0
15: 6(int) Constant 10 16: 6(int) Constant 10
16: TypeBool 17: TypeBool
19: 6(int) Constant 1 20: 6(int) Constant 1
21: 6(int) Constant 2 22: 6(int) Constant 2
30: 6(int) Constant 3 31: 6(int) Constant 3
39: 6(int) Constant 12 40: 6(int) Constant 12
43: 6(int) Constant 99 44: 6(int) Constant 99
44: TypePointer Input 6(int) 45: TypePointer Input 6(int)
45(gl_VertexID): 44(ptr) Variable Input 46(gl_VertexID): 45(ptr) Variable Input
46(gl_InstanceID): 44(ptr) Variable Input 47(gl_InstanceID): 45(ptr) Variable Input
4(main): 2 Function None 3 4(main): 2 Function None 3
5: Label 5: Label
8(i): 7(ptr) Variable Function 8(i): 7(ptr) Variable Function
18(A): 7(ptr) Variable Function 19(A): 7(ptr) Variable Function
26(B): 7(ptr) Variable Function 27(B): 7(ptr) Variable Function
28(C): 7(ptr) Variable Function 29(C): 7(ptr) Variable Function
35(D): 7(ptr) Variable Function 36(D): 7(ptr) Variable Function
37(E): 7(ptr) Variable Function 38(E): 7(ptr) Variable Function
38(F): 7(ptr) Variable Function 39(F): 7(ptr) Variable Function
42(G): 7(ptr) Variable Function 43(G): 7(ptr) Variable Function
Store 8(i) 9 Store 8(i) 9
Branch 10 Branch 10
10: Label 10: Label
14: 6(int) Load 8(i)
17: 16(bool) SLessThan 14 15
LoopMerge 12 13 None LoopMerge 12 13 None
BranchConditional 17 11 12 Branch 14
14: Label
15: 6(int) Load 8(i)
18: 17(bool) SLessThan 15 16
BranchConditional 18 11 12
11: Label 11: Label
Store 18(A) 19 Store 19(A) 20
20: 6(int) Load 8(i) 21: 6(int) Load 8(i)
22: 6(int) SMod 20 21 23: 6(int) SMod 21 22
23: 16(bool) IEqual 22 9 24: 17(bool) IEqual 23 9
SelectionMerge 25 None SelectionMerge 26 None
BranchConditional 23 24 25 BranchConditional 24 25 26
24: Label 25: Label
Store 26(B) 19 Store 27(B) 20
Branch 13 Branch 13
25: Label 26: Label
29: 6(int) Load 8(i) 30: 6(int) Load 8(i)
31: 6(int) SMod 29 30 32: 6(int) SMod 30 31
32: 16(bool) IEqual 31 9 33: 17(bool) IEqual 32 9
SelectionMerge 34 None SelectionMerge 35 None
BranchConditional 32 33 34 BranchConditional 33 34 35
33: Label 34: Label
Store 35(D) 19 Store 36(D) 20
Branch 12 Branch 12
34: Label 35: Label
Store 38(F) 39 Store 39(F) 40
Branch 13 Branch 13
13: Label 13: Label
40: 6(int) Load 8(i) 41: 6(int) Load 8(i)
41: 6(int) IAdd 40 19 42: 6(int) IAdd 41 20
Store 8(i) 41 Store 8(i) 42
Branch 10 Branch 10
12: Label 12: Label
Store 42(G) 43 Store 43(G) 44
Return Return
FunctionEnd FunctionEnd

View File

@ -7,53 +7,55 @@ Linked vertex stage:
// Module Version 10000 // Module Version 10000
// Generated by (magic number): 80001 // Generated by (magic number): 80001
// Id's are bound by 27 // Id's are bound by 28
Capability Shader Capability Shader
1: ExtInstImport "GLSL.std.450" 1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450 MemoryModel Logical GLSL450
EntryPoint Vertex 4 "main" 22 25 26 EntryPoint Vertex 4 "main" 23 26 27
Source GLSL 450 Source GLSL 450
Name 4 "main" Name 4 "main"
Name 8 "i" Name 8 "i"
Name 22 "r" Name 23 "r"
Name 25 "gl_VertexID" Name 26 "gl_VertexID"
Name 26 "gl_InstanceID" Name 27 "gl_InstanceID"
Decorate 22(r) Location 0 Decorate 23(r) Location 0
Decorate 25(gl_VertexID) BuiltIn VertexId Decorate 26(gl_VertexID) BuiltIn VertexId
Decorate 26(gl_InstanceID) BuiltIn InstanceId Decorate 27(gl_InstanceID) BuiltIn InstanceId
2: TypeVoid 2: TypeVoid
3: TypeFunction 2 3: TypeFunction 2
6: TypeInt 32 1 6: TypeInt 32 1
7: TypePointer Function 6(int) 7: TypePointer Function 6(int)
9: 6(int) Constant 0 9: 6(int) Constant 0
15: 6(int) Constant 10 16: 6(int) Constant 10
16: TypeBool 17: TypeBool
19: 6(int) Constant 1 20: 6(int) Constant 1
21: TypePointer Output 6(int) 22: TypePointer Output 6(int)
22(r): 21(ptr) Variable Output 23(r): 22(ptr) Variable Output
24: TypePointer Input 6(int) 25: TypePointer Input 6(int)
25(gl_VertexID): 24(ptr) Variable Input 26(gl_VertexID): 25(ptr) Variable Input
26(gl_InstanceID): 24(ptr) Variable Input 27(gl_InstanceID): 25(ptr) Variable Input
4(main): 2 Function None 3 4(main): 2 Function None 3
5: Label 5: Label
8(i): 7(ptr) Variable Function 8(i): 7(ptr) Variable Function
Store 8(i) 9 Store 8(i) 9
Branch 10 Branch 10
10: Label 10: Label
14: 6(int) Load 8(i)
17: 16(bool) SLessThan 14 15
LoopMerge 12 13 None LoopMerge 12 13 None
BranchConditional 17 11 12 Branch 14
14: Label
15: 6(int) Load 8(i)
18: 17(bool) SLessThan 15 16
BranchConditional 18 11 12
11: Label 11: Label
Branch 13 Branch 13
13: Label 13: Label
18: 6(int) Load 8(i) 19: 6(int) Load 8(i)
20: 6(int) IAdd 18 19 21: 6(int) IAdd 19 20
Store 8(i) 20 Store 8(i) 21
Branch 10 Branch 10
12: Label 12: Label
23: 6(int) Load 8(i) 24: 6(int) Load 8(i)
Store 22(r) 23 Store 23(r) 24
Return Return
FunctionEnd FunctionEnd

View File

@ -5,50 +5,52 @@ Linked vertex stage:
// Module Version 10000 // Module Version 10000
// Generated by (magic number): 80001 // Generated by (magic number): 80001
// Id's are bound by 26 // Id's are bound by 27
Capability Shader Capability Shader
1: ExtInstImport "GLSL.std.450" 1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450 MemoryModel Logical GLSL450
EntryPoint Vertex 4 "main" 24 25 EntryPoint Vertex 4 "main" 25 26
Source ESSL 300 Source ESSL 300
Name 4 "main" Name 4 "main"
Name 8 "i" Name 8 "i"
Name 18 "j" Name 19 "j"
Name 24 "gl_VertexID" Name 25 "gl_VertexID"
Name 25 "gl_InstanceID" Name 26 "gl_InstanceID"
Decorate 24(gl_VertexID) BuiltIn VertexId Decorate 25(gl_VertexID) BuiltIn VertexId
Decorate 25(gl_InstanceID) BuiltIn InstanceId Decorate 26(gl_InstanceID) BuiltIn InstanceId
2: TypeVoid 2: TypeVoid
3: TypeFunction 2 3: TypeFunction 2
6: TypeInt 32 1 6: TypeInt 32 1
7: TypePointer Function 6(int) 7: TypePointer Function 6(int)
9: 6(int) Constant 0 9: 6(int) Constant 0
15: 6(int) Constant 10 16: 6(int) Constant 10
16: TypeBool 17: TypeBool
19: 6(int) Constant 12 20: 6(int) Constant 12
21: 6(int) Constant 1 22: 6(int) Constant 1
23: TypePointer Input 6(int) 24: TypePointer Input 6(int)
24(gl_VertexID): 23(ptr) Variable Input 25(gl_VertexID): 24(ptr) Variable Input
25(gl_InstanceID): 23(ptr) Variable Input 26(gl_InstanceID): 24(ptr) Variable Input
4(main): 2 Function None 3 4(main): 2 Function None 3
5: Label 5: Label
8(i): 7(ptr) Variable Function 8(i): 7(ptr) Variable Function
18(j): 7(ptr) Variable Function 19(j): 7(ptr) Variable Function
Store 8(i) 9 Store 8(i) 9
Branch 10 Branch 10
10: Label 10: Label
14: 6(int) Load 8(i)
17: 16(bool) SLessThan 14 15
LoopMerge 12 13 None LoopMerge 12 13 None
BranchConditional 17 11 12 Branch 14
14: Label
15: 6(int) Load 8(i)
18: 17(bool) SLessThan 15 16
BranchConditional 18 11 12
11: Label 11: Label
Store 18(j) 19 Store 19(j) 20
Branch 13 Branch 13
13: Label 13: Label
20: 6(int) Load 8(i) 21: 6(int) Load 8(i)
22: 6(int) IAdd 20 21 23: 6(int) IAdd 21 22
Store 8(i) 22 Store 8(i) 23
Branch 10 Branch 10
12: Label 12: Label
Return Return

View File

@ -5,30 +5,30 @@ Linked fragment stage:
// Module Version 10000 // Module Version 10000
// Generated by (magic number): 80001 // Generated by (magic number): 80001
// Id's are bound by 127 // Id's are bound by 132
Capability Shader Capability Shader
1: ExtInstImport "GLSL.std.450" 1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450 MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 11 36 101 EntryPoint Fragment 4 "main" 11 37 105
ExecutionMode 4 OriginLowerLeft ExecutionMode 4 OriginLowerLeft
Source GLSL 130 Source GLSL 130
Name 4 "main" Name 4 "main"
Name 9 "color" Name 9 "color"
Name 11 "BaseColor" Name 11 "BaseColor"
Name 15 "i" Name 15 "i"
Name 23 "Count" Name 24 "Count"
Name 28 "bigColor" Name 29 "bigColor"
Name 36 "gl_FragColor" Name 37 "gl_FragColor"
Name 39 "sum" Name 40 "sum"
Name 41 "i" Name 42 "i"
Name 52 "v4" Name 54 "v4"
Name 62 "i" Name 64 "i"
Name 69 "tv4" Name 72 "tv4"
Name 86 "r" Name 89 "r"
Name 92 "i" Name 95 "i"
Name 101 "f" Name 105 "f"
Name 114 "i" Name 118 "i"
2: TypeVoid 2: TypeVoid
3: TypeFunction 2 3: TypeFunction 2
6: TypeFloat 32 6: TypeFloat 32
@ -39,166 +39,176 @@ Linked fragment stage:
13: TypeInt 32 1 13: TypeInt 32 1
14: TypePointer Function 13(int) 14: TypePointer Function 13(int)
16: 13(int) Constant 0 16: 13(int) Constant 0
22: TypePointer UniformConstant 13(int) 23: TypePointer UniformConstant 13(int)
23(Count): 22(ptr) Variable UniformConstant 24(Count): 23(ptr) Variable UniformConstant
25: TypeBool 26: TypeBool
27: TypePointer UniformConstant 7(fvec4) 28: TypePointer UniformConstant 7(fvec4)
28(bigColor): 27(ptr) Variable UniformConstant 29(bigColor): 28(ptr) Variable UniformConstant
33: 13(int) Constant 1 34: 13(int) Constant 1
35: TypePointer Output 7(fvec4) 36: TypePointer Output 7(fvec4)
36(gl_FragColor): 35(ptr) Variable Output 37(gl_FragColor): 36(ptr) Variable Output
38: TypePointer Function 6(float) 39: TypePointer Function 6(float)
40: 6(float) Constant 0 41: 6(float) Constant 0
47: 13(int) Constant 4 49: 13(int) Constant 4
49: TypeInt 32 0 51: TypeInt 32 0
50: TypeVector 49(int) 4 52: TypeVector 51(int) 4
51: TypePointer UniformConstant 50(ivec4) 53: TypePointer UniformConstant 52(ivec4)
52(v4): 51(ptr) Variable UniformConstant 54(v4): 53(ptr) Variable UniformConstant
54: TypePointer UniformConstant 49(int) 56: TypePointer UniformConstant 51(int)
74: 49(int) Constant 4 77: 51(int) Constant 4
87: TypeVector 6(float) 3 90: TypeVector 6(float) 3
100: TypePointer Input 6(float) 104: TypePointer Input 6(float)
101(f): 100(ptr) Variable Input 105(f): 104(ptr) Variable Input
103: 49(int) Constant 3 107: 51(int) Constant 3
120: 13(int) Constant 16 125: 13(int) Constant 16
4(main): 2 Function None 3 4(main): 2 Function None 3
5: Label 5: Label
9(color): 8(ptr) Variable Function 9(color): 8(ptr) Variable Function
15(i): 14(ptr) Variable Function 15(i): 14(ptr) Variable Function
39(sum): 38(ptr) Variable Function 40(sum): 39(ptr) Variable Function
41(i): 14(ptr) Variable Function 42(i): 14(ptr) Variable Function
62(i): 14(ptr) Variable Function 64(i): 14(ptr) Variable Function
69(tv4): 8(ptr) Variable Function 72(tv4): 8(ptr) Variable Function
86(r): 8(ptr) Variable Function 89(r): 8(ptr) Variable Function
92(i): 14(ptr) Variable Function 95(i): 14(ptr) Variable Function
114(i): 14(ptr) Variable Function 118(i): 14(ptr) Variable Function
12: 7(fvec4) Load 11(BaseColor) 12: 7(fvec4) Load 11(BaseColor)
Store 9(color) 12 Store 9(color) 12
Store 15(i) 16 Store 15(i) 16
Branch 17 Branch 17
17: Label 17: Label
21: 13(int) Load 15(i)
24: 13(int) Load 23(Count)
26: 25(bool) SLessThan 21 24
LoopMerge 19 20 None LoopMerge 19 20 None
BranchConditional 26 18 19 Branch 21
21: Label
22: 13(int) Load 15(i)
25: 13(int) Load 24(Count)
27: 26(bool) SLessThan 22 25
BranchConditional 27 18 19
18: Label 18: Label
29: 7(fvec4) Load 28(bigColor) 30: 7(fvec4) Load 29(bigColor)
30: 7(fvec4) Load 9(color) 31: 7(fvec4) Load 9(color)
31: 7(fvec4) FAdd 30 29 32: 7(fvec4) FAdd 31 30
Store 9(color) 31 Store 9(color) 32
Branch 20 Branch 20
20: Label 20: Label
32: 13(int) Load 15(i) 33: 13(int) Load 15(i)
34: 13(int) IAdd 32 33 35: 13(int) IAdd 33 34
Store 15(i) 34 Store 15(i) 35
Branch 17 Branch 17
19: Label 19: Label
37: 7(fvec4) Load 9(color) 38: 7(fvec4) Load 9(color)
Store 36(gl_FragColor) 37 Store 37(gl_FragColor) 38
Store 39(sum) 40 Store 40(sum) 41
Store 41(i) 16 Store 42(i) 16
Branch 42 Branch 43
42: Label 43: Label
46: 13(int) Load 41(i) LoopMerge 45 46 None
48: 25(bool) SLessThan 46 47 Branch 47
LoopMerge 44 45 None 47: Label
BranchConditional 48 43 44 48: 13(int) Load 42(i)
43: Label 50: 26(bool) SLessThan 48 49
53: 13(int) Load 41(i) BranchConditional 50 44 45
55: 54(ptr) AccessChain 52(v4) 53 44: Label
56: 49(int) Load 55 55: 13(int) Load 42(i)
57: 6(float) ConvertUToF 56 57: 56(ptr) AccessChain 54(v4) 55
58: 6(float) Load 39(sum) 58: 51(int) Load 57
59: 6(float) FAdd 58 57 59: 6(float) ConvertUToF 58
Store 39(sum) 59 60: 6(float) Load 40(sum)
Branch 45 61: 6(float) FAdd 60 59
45: Label Store 40(sum) 61
60: 13(int) Load 41(i) Branch 46
61: 13(int) IAdd 60 33 46: Label
Store 41(i) 61 62: 13(int) Load 42(i)
Branch 42 63: 13(int) IAdd 62 34
44: Label Store 42(i) 63
Store 62(i) 16 Branch 43
Branch 63 45: Label
63: Label Store 64(i) 16
67: 13(int) Load 62(i) Branch 65
68: 25(bool) SLessThan 67 47
LoopMerge 65 66 None
BranchConditional 68 64 65
64: Label
70: 13(int) Load 62(i)
71: 13(int) Load 62(i)
72: 54(ptr) AccessChain 52(v4) 71
73: 49(int) Load 72
75: 49(int) IMul 73 74
76: 6(float) ConvertUToF 75
77: 38(ptr) AccessChain 69(tv4) 70
Store 77 76
Branch 66
66: Label
78: 13(int) Load 62(i)
79: 13(int) IAdd 78 33
Store 62(i) 79
Branch 63
65: Label 65: Label
80: 6(float) Load 39(sum) LoopMerge 67 68 None
81: 7(fvec4) CompositeConstruct 80 80 80 80 Branch 69
82: 7(fvec4) Load 69(tv4) 69: Label
83: 7(fvec4) FAdd 81 82 70: 13(int) Load 64(i)
84: 7(fvec4) Load 36(gl_FragColor) 71: 26(bool) SLessThan 70 49
85: 7(fvec4) FAdd 84 83 BranchConditional 71 66 67
Store 36(gl_FragColor) 85 66: Label
88: 7(fvec4) Load 11(BaseColor) 73: 13(int) Load 64(i)
89: 87(fvec3) VectorShuffle 88 88 0 1 2 74: 13(int) Load 64(i)
90: 7(fvec4) Load 86(r) 75: 56(ptr) AccessChain 54(v4) 74
91: 7(fvec4) VectorShuffle 90 89 4 5 6 3 76: 51(int) Load 75
Store 86(r) 91 78: 51(int) IMul 76 77
Store 92(i) 16 79: 6(float) ConvertUToF 78
Branch 93 80: 39(ptr) AccessChain 72(tv4) 73
93: Label Store 80 79
97: 13(int) Load 92(i) Branch 68
98: 13(int) Load 23(Count) 68: Label
99: 25(bool) SLessThan 97 98 81: 13(int) Load 64(i)
LoopMerge 95 96 None 82: 13(int) IAdd 81 34
BranchConditional 99 94 95 Store 64(i) 82
94: Label Branch 65
102: 6(float) Load 101(f) 67: Label
104: 38(ptr) AccessChain 86(r) 103 83: 6(float) Load 40(sum)
Store 104 102 84: 7(fvec4) CompositeConstruct 83 83 83 83
85: 7(fvec4) Load 72(tv4)
86: 7(fvec4) FAdd 84 85
87: 7(fvec4) Load 37(gl_FragColor)
88: 7(fvec4) FAdd 87 86
Store 37(gl_FragColor) 88
91: 7(fvec4) Load 11(BaseColor)
92: 90(fvec3) VectorShuffle 91 91 0 1 2
93: 7(fvec4) Load 89(r)
94: 7(fvec4) VectorShuffle 93 92 4 5 6 3
Store 89(r) 94
Store 95(i) 16
Branch 96
96: Label
LoopMerge 98 99 None
Branch 100
100: Label
101: 13(int) Load 95(i)
102: 13(int) Load 24(Count)
103: 26(bool) SLessThan 101 102
BranchConditional 103 97 98
97: Label
106: 6(float) Load 105(f)
108: 39(ptr) AccessChain 89(r) 107
Store 108 106
Branch 99
99: Label
109: 13(int) Load 95(i)
110: 13(int) IAdd 109 34
Store 95(i) 110
Branch 96 Branch 96
96: Label 98: Label
105: 13(int) Load 92(i) 111: 7(fvec4) Load 89(r)
106: 13(int) IAdd 105 33 112: 90(fvec3) VectorShuffle 111 111 0 1 2
Store 92(i) 106 113: 7(fvec4) Load 37(gl_FragColor)
Branch 93 114: 90(fvec3) VectorShuffle 113 113 0 1 2
95: Label 115: 90(fvec3) FAdd 114 112
107: 7(fvec4) Load 86(r) 116: 7(fvec4) Load 37(gl_FragColor)
108: 87(fvec3) VectorShuffle 107 107 0 1 2 117: 7(fvec4) VectorShuffle 116 115 4 5 6 3
109: 7(fvec4) Load 36(gl_FragColor) Store 37(gl_FragColor) 117
110: 87(fvec3) VectorShuffle 109 109 0 1 2 Store 118(i) 16
111: 87(fvec3) FAdd 110 108 Branch 119
112: 7(fvec4) Load 36(gl_FragColor) 119: Label
113: 7(fvec4) VectorShuffle 112 111 4 5 6 3 LoopMerge 121 122 None
Store 36(gl_FragColor) 113 Branch 123
Store 114(i) 16 123: Label
Branch 115 124: 13(int) Load 118(i)
115: Label 126: 26(bool) SLessThan 124 125
119: 13(int) Load 114(i) BranchConditional 126 120 121
121: 25(bool) SLessThan 119 120 120: Label
LoopMerge 117 118 None 127: 6(float) Load 105(f)
BranchConditional 121 116 117 128: 7(fvec4) Load 37(gl_FragColor)
116: Label 129: 7(fvec4) VectorTimesScalar 128 127
122: 6(float) Load 101(f) Store 37(gl_FragColor) 129
123: 7(fvec4) Load 36(gl_FragColor) Branch 122
124: 7(fvec4) VectorTimesScalar 123 122 122: Label
Store 36(gl_FragColor) 124 130: 13(int) Load 118(i)
Branch 118 131: 13(int) IAdd 130 49
118: Label Store 118(i) 131
125: 13(int) Load 114(i) Branch 119
126: 13(int) IAdd 125 47 121: Label
Store 114(i) 126
Branch 115
117: Label
Return Return
FunctionEnd FunctionEnd

View File

@ -8,12 +8,12 @@ Linked fragment stage:
// Module Version 10000 // Module Version 10000
// Generated by (magic number): 80001 // Generated by (magic number): 80001
// Id's are bound by 137 // Id's are bound by 138
Capability Shader Capability Shader
1: ExtInstImport "GLSL.std.450" 1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450 MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 40 97 107 EntryPoint Fragment 4 "main" 40 98 108
ExecutionMode 4 OriginLowerLeft ExecutionMode 4 OriginLowerLeft
Source GLSL 130 Source GLSL 130
Name 4 "main" Name 4 "main"
@ -38,14 +38,14 @@ Linked fragment stage:
Name 68 "x" Name 68 "x"
Name 70 "localArray" Name 70 "localArray"
Name 75 "i" Name 75 "i"
Name 83 "a" Name 84 "a"
Name 89 "condition" Name 90 "condition"
Name 97 "color" Name 98 "color"
Name 107 "gl_FragColor" Name 108 "gl_FragColor"
Name 127 "samp2D" Name 128 "samp2D"
Name 133 "foo" Name 134 "foo"
Name 134 "foo2" Name 135 "foo2"
Name 136 "uFloatArray" Name 137 "uFloatArray"
2: TypeVoid 2: TypeVoid
3: TypeFunction 2 3: TypeFunction 2
6: TypeInt 32 1 6: TypeInt 32 1
@ -80,26 +80,26 @@ Linked fragment stage:
48: TypePointer Function 47 48: TypePointer Function 47
52: TypePointer Function 6(int) 52: TypePointer Function 6(int)
69: 6(int) Constant 5 69: 6(int) Constant 5
81: 6(int) Constant 16 82: 6(int) Constant 16
85: 7(float) Constant 0 86: 7(float) Constant 0
89(condition): 20(ptr) Variable UniformConstant 90(condition): 20(ptr) Variable UniformConstant
95: 6(int) Constant 3 96: 6(int) Constant 3
96: TypePointer Input 9(fvec4) 97: TypePointer Input 9(fvec4)
97(color): 96(ptr) Variable Input 98(color): 97(ptr) Variable Input
99: TypePointer Function 9(fvec4) 100: TypePointer Function 9(fvec4)
101: 32(int) Constant 1 102: 32(int) Constant 1
104: 32(int) Constant 2 105: 32(int) Constant 2
106: TypePointer Output 9(fvec4) 107: TypePointer Output 9(fvec4)
107(gl_FragColor): 106(ptr) Variable Output 108(gl_FragColor): 107(ptr) Variable Output
124: TypeImage 7(float) 2D sampled format:Unknown 125: TypeImage 7(float) 2D sampled format:Unknown
125: TypeSampledImage 124 126: TypeSampledImage 125
126: TypePointer UniformConstant 125 127: TypePointer UniformConstant 126
127(samp2D): 126(ptr) Variable UniformConstant 128(samp2D): 127(ptr) Variable UniformConstant
132: TypePointer UniformConstant 8(s1) 133: TypePointer UniformConstant 8(s1)
133(foo): 132(ptr) Variable UniformConstant 134(foo): 133(ptr) Variable UniformConstant
134(foo2): 17(ptr) Variable UniformConstant 135(foo2): 17(ptr) Variable UniformConstant
135: TypePointer UniformConstant 34 136: TypePointer UniformConstant 34
136(uFloatArray): 135(ptr) Variable UniformConstant 137(uFloatArray): 136(ptr) Variable UniformConstant
4(main): 2 Function None 3 4(main): 2 Function None 3
5: Label 5: Label
12(locals2): 11(ptr) Variable Function 12(locals2): 11(ptr) Variable Function
@ -108,7 +108,7 @@ Linked fragment stage:
68(x): 52(ptr) Variable Function 68(x): 52(ptr) Variable Function
70(localArray): 35(ptr) Variable Function 70(localArray): 35(ptr) Variable Function
75(i): 52(ptr) Variable Function 75(i): 52(ptr) Variable Function
83(a): 35(ptr) Variable Function 84(a): 35(ptr) Variable Function
18: 17(ptr) AccessChain 15(foo3) 16 18: 17(ptr) AccessChain 15(foo3) 16
19: 10(s2) Load 18 19: 10(s2) Load 18
Store 12(locals2) 19 Store 12(locals2) 19
@ -161,57 +161,59 @@ Linked fragment stage:
Store 75(i) 16 Store 75(i) 16
Branch 76 Branch 76
76: Label 76: Label
80: 6(int) Load 75(i)
82: 23(bool) SLessThan 80 81
LoopMerge 78 79 None LoopMerge 78 79 None
BranchConditional 82 77 78 Branch 80
80: Label
81: 6(int) Load 75(i)
83: 23(bool) SLessThan 81 82
BranchConditional 83 77 78
77: Label 77: Label
84: 6(int) Load 75(i) 85: 6(int) Load 75(i)
86: 30(ptr) AccessChain 83(a) 84 87: 30(ptr) AccessChain 84(a) 85
Store 86 85 Store 87 86
Branch 79 Branch 79
79: Label 79: Label
87: 6(int) Load 75(i) 88: 6(int) Load 75(i)
88: 6(int) IAdd 87 28 89: 6(int) IAdd 88 28
Store 75(i) 88 Store 75(i) 89
Branch 76 Branch 76
78: Label 78: Label
90: 6(int) Load 89(condition) 91: 6(int) Load 90(condition)
91: 23(bool) IEqual 90 28 92: 23(bool) IEqual 91 28
SelectionMerge 93 None SelectionMerge 94 None
BranchConditional 91 92 93 BranchConditional 92 93 94
92: Label 93: Label
94: 34 Load 70(localArray) 95: 34 Load 70(localArray)
Store 83(a) 94 Store 84(a) 95
Branch 93 Branch 94
93: Label 94: Label
98: 9(fvec4) Load 97(color) 99: 9(fvec4) Load 98(color)
100: 99(ptr) AccessChain 12(locals2) 95 101: 100(ptr) AccessChain 12(locals2) 96
Store 100 98 Store 101 99
102: 42(ptr) AccessChain 40(coord) 101 103: 42(ptr) AccessChain 40(coord) 102
103: 7(float) Load 102 104: 7(float) Load 103
105: 30(ptr) AccessChain 12(locals2) 95 104 106: 30(ptr) AccessChain 12(locals2) 96 105
Store 105 103 Store 106 104
108: 99(ptr) AccessChain 12(locals2) 95 109: 100(ptr) AccessChain 12(locals2) 96
109: 9(fvec4) Load 108 110: 9(fvec4) Load 109
110: 30(ptr) AccessChain 36(localFArray) 37 111: 30(ptr) AccessChain 36(localFArray) 37
111: 7(float) Load 110 112: 7(float) Load 111
112: 30(ptr) AccessChain 12(locals2) 27 28 113: 30(ptr) AccessChain 12(locals2) 27 28
113: 7(float) Load 112 114: 7(float) Load 113
114: 7(float) FAdd 111 113 115: 7(float) FAdd 112 114
115: 6(int) Load 68(x) 116: 6(int) Load 68(x)
116: 30(ptr) AccessChain 70(localArray) 115 117: 30(ptr) AccessChain 70(localArray) 116
117: 7(float) Load 116 118: 7(float) Load 117
118: 7(float) FAdd 114 117 119: 7(float) FAdd 115 118
119: 6(int) Load 68(x) 120: 6(int) Load 68(x)
120: 30(ptr) AccessChain 83(a) 119 121: 30(ptr) AccessChain 84(a) 120
121: 7(float) Load 120 122: 7(float) Load 121
122: 7(float) FAdd 118 121 123: 7(float) FAdd 119 122
123: 9(fvec4) VectorTimesScalar 109 122 124: 9(fvec4) VectorTimesScalar 110 123
128: 125 Load 127(samp2D) 129: 126 Load 128(samp2D)
129: 38(fvec2) Load 40(coord) 130: 38(fvec2) Load 40(coord)
130: 9(fvec4) ImageSampleImplicitLod 128 129 131: 9(fvec4) ImageSampleImplicitLod 129 130
131: 9(fvec4) FMul 123 130 132: 9(fvec4) FMul 124 131
Store 107(gl_FragColor) 131 Store 108(gl_FragColor) 132
Return Return
FunctionEnd FunctionEnd

File diff suppressed because it is too large Load Diff

View File

@ -7,12 +7,12 @@ Linked fragment stage:
// Module Version 10000 // Module Version 10000
// Generated by (magic number): 80001 // Generated by (magic number): 80001
// Id's are bound by 187 // Id's are bound by 188
Capability Shader Capability Shader
1: ExtInstImport "GLSL.std.450" 1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450 MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 11 140 EntryPoint Fragment 4 "main" 11 141
ExecutionMode 4 OriginLowerLeft ExecutionMode 4 OriginLowerLeft
Source GLSL 130 Source GLSL 130
Name 4 "main" Name 4 "main"
@ -20,51 +20,51 @@ Linked fragment stage:
Name 11 "BaseColor" Name 11 "BaseColor"
Name 18 "bigColor4" Name 18 "bigColor4"
Name 28 "d4" Name 28 "d4"
Name 80 "d13" Name 81 "d13"
Name 140 "gl_FragColor" Name 141 "gl_FragColor"
Name 142 "bigColor" Name 143 "bigColor"
Name 143 "bigColor1_1" Name 144 "bigColor1_1"
Name 144 "bigColor1_2" Name 145 "bigColor1_2"
Name 145 "bigColor1_3" Name 146 "bigColor1_3"
Name 146 "bigColor2" Name 147 "bigColor2"
Name 147 "bigColor3" Name 148 "bigColor3"
Name 148 "bigColor5" Name 149 "bigColor5"
Name 149 "bigColor6" Name 150 "bigColor6"
Name 150 "bigColor7" Name 151 "bigColor7"
Name 151 "bigColor8" Name 152 "bigColor8"
Name 152 "d" Name 153 "d"
Name 153 "d2" Name 154 "d2"
Name 154 "d3" Name 155 "d3"
Name 155 "d5" Name 156 "d5"
Name 156 "d6" Name 157 "d6"
Name 157 "d7" Name 158 "d7"
Name 158 "d8" Name 159 "d8"
Name 159 "d9" Name 160 "d9"
Name 160 "d10" Name 161 "d10"
Name 161 "d11" Name 162 "d11"
Name 162 "d12" Name 163 "d12"
Name 163 "d14" Name 164 "d14"
Name 164 "d15" Name 165 "d15"
Name 165 "d16" Name 166 "d16"
Name 166 "d17" Name 167 "d17"
Name 167 "d18" Name 168 "d18"
Name 168 "d19" Name 169 "d19"
Name 169 "d20" Name 170 "d20"
Name 170 "d21" Name 171 "d21"
Name 171 "d22" Name 172 "d22"
Name 172 "d23" Name 173 "d23"
Name 173 "d24" Name 174 "d24"
Name 174 "d25" Name 175 "d25"
Name 175 "d26" Name 176 "d26"
Name 176 "d27" Name 177 "d27"
Name 177 "d28" Name 178 "d28"
Name 178 "d29" Name 179 "d29"
Name 179 "d30" Name 180 "d30"
Name 180 "d31" Name 181 "d31"
Name 181 "d32" Name 182 "d32"
Name 182 "d33" Name 183 "d33"
Name 183 "d34" Name 184 "d34"
Name 186 "Count" Name 187 "Count"
2: TypeVoid 2: TypeVoid
3: TypeFunction 2 3: TypeFunction 2
6: TypeFloat 32 6: TypeFloat 32
@ -84,55 +84,55 @@ Linked fragment stage:
35: 22(int) Constant 2 35: 22(int) Constant 2
48: 6(float) Constant 1065353216 48: 6(float) Constant 1065353216
51: 22(int) Constant 1 51: 22(int) Constant 1
77: 22(int) Constant 3 78: 22(int) Constant 3
80(d13): 27(ptr) Variable UniformConstant 81(d13): 27(ptr) Variable UniformConstant
139: TypePointer Output 7(fvec4) 140: TypePointer Output 7(fvec4)
140(gl_FragColor): 139(ptr) Variable Output 141(gl_FragColor): 140(ptr) Variable Output
142(bigColor): 17(ptr) Variable UniformConstant 143(bigColor): 17(ptr) Variable UniformConstant
143(bigColor1_1): 17(ptr) Variable UniformConstant 144(bigColor1_1): 17(ptr) Variable UniformConstant
144(bigColor1_2): 17(ptr) Variable UniformConstant 145(bigColor1_2): 17(ptr) Variable UniformConstant
145(bigColor1_3): 17(ptr) Variable UniformConstant 146(bigColor1_3): 17(ptr) Variable UniformConstant
146(bigColor2): 17(ptr) Variable UniformConstant 147(bigColor2): 17(ptr) Variable UniformConstant
147(bigColor3): 17(ptr) Variable UniformConstant 148(bigColor3): 17(ptr) Variable UniformConstant
148(bigColor5): 17(ptr) Variable UniformConstant 149(bigColor5): 17(ptr) Variable UniformConstant
149(bigColor6): 17(ptr) Variable UniformConstant 150(bigColor6): 17(ptr) Variable UniformConstant
150(bigColor7): 17(ptr) Variable UniformConstant 151(bigColor7): 17(ptr) Variable UniformConstant
151(bigColor8): 17(ptr) Variable UniformConstant 152(bigColor8): 17(ptr) Variable UniformConstant
152(d): 27(ptr) Variable UniformConstant 153(d): 27(ptr) Variable UniformConstant
153(d2): 27(ptr) Variable UniformConstant 154(d2): 27(ptr) Variable UniformConstant
154(d3): 27(ptr) Variable UniformConstant 155(d3): 27(ptr) Variable UniformConstant
155(d5): 27(ptr) Variable UniformConstant 156(d5): 27(ptr) Variable UniformConstant
156(d6): 27(ptr) Variable UniformConstant 157(d6): 27(ptr) Variable UniformConstant
157(d7): 27(ptr) Variable UniformConstant 158(d7): 27(ptr) Variable UniformConstant
158(d8): 27(ptr) Variable UniformConstant 159(d8): 27(ptr) Variable UniformConstant
159(d9): 27(ptr) Variable UniformConstant 160(d9): 27(ptr) Variable UniformConstant
160(d10): 27(ptr) Variable UniformConstant 161(d10): 27(ptr) Variable UniformConstant
161(d11): 27(ptr) Variable UniformConstant 162(d11): 27(ptr) Variable UniformConstant
162(d12): 27(ptr) Variable UniformConstant 163(d12): 27(ptr) Variable UniformConstant
163(d14): 27(ptr) Variable UniformConstant 164(d14): 27(ptr) Variable UniformConstant
164(d15): 27(ptr) Variable UniformConstant 165(d15): 27(ptr) Variable UniformConstant
165(d16): 27(ptr) Variable UniformConstant 166(d16): 27(ptr) Variable UniformConstant
166(d17): 27(ptr) Variable UniformConstant 167(d17): 27(ptr) Variable UniformConstant
167(d18): 27(ptr) Variable UniformConstant 168(d18): 27(ptr) Variable UniformConstant
168(d19): 27(ptr) Variable UniformConstant 169(d19): 27(ptr) Variable UniformConstant
169(d20): 27(ptr) Variable UniformConstant 170(d20): 27(ptr) Variable UniformConstant
170(d21): 27(ptr) Variable UniformConstant 171(d21): 27(ptr) Variable UniformConstant
171(d22): 27(ptr) Variable UniformConstant 172(d22): 27(ptr) Variable UniformConstant
172(d23): 27(ptr) Variable UniformConstant 173(d23): 27(ptr) Variable UniformConstant
173(d24): 27(ptr) Variable UniformConstant 174(d24): 27(ptr) Variable UniformConstant
174(d25): 27(ptr) Variable UniformConstant 175(d25): 27(ptr) Variable UniformConstant
175(d26): 27(ptr) Variable UniformConstant 176(d26): 27(ptr) Variable UniformConstant
176(d27): 27(ptr) Variable UniformConstant 177(d27): 27(ptr) Variable UniformConstant
177(d28): 27(ptr) Variable UniformConstant 178(d28): 27(ptr) Variable UniformConstant
178(d29): 27(ptr) Variable UniformConstant 179(d29): 27(ptr) Variable UniformConstant
179(d30): 27(ptr) Variable UniformConstant 180(d30): 27(ptr) Variable UniformConstant
180(d31): 27(ptr) Variable UniformConstant 181(d31): 27(ptr) Variable UniformConstant
181(d32): 27(ptr) Variable UniformConstant 182(d32): 27(ptr) Variable UniformConstant
182(d33): 27(ptr) Variable UniformConstant 183(d33): 27(ptr) Variable UniformConstant
183(d34): 27(ptr) Variable UniformConstant 184(d34): 27(ptr) Variable UniformConstant
184: TypeInt 32 1 185: TypeInt 32 1
185: TypePointer UniformConstant 184(int) 186: TypePointer UniformConstant 185(int)
186(Count): 185(ptr) Variable UniformConstant 187(Count): 186(ptr) Variable UniformConstant
4(main): 2 Function None 3 4(main): 2 Function None 3
5: Label 5: Label
9(color): 8(ptr) Variable Function 9(color): 8(ptr) Variable Function
@ -207,95 +207,97 @@ Linked fragment stage:
15: Label 15: Label
Branch 73 Branch 73
73: Label 73: Label
78: 24(ptr) AccessChain 9(color) 77
79: 6(float) Load 78
81: 6(float) Load 80(d13)
82: 30(bool) FOrdLessThan 79 81
LoopMerge 75 76 None LoopMerge 75 76 None
BranchConditional 82 74 75 Branch 77
77: Label
79: 24(ptr) AccessChain 9(color) 78
80: 6(float) Load 79
82: 6(float) Load 81(d13)
83: 30(bool) FOrdLessThan 80 82
BranchConditional 83 74 75
74: Label 74: Label
83: 24(ptr) AccessChain 9(color) 35 84: 24(ptr) AccessChain 9(color) 35
84: 6(float) Load 83 85: 6(float) Load 84
85: 6(float) Load 80(d13) 86: 6(float) Load 81(d13)
86: 30(bool) FOrdLessThan 84 85 87: 30(bool) FOrdLessThan 85 86
SelectionMerge 88 None SelectionMerge 89 None
BranchConditional 86 87 92 BranchConditional 87 88 93
87: Label 88: Label
89: 7(fvec4) Load 9(color) 90: 7(fvec4) Load 9(color)
90: 7(fvec4) CompositeConstruct 48 48 48 48 91: 7(fvec4) CompositeConstruct 48 48 48 48
91: 7(fvec4) FAdd 89 90 92: 7(fvec4) FAdd 90 91
Store 9(color) 91 Store 9(color) 92
Branch 88 Branch 89
92: Label 93: Label
93: 7(fvec4) Load 9(color) 94: 7(fvec4) Load 9(color)
94: 7(fvec4) CompositeConstruct 48 48 48 48 95: 7(fvec4) CompositeConstruct 48 48 48 48
95: 7(fvec4) FSub 93 94 96: 7(fvec4) FSub 94 95
Store 9(color) 95 Store 9(color) 96
Branch 88 Branch 89
88: Label 89: Label
96: 7(fvec4) Load 18(bigColor4) 97: 7(fvec4) Load 18(bigColor4)
97: 7(fvec4) Load 9(color) 98: 7(fvec4) Load 9(color)
98: 7(fvec4) FAdd 97 96 99: 7(fvec4) FAdd 98 97
Store 9(color) 98 Store 9(color) 99
99: 24(ptr) AccessChain 9(color) 23 100: 24(ptr) AccessChain 9(color) 23
100: 6(float) Load 99 101: 6(float) Load 100
101: 6(float) Load 28(d4) 102: 6(float) Load 28(d4)
102: 30(bool) FOrdLessThan 100 101 103: 30(bool) FOrdLessThan 101 102
SelectionMerge 104 None SelectionMerge 105 None
BranchConditional 102 103 104 BranchConditional 103 104 105
103: Label 104: Label
105: 24(ptr) AccessChain 9(color) 35 106: 24(ptr) AccessChain 9(color) 35
106: 6(float) Load 105 107: 6(float) Load 106
107: 6(float) FAdd 106 34 108: 6(float) FAdd 107 34
108: 24(ptr) AccessChain 9(color) 35
Store 108 107
109: 24(ptr) AccessChain 9(color) 35 109: 24(ptr) AccessChain 9(color) 35
110: 6(float) Load 109 Store 109 108
111: 6(float) Load 28(d4) 110: 24(ptr) AccessChain 9(color) 35
112: 30(bool) FOrdLessThan 110 111 111: 6(float) Load 110
SelectionMerge 114 None 112: 6(float) Load 28(d4)
BranchConditional 112 113 114 113: 30(bool) FOrdLessThan 111 112
113: Label SelectionMerge 115 None
115: 24(ptr) AccessChain 9(color) 23 BranchConditional 113 114 115
116: 6(float) Load 115 114: Label
117: 6(float) FAdd 116 48 116: 24(ptr) AccessChain 9(color) 23
Store 115 117 117: 6(float) Load 116
118: 6(float) FAdd 117 48
Store 116 118
Branch 76 Branch 76
114: Label 115: Label
Branch 104 Branch 105
104: Label 105: Label
119: 24(ptr) AccessChain 9(color) 51 120: 24(ptr) AccessChain 9(color) 51
120: 6(float) Load 119 121: 6(float) Load 120
121: 6(float) Load 28(d4) 122: 6(float) Load 28(d4)
122: 30(bool) FOrdLessThan 120 121 123: 30(bool) FOrdLessThan 121 122
SelectionMerge 124 None SelectionMerge 125 None
BranchConditional 122 123 130 BranchConditional 123 124 131
123: Label 124: Label
125: 6(float) Load 28(d4) 126: 6(float) Load 28(d4)
126: 24(ptr) AccessChain 9(color) 51 127: 24(ptr) AccessChain 9(color) 51
127: 6(float) Load 126 128: 6(float) Load 127
128: 6(float) FAdd 127 125 129: 6(float) FAdd 128 126
129: 24(ptr) AccessChain 9(color) 51 130: 24(ptr) AccessChain 9(color) 51
Store 129 128 Store 130 129
Branch 124 Branch 125
130: Label 131: Label
131: 6(float) Load 28(d4) 132: 6(float) Load 28(d4)
132: 24(ptr) AccessChain 9(color) 23 133: 24(ptr) AccessChain 9(color) 23
133: 6(float) Load 132 134: 6(float) Load 133
134: 6(float) FAdd 133 131 135: 6(float) FAdd 134 132
135: 24(ptr) AccessChain 9(color) 23 136: 24(ptr) AccessChain 9(color) 23
Store 135 134 Store 136 135
Branch 124 Branch 125
124: Label 125: Label
Branch 76 Branch 76
76: Label 76: Label
Branch 73 Branch 73
75: Label 75: Label
136: 7(fvec4) Load 9(color) 137: 7(fvec4) Load 9(color)
137: 7(fvec4) CompositeConstruct 48 48 48 48 138: 7(fvec4) CompositeConstruct 48 48 48 48
138: 7(fvec4) FAdd 136 137 139: 7(fvec4) FAdd 137 138
Store 9(color) 138 Store 9(color) 139
141: 7(fvec4) Load 9(color) 142: 7(fvec4) Load 9(color)
Store 140(gl_FragColor) 141 Store 141(gl_FragColor) 142
Return Return
FunctionEnd FunctionEnd

View File

@ -10,12 +10,12 @@ Linked fragment stage:
// Module Version 10000 // Module Version 10000
// Generated by (magic number): 80001 // Generated by (magic number): 80001
// Id's are bound by 267 // Id's are bound by 269
Capability Shader Capability Shader
1: ExtInstImport "GLSL.std.450" 1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450 MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 75 225 EntryPoint Fragment 4 "main" 75 227
ExecutionMode 4 OriginLowerLeft ExecutionMode 4 OriginLowerLeft
Source ESSL 310 Source ESSL 310
Name 4 "main" Name 4 "main"
@ -33,24 +33,24 @@ Linked fragment stage:
Name 75 "x" Name 75 "x"
Name 129 "d" Name 129 "d"
Name 155 "i" Name 155 "i"
Name 174 "j" Name 175 "j"
Name 225 "color" Name 227 "color"
Name 231 "v" Name 233 "v"
Name 232 "param"
Name 234 "param" Name 234 "param"
Name 236 "param" Name 236 "param"
Name 244 "param" Name 238 "param"
Name 246 "param" Name 246 "param"
Name 248 "param" Name 248 "param"
Name 250 "param"
Decorate 60(local) RelaxedPrecision Decorate 60(local) RelaxedPrecision
Decorate 62(c) RelaxedPrecision Decorate 62(c) RelaxedPrecision
Decorate 73(f) RelaxedPrecision Decorate 73(f) RelaxedPrecision
Decorate 75(x) RelaxedPrecision Decorate 75(x) RelaxedPrecision
Decorate 129(d) RelaxedPrecision Decorate 129(d) RelaxedPrecision
Decorate 155(i) RelaxedPrecision Decorate 155(i) RelaxedPrecision
Decorate 174(j) RelaxedPrecision Decorate 175(j) RelaxedPrecision
Decorate 225(color) RelaxedPrecision Decorate 227(color) RelaxedPrecision
Decorate 231(v) RelaxedPrecision Decorate 233(v) RelaxedPrecision
2: TypeVoid 2: TypeVoid
3: TypeFunction 2 3: TypeFunction 2
6: TypeFloat 32 6: TypeFloat 32
@ -71,31 +71,31 @@ Linked fragment stage:
75(x): 74(ptr) Variable Input 75(x): 74(ptr) Variable Input
129(d): 61(ptr) Variable UniformConstant 129(d): 61(ptr) Variable UniformConstant
156: 9(int) Constant 0 156: 9(int) Constant 0
162: 9(int) Constant 10 163: 9(int) Constant 10
163: TypeBool 164: TypeBool
175: 9(int) Constant 20 176: 9(int) Constant 20
181: 9(int) Constant 30 183: 9(int) Constant 30
186: 6(float) Constant 1120429670 188: 6(float) Constant 1120429670
206: 6(float) Constant 1079739679 208: 6(float) Constant 1079739679
224: TypePointer Output 6(float) 226: TypePointer Output 6(float)
225(color): 224(ptr) Variable Output 227(color): 226(ptr) Variable Output
230: TypePointer UniformConstant 7(fvec4) 232: TypePointer UniformConstant 7(fvec4)
231(v): 230(ptr) Variable UniformConstant 233(v): 232(ptr) Variable UniformConstant
239: TypeInt 32 0 241: TypeInt 32 0
240: 239(int) Constant 1 242: 241(int) Constant 1
251: 239(int) Constant 2 253: 241(int) Constant 2
4(main): 2 Function None 3 4(main): 2 Function None 3
5: Label 5: Label
60(local): 10(ptr) Variable Function 60(local): 10(ptr) Variable Function
73(f): 72(ptr) Variable Function 73(f): 72(ptr) Variable Function
155(i): 10(ptr) Variable Function 155(i): 10(ptr) Variable Function
174(j): 10(ptr) Variable Function 175(j): 10(ptr) Variable Function
232(param): 8(ptr) Variable Function
234(param): 8(ptr) Variable Function 234(param): 8(ptr) Variable Function
236(param): 10(ptr) Variable Function 236(param): 8(ptr) Variable Function
244(param): 8(ptr) Variable Function 238(param): 10(ptr) Variable Function
246(param): 8(ptr) Variable Function 246(param): 8(ptr) Variable Function
248(param): 10(ptr) Variable Function 248(param): 8(ptr) Variable Function
250(param): 10(ptr) Variable Function
63: 9(int) Load 62(c) 63: 9(int) Load 62(c)
Store 60(local) 63 Store 60(local) 63
64: 9(int) Load 60(local) 64: 9(int) Load 60(local)
@ -218,134 +218,138 @@ Linked fragment stage:
Store 155(i) 156 Store 155(i) 156
Branch 157 Branch 157
157: Label 157: Label
161: 9(int) Load 155(i)
164: 163(bool) SLessThan 161 162
LoopMerge 159 160 None LoopMerge 159 160 None
BranchConditional 164 158 159 Branch 161
161: Label
162: 9(int) Load 155(i)
165: 164(bool) SLessThan 162 163
BranchConditional 165 158 159
158: Label 158: Label
165: 9(int) Load 62(c) 166: 9(int) Load 62(c)
SelectionMerge 169 None SelectionMerge 170 None
Switch 165 168 Switch 166 169
case 1: 166 case 1: 167
case 2: 167 case 2: 168
168: Label 169: Label
200: 6(float) Load 75(x) 202: 6(float) Load 75(x)
201: 6(float) ExtInst 1(GLSL.std.450) 15(Tan) 200 203: 6(float) ExtInst 1(GLSL.std.450) 15(Tan) 202
202: 6(float) Load 73(f) 204: 6(float) Load 73(f)
203: 6(float) FAdd 202 201 205: 6(float) FAdd 204 203
Store 73(f) 203 Store 73(f) 205
Branch 169 Branch 170
166: Label
170: 6(float) Load 75(x)
171: 6(float) ExtInst 1(GLSL.std.450) 13(Sin) 170
172: 6(float) Load 73(f)
173: 6(float) FAdd 172 171
Store 73(f) 173
Store 174(j) 175
Branch 176
176: Label
180: 9(int) Load 174(j)
182: 163(bool) SLessThan 180 181
LoopMerge 178 179 None
BranchConditional 182 177 178
177: Label
183: 6(float) Load 73(f)
184: 6(float) FAdd 183 48
Store 73(f) 184
185: 6(float) Load 73(f)
187: 163(bool) FOrdLessThan 185 186
SelectionMerge 189 None
BranchConditional 187 188 189
188: Label
Branch 178
189: Label
Branch 179
179: Label
191: 9(int) Load 174(j)
192: 9(int) IAdd 191 65
Store 174(j) 192
Branch 176
178: Label
Branch 169
167: Label 167: Label
194: 6(float) Load 75(x) 171: 6(float) Load 75(x)
195: 6(float) ExtInst 1(GLSL.std.450) 14(Cos) 194 172: 6(float) ExtInst 1(GLSL.std.450) 13(Sin) 171
196: 6(float) Load 73(f) 173: 6(float) Load 73(f)
197: 6(float) FAdd 196 195 174: 6(float) FAdd 173 172
Store 73(f) 197 Store 73(f) 174
Branch 169 Store 175(j) 176
169: Label Branch 177
205: 6(float) Load 73(f) 177: Label
207: 163(bool) FOrdLessThan 205 206 LoopMerge 179 180 None
SelectionMerge 209 None Branch 181
BranchConditional 207 208 209 181: Label
208: Label 182: 9(int) Load 175(j)
184: 164(bool) SLessThan 182 183
BranchConditional 184 178 179
178: Label
185: 6(float) Load 73(f)
186: 6(float) FAdd 185 48
Store 73(f) 186
187: 6(float) Load 73(f)
189: 164(bool) FOrdLessThan 187 188
SelectionMerge 191 None
BranchConditional 189 190 191
190: Label
Branch 179
191: Label
Branch 180
180: Label
193: 9(int) Load 175(j)
194: 9(int) IAdd 193 65
Store 175(j) 194
Branch 177
179: Label
Branch 170
168: Label
196: 6(float) Load 75(x)
197: 6(float) ExtInst 1(GLSL.std.450) 14(Cos) 196
198: 6(float) Load 73(f)
199: 6(float) FAdd 198 197
Store 73(f) 199
Branch 170
170: Label
207: 6(float) Load 73(f)
209: 164(bool) FOrdLessThan 207 208
SelectionMerge 211 None
BranchConditional 209 210 211
210: Label
Branch 159 Branch 159
209: Label 211: Label
Branch 160 Branch 160
160: Label 160: Label
211: 9(int) Load 155(i) 213: 9(int) Load 155(i)
212: 9(int) IAdd 211 65 214: 9(int) IAdd 213 65
Store 155(i) 212 Store 155(i) 214
Branch 157 Branch 157
159: Label 159: Label
213: 9(int) Load 62(c) 215: 9(int) Load 62(c)
SelectionMerge 216 None SelectionMerge 218 None
Switch 213 216 Switch 215 218
case 1: 214 case 1: 216
case 2: 215 case 2: 217
214: Label 216: Label
217: 6(float) Load 75(x) 219: 6(float) Load 75(x)
218: 6(float) ExtInst 1(GLSL.std.450) 13(Sin) 217 220: 6(float) ExtInst 1(GLSL.std.450) 13(Sin) 219
219: 6(float) Load 73(f) 221: 6(float) Load 73(f)
220: 6(float) FAdd 219 218 222: 6(float) FAdd 221 220
Store 73(f) 220 Store 73(f) 222
Branch 216 Branch 218
215: Label 217: Label
Branch 216 Branch 218
216: Label 218: Label
226: 6(float) Load 73(f) 228: 6(float) Load 73(f)
227: 9(int) Load 60(local) 229: 9(int) Load 60(local)
228: 6(float) ConvertSToF 227 230: 6(float) ConvertSToF 229
229: 6(float) FAdd 226 228 231: 6(float) FAdd 228 230
Store 225(color) 229 Store 227(color) 231
233: 7(fvec4) Load 231(v) 235: 7(fvec4) Load 233(v)
Store 232(param) 233
235: 7(fvec4) Load 231(v)
Store 234(param) 235 Store 234(param) 235
237: 9(int) Load 62(c) 237: 7(fvec4) Load 233(v)
Store 236(param) 237 Store 236(param) 237
238: 7(fvec4) FunctionCall 15(foo1(vf4;vf4;i1;) 232(param) 234(param) 236(param) 239: 9(int) Load 62(c)
241: 6(float) CompositeExtract 238 1 Store 238(param) 239
242: 6(float) Load 225(color) 240: 7(fvec4) FunctionCall 15(foo1(vf4;vf4;i1;) 234(param) 236(param) 238(param)
243: 6(float) FAdd 242 241 243: 6(float) CompositeExtract 240 1
Store 225(color) 243 244: 6(float) Load 227(color)
245: 7(fvec4) Load 231(v) 245: 6(float) FAdd 244 243
Store 244(param) 245 Store 227(color) 245
247: 7(fvec4) Load 231(v) 247: 7(fvec4) Load 233(v)
Store 246(param) 247 Store 246(param) 247
249: 9(int) Load 62(c) 249: 7(fvec4) Load 233(v)
Store 248(param) 249 Store 248(param) 249
250: 7(fvec4) FunctionCall 20(foo2(vf4;vf4;i1;) 244(param) 246(param) 248(param) 251: 9(int) Load 62(c)
252: 6(float) CompositeExtract 250 2 Store 250(param) 251
253: 6(float) Load 225(color) 252: 7(fvec4) FunctionCall 20(foo2(vf4;vf4;i1;) 246(param) 248(param) 250(param)
254: 6(float) FAdd 253 252 254: 6(float) CompositeExtract 252 2
Store 225(color) 254 255: 6(float) Load 227(color)
255: 9(int) Load 62(c) 256: 6(float) FAdd 255 254
SelectionMerge 258 None Store 227(color) 256
Switch 255 257 257: 9(int) Load 62(c)
case 0: 256 SelectionMerge 260 None
257: Label Switch 257 259
Branch 258 case 0: 258
256: Label 259: Label
Branch 258 Branch 260
258: Label 258: Label
262: 9(int) Load 62(c) Branch 260
SelectionMerge 264 None 260: Label
Switch 262 263 264: 9(int) Load 62(c)
263: Label SelectionMerge 266 None
Branch 264 Switch 264 265
264: Label 265: Label
Branch 266
266: Label
Return Return
FunctionEnd FunctionEnd
15(foo1(vf4;vf4;i1;): 7(fvec4) Function None 11 15(foo1(vf4;vf4;i1;): 7(fvec4) Function None 11

View File

@ -5,78 +5,80 @@ Linked vertex stage:
// Module Version 10000 // Module Version 10000
// Generated by (magic number): 80001 // Generated by (magic number): 80001
// Id's are bound by 43 // Id's are bound by 44
Capability Shader Capability Shader
1: ExtInstImport "GLSL.std.450" 1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450 MemoryModel Logical GLSL450
EntryPoint Vertex 4 "main" 41 42 EntryPoint Vertex 4 "main" 42 43
Source ESSL 300 Source ESSL 300
Name 4 "main" Name 4 "main"
Name 8 "i" Name 8 "i"
Name 18 "A" Name 19 "A"
Name 26 "B" Name 27 "B"
Name 28 "C" Name 29 "C"
Name 38 "D" Name 39 "D"
Name 41 "gl_VertexID" Name 42 "gl_VertexID"
Name 42 "gl_InstanceID" Name 43 "gl_InstanceID"
Decorate 41(gl_VertexID) BuiltIn VertexId Decorate 42(gl_VertexID) BuiltIn VertexId
Decorate 42(gl_InstanceID) BuiltIn InstanceId Decorate 43(gl_InstanceID) BuiltIn InstanceId
2: TypeVoid 2: TypeVoid
3: TypeFunction 2 3: TypeFunction 2
6: TypeInt 32 1 6: TypeInt 32 1
7: TypePointer Function 6(int) 7: TypePointer Function 6(int)
9: 6(int) Constant 0 9: 6(int) Constant 0
15: 6(int) Constant 10 16: 6(int) Constant 10
16: TypeBool 17: TypeBool
19: 6(int) Constant 1 20: 6(int) Constant 1
21: 6(int) Constant 2 22: 6(int) Constant 2
30: 6(int) Constant 5 31: 6(int) Constant 5
39: 6(int) Constant 3 40: 6(int) Constant 3
40: TypePointer Input 6(int) 41: TypePointer Input 6(int)
41(gl_VertexID): 40(ptr) Variable Input 42(gl_VertexID): 41(ptr) Variable Input
42(gl_InstanceID): 40(ptr) Variable Input 43(gl_InstanceID): 41(ptr) Variable Input
4(main): 2 Function None 3 4(main): 2 Function None 3
5: Label 5: Label
8(i): 7(ptr) Variable Function 8(i): 7(ptr) Variable Function
18(A): 7(ptr) Variable Function 19(A): 7(ptr) Variable Function
26(B): 7(ptr) Variable Function 27(B): 7(ptr) Variable Function
28(C): 7(ptr) Variable Function 29(C): 7(ptr) Variable Function
38(D): 7(ptr) Variable Function 39(D): 7(ptr) Variable Function
Store 8(i) 9 Store 8(i) 9
Branch 10 Branch 10
10: Label 10: Label
14: 6(int) Load 8(i)
17: 16(bool) SLessThan 14 15
LoopMerge 12 13 None LoopMerge 12 13 None
BranchConditional 17 11 12 Branch 14
14: Label
15: 6(int) Load 8(i)
18: 17(bool) SLessThan 15 16
BranchConditional 18 11 12
11: Label 11: Label
Store 18(A) 19 Store 19(A) 20
20: 6(int) Load 8(i) 21: 6(int) Load 8(i)
22: 6(int) SMod 20 21 23: 6(int) SMod 21 22
23: 16(bool) IEqual 22 9 24: 17(bool) IEqual 23 9
SelectionMerge 25 None SelectionMerge 26 None
BranchConditional 23 24 25 BranchConditional 24 25 26
24: Label 25: Label
Store 26(B) 21 Store 27(B) 22
Branch 13 Branch 13
25: Label 26: Label
29: 6(int) Load 8(i) 30: 6(int) Load 8(i)
31: 6(int) SMod 29 30 32: 6(int) SMod 30 31
32: 16(bool) IEqual 31 9 33: 17(bool) IEqual 32 9
SelectionMerge 34 None SelectionMerge 35 None
BranchConditional 32 33 34 BranchConditional 33 34 35
33: Label 34: Label
Store 26(B) 21 Store 27(B) 22
Branch 12 Branch 12
34: Label 35: Label
36: 6(int) Load 8(i) 37: 6(int) Load 8(i)
37: 6(int) IAdd 36 19 38: 6(int) IAdd 37 20
Store 8(i) 37 Store 8(i) 38
Branch 13 Branch 13
13: Label 13: Label
Branch 10 Branch 10
12: Label 12: Label
Store 38(D) 39 Store 39(D) 40
Return Return
FunctionEnd FunctionEnd

View File

@ -5,44 +5,46 @@ Linked vertex stage:
// Module Version 10000 // Module Version 10000
// Generated by (magic number): 80001 // Generated by (magic number): 80001
// Id's are bound by 24 // Id's are bound by 25
Capability Shader Capability Shader
1: ExtInstImport "GLSL.std.450" 1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450 MemoryModel Logical GLSL450
EntryPoint Vertex 4 "main" 22 23 EntryPoint Vertex 4 "main" 23 24
Source ESSL 300 Source ESSL 300
Name 4 "main" Name 4 "main"
Name 8 "i" Name 8 "i"
Name 22 "gl_VertexID" Name 23 "gl_VertexID"
Name 23 "gl_InstanceID" Name 24 "gl_InstanceID"
Decorate 22(gl_VertexID) BuiltIn VertexId Decorate 23(gl_VertexID) BuiltIn VertexId
Decorate 23(gl_InstanceID) BuiltIn InstanceId Decorate 24(gl_InstanceID) BuiltIn InstanceId
2: TypeVoid 2: TypeVoid
3: TypeFunction 2 3: TypeFunction 2
6: TypeInt 32 1 6: TypeInt 32 1
7: TypePointer Function 6(int) 7: TypePointer Function 6(int)
9: 6(int) Constant 0 9: 6(int) Constant 0
15: 6(int) Constant 10 16: 6(int) Constant 10
16: TypeBool 17: TypeBool
19: 6(int) Constant 1 20: 6(int) Constant 1
21: TypePointer Input 6(int) 22: TypePointer Input 6(int)
22(gl_VertexID): 21(ptr) Variable Input 23(gl_VertexID): 22(ptr) Variable Input
23(gl_InstanceID): 21(ptr) Variable Input 24(gl_InstanceID): 22(ptr) Variable Input
4(main): 2 Function None 3 4(main): 2 Function None 3
5: Label 5: Label
8(i): 7(ptr) Variable Function 8(i): 7(ptr) Variable Function
Store 8(i) 9 Store 8(i) 9
Branch 10 Branch 10
10: Label 10: Label
14: 6(int) Load 8(i)
17: 16(bool) SLessThan 14 15
LoopMerge 12 13 None LoopMerge 12 13 None
BranchConditional 17 11 12 Branch 14
14: Label
15: 6(int) Load 8(i)
18: 17(bool) SLessThan 15 16
BranchConditional 18 11 12
11: Label 11: Label
18: 6(int) Load 8(i) 19: 6(int) Load 8(i)
20: 6(int) IAdd 18 19 21: 6(int) IAdd 19 20
Store 8(i) 20 Store 8(i) 21
Branch 13 Branch 13
13: Label 13: Label
Branch 10 Branch 10

View File

@ -5,20 +5,20 @@ Linked fragment stage:
// Module Version 10000 // Module Version 10000
// Generated by (magic number): 80001 // Generated by (magic number): 80001
// Id's are bound by 35 // Id's are bound by 36
Capability Shader Capability Shader
1: ExtInstImport "GLSL.std.450" 1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450 MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 11 33 EntryPoint Fragment 4 "main" 11 34
ExecutionMode 4 OriginLowerLeft ExecutionMode 4 OriginLowerLeft
Source GLSL 110 Source GLSL 110
Name 4 "main" Name 4 "main"
Name 9 "color" Name 9 "color"
Name 11 "BaseColor" Name 11 "BaseColor"
Name 23 "d" Name 24 "d"
Name 28 "bigColor" Name 29 "bigColor"
Name 33 "gl_FragColor" Name 34 "gl_FragColor"
2: TypeVoid 2: TypeVoid
3: TypeFunction 2 3: TypeFunction 2
6: TypeFloat 32 6: TypeFloat 32
@ -26,16 +26,16 @@ Linked fragment stage:
8: TypePointer Function 7(fvec4) 8: TypePointer Function 7(fvec4)
10: TypePointer Input 7(fvec4) 10: TypePointer Input 7(fvec4)
11(BaseColor): 10(ptr) Variable Input 11(BaseColor): 10(ptr) Variable Input
17: TypeInt 32 0 18: TypeInt 32 0
18: 17(int) Constant 0 19: 18(int) Constant 0
19: TypePointer Function 6(float) 20: TypePointer Function 6(float)
22: TypePointer UniformConstant 6(float) 23: TypePointer UniformConstant 6(float)
23(d): 22(ptr) Variable UniformConstant 24(d): 23(ptr) Variable UniformConstant
25: TypeBool 26: TypeBool
27: TypePointer UniformConstant 7(fvec4) 28: TypePointer UniformConstant 7(fvec4)
28(bigColor): 27(ptr) Variable UniformConstant 29(bigColor): 28(ptr) Variable UniformConstant
32: TypePointer Output 7(fvec4) 33: TypePointer Output 7(fvec4)
33(gl_FragColor): 32(ptr) Variable Output 34(gl_FragColor): 33(ptr) Variable Output
4(main): 2 Function None 3 4(main): 2 Function None 3
5: Label 5: Label
9(color): 8(ptr) Variable Function 9(color): 8(ptr) Variable Function
@ -43,22 +43,24 @@ Linked fragment stage:
Store 9(color) 12 Store 9(color) 12
Branch 13 Branch 13
13: Label 13: Label
20: 19(ptr) AccessChain 9(color) 18
21: 6(float) Load 20
24: 6(float) Load 23(d)
26: 25(bool) FOrdLessThan 21 24
LoopMerge 15 16 None LoopMerge 15 16 None
BranchConditional 26 14 15 Branch 17
17: Label
21: 20(ptr) AccessChain 9(color) 19
22: 6(float) Load 21
25: 6(float) Load 24(d)
27: 26(bool) FOrdLessThan 22 25
BranchConditional 27 14 15
14: Label 14: Label
29: 7(fvec4) Load 28(bigColor) 30: 7(fvec4) Load 29(bigColor)
30: 7(fvec4) Load 9(color) 31: 7(fvec4) Load 9(color)
31: 7(fvec4) FAdd 30 29 32: 7(fvec4) FAdd 31 30
Store 9(color) 31 Store 9(color) 32
Branch 16 Branch 16
16: Label 16: Label
Branch 13 Branch 13
15: Label 15: Label
34: 7(fvec4) Load 9(color) 35: 7(fvec4) Load 9(color)
Store 33(gl_FragColor) 34 Store 34(gl_FragColor) 35
Return Return
FunctionEnd FunctionEnd

View File

@ -2,8 +2,5 @@
layout(location=0) out highp int r; layout(location=0) out highp int r;
void main() { void main() {
int i; int i;
// This infinite loop results in bad SPIR-V generated, since the merge block
// is dropped as unreachable. It is still useful for testing the rest of the
// code generation.
for (i=0; ; i++) { r = i; } for (i=0; ; i++) { r = i; }
} }