Full vector and fully specified vector swizzle stores are not affected by this change, only partial swizzles ie swizzles with fewer components than the vector being stored to. Previously the vector being stored to loaded and any components not specified in the swizzle were used to create a full store to the vector. While this change generates more SPIR-V instructions, it is necessary for correctness. Fixes #2518.
184 lines
8.5 KiB
Plaintext
184 lines
8.5 KiB
Plaintext
spv.swizzle.frag
|
|
// Module Version 10000
|
|
// Generated by (magic number): 8000a
|
|
// Id's are bound by 117
|
|
|
|
Capability Shader
|
|
1: ExtInstImport "GLSL.std.450"
|
|
MemoryModel Logical GLSL450
|
|
EntryPoint Fragment 4 "main" 14 30 78 116
|
|
ExecutionMode 4 OriginUpperLeft
|
|
Source GLSL 140
|
|
Name 4 "main"
|
|
Name 8 "blendscale"
|
|
Name 12 "w"
|
|
Name 14 "u"
|
|
Name 16 "w_dep"
|
|
Name 18 "w_reorder"
|
|
Name 20 "w2"
|
|
Name 22 "w_flow"
|
|
Name 30 "t"
|
|
Name 56 "w_undef"
|
|
Name 65 "p"
|
|
Name 78 "gl_FragColor"
|
|
Name 90 "c"
|
|
Name 92 "rep"
|
|
Name 116 "blend"
|
|
Decorate 14(u) Location 1
|
|
Decorate 30(t) Location 2
|
|
Decorate 78(gl_FragColor) Location 0
|
|
Decorate 116(blend) Location 0
|
|
2: TypeVoid
|
|
3: TypeFunction 2
|
|
6: TypeFloat 32
|
|
7: TypePointer Function 6(float)
|
|
9: 6(float) Constant 1071971828
|
|
10: TypeVector 6(float) 4
|
|
11: TypePointer Function 10(fvec4)
|
|
13: TypePointer Input 10(fvec4)
|
|
14(u): 13(ptr) Variable Input
|
|
25: TypeInt 32 0
|
|
26: 25(int) Constant 2
|
|
28: TypeVector 6(float) 2
|
|
29: TypePointer Input 28(fvec2)
|
|
30(t): 29(ptr) Variable Input
|
|
32: 25(int) Constant 3
|
|
35: 25(int) Constant 1
|
|
39: 25(int) Constant 0
|
|
63: TypeBool
|
|
64: TypePointer Private 63(bool)
|
|
65(p): 64(ptr) Variable Private
|
|
69: TypePointer Input 6(float)
|
|
77: TypePointer Output 10(fvec4)
|
|
78(gl_FragColor): 77(ptr) Variable Output
|
|
89: TypePointer Function 28(fvec2)
|
|
93: 6(float) Constant 0
|
|
94: 6(float) Constant 1065353216
|
|
95: 10(fvec4) ConstantComposite 93 93 93 94
|
|
101: 6(float) Constant 3212836864
|
|
111: 6(float) Constant 1079613850
|
|
116(blend): 69(ptr) Variable Input
|
|
4(main): 2 Function None 3
|
|
5: Label
|
|
8(blendscale): 7(ptr) Variable Function
|
|
12(w): 11(ptr) Variable Function
|
|
16(w_dep): 11(ptr) Variable Function
|
|
18(w_reorder): 11(ptr) Variable Function
|
|
20(w2): 11(ptr) Variable Function
|
|
22(w_flow): 11(ptr) Variable Function
|
|
56(w_undef): 11(ptr) Variable Function
|
|
90(c): 89(ptr) Variable Function
|
|
92(rep): 11(ptr) Variable Function
|
|
Store 8(blendscale) 9
|
|
15: 10(fvec4) Load 14(u)
|
|
Store 12(w) 15
|
|
17: 10(fvec4) Load 14(u)
|
|
Store 16(w_dep) 17
|
|
19: 10(fvec4) Load 14(u)
|
|
Store 18(w_reorder) 19
|
|
21: 10(fvec4) Load 14(u)
|
|
Store 20(w2) 21
|
|
23: 10(fvec4) Load 14(u)
|
|
Store 22(w_flow) 23
|
|
24: 6(float) Load 8(blendscale)
|
|
27: 7(ptr) AccessChain 18(w_reorder) 26
|
|
Store 27 24
|
|
31: 28(fvec2) Load 30(t)
|
|
33: 7(ptr) AccessChain 12(w) 32
|
|
34: 6(float) CompositeExtract 31 0
|
|
Store 33 34
|
|
36: 7(ptr) AccessChain 12(w) 35
|
|
37: 6(float) CompositeExtract 31 1
|
|
Store 36 37
|
|
38: 6(float) Load 8(blendscale)
|
|
40: 7(ptr) AccessChain 18(w_reorder) 39
|
|
Store 40 38
|
|
41: 10(fvec4) Load 14(u)
|
|
42: 10(fvec4) VectorShuffle 41 41 2 3 0 1
|
|
Store 20(w2) 42
|
|
43: 6(float) Load 8(blendscale)
|
|
44: 7(ptr) AccessChain 18(w_reorder) 35
|
|
Store 44 43
|
|
45: 10(fvec4) Load 20(w2)
|
|
46: 28(fvec2) VectorShuffle 45 45 0 2
|
|
47: 7(ptr) AccessChain 16(w_dep) 39
|
|
48: 6(float) CompositeExtract 46 0
|
|
Store 47 48
|
|
49: 7(ptr) AccessChain 16(w_dep) 35
|
|
50: 6(float) CompositeExtract 46 1
|
|
Store 49 50
|
|
51: 28(fvec2) Load 30(t)
|
|
52: 7(ptr) AccessChain 16(w_dep) 26
|
|
53: 6(float) CompositeExtract 51 0
|
|
Store 52 53
|
|
54: 7(ptr) AccessChain 16(w_dep) 32
|
|
55: 6(float) CompositeExtract 51 1
|
|
Store 54 55
|
|
57: 10(fvec4) Load 14(u)
|
|
58: 28(fvec2) VectorShuffle 57 57 2 3
|
|
59: 7(ptr) AccessChain 56(w_undef) 39
|
|
60: 6(float) CompositeExtract 58 0
|
|
Store 59 60
|
|
61: 7(ptr) AccessChain 56(w_undef) 35
|
|
62: 6(float) CompositeExtract 58 1
|
|
Store 61 62
|
|
66: 63(bool) Load 65(p)
|
|
SelectionMerge 68 None
|
|
BranchConditional 66 67 73
|
|
67: Label
|
|
70: 69(ptr) AccessChain 30(t) 39
|
|
71: 6(float) Load 70
|
|
72: 7(ptr) AccessChain 22(w_flow) 39
|
|
Store 72 71
|
|
Branch 68
|
|
73: Label
|
|
74: 69(ptr) AccessChain 30(t) 35
|
|
75: 6(float) Load 74
|
|
76: 7(ptr) AccessChain 22(w_flow) 39
|
|
Store 76 75
|
|
Branch 68
|
|
68: Label
|
|
79: 10(fvec4) Load 18(w_reorder)
|
|
80: 10(fvec4) Load 56(w_undef)
|
|
81: 10(fvec4) Load 12(w)
|
|
82: 10(fvec4) Load 20(w2)
|
|
83: 10(fvec4) FMul 81 82
|
|
84: 10(fvec4) Load 16(w_dep)
|
|
85: 10(fvec4) FMul 83 84
|
|
86: 10(fvec4) Load 22(w_flow)
|
|
87: 10(fvec4) FMul 85 86
|
|
88: 10(fvec4) ExtInst 1(GLSL.std.450) 46(FMix) 79 80 87
|
|
Store 78(gl_FragColor) 88
|
|
91: 28(fvec2) Load 30(t)
|
|
Store 90(c) 91
|
|
Store 92(rep) 95
|
|
96: 7(ptr) AccessChain 90(c) 39
|
|
97: 6(float) Load 96
|
|
98: 63(bool) FOrdLessThan 97 93
|
|
SelectionMerge 100 None
|
|
BranchConditional 98 99 100
|
|
99: Label
|
|
102: 7(ptr) AccessChain 90(c) 39
|
|
103: 6(float) Load 102
|
|
104: 6(float) FMul 103 101
|
|
105: 7(ptr) AccessChain 90(c) 39
|
|
Store 105 104
|
|
Branch 100
|
|
100: Label
|
|
106: 7(ptr) AccessChain 90(c) 39
|
|
107: 6(float) Load 106
|
|
108: 63(bool) FOrdLessThanEqual 107 94
|
|
SelectionMerge 110 None
|
|
BranchConditional 108 109 110
|
|
109: Label
|
|
112: 7(ptr) AccessChain 92(rep) 39
|
|
Store 112 111
|
|
Branch 110
|
|
110: Label
|
|
113: 10(fvec4) Load 92(rep)
|
|
114: 10(fvec4) Load 78(gl_FragColor)
|
|
115: 10(fvec4) FAdd 114 113
|
|
Store 78(gl_FragColor) 115
|
|
Return
|
|
FunctionEnd
|