Support multiple swizzled out operands (#2175)

Swizzled out operands were added in bbbd9a2a. This was sufficient
for most tests, but we ran into problems with umulExtended and
imulExtended, which have two.

This CL converts the tracking values to vectors so multiple operands
can be supported.

Test: KHR-GLES31.core.shader_bitfield_operation.*
Test: ctest
This commit is contained in:
Cody Northrop 2020-04-13 21:59:49 -06:00 committed by GitHub
parent 4657244018
commit 4d2298bfd7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 387 additions and 324 deletions

View File

@ -2357,10 +2357,10 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt
spec_constant_op_mode_setter.turnOnSpecConstantOpMode(); spec_constant_op_mode_setter.turnOnSpecConstantOpMode();
spv::Id result = spv::NoResult; spv::Id result = spv::NoResult;
spv::Id invertedType = spv::NoType; // to use to override the natural type of the node spv::Id invertedType = spv::NoType; // to use to override the natural type of the node
spv::Builder::AccessChain complexLvalue; // for holding swizzling l-values too complex for SPIR-V, std::vector<spv::Builder::AccessChain> complexLvalues; // for holding swizzling l-values too complex for
// for at out parameter // SPIR-V, for an out parameter
spv::Id temporaryLvalue = spv::NoResult; // temporary to pass, as proxy for complexLValue std::vector<spv::Id> temporaryLvalues; // temporaries to pass, as proxies for complexLValues
auto resultType = [&invertedType, &node, this](){ return invertedType != spv::NoType ? auto resultType = [&invertedType, &node, this](){ return invertedType != spv::NoType ?
invertedType : invertedType :
@ -2976,10 +2976,10 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt
// reduce to a simple access chain. So, we need a temporary vector to // reduce to a simple access chain. So, we need a temporary vector to
// receive the result, and must later swizzle that into the original // receive the result, and must later swizzle that into the original
// l-value. // l-value.
complexLvalue = builder.getAccessChain(); complexLvalues.push_back(builder.getAccessChain());
temporaryLvalue = builder.createVariable(spv::StorageClassFunction, temporaryLvalues.push_back(builder.createVariable(spv::StorageClassFunction,
builder.accessChainGetInferredType(), "swizzleTemp"); builder.accessChainGetInferredType(), "swizzleTemp"));
operands.push_back(temporaryLvalue); operands.push_back(temporaryLvalues.back());
} else { } else {
operands.push_back(builder.accessChainGetLValue()); operands.push_back(builder.accessChainGetLValue());
} }
@ -3074,11 +3074,13 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt
result = createMiscOperation(node->getOp(), precision, resultType(), operands, node->getBasicType()); result = createMiscOperation(node->getOp(), precision, resultType(), operands, node->getBasicType());
break; break;
} }
if (invertedType != spv::NoResult) if (invertedType != spv::NoResult)
result = createInvertedSwizzle(precision, *glslangOperands[0]->getAsBinaryNode(), result); result = createInvertedSwizzle(precision, *glslangOperands[0]->getAsBinaryNode(), result);
else if (temporaryLvalue != spv::NoResult) {
builder.setAccessChain(complexLvalue); for (unsigned int i = 0; i < temporaryLvalues.size(); ++i) {
builder.accessChainStore(builder.createLoad(temporaryLvalue)); builder.setAccessChain(complexLvalues[i]);
builder.accessChainStore(builder.createLoad(temporaryLvalues[i]));
} }
} }

View File

