SPV: Fix issue #320: Fetch needs to extract the image.
GLSL takes a traditional sampler, but SPIR-V wants just the sampled image, not the combined sampler and image.
This commit is contained in:
@@ -9,13 +9,13 @@ Linked fragment stage:
|
||||
|
||||
// Module Version 10000
|
||||
// Generated by (magic number): 80001
|
||||
// Id's are bound by 290
|
||||
// Id's are bound by 291
|
||||
|
||||
Capability Shader
|
||||
Capability Sampled1D
|
||||
1: ExtInstImport "GLSL.std.450"
|
||||
MemoryModel Logical GLSL450
|
||||
EntryPoint Fragment 4 "main" 47 276 279 282 288 289
|
||||
EntryPoint Fragment 4 "main" 47 277 280 283 289 290
|
||||
ExecutionMode 4 OriginUpperLeft
|
||||
Source GLSL 140
|
||||
Name 4 "main"
|
||||
@@ -36,13 +36,13 @@ Linked fragment stage:
|
||||
Name 158 "shadowSampler2D"
|
||||
Name 207 "iCoords2D"
|
||||
Name 212 "iLod"
|
||||
Name 221 "gradX"
|
||||
Name 224 "gradY"
|
||||
Name 276 "gl_FragColor"
|
||||
Name 279 "u"
|
||||
Name 282 "blend"
|
||||
Name 288 "scale"
|
||||
Name 289 "t"
|
||||
Name 222 "gradX"
|
||||
Name 225 "gradY"
|
||||
Name 277 "gl_FragColor"
|
||||
Name 280 "u"
|
||||
Name 283 "blend"
|
||||
Name 289 "scale"
|
||||
Name 290 "t"
|
||||
Decorate 32(texSampler1D) DescriptorSet 0
|
||||
Decorate 72(texSampler2D) DescriptorSet 0
|
||||
Decorate 98(texSampler3D) DescriptorSet 0
|
||||
@@ -101,18 +101,18 @@ Linked fragment stage:
|
||||
210: 205(ivec2) ConstantComposite 208 209
|
||||
211: TypePointer Function 204(int)
|
||||
213: 204(int) Constant 1
|
||||
220: TypePointer Function 45(fvec2)
|
||||
249: 204(int) Constant 3
|
||||
250: 204(int) Constant 4294967289
|
||||
251: 205(ivec2) ConstantComposite 249 250
|
||||
275: TypePointer Output 22(fvec4)
|
||||
276(gl_FragColor): 275(ptr) Variable Output
|
||||
278: TypePointer Input 22(fvec4)
|
||||
279(u): 278(ptr) Variable Input
|
||||
281: TypePointer Input 6(float)
|
||||
282(blend): 281(ptr) Variable Input
|
||||
288(scale): 46(ptr) Variable Input
|
||||
289(t): 46(ptr) Variable Input
|
||||
221: TypePointer Function 45(fvec2)
|
||||
250: 204(int) Constant 3
|
||||
251: 204(int) Constant 4294967289
|
||||
252: 205(ivec2) ConstantComposite 250 251
|
||||
276: TypePointer Output 22(fvec4)
|
||||
277(gl_FragColor): 276(ptr) Variable Output
|
||||
279: TypePointer Input 22(fvec4)
|
||||
280(u): 279(ptr) Variable Input
|
||||
282: TypePointer Input 6(float)
|
||||
283(blend): 282(ptr) Variable Input
|
||||
289(scale): 46(ptr) Variable Input
|
||||
290(t): 46(ptr) Variable Input
|
||||
4(main): 2 Function None 3
|
||||
5: Label
|
||||
8(blendscale): 7(ptr) Variable Function
|
||||
@@ -125,8 +125,8 @@ Linked fragment stage:
|
||||
26(color): 23(ptr) Variable Function
|
||||
207(iCoords2D): 206(ptr) Variable Function
|
||||
212(iLod): 211(ptr) Variable Function
|
||||
221(gradX): 220(ptr) Variable Function
|
||||
224(gradY): 220(ptr) Variable Function
|
||||
222(gradX): 221(ptr) Variable Function
|
||||
225(gradY): 221(ptr) Variable Function
|
||||
Store 8(blendscale) 9
|
||||
Store 10(bias) 11
|
||||
Store 12(lod) 13
|
||||
@@ -312,73 +312,74 @@ Linked fragment stage:
|
||||
214: 70 Load 72(texSampler2D)
|
||||
215: 205(ivec2) Load 207(iCoords2D)
|
||||
216: 204(int) Load 212(iLod)
|
||||
217: 22(fvec4) ImageFetch 214 215 Lod 216
|
||||
218: 22(fvec4) Load 26(color)
|
||||
219: 22(fvec4) FAdd 218 217
|
||||
Store 26(color) 219
|
||||
222: 45(fvec2) Load 47(coords2D)
|
||||
223: 45(fvec2) DPdx 222
|
||||
Store 221(gradX) 223
|
||||
225: 45(fvec2) Load 47(coords2D)
|
||||
226: 45(fvec2) DPdy 225
|
||||
Store 224(gradY) 226
|
||||
227: 70 Load 72(texSampler2D)
|
||||
228: 45(fvec2) Load 47(coords2D)
|
||||
229: 45(fvec2) Load 221(gradX)
|
||||
230: 45(fvec2) Load 224(gradY)
|
||||
231: 22(fvec4) ImageSampleExplicitLod 227 228 Grad 229 230
|
||||
232: 22(fvec4) Load 26(color)
|
||||
233: 22(fvec4) FAdd 232 231
|
||||
Store 26(color) 233
|
||||
234: 70 Load 72(texSampler2D)
|
||||
235: 45(fvec2) Load 47(coords2D)
|
||||
236: 6(float) Load 14(proj)
|
||||
237: 6(float) CompositeExtract 235 0
|
||||
238: 6(float) CompositeExtract 235 1
|
||||
239: 16(fvec3) CompositeConstruct 237 238 236
|
||||
240: 45(fvec2) Load 221(gradX)
|
||||
241: 45(fvec2) Load 224(gradY)
|
||||
242: 22(fvec4) ImageSampleProjExplicitLod 234 239 Grad 240 241
|
||||
243: 22(fvec4) Load 26(color)
|
||||
244: 22(fvec4) FAdd 243 242
|
||||
Store 26(color) 244
|
||||
245: 70 Load 72(texSampler2D)
|
||||
246: 45(fvec2) Load 47(coords2D)
|
||||
247: 45(fvec2) Load 221(gradX)
|
||||
248: 45(fvec2) Load 224(gradY)
|
||||
252: 22(fvec4) ImageSampleExplicitLod 245 246 Grad ConstOffset 247 248 251
|
||||
253: 22(fvec4) Load 26(color)
|
||||
254: 22(fvec4) FAdd 253 252
|
||||
Store 26(color) 254
|
||||
255: 70 Load 72(texSampler2D)
|
||||
256: 16(fvec3) Load 18(coords3D)
|
||||
257: 45(fvec2) Load 221(gradX)
|
||||
258: 45(fvec2) Load 224(gradY)
|
||||
259: 22(fvec4) ImageSampleProjExplicitLod 255 256 Grad ConstOffset 257 258 251
|
||||
260: 22(fvec4) Load 26(color)
|
||||
261: 22(fvec4) FAdd 260 259
|
||||
Store 26(color) 261
|
||||
262: 156 Load 158(shadowSampler2D)
|
||||
263: 45(fvec2) Load 47(coords2D)
|
||||
264: 6(float) Load 12(lod)
|
||||
265: 6(float) CompositeExtract 263 0
|
||||
266: 6(float) CompositeExtract 263 1
|
||||
267: 16(fvec3) CompositeConstruct 265 266 264
|
||||
268: 45(fvec2) Load 221(gradX)
|
||||
269: 45(fvec2) Load 224(gradY)
|
||||
270: 6(float) CompositeExtract 267 2
|
||||
271: 6(float) ImageSampleDrefExplicitLod 262 267 270 Grad 268 269
|
||||
272: 22(fvec4) Load 26(color)
|
||||
273: 22(fvec4) CompositeConstruct 271 271 271 271
|
||||
274: 22(fvec4) FAdd 272 273
|
||||
Store 26(color) 274
|
||||
277: 22(fvec4) Load 26(color)
|
||||
280: 22(fvec4) Load 279(u)
|
||||
283: 6(float) Load 282(blend)
|
||||
284: 6(float) Load 8(blendscale)
|
||||
285: 6(float) FMul 283 284
|
||||
286: 22(fvec4) CompositeConstruct 285 285 285 285
|
||||
287: 22(fvec4) ExtInst 1(GLSL.std.450) 46(FMix) 277 280 286
|
||||
Store 276(gl_FragColor) 287
|
||||
217: 69 Image 214
|
||||
218: 22(fvec4) ImageFetch 217 215 Lod 216
|
||||
219: 22(fvec4) Load 26(color)
|
||||
220: 22(fvec4) FAdd 219 218
|
||||
Store 26(color) 220
|
||||
223: 45(fvec2) Load 47(coords2D)
|
||||
224: 45(fvec2) DPdx 223
|
||||
Store 222(gradX) 224
|
||||
226: 45(fvec2) Load 47(coords2D)
|
||||
227: 45(fvec2) DPdy 226
|
||||
Store 225(gradY) 227
|
||||
228: 70 Load 72(texSampler2D)
|
||||
229: 45(fvec2) Load 47(coords2D)
|
||||
230: 45(fvec2) Load 222(gradX)
|
||||
231: 45(fvec2) Load 225(gradY)
|
||||
232: 22(fvec4) ImageSampleExplicitLod 228 229 Grad 230 231
|
||||
233: 22(fvec4) Load 26(color)
|
||||
234: 22(fvec4) FAdd 233 232
|
||||
Store 26(color) 234
|
||||
235: 70 Load 72(texSampler2D)
|
||||
236: 45(fvec2) Load 47(coords2D)
|
||||
237: 6(float) Load 14(proj)
|
||||
238: 6(float) CompositeExtract 236 0
|
||||
239: 6(float) CompositeExtract 236 1
|
||||
240: 16(fvec3) CompositeConstruct 238 239 237
|
||||
241: 45(fvec2) Load 222(gradX)
|
||||
242: 45(fvec2) Load 225(gradY)
|
||||
243: 22(fvec4) ImageSampleProjExplicitLod 235 240 Grad 241 242
|
||||
244: 22(fvec4) Load 26(color)
|
||||
245: 22(fvec4) FAdd 244 243
|
||||
Store 26(color) 245
|
||||
246: 70 Load 72(texSampler2D)
|
||||
247: 45(fvec2) Load 47(coords2D)
|
||||
248: 45(fvec2) Load 222(gradX)
|
||||
249: 45(fvec2) Load 225(gradY)
|
||||
253: 22(fvec4) ImageSampleExplicitLod 246 247 Grad ConstOffset 248 249 252
|
||||
254: 22(fvec4) Load 26(color)
|
||||
255: 22(fvec4) FAdd 254 253
|
||||
Store 26(color) 255
|
||||
256: 70 Load 72(texSampler2D)
|
||||
257: 16(fvec3) Load 18(coords3D)
|
||||
258: 45(fvec2) Load 222(gradX)
|
||||
259: 45(fvec2) Load 225(gradY)
|
||||
260: 22(fvec4) ImageSampleProjExplicitLod 256 257 Grad ConstOffset 258 259 252
|
||||
261: 22(fvec4) Load 26(color)
|
||||
262: 22(fvec4) FAdd 261 260
|
||||
Store 26(color) 262
|
||||
263: 156 Load 158(shadowSampler2D)
|
||||
264: 45(fvec2) Load 47(coords2D)
|
||||
265: 6(float) Load 12(lod)
|
||||
266: 6(float) CompositeExtract 264 0
|
||||
267: 6(float) CompositeExtract 264 1
|
||||
268: 16(fvec3) CompositeConstruct 266 267 265
|
||||
269: 45(fvec2) Load 222(gradX)
|
||||
270: 45(fvec2) Load 225(gradY)
|
||||
271: 6(float) CompositeExtract 268 2
|
||||
272: 6(float) ImageSampleDrefExplicitLod 263 268 271 Grad 269 270
|
||||
273: 22(fvec4) Load 26(color)
|
||||
274: 22(fvec4) CompositeConstruct 272 272 272 272
|
||||
275: 22(fvec4) FAdd 273 274
|
||||
Store 26(color) 275
|
||||
278: 22(fvec4) Load 26(color)
|
||||
281: 22(fvec4) Load 280(u)
|
||||
284: 6(float) Load 283(blend)
|
||||
285: 6(float) Load 8(blendscale)
|
||||
286: 6(float) FMul 284 285
|
||||
287: 22(fvec4) CompositeConstruct 286 286 286 286
|
||||
288: 22(fvec4) ExtInst 1(GLSL.std.450) 46(FMix) 278 281 287
|
||||
Store 277(gl_FragColor) 288
|
||||
Return
|
||||
FunctionEnd
|
||||
|
||||
Reference in New Issue
Block a user