SPV: Implement Vulkan version of GLSL (KHR_vulkan_glsl).

This commit is contained in:
John Kessenich 2016-02-15 20:58:50 -07:00
parent 019f08fcd8
commit 6c292d3ba7
200 changed files with 7841 additions and 5577 deletions

View file

@ -5,29 +5,29 @@ Linked fragment stage:
// Module Version 10000
// Generated by (magic number): 80001
// Id's are bound by 112
// Id's are bound by 110
Capability Shader
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 11 18 107
ExecutionMode 4 OriginLowerLeft
EntryPoint Fragment 4 "main" 11 14 17 19 25 30 39 51 63 105 109
ExecutionMode 4 OriginUpperLeft
Source GLSL 140
Name 4 "main"
Name 9 "color"
Name 11 "BaseColor"
Name 13 "color2"
Name 15 "otherColor"
Name 18 "c"
Name 21 "d"
Name 27 "bigColor"
Name 32 "smallColor"
Name 41 "minimum"
Name 53 "threshhold"
Name 65 "threshhold2"
Name 79 "b"
Name 107 "gl_FragColor"
Name 111 "threshhold3"
Name 14 "otherColor"
Name 17 "c"
Name 19 "d"
Name 25 "bigColor"
Name 30 "smallColor"
Name 39 "minimum"
Name 51 "threshhold"
Name 63 "threshhold2"
Name 77 "b"
Name 105 "gl_FragColor"
Name 109 "threshhold3"
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32
@ -35,141 +35,139 @@ Linked fragment stage:
8: TypePointer Function 7(fvec4)
10: TypePointer Input 7(fvec4)
11(BaseColor): 10(ptr) Variable Input
14: TypePointer UniformConstant 7(fvec4)
15(otherColor): 14(ptr) Variable UniformConstant
17: TypePointer Input 6(float)
18(c): 17(ptr) Variable Input
20: TypePointer UniformConstant 6(float)
21(d): 20(ptr) Variable UniformConstant
23: TypeBool
27(bigColor): 14(ptr) Variable UniformConstant
32(smallColor): 14(ptr) Variable UniformConstant
36: TypeInt 32 0
37: 36(int) Constant 2
38: TypePointer Function 6(float)
41(minimum): 20(ptr) Variable UniformConstant
49: 6(float) Constant 1065353216
53(threshhold): 20(ptr) Variable UniformConstant
62: 36(int) Constant 3
65(threshhold2): 20(ptr) Variable UniformConstant
78: TypePointer UniformConstant 23(bool)
79(b): 78(ptr) Variable UniformConstant
87: 36(int) Constant 0
106: TypePointer Output 7(fvec4)
107(gl_FragColor): 106(ptr) Variable Output
111(threshhold3): 20(ptr) Variable UniformConstant
14(otherColor): 10(ptr) Variable Input
16: TypePointer Input 6(float)
17(c): 16(ptr) Variable Input
19(d): 16(ptr) Variable Input
21: TypeBool
25(bigColor): 10(ptr) Variable Input
30(smallColor): 10(ptr) Variable Input
34: TypeInt 32 0
35: 34(int) Constant 2
36: TypePointer Function 6(float)
39(minimum): 16(ptr) Variable Input
47: 6(float) Constant 1065353216
51(threshhold): 16(ptr) Variable Input
60: 34(int) Constant 3
63(threshhold2): 16(ptr) Variable Input
76: TypePointer Private 21(bool)
77(b): 76(ptr) Variable Private
85: 34(int) Constant 0
104: TypePointer Output 7(fvec4)
105(gl_FragColor): 104(ptr) Variable Output
109(threshhold3): 16(ptr) Variable Input
4(main): 2 Function None 3
5: Label
9(color): 8(ptr) Variable Function
13(color2): 8(ptr) Variable Function
12: 7(fvec4) Load 11(BaseColor)
Store 9(color) 12
16: 7(fvec4) Load 15(otherColor)
Store 13(color2) 16
19: 6(float) Load 18(c)
22: 6(float) Load 21(d)
24: 23(bool) FOrdGreaterThan 19 22
SelectionMerge 26 None
BranchConditional 24 25 31
25: Label
28: 7(fvec4) Load 27(bigColor)
29: 7(fvec4) Load 9(color)
30: 7(fvec4) FAdd 29 28
Store 9(color) 30
Branch 26
31: Label
33: 7(fvec4) Load 32(smallColor)
34: 7(fvec4) Load 9(color)
35: 7(fvec4) FAdd 34 33
Store 9(color) 35
Branch 26
26: Label
39: 38(ptr) AccessChain 9(color) 37
40: 6(float) Load 39
42: 6(float) Load 41(minimum)
43: 23(bool) FOrdLessThan 40 42
SelectionMerge 45 None
BranchConditional 43 44 45
44: Label
15: 7(fvec4) Load 14(otherColor)
Store 13(color2) 15
18: 6(float) Load 17(c)
20: 6(float) Load 19(d)
22: 21(bool) FOrdGreaterThan 18 20
SelectionMerge 24 None
BranchConditional 22 23 29
23: Label
26: 7(fvec4) Load 25(bigColor)
27: 7(fvec4) Load 9(color)
28: 7(fvec4) FAdd 27 26
Store 9(color) 28
Branch 24
29: Label
31: 7(fvec4) Load 30(smallColor)
32: 7(fvec4) Load 9(color)
33: 7(fvec4) FAdd 32 31
Store 9(color) 33
Branch 24
24: Label
37: 36(ptr) AccessChain 9(color) 35
38: 6(float) Load 37
40: 6(float) Load 39(minimum)
41: 21(bool) FOrdLessThan 38 40
SelectionMerge 43 None
BranchConditional 41 42 43
42: Label
Return
45: Label
47: 38(ptr) AccessChain 9(color) 37
48: 6(float) Load 47
50: 6(float) FAdd 48 49
Store 47 50
51: 38(ptr) AccessChain 9(color) 37
52: 6(float) Load 51
54: 6(float) Load 53(threshhold)
55: 23(bool) FOrdGreaterThan 52 54
SelectionMerge 57 None
BranchConditional 55 56 57
56: Label
43: Label
45: 36(ptr) AccessChain 9(color) 35
46: 6(float) Load 45
48: 6(float) FAdd 46 47
Store 45 48
49: 36(ptr) AccessChain 9(color) 35
50: 6(float) Load 49
52: 6(float) Load 51(threshhold)
53: 21(bool) FOrdGreaterThan 50 52
SelectionMerge 55 None
BranchConditional 53 54 55
54: Label
Kill
57: Label
59: 7(fvec4) Load 9(color)
60: 7(fvec4) CompositeConstruct 49 49 49 49
61: 7(fvec4) FAdd 59 60
Store 9(color) 61
63: 38(ptr) AccessChain 9(color) 62
64: 6(float) Load 63
66: 6(float) Load 65(threshhold2)
67: 23(bool) FOrdGreaterThan 64 66
SelectionMerge 69 None
BranchConditional 67 68 99
68: Label
70: 38(ptr) AccessChain 9(color) 37
71: 6(float) Load 70
72: 6(float) Load 65(threshhold2)
73: 23(bool) FOrdGreaterThan 71 72
SelectionMerge 75 None
BranchConditional 73 74 77
74: Label
55: Label
57: 7(fvec4) Load 9(color)
58: 7(fvec4) CompositeConstruct 47 47 47 47
59: 7(fvec4) FAdd 57 58
Store 9(color) 59
61: 36(ptr) AccessChain 9(color) 60
62: 6(float) Load 61
64: 6(float) Load 63(threshhold2)
65: 21(bool) FOrdGreaterThan 62 64
SelectionMerge 67 None
BranchConditional 65 66 97
66: Label
68: 36(ptr) AccessChain 9(color) 35
69: 6(float) Load 68
70: 6(float) Load 63(threshhold2)
71: 21(bool) FOrdGreaterThan 69 70
SelectionMerge 73 None
BranchConditional 71 72 75
72: Label
Return
77: Label
80: 23(bool) Load 79(b)
SelectionMerge 82 None
BranchConditional 80 81 86
81: Label
83: 38(ptr) AccessChain 9(color) 37
84: 6(float) Load 83
85: 6(float) FAdd 84 49
Store 83 85
Branch 82
86: Label
88: 38(ptr) AccessChain 9(color) 87
89: 6(float) Load 88
90: 6(float) Load 41(minimum)
91: 23(bool) FOrdLessThan 89 90
SelectionMerge 93 None
BranchConditional 91 92 95
92: Label
75: Label
78: 21(bool) Load 77(b)
SelectionMerge 80 None
BranchConditional 78 79 84
79: Label
81: 36(ptr) AccessChain 9(color) 35
82: 6(float) Load 81
83: 6(float) FAdd 82 47
Store 81 83
Branch 80
84: Label
86: 36(ptr) AccessChain 9(color) 85
87: 6(float) Load 86
88: 6(float) Load 39(minimum)
89: 21(bool) FOrdLessThan 87 88
SelectionMerge 91 None
BranchConditional 89 90 93
90: Label
Kill
95: Label
96: 7(fvec4) Load 9(color)
97: 7(fvec4) CompositeConstruct 49 49 49 49
98: 7(fvec4) FAdd 96 97
Store 9(color) 98
Branch 93
93: Label
Branch 82
82: Label
Branch 75
75: Label
Branch 69
99: Label
100: 23(bool) Load 79(b)
SelectionMerge 102 None
BranchConditional 100 101 104
101: Label
93: Label
94: 7(fvec4) Load 9(color)
95: 7(fvec4) CompositeConstruct 47 47 47 47
96: 7(fvec4) FAdd 94 95
Store 9(color) 96
Branch 91
91: Label
Branch 80
80: Label
Branch 73
73: Label
Branch 67
97: Label
98: 21(bool) Load 77(b)
SelectionMerge 100 None
BranchConditional 98 99 102
99: Label
Kill
104: Label
102: Label
Return
102: Label
Branch 69
69: Label
108: 7(fvec4) Load 9(color)
109: 7(fvec4) Load 13(color2)
110: 7(fvec4) FMul 108 109
Store 107(gl_FragColor) 110
100: Label
Branch 67
67: Label
106: 7(fvec4) Load 9(color)
107: 7(fvec4) Load 13(color2)
108: 7(fvec4) FMul 106 107
Store 105(gl_FragColor) 108
Return
FunctionEnd