@ -1,12 +1,12 @@
spv.Operations.frag spv.Operations.frag
// Module Version 10000 // Module Version 10000
// Generated by (magic number): 80008 // Generated by (magic number): 80008
// Id's are bound by 540 // Id's are bound by 583
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 22 220 296 493 534 539 EntryPoint Fragment 4 "main" 11 22 220 296 314 539 580
ExecutionMode 4 OriginUpperLeft ExecutionMode 4 OriginUpperLeft
Source GLSL 450 Source GLSL 450
Name 4 "main" Name 4 "main"
@ -20,18 +20,23 @@ spv.Operations.frag
Name 220 "uf" Name 220 "uf"
Name 293 "u" Name 293 "u"
Name 296 "uui" Name 296 "uui"
Name 313 "b" Name 314 "uuv4"
Name 350 "ub42" Name 321 "msb"
Name 493 "FragColor" Name 323 "swizzleTemp"
Name 511 "m1" Name 324 "lsb"
Name 518 "m2" Name 325 "swizzleTemp"
Name 534 "uiv4" Name 326 "ResType"
Name 536 "ub" Name 359 "b"
Name 539 "uuv4" Name 396 "ub42"
Name 539 "FragColor"
Name 557 "m1"
Name 564 "m2"
Name 580 "uiv4"
Name 582 "ub"
Decorate 22(ui) Flat Decorate 22(ui) Flat
Decorate 296(uui) Flat Decorate 296(uui) Flat
Decorate 534(uiv4) Flat Decorate 314(uuv4) Flat
Decorate 539(uuv4) Flat Decorate 580(uiv4) Flat
2: TypeVoid 2: TypeVoid
3: TypeFunction 2 3: TypeFunction 2
6: TypeFloat 32 6: TypeFloat 32
@ -55,35 +60,41 @@ spv.Operations.frag
292: TypePointer Function 141(int) 292: TypePointer Function 141(int)
295: TypePointer Input 141(int) 295: TypePointer Input 141(int)
296(uui): 295(ptr) Variable Input 296(uui): 295(ptr) Variable Input
312: TypePointer Function 186(bool) 312: TypeVector 141(int) 4
350(ub42): 188(ptr) Variable Private 313: TypePointer Input 312(ivec4)
406: 18(int) Constant 2 314(uuv4): 313(ptr) Variable Input
413: 18(int) Constant 1 315: TypeVector 141(int) 3
443: TypeVector 6(float) 3 320: TypePointer Function 312(ivec4)
462: 6(float) Constant 1073741824 322: TypePointer Function 315(ivec3)
469: 6(float) Constant 1065353216 326(ResType): TypeStruct 315(ivec3) 315(ivec3)
474: 18(int) Constant 66 338: 141(int) Constant 1
480: 18(int) Constant 17 342: 141(int) Constant 2
492: TypePointer Output 7(fvec4) 358: TypePointer Function 186(bool)
493(FragColor): 492(ptr) Variable Output 396(ub42): 188(ptr) Variable Private
509: TypeMatrix 7(fvec4) 4 452: 18(int) Constant 2
510: TypePointer Function 509 459: 18(int) Constant 1
512: 6(float) Constant 0 489: TypeVector 6(float) 3
513: 7(fvec4) ConstantComposite 469 512 512 512 508: 6(float) Constant 1073741824
514: 7(fvec4) ConstantComposite 512 469 512 512 515: 6(float) Constant 1065353216
515: 7(fvec4) ConstantComposite 512 512 469 512 520: 18(int) Constant 66
516: 7(fvec4) ConstantComposite 512 512 512 469 526: 18(int) Constant 17
517: 509 ConstantComposite 513 514 515 516 538: TypePointer Output 7(fvec4)
519: 7(fvec4) ConstantComposite 512 512 512 512 539(FragColor): 538(ptr) Variable Output
520: 509 ConstantComposite 519 519 519 519 555: TypeMatrix 7(fvec4) 4
532: TypeVector 18(int) 4 556: TypePointer Function 555
533: TypePointer Input 532(ivec4) 558: 6(float) Constant 0
534(uiv4): 533(ptr) Variable Input 559: 7(fvec4) ConstantComposite 515 558 558 558
535: TypePointer Private 186(bool) 560: 7(fvec4) ConstantComposite 558 515 558 558
536(ub): 535(ptr) Variable Private 561: 7(fvec4) ConstantComposite 558 558 515 558
537: TypeVector 141(int) 4 562: 7(fvec4) ConstantComposite 558 558 558 515
538: TypePointer Input 537(ivec4) 563: 555 ConstantComposite 559 560 561 562
539(uuv4): 538(ptr) Variable Input 565: 7(fvec4) ConstantComposite 558 558 558 558
566: 555 ConstantComposite 565 565 565 565
578: TypeVector 18(int) 4
579: TypePointer Input 578(ivec4)
580(uiv4): 579(ptr) Variable Input
581: TypePointer Private 186(bool)
582(ub): 581(ptr) Variable Private
4(main): 2 Function None 3 4(main): 2 Function None 3
5: Label 5: Label
9(v): 8(ptr) Variable Function 9(v): 8(ptr) Variable Function
@ -91,11 +102,15 @@ spv.Operations.frag
155(swizzleTemp): 8(ptr) Variable Function 155(swizzleTemp): 8(ptr) Variable Function
196(f): 143(ptr) Variable Function 196(f): 143(ptr) Variable Function
293(u): 292(ptr) Variable Function 293(u): 292(ptr) Variable Function
313(b): 312(ptr) Variable Function 321(msb): 320(ptr) Variable Function
495: 8(ptr) Variable Function 323(swizzleTemp): 322(ptr) Variable Function
511(m1): 510(ptr) Variable Function 324(lsb): 320(ptr) Variable Function
518(m2): 510(ptr) Variable Function 325(swizzleTemp): 322(ptr) Variable Function
522: 510(ptr) Variable Function 359(b): 358(ptr) Variable Function
541: 8(ptr) Variable Function
557(m1): 556(ptr) Variable Function
564(m2): 556(ptr) Variable Function
568: 556(ptr) Variable Function
12: 7(fvec4) Load 11(uv4) 12: 7(fvec4) Load 11(uv4)
13: 7(fvec4) ExtInst 1(GLSL.std.450) 11(Radians) 12 13: 7(fvec4) ExtInst 1(GLSL.std.450) 11(Radians) 12
Store 9(v) 13 Store 9(v) 13
@ -437,277 +452,316 @@ spv.Operations.frag
310: 141(int) Load 293(u) 310: 141(int) Load 293(u)
311: 141(int) IAdd 310 309 311: 141(int) IAdd 310 309
Store 293(u) 311 Store 293(u) 311
314: 6(float) Load 220(uf) 316: 312(ivec4) Load 314(uuv4)
315: 186(bool) IsNan 314 317: 315(ivec3) VectorShuffle 316 316 0 1 2
Store 313(b) 315 318: 312(ivec4) Load 314(uuv4)
316: 6(float) Load 196(f) 319: 315(ivec3) VectorShuffle 318 318 0 1 2
317: 186(bool) IsInf 316 327:326(ResType) UMulExtended 317 319
Store 313(b) 317 328: 315(ivec3) CompositeExtract 327 0
318: 7(fvec4) Load 9(v) Store 325(swizzleTemp) 328
319: 7(fvec4) Load 11(uv4) 329: 315(ivec3) CompositeExtract 327 1
320: 187(bvec4) FOrdLessThan 318 319 Store 323(swizzleTemp) 329
321: 186(bool) Any 320 330: 315(ivec3) Load 323(swizzleTemp)
Store 313(b) 321 331: 312(ivec4) Load 321(msb)
322: 186(bool) Load 313(b) 332: 312(ivec4) VectorShuffle 331 330 4 5 6 3
SelectionMerge 324 None Store 321(msb) 332
BranchConditional 322 323 324 333: 315(ivec3) Load 325(swizzleTemp)
323: Label 334: 312(ivec4) Load 324(lsb)
325: 7(fvec4) Load 9(v) 335: 312(ivec4) VectorShuffle 334 333 4 5 6 3
326: 7(fvec4) Load 11(uv4) Store 324(lsb) 335
327: 187(bvec4) FOrdLessThanEqual 325 326 336: 292(ptr) AccessChain 321(msb) 142
328: 186(bool) Any 327 337: 141(int) Load 336
Branch 324 339: 292(ptr) AccessChain 321(msb) 338
324: Label 340: 141(int) Load 339
329: 186(bool) Phi 322 5 328 323 341: 141(int) IAdd 337 340
Store 313(b) 329 343: 292(ptr) AccessChain 321(msb) 342
330: 186(bool) Load 313(b) 344: 141(int) Load 343
SelectionMerge 332 None 345: 141(int) IAdd 341 344
BranchConditional 330 331 332 346: 141(int) Load 293(u)
331: Label 347: 141(int) IAdd 346 345
333: 7(fvec4) Load 9(v) Store 293(u) 347
334: 7(fvec4) Load 11(uv4) 348: 292(ptr) AccessChain 324(lsb) 142
335: 187(bvec4) FOrdGreaterThan 333 334 349: 141(int) Load 348
336: 186(bool) Any 335 350: 292(ptr) AccessChain 324(lsb) 338
Branch 332 351: 141(int) Load 350
332: Label 352: 141(int) IAdd 349 351
337: 186(bool) Phi 330 324 336 331 353: 292(ptr) AccessChain 324(lsb) 342
Store 313(b) 337 354: 141(int) Load 353
338: 186(bool) Load 313(b) 355: 141(int) IAdd 352 354
SelectionMerge 340 None 356: 141(int) Load 293(u)
BranchConditional 338 339 340 357: 141(int) IAdd 356 355
339: Label Store 293(u) 357
341: 7(fvec4) Load 9(v) 360: 6(float) Load 220(uf)
342: 7(fvec4) Load 11(uv4) 361: 186(bool) IsNan 360
343: 187(bvec4) FOrdGreaterThanEqual 341 342 Store 359(b) 361
344: 186(bool) Any 343 362: 6(float) Load 196(f)
Branch 340 363: 186(bool) IsInf 362
340: Label Store 359(b) 363
345: 186(bool) Phi 338 332 344 339 364: 7(fvec4) Load 9(v)
Store 313(b) 345 365: 7(fvec4) Load 11(uv4)
346: 186(bool) Load 313(b) 366: 187(bvec4) FOrdLessThan 364 365
SelectionMerge 348 None 367: 186(bool) Any 366
BranchConditional 346 347 348 Store 359(b) 367
347: Label 368: 186(bool) Load 359(b)
349: 187(bvec4) Load 189(ub41) SelectionMerge 370 None
351: 187(bvec4) Load 350(ub42) BranchConditional 368 369 370
352: 187(bvec4) LogicalEqual 349 351 369: Label
353: 186(bool) Any 352 371: 7(fvec4) Load 9(v)
Branch 348 372: 7(fvec4) Load 11(uv4)
348: Label 373: 187(bvec4) FOrdLessThanEqual 371 372
354: 186(bool) Phi 346 340 353 347 374: 186(bool) Any 373
Store 313(b) 354 Branch 370
355: 186(bool) Load 313(b) 370: Label
SelectionMerge 357 None 375: 186(bool) Phi 368 5 374 369
BranchConditional 355 356 357 Store 359(b) 375
356: Label 376: 186(bool) Load 359(b)
358: 187(bvec4) Load 189(ub41) SelectionMerge 378 None
359: 187(bvec4) Load 350(ub42) BranchConditional 376 377 378
360: 187(bvec4) LogicalNotEqual 358 359 377: Label
361: 186(bool) Any 360 379: 7(fvec4) Load 9(v)
Branch 357 380: 7(fvec4) Load 11(uv4)
357: Label 381: 187(bvec4) FOrdGreaterThan 379 380
362: 186(bool) Phi 355 348 361 356 382: 186(bool) Any 381
Store 313(b) 362 Branch 378
363: 186(bool) Load 313(b) 378: Label
364: 187(bvec4) Load 189(ub41) 383: 186(bool) Phi 376 370 382 377
365: 186(bool) Any 364 Store 359(b) 383
366: 186(bool) LogicalAnd 363 365 384: 186(bool) Load 359(b)
Store 313(b) 366 SelectionMerge 386 None
367: 186(bool) Load 313(b) BranchConditional 384 385 386
368: 187(bvec4) Load 189(ub41) 385: Label
369: 186(bool) All 368 387: 7(fvec4) Load 9(v)
370: 186(bool) LogicalAnd 367 369 388: 7(fvec4) Load 11(uv4)
Store 313(b) 370 389: 187(bvec4) FOrdGreaterThanEqual 387 388
371: 186(bool) Load 313(b) 390: 186(bool) Any 389
SelectionMerge 373 None Branch 386
BranchConditional 371 372 373 386: Label
372: Label 391: 186(bool) Phi 384 378 390 385
374: 187(bvec4) Load 189(ub41) Store 359(b) 391
375: 187(bvec4) LogicalNot 374 392: 186(bool) Load 359(b)
376: 186(bool) Any 375 SelectionMerge 394 None
Branch 373 BranchConditional 392 393 394
373: Label 393: Label
377: 186(bool) Phi 371 357 376 372 395: 187(bvec4) Load 189(ub41)
Store 313(b) 377 397: 187(bvec4) Load 396(ub42)
378: 18(int) Load 20(i) 398: 187(bvec4) LogicalEqual 395 397
379: 18(int) Load 22(ui) 399: 186(bool) Any 398
380: 18(int) IAdd 378 379 Branch 394
381: 18(int) Load 20(i) 394: Label
382: 18(int) IMul 380 381 400: 186(bool) Phi 392 386 399 393
383: 18(int) Load 22(ui) Store 359(b) 400
384: 18(int) ISub 382 383 401: 186(bool) Load 359(b)
385: 18(int) Load 20(i) SelectionMerge 403 None
386: 18(int) SDiv 384 385 BranchConditional 401 402 403
Store 20(i) 386 402: Label
387: 18(int) Load 20(i) 404: 187(bvec4) Load 189(ub41)
388: 18(int) Load 22(ui) 405: 187(bvec4) Load 396(ub42)
389: 18(int) SMod 387 388 406: 187(bvec4) LogicalNotEqual 404 405
Store 20(i) 389 407: 186(bool) Any 406
390: 18(int) Load 20(i) Branch 403
391: 18(int) Load 22(ui) 403: Label
392: 186(bool) IEqual 390 391 408: 186(bool) Phi 401 394 407 402
393: 186(bool) LogicalNot 392 Store 359(b) 408
SelectionMerge 395 None 409: 186(bool) Load 359(b)
BranchConditional 393 394 395 410: 187(bvec4) Load 189(ub41)
394: Label 411: 186(bool) Any 410
396: 18(int) Load 20(i) 412: 186(bool) LogicalAnd 409 411
397: 18(int) Load 22(ui) Store 359(b) 412
398: 186(bool) INotEqual 396 397 413: 186(bool) Load 359(b)
SelectionMerge 400 None 414: 187(bvec4) Load 189(ub41)
BranchConditional 398 399 400 415: 186(bool) All 414
399: Label 416: 186(bool) LogicalAnd 413 415
401: 18(int) Load 20(i) Store 359(b) 416
402: 18(int) Load 22(ui) 417: 186(bool) Load 359(b)
403: 186(bool) IEqual 401 402 SelectionMerge 419 None
Branch 400 BranchConditional 417 418 419
400: Label 418: Label
404: 186(bool) Phi 398 394 403 399 420: 187(bvec4) Load 189(ub41)
405: 18(int) Load 20(i) 421: 187(bvec4) LogicalNot 420
407: 186(bool) INotEqual 405 406 422: 186(bool) Any 421
408: 186(bool) LogicalNotEqual 404 407 Branch 419
Branch 395 419: Label
395: Label 423: 186(bool) Phi 417 403 422 418
409: 186(bool) Phi 392 373 408 400 Store 359(b) 423
SelectionMerge 411 None 424: 18(int) Load 20(i)
BranchConditional 409 410 411 425: 18(int) Load 22(ui)
410: Label 426: 18(int) IAdd 424 425
412: 18(int) Load 20(i) 427: 18(int) Load 20(i)
414: 18(int) IAdd 412 413 428: 18(int) IMul 426 427
Store 20(i) 414 429: 18(int) Load 22(ui)
Branch 411 430: 18(int) ISub 428 429
411: Label 431: 18(int) Load 20(i)
415: 6(float) Load 220(uf) 432: 18(int) SDiv 430 431
416: 6(float) Load 220(uf) Store 20(i) 432
417: 6(float) FAdd 415 416 433: 18(int) Load 20(i)
418: 6(float) Load 220(uf) 434: 18(int) Load 22(ui)
419: 6(float) FMul 417 418 435: 18(int) SMod 433 434
420: 6(float) Load 220(uf) Store 20(i) 435
421: 6(float) FSub 419 420 436: 18(int) Load 20(i)
422: 6(float) Load 220(uf) 437: 18(int) Load 22(ui)
423: 6(float) FDiv 421 422 438: 186(bool) IEqual 436 437
Store 196(f) 423 439: 186(bool) LogicalNot 438
424: 7(fvec4) Load 9(v) SelectionMerge 441 None
425: 6(float) ExtInst 1(GLSL.std.450) 66(Length) 424 BranchConditional 439 440 441
426: 6(float) Load 196(f) 440: Label
427: 6(float) FAdd 426 425 442: 18(int) Load 20(i)
Store 196(f) 427 443: 18(int) Load 22(ui)
428: 7(fvec4) Load 9(v) 444: 186(bool) INotEqual 442 443
429: 7(fvec4) Load 9(v) SelectionMerge 446 None
430: 6(float) ExtInst 1(GLSL.std.450) 67(Distance) 428 429 BranchConditional 444 445 446
431: 6(float) Load 196(f) 445: Label
432: 6(float) FAdd 431 430 447: 18(int) Load 20(i)
Store 196(f) 432 448: 18(int) Load 22(ui)
433: 7(fvec4) Load 9(v) 449: 186(bool) IEqual 447 448
434: 7(fvec4) Load 9(v) Branch 446
435: 6(float) Dot 433 434 446: Label
436: 6(float) Load 196(f) 450: 186(bool) Phi 444 440 449 445
437: 6(float) FAdd 436 435 451: 18(int) Load 20(i)
Store 196(f) 437 453: 186(bool) INotEqual 451 452
438: 6(float) Load 196(f) 454: 186(bool) LogicalNotEqual 450 453
439: 6(float) Load 220(uf) Branch 441
440: 6(float) FMul 438 439 441: Label
441: 6(float) Load 196(f) 455: 186(bool) Phi 438 419 454 446
442: 6(float) FAdd 441 440
Store 196(f) 442
444: 7(fvec4) Load 9(v)
445: 443(fvec3) VectorShuffle 444 444 0 1 2
446: 7(fvec4) Load 9(v)
447: 443(fvec3) VectorShuffle 446 446 0 1 2
448: 443(fvec3) ExtInst 1(GLSL.std.450) 68(Cross) 445 447
449: 6(float) CompositeExtract 448 0
450: 6(float) Load 196(f)
451: 6(float) FAdd 450 449
Store 196(f) 451
452: 6(float) Load 196(f)
453: 6(float) Load 220(uf)
454: 186(bool) FOrdEqual 452 453
455: 186(bool) LogicalNot 454
SelectionMerge 457 None SelectionMerge 457 None
BranchConditional 455 456 457 BranchConditional 455 456 457
456: Label 456: Label
458: 6(float) Load 196(f) 458: 18(int) Load 20(i)
459: 6(float) Load 220(uf) 460: 18(int) IAdd 458 459
460: 186(bool) FOrdNotEqual 458 459 Store 20(i) 460
461: 6(float) Load 196(f)
463: 186(bool) FOrdNotEqual 461 462
464: 186(bool) LogicalAnd 460 463
Branch 457 Branch 457
457: Label 457: Label
465: 186(bool) Phi 454 411 464 456 461: 6(float) Load 220(uf)
SelectionMerge 467 None 462: 6(float) Load 220(uf)
BranchConditional 465 466 467 463: 6(float) FAdd 461 462
466: Label 464: 6(float) Load 220(uf)
468: 6(float) Load 196(f) 465: 6(float) FMul 463 464
470: 6(float) FAdd 468 469 466: 6(float) Load 220(uf)
Store 196(f) 470 467: 6(float) FSub 465 466
Branch 467 468: 6(float) Load 220(uf)
467: Label 469: 6(float) FDiv 467 468
471: 18(int) Load 22(ui) Store 196(f) 469
472: 18(int) Load 20(i) 470: 7(fvec4) Load 9(v)
473: 18(int) BitwiseAnd 472 471 471: 6(float) ExtInst 1(GLSL.std.450) 66(Length) 470
Store 20(i) 473 472: 6(float) Load 196(f)
475: 18(int) Load 20(i) 473: 6(float) FAdd 472 471
476: 18(int) BitwiseOr 475 474 Store 196(f) 473
Store 20(i) 476 474: 7(fvec4) Load 9(v)
477: 18(int) Load 22(ui) 475: 7(fvec4) Load 9(v)
478: 18(int) Load 20(i) 476: 6(float) ExtInst 1(GLSL.std.450) 67(Distance) 474 475
479: 18(int) BitwiseXor 478 477 477: 6(float) Load 196(f)
Store 20(i) 479 478: 6(float) FAdd 477 476
481: 18(int) Load 20(i) Store 196(f) 478
482: 18(int) SMod 481 480 479: 7(fvec4) Load 9(v)
Store 20(i) 482 480: 7(fvec4) Load 9(v)
483: 18(int) Load 20(i) 481: 6(float) Dot 479 480
484: 18(int) ShiftRightArithmetic 483 406 482: 6(float) Load 196(f)
Store 20(i) 484 483: 6(float) FAdd 482 481
485: 18(int) Load 22(ui) Store 196(f) 483
486: 18(int) Load 20(i) 484: 6(float) Load 196(f)
487: 18(int) ShiftLeftLogical 486 485 485: 6(float) Load 220(uf)
Store 20(i) 487 486: 6(float) FMul 484 485
488: 18(int) Load 20(i) 487: 6(float) Load 196(f)
489: 18(int) Not 488 488: 6(float) FAdd 487 486
Store 20(i) 489 Store 196(f) 488
490: 186(bool) Load 313(b) 490: 7(fvec4) Load 9(v)
491: 186(bool) LogicalNot 490 491: 489(fvec3) VectorShuffle 490 490 0 1 2
Store 313(b) 491 492: 7(fvec4) Load 9(v)
494: 186(bool) Load 313(b) 493: 489(fvec3) VectorShuffle 492 492 0 1 2
SelectionMerge 497 None 494: 489(fvec3) ExtInst 1(GLSL.std.450) 68(Cross) 491 493
BranchConditional 494 496 506 495: 6(float) CompositeExtract 494 0
496: Label 496: 6(float) Load 196(f)
498: 18(int) Load 20(i) 497: 6(float) FAdd 496 495
499: 6(float) ConvertSToF 498 Store 196(f) 497
500: 7(fvec4) CompositeConstruct 499 499 499 499 498: 6(float) Load 196(f)
501: 6(float) Load 196(f) 499: 6(float) Load 220(uf)
502: 7(fvec4) CompositeConstruct 501 501 501 501 500: 186(bool) FOrdEqual 498 499
503: 7(fvec4) FAdd 500 502 501: 186(bool) LogicalNot 500
504: 7(fvec4) Load 9(v) SelectionMerge 503 None
505: 7(fvec4) FAdd 503 504 BranchConditional 501 502 503
Store 495 505 502: Label
Branch 497 504: 6(float) Load 196(f)
506: Label 505: 6(float) Load 220(uf)
507: 7(fvec4) Load 9(v) 506: 186(bool) FOrdNotEqual 504 505
Store 495 507 507: 6(float) Load 196(f)
Branch 497 509: 186(bool) FOrdNotEqual 507 508
497: Label 510: 186(bool) LogicalAnd 506 509
508: 7(fvec4) Load 495 Branch 503
Store 493(FragColor) 508 503: Label
Store 511(m1) 517 511: 186(bool) Phi 500 457 510 502
Store 518(m2) 520 SelectionMerge 513 None
521: 186(bool) Load 313(b) BranchConditional 511 512 513
SelectionMerge 524 None 512: Label
BranchConditional 521 523 526 514: 6(float) Load 196(f)
523: Label 516: 6(float) FAdd 514 515
525: 509 Load 511(m1) Store 196(f) 516
Store 522 525 Branch 513
Branch 524 513: Label
526: Label 517: 18(int) Load 22(ui)
527: 509 Load 518(m2) 518: 18(int) Load 20(i)
Store 522 527 519: 18(int) BitwiseAnd 518 517
Branch 524 Store 20(i) 519
524: Label 521: 18(int) Load 20(i)
528: 8(ptr) AccessChain 522 413 522: 18(int) BitwiseOr 521 520
529: 7(fvec4) Load 528 Store 20(i) 522
530: 7(fvec4) Load 493(FragColor) 523: 18(int) Load 22(ui)
531: 7(fvec4) FAdd 530 529 524: 18(int) Load 20(i)
Store 493(FragColor) 531 525: 18(int) BitwiseXor 524 523
Store 20(i) 525
527: 18(int) Load 20(i)
528: 18(int) SMod 527 526
Store 20(i) 528
529: 18(int) Load 20(i)
530: 18(int) ShiftRightArithmetic 529 452
Store 20(i) 530
531: 18(int) Load 22(ui)
532: 18(int) Load 20(i)
533: 18(int) ShiftLeftLogical 532 531
Store 20(i) 533
534: 18(int) Load 20(i)
535: 18(int) Not 534
Store 20(i) 535
536: 186(bool) Load 359(b)
537: 186(bool) LogicalNot 536
Store 359(b) 537
540: 186(bool) Load 359(b)
SelectionMerge 543 None
BranchConditional 540 542 552
542: Label
544: 18(int) Load 20(i)
545: 6(float) ConvertSToF 544
546: 7(fvec4) CompositeConstruct 545 545 545 545
547: 6(float) Load 196(f)
548: 7(fvec4) CompositeConstruct 547 547 547 547
549: 7(fvec4) FAdd 546 548
550: 7(fvec4) Load 9(v)
551: 7(fvec4) FAdd 549 550
Store 541 551
Branch 543
552: Label
553: 7(fvec4) Load 9(v)
Store 541 553
Branch 543
543: Label
554: 7(fvec4) Load 541
Store 539(FragColor) 554
Store 557(m1) 563
Store 564(m2) 566
567: 186(bool) Load 359(b)
SelectionMerge 570 None
BranchConditional 567 569 572
569: Label
571: 555 Load 557(m1)
Store 568 571
Branch 570
572: Label
573: 555 Load 564(m2)
Store 568 573
Branch 570
570: Label
574: 8(ptr) AccessChain 568 459
575: 7(fvec4) Load 574
576: 7(fvec4) Load 539(FragColor)
577: 7(fvec4) FAdd 576 575
Store 539(FragColor) 577
Return Return
FunctionEnd FunctionEnd

View File

@ -97,6 +97,13 @@ void main()
u += max(u, uui); u += max(u, uui);
u += clamp(u, uui, uui); u += clamp(u, uui, uui);
// multiple out operands
uvec4 msb;
uvec4 lsb;
umulExtended(uuv4.xyz, uuv4.xyz, msb.xyz, lsb.xyz);
u += msb.x + msb.y + msb.z;
u += lsb.x + lsb.y + lsb.z;
//// bool //// bool
b = isnan(uf); b = isnan(uf);
b = isinf(f); b = isinf(f);