SPV: projective texturing: move the project coordinate.

SPV doesn't allow gaps in the components of the texturing coordinate.
It also removes the shadow reference.
So, close up the components so all used components are together.
This commit is contained in:
John Kessenich 2016-06-16 14:06:26 -06:00
parent 76d4dfcd51
commit 65336488a8
5 changed files with 1908 additions and 1858 deletions

View file

@ -5,13 +5,13 @@ Linked vertex stage:
// Module Version 10000
// Generated by (magic number): 80001
// Id's are bound by 142
// Id's are bound by 150
Capability Shader
Capability Sampled1D
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Vertex 4 "main" 39 140
EntryPoint Vertex 4 "main" 39 148
Source GLSL 140
Name 4 "main"
Name 8 "lod"
@ -21,19 +21,19 @@ Linked vertex stage:
Name 23 "color"
Name 29 "texSampler1D"
Name 39 "coords2D"
Name 54 "texSampler2D"
Name 76 "texSampler3D"
Name 92 "texSamplerCube"
Name 102 "shadowSampler1D"
Name 114 "shadowSampler2D"
Name 140 "gl_Position"
Name 56 "texSampler2D"
Name 80 "texSampler3D"
Name 96 "texSamplerCube"
Name 106 "shadowSampler1D"
Name 118 "shadowSampler2D"
Name 148 "gl_Position"
Decorate 29(texSampler1D) DescriptorSet 0
Decorate 54(texSampler2D) DescriptorSet 0
Decorate 76(texSampler3D) DescriptorSet 0
Decorate 92(texSamplerCube) DescriptorSet 0
Decorate 102(shadowSampler1D) DescriptorSet 0
Decorate 114(shadowSampler2D) DescriptorSet 0
Decorate 140(gl_Position) BuiltIn Position
Decorate 56(texSampler2D) DescriptorSet 0
Decorate 80(texSampler3D) DescriptorSet 0
Decorate 96(texSamplerCube) DescriptorSet 0
Decorate 106(shadowSampler1D) DescriptorSet 0
Decorate 118(shadowSampler2D) DescriptorSet 0
Decorate 148(gl_Position) BuiltIn Position
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32
@ -58,28 +58,28 @@ Linked vertex stage:
37: TypeVector 6(float) 2
38: TypePointer Input 37(fvec2)
39(coords2D): 38(ptr) Variable Input
51: TypeImage 6(float) 2D sampled format:Unknown
52: TypeSampledImage 51
53: TypePointer UniformConstant 52
54(texSampler2D): 53(ptr) Variable UniformConstant
73: TypeImage 6(float) 3D sampled format:Unknown
74: TypeSampledImage 73
75: TypePointer UniformConstant 74
76(texSampler3D): 75(ptr) Variable UniformConstant
89: TypeImage 6(float) Cube sampled format:Unknown
90: TypeSampledImage 89
91: TypePointer UniformConstant 90
92(texSamplerCube): 91(ptr) Variable UniformConstant
99: TypeImage 6(float) 1D depth sampled format:Unknown
100: TypeSampledImage 99
101: TypePointer UniformConstant 100
102(shadowSampler1D): 101(ptr) Variable UniformConstant
111: TypeImage 6(float) 2D depth sampled format:Unknown
112: TypeSampledImage 111
113: TypePointer UniformConstant 112
114(shadowSampler2D): 113(ptr) Variable UniformConstant
139: TypePointer Output 18(fvec4)
140(gl_Position): 139(ptr) Variable Output
53: TypeImage 6(float) 2D sampled format:Unknown
54: TypeSampledImage 53
55: TypePointer UniformConstant 54
56(texSampler2D): 55(ptr) Variable UniformConstant
77: TypeImage 6(float) 3D sampled format:Unknown
78: TypeSampledImage 77
79: TypePointer UniformConstant 78
80(texSampler3D): 79(ptr) Variable UniformConstant
93: TypeImage 6(float) Cube sampled format:Unknown
94: TypeSampledImage 93
95: TypePointer UniformConstant 94
96(texSamplerCube): 95(ptr) Variable UniformConstant
103: TypeImage 6(float) 1D depth sampled format:Unknown
104: TypeSampledImage 103
105: TypePointer UniformConstant 104
106(shadowSampler1D): 105(ptr) Variable UniformConstant
115: TypeImage 6(float) 2D depth sampled format:Unknown
116: TypeSampledImage 115
117: TypePointer UniformConstant 116
118(shadowSampler2D): 117(ptr) Variable UniformConstant
147: TypePointer Output 18(fvec4)
148(gl_Position): 147(ptr) Variable Output
4(main): 2 Function None 3
5: Label
8(lod): 7(ptr) Variable Function
@ -109,89 +109,97 @@ Linked vertex stage:
45: 27 Load 29(texSampler1D)
46: 18(fvec4) Load 20(coords4D)
47: 6(float) Load 8(lod)
48: 18(fvec4) ImageSampleProjExplicitLod 45 46 Lod 47
49: 18(fvec4) Load 23(color)
50: 18(fvec4) FAdd 49 48
Store 23(color) 50
55: 52 Load 54(texSampler2D)
56: 37(fvec2) Load 39(coords2D)
57: 6(float) Load 8(lod)
58: 18(fvec4) ImageSampleExplicitLod 55 56 Lod 57
59: 18(fvec4) Load 23(color)
60: 18(fvec4) FAdd 59 58
Store 23(color) 60
61: 52 Load 54(texSampler2D)
62: 12(fvec3) Load 14(coords3D)
63: 6(float) Load 8(lod)
64: 18(fvec4) ImageSampleProjExplicitLod 61 62 Lod 63
65: 18(fvec4) Load 23(color)
66: 18(fvec4) FAdd 65 64
Store 23(color) 66
67: 52 Load 54(texSampler2D)
68: 18(fvec4) Load 20(coords4D)
69: 6(float) Load 8(lod)
70: 18(fvec4) ImageSampleProjExplicitLod 67 68 Lod 69
71: 18(fvec4) Load 23(color)
72: 18(fvec4) FAdd 71 70
Store 23(color) 72
77: 74 Load 76(texSampler3D)
78: 12(fvec3) Load 14(coords3D)
79: 6(float) Load 8(lod)
80: 18(fvec4) ImageSampleExplicitLod 77 78 Lod 79
81: 18(fvec4) Load 23(color)
82: 18(fvec4) FAdd 81 80
Store 23(color) 82
83: 74 Load 76(texSampler3D)
84: 18(fvec4) Load 20(coords4D)
85: 6(float) Load 8(lod)
86: 18(fvec4) ImageSampleProjExplicitLod 83 84 Lod 85
87: 18(fvec4) Load 23(color)
88: 18(fvec4) FAdd 87 86
Store 23(color) 88
93: 90 Load 92(texSamplerCube)
94: 12(fvec3) Load 14(coords3D)
95: 6(float) Load 8(lod)
96: 18(fvec4) ImageSampleExplicitLod 93 94 Lod 95
97: 18(fvec4) Load 23(color)
98: 18(fvec4) FAdd 97 96
Store 23(color) 98
103: 100 Load 102(shadowSampler1D)
104: 12(fvec3) Load 14(coords3D)
105: 6(float) Load 8(lod)
106: 6(float) CompositeExtract 104 2
107: 6(float) ImageSampleDrefExplicitLod 103 104 106 Lod 105
108: 18(fvec4) Load 23(color)
109: 18(fvec4) CompositeConstruct 107 107 107 107
110: 18(fvec4) FAdd 108 109
Store 23(color) 110
115: 112 Load 114(shadowSampler2D)
116: 12(fvec3) Load 14(coords3D)
117: 6(float) Load 8(lod)
118: 6(float) CompositeExtract 116 2
119: 6(float) ImageSampleDrefExplicitLod 115 116 118 Lod 117
120: 18(fvec4) Load 23(color)
121: 18(fvec4) CompositeConstruct 119 119 119 119
122: 18(fvec4) FAdd 120 121
Store 23(color) 122
123: 100 Load 102(shadowSampler1D)
124: 18(fvec4) Load 20(coords4D)
125: 6(float) Load 8(lod)
126: 6(float) CompositeExtract 124 2
127: 6(float) ImageSampleProjDrefExplicitLod 123 124 126 Lod 125
128: 18(fvec4) Load 23(color)
129: 18(fvec4) CompositeConstruct 127 127 127 127
130: 18(fvec4) FAdd 128 129
Store 23(color) 130
131: 112 Load 114(shadowSampler2D)
132: 18(fvec4) Load 20(coords4D)
133: 6(float) Load 8(lod)
134: 6(float) CompositeExtract 132 2
135: 6(float) ImageSampleProjDrefExplicitLod 131 132 134 Lod 133
136: 18(fvec4) Load 23(color)
137: 18(fvec4) CompositeConstruct 135 135 135 135
138: 18(fvec4) FAdd 136 137
Store 23(color) 138
141: 18(fvec4) Load 23(color)
Store 140(gl_Position) 141
48: 6(float) CompositeExtract 46 3
49: 18(fvec4) CompositeInsert 48 46 1
50: 18(fvec4) ImageSampleProjExplicitLod 45 49 Lod 47
51: 18(fvec4) Load 23(color)
52: 18(fvec4) FAdd 51 50
Store 23(color) 52
57: 54 Load 56(texSampler2D)
58: 37(fvec2) Load 39(coords2D)
59: 6(float) Load 8(lod)
60: 18(fvec4) ImageSampleExplicitLod 57 58 Lod 59
61: 18(fvec4) Load 23(color)
62: 18(fvec4) FAdd 61 60
Store 23(color) 62
63: 54 Load 56(texSampler2D)
64: 12(fvec3) Load 14(coords3D)
65: 6(float) Load 8(lod)
66: 18(fvec4) ImageSampleProjExplicitLod 63 64 Lod 65
67: 18(fvec4) Load 23(color)
68: 18(fvec4) FAdd 67 66
Store 23(color) 68
69: 54 Load 56(texSampler2D)
70: 18(fvec4) Load 20(coords4D)
71: 6(float) Load 8(lod)
72: 6(float) CompositeExtract 70 3
73: 18(fvec4) CompositeInsert 72 70 2
74: 18(fvec4) ImageSampleProjExplicitLod 69 73 Lod 71
75: 18(fvec4) Load 23(color)
76: 18(fvec4) FAdd 75 74
Store 23(color) 76
81: 78 Load 80(texSampler3D)
82: 12(fvec3) Load 14(coords3D)
83: 6(float) Load 8(lod)
84: 18(fvec4) ImageSampleExplicitLod 81 82 Lod 83
85: 18(fvec4) Load 23(color)
86: 18(fvec4) FAdd 85 84
Store 23(color) 86
87: 78 Load 80(texSampler3D)
88: 18(fvec4) Load 20(coords4D)
89: 6(float) Load 8(lod)
90: 18(fvec4) ImageSampleProjExplicitLod 87 88 Lod 89
91: 18(fvec4) Load 23(color)
92: 18(fvec4) FAdd 91 90
Store 23(color) 92
97: 94 Load 96(texSamplerCube)
98: 12(fvec3) Load 14(coords3D)
99: 6(float) Load 8(lod)
100: 18(fvec4) ImageSampleExplicitLod 97 98 Lod 99
101: 18(fvec4) Load 23(color)
102: 18(fvec4) FAdd 101 100
Store 23(color) 102
107: 104 Load 106(shadowSampler1D)
108: 12(fvec3) Load 14(coords3D)
109: 6(float) Load 8(lod)
110: 6(float) CompositeExtract 108 2
111: 6(float) ImageSampleDrefExplicitLod 107 108 110 Lod 109
112: 18(fvec4) Load 23(color)
113: 18(fvec4) CompositeConstruct 111 111 111 111
114: 18(fvec4) FAdd 112 113
Store 23(color) 114
119: 116 Load 118(shadowSampler2D)
120: 12(fvec3) Load 14(coords3D)
121: 6(float) Load 8(lod)
122: 6(float) CompositeExtract 120 2
123: 6(float) ImageSampleDrefExplicitLod 119 120 122 Lod 121
124: 18(fvec4) Load 23(color)
125: 18(fvec4) CompositeConstruct 123 123 123 123
126: 18(fvec4) FAdd 124 125
Store 23(color) 126
127: 104 Load 106(shadowSampler1D)
128: 18(fvec4) Load 20(coords4D)
129: 6(float) Load 8(lod)
130: 6(float) CompositeExtract 128 2
131: 6(float) CompositeExtract 128 3
132: 18(fvec4) CompositeInsert 131 128 1
133: 6(float) ImageSampleProjDrefExplicitLod 127 132 130 Lod 129
134: 18(fvec4) Load 23(color)
135: 18(fvec4) CompositeConstruct 133 133 133 133
136: 18(fvec4) FAdd 134 135
Store 23(color) 136
137: 116 Load 118(shadowSampler2D)
138: 18(fvec4) Load 20(coords4D)
139: 6(float) Load 8(lod)
140: 6(float) CompositeExtract 138 2
141: 6(float) CompositeExtract 138 3
142: 18(fvec4) CompositeInsert 141 138 2
143: 6(float) ImageSampleProjDrefExplicitLod 137 142 140 Lod 139
144: 18(fvec4) Load 23(color)
145: 18(fvec4) CompositeConstruct 143 143 143 143
146: 18(fvec4) FAdd 144 145
Store 23(color) 146
149: 18(fvec4) Load 23(color)
Store 148(gl_Position) 149
Return
FunctionEnd