From 4d2298bfd78a82f77f2325c4ade096ccdab1f00d Mon Sep 17 00:00:00 2001 From: Cody Northrop Date: Mon, 13 Apr 2020 21:59:49 -0600 Subject: [PATCH] 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 --- SPIRV/GlslangToSpv.cpp | 24 +- Test/baseResults/spv.Operations.frag.out | 680 +++++++++++++++++-------------- Test/spv.Operations.frag | 7 + 3 files changed, 387 insertions(+), 324 deletions(-) diff --git a/SPIRV/GlslangToSpv.cpp b/SPIRV/GlslangToSpv.cpp index 51a7618..071dad3 100644 --- a/SPIRV/GlslangToSpv.cpp +++ b/SPIRV/GlslangToSpv.cpp @@ -2357,10 +2357,10 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt spec_constant_op_mode_setter.turnOnSpecConstantOpMode(); spv::Id result = spv::NoResult; - 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, - // for at out parameter - spv::Id temporaryLvalue = spv::NoResult; // temporary to pass, as proxy for complexLValue + spv::Id invertedType = spv::NoType; // to use to override the natural type of the node + std::vector complexLvalues; // for holding swizzling l-values too complex for + // SPIR-V, for an out parameter + std::vector temporaryLvalues; // temporaries to pass, as proxies for complexLValues auto resultType = [&invertedType, &node, this](){ return invertedType != spv::NoType ? 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 // receive the result, and must later swizzle that into the original // l-value. - complexLvalue = builder.getAccessChain(); - temporaryLvalue = builder.createVariable(spv::StorageClassFunction, - builder.accessChainGetInferredType(), "swizzleTemp"); - operands.push_back(temporaryLvalue); + complexLvalues.push_back(builder.getAccessChain()); + temporaryLvalues.push_back(builder.createVariable(spv::StorageClassFunction, + builder.accessChainGetInferredType(), "swizzleTemp")); + operands.push_back(temporaryLvalues.back()); } else { 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()); break; } + if (invertedType != spv::NoResult) result = createInvertedSwizzle(precision, *glslangOperands[0]->getAsBinaryNode(), result); - else if (temporaryLvalue != spv::NoResult) { - builder.setAccessChain(complexLvalue); - builder.accessChainStore(builder.createLoad(temporaryLvalue)); + + for (unsigned int i = 0; i < temporaryLvalues.size(); ++i) { + builder.setAccessChain(complexLvalues[i]); + builder.accessChainStore(builder.createLoad(temporaryLvalues[i])); } } diff --git a/Test/baseResults/spv.Operations.frag.out b/Test/baseResults/spv.Operations.frag.out index 77f345a..ad54f6c 100644 --- a/Test/baseResults/spv.Operations.frag.out +++ b/Test/baseResults/spv.Operations.frag.out @@ -1,12 +1,12 @@ spv.Operations.frag // Module Version 10000 // Generated by (magic number): 80008 -// Id's are bound by 540 +// Id's are bound by 583 Capability Shader 1: ExtInstImport "GLSL.std.450" 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 Source GLSL 450 Name 4 "main" @@ -20,18 +20,23 @@ spv.Operations.frag Name 220 "uf" Name 293 "u" Name 296 "uui" - Name 313 "b" - Name 350 "ub42" - Name 493 "FragColor" - Name 511 "m1" - Name 518 "m2" - Name 534 "uiv4" - Name 536 "ub" - Name 539 "uuv4" + Name 314 "uuv4" + Name 321 "msb" + Name 323 "swizzleTemp" + Name 324 "lsb" + Name 325 "swizzleTemp" + Name 326 "ResType" + Name 359 "b" + Name 396 "ub42" + Name 539 "FragColor" + Name 557 "m1" + Name 564 "m2" + Name 580 "uiv4" + Name 582 "ub" Decorate 22(ui) Flat Decorate 296(uui) Flat - Decorate 534(uiv4) Flat - Decorate 539(uuv4) Flat + Decorate 314(uuv4) Flat + Decorate 580(uiv4) Flat 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 @@ -55,35 +60,41 @@ spv.Operations.frag 292: TypePointer Function 141(int) 295: TypePointer Input 141(int) 296(uui): 295(ptr) Variable Input - 312: TypePointer Function 186(bool) - 350(ub42): 188(ptr) Variable Private - 406: 18(int) Constant 2 - 413: 18(int) Constant 1 - 443: TypeVector 6(float) 3 - 462: 6(float) Constant 1073741824 - 469: 6(float) Constant 1065353216 - 474: 18(int) Constant 66 - 480: 18(int) Constant 17 - 492: TypePointer Output 7(fvec4) - 493(FragColor): 492(ptr) Variable Output - 509: TypeMatrix 7(fvec4) 4 - 510: TypePointer Function 509 - 512: 6(float) Constant 0 - 513: 7(fvec4) ConstantComposite 469 512 512 512 - 514: 7(fvec4) ConstantComposite 512 469 512 512 - 515: 7(fvec4) ConstantComposite 512 512 469 512 - 516: 7(fvec4) ConstantComposite 512 512 512 469 - 517: 509 ConstantComposite 513 514 515 516 - 519: 7(fvec4) ConstantComposite 512 512 512 512 - 520: 509 ConstantComposite 519 519 519 519 - 532: TypeVector 18(int) 4 - 533: TypePointer Input 532(ivec4) - 534(uiv4): 533(ptr) Variable Input - 535: TypePointer Private 186(bool) - 536(ub): 535(ptr) Variable Private - 537: TypeVector 141(int) 4 - 538: TypePointer Input 537(ivec4) - 539(uuv4): 538(ptr) Variable Input + 312: TypeVector 141(int) 4 + 313: TypePointer Input 312(ivec4) + 314(uuv4): 313(ptr) Variable Input + 315: TypeVector 141(int) 3 + 320: TypePointer Function 312(ivec4) + 322: TypePointer Function 315(ivec3) + 326(ResType): TypeStruct 315(ivec3) 315(ivec3) + 338: 141(int) Constant 1 + 342: 141(int) Constant 2 + 358: TypePointer Function 186(bool) + 396(ub42): 188(ptr) Variable Private + 452: 18(int) Constant 2 + 459: 18(int) Constant 1 + 489: TypeVector 6(float) 3 + 508: 6(float) Constant 1073741824 + 515: 6(float) Constant 1065353216 + 520: 18(int) Constant 66 + 526: 18(int) Constant 17 + 538: TypePointer Output 7(fvec4) + 539(FragColor): 538(ptr) Variable Output + 555: TypeMatrix 7(fvec4) 4 + 556: TypePointer Function 555 + 558: 6(float) Constant 0 + 559: 7(fvec4) ConstantComposite 515 558 558 558 + 560: 7(fvec4) ConstantComposite 558 515 558 558 + 561: 7(fvec4) ConstantComposite 558 558 515 558 + 562: 7(fvec4) ConstantComposite 558 558 558 515 + 563: 555 ConstantComposite 559 560 561 562 + 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 5: Label 9(v): 8(ptr) Variable Function @@ -91,11 +102,15 @@ spv.Operations.frag 155(swizzleTemp): 8(ptr) Variable Function 196(f): 143(ptr) Variable Function 293(u): 292(ptr) Variable Function - 313(b): 312(ptr) Variable Function - 495: 8(ptr) Variable Function - 511(m1): 510(ptr) Variable Function - 518(m2): 510(ptr) Variable Function - 522: 510(ptr) Variable Function + 321(msb): 320(ptr) Variable Function +323(swizzleTemp): 322(ptr) Variable Function + 324(lsb): 320(ptr) Variable Function +325(swizzleTemp): 322(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) 13: 7(fvec4) ExtInst 1(GLSL.std.450) 11(Radians) 12 Store 9(v) 13 @@ -437,277 +452,316 @@ spv.Operations.frag 310: 141(int) Load 293(u) 311: 141(int) IAdd 310 309 Store 293(u) 311 - 314: 6(float) Load 220(uf) - 315: 186(bool) IsNan 314 - Store 313(b) 315 - 316: 6(float) Load 196(f) - 317: 186(bool) IsInf 316 - Store 313(b) 317 - 318: 7(fvec4) Load 9(v) - 319: 7(fvec4) Load 11(uv4) - 320: 187(bvec4) FOrdLessThan 318 319 - 321: 186(bool) Any 320 - Store 313(b) 321 - 322: 186(bool) Load 313(b) - SelectionMerge 324 None - BranchConditional 322 323 324 - 323: Label - 325: 7(fvec4) Load 9(v) - 326: 7(fvec4) Load 11(uv4) - 327: 187(bvec4) FOrdLessThanEqual 325 326 - 328: 186(bool) Any 327 - Branch 324 - 324: Label - 329: 186(bool) Phi 322 5 328 323 - Store 313(b) 329 - 330: 186(bool) Load 313(b) - SelectionMerge 332 None - BranchConditional 330 331 332 - 331: Label - 333: 7(fvec4) Load 9(v) - 334: 7(fvec4) Load 11(uv4) - 335: 187(bvec4) FOrdGreaterThan 333 334 - 336: 186(bool) Any 335 - Branch 332 - 332: Label - 337: 186(bool) Phi 330 324 336 331 - Store 313(b) 337 - 338: 186(bool) Load 313(b) - SelectionMerge 340 None - BranchConditional 338 339 340 - 339: Label - 341: 7(fvec4) Load 9(v) - 342: 7(fvec4) Load 11(uv4) - 343: 187(bvec4) FOrdGreaterThanEqual 341 342 - 344: 186(bool) Any 343 - Branch 340 - 340: Label - 345: 186(bool) Phi 338 332 344 339 - Store 313(b) 345 - 346: 186(bool) Load 313(b) - SelectionMerge 348 None - BranchConditional 346 347 348 - 347: Label - 349: 187(bvec4) Load 189(ub41) - 351: 187(bvec4) Load 350(ub42) - 352: 187(bvec4) LogicalEqual 349 351 - 353: 186(bool) Any 352 - Branch 348 - 348: Label - 354: 186(bool) Phi 346 340 353 347 - Store 313(b) 354 - 355: 186(bool) Load 313(b) - SelectionMerge 357 None - BranchConditional 355 356 357 - 356: Label - 358: 187(bvec4) Load 189(ub41) - 359: 187(bvec4) Load 350(ub42) - 360: 187(bvec4) LogicalNotEqual 358 359 - 361: 186(bool) Any 360 - Branch 357 - 357: Label - 362: 186(bool) Phi 355 348 361 356 - Store 313(b) 362 - 363: 186(bool) Load 313(b) - 364: 187(bvec4) Load 189(ub41) - 365: 186(bool) Any 364 - 366: 186(bool) LogicalAnd 363 365 - Store 313(b) 366 - 367: 186(bool) Load 313(b) - 368: 187(bvec4) Load 189(ub41) - 369: 186(bool) All 368 - 370: 186(bool) LogicalAnd 367 369 - Store 313(b) 370 - 371: 186(bool) Load 313(b) - SelectionMerge 373 None - BranchConditional 371 372 373 - 372: Label - 374: 187(bvec4) Load 189(ub41) - 375: 187(bvec4) LogicalNot 374 - 376: 186(bool) Any 375 - Branch 373 - 373: Label - 377: 186(bool) Phi 371 357 376 372 - Store 313(b) 377 - 378: 18(int) Load 20(i) - 379: 18(int) Load 22(ui) - 380: 18(int) IAdd 378 379 - 381: 18(int) Load 20(i) - 382: 18(int) IMul 380 381 - 383: 18(int) Load 22(ui) - 384: 18(int) ISub 382 383 - 385: 18(int) Load 20(i) - 386: 18(int) SDiv 384 385 - Store 20(i) 386 - 387: 18(int) Load 20(i) - 388: 18(int) Load 22(ui) - 389: 18(int) SMod 387 388 - Store 20(i) 389 - 390: 18(int) Load 20(i) - 391: 18(int) Load 22(ui) - 392: 186(bool) IEqual 390 391 - 393: 186(bool) LogicalNot 392 - SelectionMerge 395 None - BranchConditional 393 394 395 - 394: Label - 396: 18(int) Load 20(i) - 397: 18(int) Load 22(ui) - 398: 186(bool) INotEqual 396 397 - SelectionMerge 400 None - BranchConditional 398 399 400 - 399: Label - 401: 18(int) Load 20(i) - 402: 18(int) Load 22(ui) - 403: 186(bool) IEqual 401 402 - Branch 400 - 400: Label - 404: 186(bool) Phi 398 394 403 399 - 405: 18(int) Load 20(i) - 407: 186(bool) INotEqual 405 406 - 408: 186(bool) LogicalNotEqual 404 407 - Branch 395 - 395: Label - 409: 186(bool) Phi 392 373 408 400 - SelectionMerge 411 None - BranchConditional 409 410 411 - 410: Label - 412: 18(int) Load 20(i) - 414: 18(int) IAdd 412 413 - Store 20(i) 414 - Branch 411 - 411: Label - 415: 6(float) Load 220(uf) - 416: 6(float) Load 220(uf) - 417: 6(float) FAdd 415 416 - 418: 6(float) Load 220(uf) - 419: 6(float) FMul 417 418 - 420: 6(float) Load 220(uf) - 421: 6(float) FSub 419 420 - 422: 6(float) Load 220(uf) - 423: 6(float) FDiv 421 422 - Store 196(f) 423 - 424: 7(fvec4) Load 9(v) - 425: 6(float) ExtInst 1(GLSL.std.450) 66(Length) 424 - 426: 6(float) Load 196(f) - 427: 6(float) FAdd 426 425 - Store 196(f) 427 - 428: 7(fvec4) Load 9(v) - 429: 7(fvec4) Load 9(v) - 430: 6(float) ExtInst 1(GLSL.std.450) 67(Distance) 428 429 - 431: 6(float) Load 196(f) - 432: 6(float) FAdd 431 430 - Store 196(f) 432 - 433: 7(fvec4) Load 9(v) - 434: 7(fvec4) Load 9(v) - 435: 6(float) Dot 433 434 - 436: 6(float) Load 196(f) - 437: 6(float) FAdd 436 435 - Store 196(f) 437 - 438: 6(float) Load 196(f) - 439: 6(float) Load 220(uf) - 440: 6(float) FMul 438 439 - 441: 6(float) Load 196(f) - 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 + 316: 312(ivec4) Load 314(uuv4) + 317: 315(ivec3) VectorShuffle 316 316 0 1 2 + 318: 312(ivec4) Load 314(uuv4) + 319: 315(ivec3) VectorShuffle 318 318 0 1 2 + 327:326(ResType) UMulExtended 317 319 + 328: 315(ivec3) CompositeExtract 327 0 + Store 325(swizzleTemp) 328 + 329: 315(ivec3) CompositeExtract 327 1 + Store 323(swizzleTemp) 329 + 330: 315(ivec3) Load 323(swizzleTemp) + 331: 312(ivec4) Load 321(msb) + 332: 312(ivec4) VectorShuffle 331 330 4 5 6 3 + Store 321(msb) 332 + 333: 315(ivec3) Load 325(swizzleTemp) + 334: 312(ivec4) Load 324(lsb) + 335: 312(ivec4) VectorShuffle 334 333 4 5 6 3 + Store 324(lsb) 335 + 336: 292(ptr) AccessChain 321(msb) 142 + 337: 141(int) Load 336 + 339: 292(ptr) AccessChain 321(msb) 338 + 340: 141(int) Load 339 + 341: 141(int) IAdd 337 340 + 343: 292(ptr) AccessChain 321(msb) 342 + 344: 141(int) Load 343 + 345: 141(int) IAdd 341 344 + 346: 141(int) Load 293(u) + 347: 141(int) IAdd 346 345 + Store 293(u) 347 + 348: 292(ptr) AccessChain 324(lsb) 142 + 349: 141(int) Load 348 + 350: 292(ptr) AccessChain 324(lsb) 338 + 351: 141(int) Load 350 + 352: 141(int) IAdd 349 351 + 353: 292(ptr) AccessChain 324(lsb) 342 + 354: 141(int) Load 353 + 355: 141(int) IAdd 352 354 + 356: 141(int) Load 293(u) + 357: 141(int) IAdd 356 355 + Store 293(u) 357 + 360: 6(float) Load 220(uf) + 361: 186(bool) IsNan 360 + Store 359(b) 361 + 362: 6(float) Load 196(f) + 363: 186(bool) IsInf 362 + Store 359(b) 363 + 364: 7(fvec4) Load 9(v) + 365: 7(fvec4) Load 11(uv4) + 366: 187(bvec4) FOrdLessThan 364 365 + 367: 186(bool) Any 366 + Store 359(b) 367 + 368: 186(bool) Load 359(b) + SelectionMerge 370 None + BranchConditional 368 369 370 + 369: Label + 371: 7(fvec4) Load 9(v) + 372: 7(fvec4) Load 11(uv4) + 373: 187(bvec4) FOrdLessThanEqual 371 372 + 374: 186(bool) Any 373 + Branch 370 + 370: Label + 375: 186(bool) Phi 368 5 374 369 + Store 359(b) 375 + 376: 186(bool) Load 359(b) + SelectionMerge 378 None + BranchConditional 376 377 378 + 377: Label + 379: 7(fvec4) Load 9(v) + 380: 7(fvec4) Load 11(uv4) + 381: 187(bvec4) FOrdGreaterThan 379 380 + 382: 186(bool) Any 381 + Branch 378 + 378: Label + 383: 186(bool) Phi 376 370 382 377 + Store 359(b) 383 + 384: 186(bool) Load 359(b) + SelectionMerge 386 None + BranchConditional 384 385 386 + 385: Label + 387: 7(fvec4) Load 9(v) + 388: 7(fvec4) Load 11(uv4) + 389: 187(bvec4) FOrdGreaterThanEqual 387 388 + 390: 186(bool) Any 389 + Branch 386 + 386: Label + 391: 186(bool) Phi 384 378 390 385 + Store 359(b) 391 + 392: 186(bool) Load 359(b) + SelectionMerge 394 None + BranchConditional 392 393 394 + 393: Label + 395: 187(bvec4) Load 189(ub41) + 397: 187(bvec4) Load 396(ub42) + 398: 187(bvec4) LogicalEqual 395 397 + 399: 186(bool) Any 398 + Branch 394 + 394: Label + 400: 186(bool) Phi 392 386 399 393 + Store 359(b) 400 + 401: 186(bool) Load 359(b) + SelectionMerge 403 None + BranchConditional 401 402 403 + 402: Label + 404: 187(bvec4) Load 189(ub41) + 405: 187(bvec4) Load 396(ub42) + 406: 187(bvec4) LogicalNotEqual 404 405 + 407: 186(bool) Any 406 + Branch 403 + 403: Label + 408: 186(bool) Phi 401 394 407 402 + Store 359(b) 408 + 409: 186(bool) Load 359(b) + 410: 187(bvec4) Load 189(ub41) + 411: 186(bool) Any 410 + 412: 186(bool) LogicalAnd 409 411 + Store 359(b) 412 + 413: 186(bool) Load 359(b) + 414: 187(bvec4) Load 189(ub41) + 415: 186(bool) All 414 + 416: 186(bool) LogicalAnd 413 415 + Store 359(b) 416 + 417: 186(bool) Load 359(b) + SelectionMerge 419 None + BranchConditional 417 418 419 + 418: Label + 420: 187(bvec4) Load 189(ub41) + 421: 187(bvec4) LogicalNot 420 + 422: 186(bool) Any 421 + Branch 419 + 419: Label + 423: 186(bool) Phi 417 403 422 418 + Store 359(b) 423 + 424: 18(int) Load 20(i) + 425: 18(int) Load 22(ui) + 426: 18(int) IAdd 424 425 + 427: 18(int) Load 20(i) + 428: 18(int) IMul 426 427 + 429: 18(int) Load 22(ui) + 430: 18(int) ISub 428 429 + 431: 18(int) Load 20(i) + 432: 18(int) SDiv 430 431 + Store 20(i) 432 + 433: 18(int) Load 20(i) + 434: 18(int) Load 22(ui) + 435: 18(int) SMod 433 434 + Store 20(i) 435 + 436: 18(int) Load 20(i) + 437: 18(int) Load 22(ui) + 438: 186(bool) IEqual 436 437 + 439: 186(bool) LogicalNot 438 + SelectionMerge 441 None + BranchConditional 439 440 441 + 440: Label + 442: 18(int) Load 20(i) + 443: 18(int) Load 22(ui) + 444: 186(bool) INotEqual 442 443 + SelectionMerge 446 None + BranchConditional 444 445 446 + 445: Label + 447: 18(int) Load 20(i) + 448: 18(int) Load 22(ui) + 449: 186(bool) IEqual 447 448 + Branch 446 + 446: Label + 450: 186(bool) Phi 444 440 449 445 + 451: 18(int) Load 20(i) + 453: 186(bool) INotEqual 451 452 + 454: 186(bool) LogicalNotEqual 450 453 + Branch 441 + 441: Label + 455: 186(bool) Phi 438 419 454 446 SelectionMerge 457 None BranchConditional 455 456 457 456: Label - 458: 6(float) Load 196(f) - 459: 6(float) Load 220(uf) - 460: 186(bool) FOrdNotEqual 458 459 - 461: 6(float) Load 196(f) - 463: 186(bool) FOrdNotEqual 461 462 - 464: 186(bool) LogicalAnd 460 463 + 458: 18(int) Load 20(i) + 460: 18(int) IAdd 458 459 + Store 20(i) 460 Branch 457 457: Label - 465: 186(bool) Phi 454 411 464 456 - SelectionMerge 467 None - BranchConditional 465 466 467 - 466: Label - 468: 6(float) Load 196(f) - 470: 6(float) FAdd 468 469 - Store 196(f) 470 - Branch 467 - 467: Label - 471: 18(int) Load 22(ui) - 472: 18(int) Load 20(i) - 473: 18(int) BitwiseAnd 472 471 - Store 20(i) 473 - 475: 18(int) Load 20(i) - 476: 18(int) BitwiseOr 475 474 - Store 20(i) 476 - 477: 18(int) Load 22(ui) - 478: 18(int) Load 20(i) - 479: 18(int) BitwiseXor 478 477 - Store 20(i) 479 - 481: 18(int) Load 20(i) - 482: 18(int) SMod 481 480 - Store 20(i) 482 - 483: 18(int) Load 20(i) - 484: 18(int) ShiftRightArithmetic 483 406 - Store 20(i) 484 - 485: 18(int) Load 22(ui) - 486: 18(int) Load 20(i) - 487: 18(int) ShiftLeftLogical 486 485 - Store 20(i) 487 - 488: 18(int) Load 20(i) - 489: 18(int) Not 488 - Store 20(i) 489 - 490: 186(bool) Load 313(b) - 491: 186(bool) LogicalNot 490 - Store 313(b) 491 - 494: 186(bool) Load 313(b) - SelectionMerge 497 None - BranchConditional 494 496 506 - 496: Label - 498: 18(int) Load 20(i) - 499: 6(float) ConvertSToF 498 - 500: 7(fvec4) CompositeConstruct 499 499 499 499 - 501: 6(float) Load 196(f) - 502: 7(fvec4) CompositeConstruct 501 501 501 501 - 503: 7(fvec4) FAdd 500 502 - 504: 7(fvec4) Load 9(v) - 505: 7(fvec4) FAdd 503 504 - Store 495 505 - Branch 497 - 506: Label - 507: 7(fvec4) Load 9(v) - Store 495 507 - Branch 497 - 497: Label - 508: 7(fvec4) Load 495 - Store 493(FragColor) 508 - Store 511(m1) 517 - Store 518(m2) 520 - 521: 186(bool) Load 313(b) - SelectionMerge 524 None - BranchConditional 521 523 526 - 523: Label - 525: 509 Load 511(m1) - Store 522 525 - Branch 524 - 526: Label - 527: 509 Load 518(m2) - Store 522 527 - Branch 524 - 524: Label - 528: 8(ptr) AccessChain 522 413 - 529: 7(fvec4) Load 528 - 530: 7(fvec4) Load 493(FragColor) - 531: 7(fvec4) FAdd 530 529 - Store 493(FragColor) 531 + 461: 6(float) Load 220(uf) + 462: 6(float) Load 220(uf) + 463: 6(float) FAdd 461 462 + 464: 6(float) Load 220(uf) + 465: 6(float) FMul 463 464 + 466: 6(float) Load 220(uf) + 467: 6(float) FSub 465 466 + 468: 6(float) Load 220(uf) + 469: 6(float) FDiv 467 468 + Store 196(f) 469 + 470: 7(fvec4) Load 9(v) + 471: 6(float) ExtInst 1(GLSL.std.450) 66(Length) 470 + 472: 6(float) Load 196(f) + 473: 6(float) FAdd 472 471 + Store 196(f) 473 + 474: 7(fvec4) Load 9(v) + 475: 7(fvec4) Load 9(v) + 476: 6(float) ExtInst 1(GLSL.std.450) 67(Distance) 474 475 + 477: 6(float) Load 196(f) + 478: 6(float) FAdd 477 476 + Store 196(f) 478 + 479: 7(fvec4) Load 9(v) + 480: 7(fvec4) Load 9(v) + 481: 6(float) Dot 479 480 + 482: 6(float) Load 196(f) + 483: 6(float) FAdd 482 481 + Store 196(f) 483 + 484: 6(float) Load 196(f) + 485: 6(float) Load 220(uf) + 486: 6(float) FMul 484 485 + 487: 6(float) Load 196(f) + 488: 6(float) FAdd 487 486 + Store 196(f) 488 + 490: 7(fvec4) Load 9(v) + 491: 489(fvec3) VectorShuffle 490 490 0 1 2 + 492: 7(fvec4) Load 9(v) + 493: 489(fvec3) VectorShuffle 492 492 0 1 2 + 494: 489(fvec3) ExtInst 1(GLSL.std.450) 68(Cross) 491 493 + 495: 6(float) CompositeExtract 494 0 + 496: 6(float) Load 196(f) + 497: 6(float) FAdd 496 495 + Store 196(f) 497 + 498: 6(float) Load 196(f) + 499: 6(float) Load 220(uf) + 500: 186(bool) FOrdEqual 498 499 + 501: 186(bool) LogicalNot 500 + SelectionMerge 503 None + BranchConditional 501 502 503 + 502: Label + 504: 6(float) Load 196(f) + 505: 6(float) Load 220(uf) + 506: 186(bool) FOrdNotEqual 504 505 + 507: 6(float) Load 196(f) + 509: 186(bool) FOrdNotEqual 507 508 + 510: 186(bool) LogicalAnd 506 509 + Branch 503 + 503: Label + 511: 186(bool) Phi 500 457 510 502 + SelectionMerge 513 None + BranchConditional 511 512 513 + 512: Label + 514: 6(float) Load 196(f) + 516: 6(float) FAdd 514 515 + Store 196(f) 516 + Branch 513 + 513: Label + 517: 18(int) Load 22(ui) + 518: 18(int) Load 20(i) + 519: 18(int) BitwiseAnd 518 517 + Store 20(i) 519 + 521: 18(int) Load 20(i) + 522: 18(int) BitwiseOr 521 520 + Store 20(i) 522 + 523: 18(int) Load 22(ui) + 524: 18(int) Load 20(i) + 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 FunctionEnd diff --git a/Test/spv.Operations.frag b/Test/spv.Operations.frag index d34032d..3477a79 100644 --- a/Test/spv.Operations.frag +++ b/Test/spv.Operations.frag @@ -97,6 +97,13 @@ void main() u += max(u, 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 b = isnan(uf); b = isinf(f); -- 2.7.4