SPV: Implement Vulkan version of GLSL (KHR_vulkan_glsl).

This commit is contained in:
John Kessenich
2016-02-15 20:58:50 -07:00
parent 019f08fcd8
commit 6c292d3ba7
200 changed files with 7841 additions and 5577 deletions

View File

@@ -7,13 +7,13 @@ Linked fragment stage:
// Module Version 10000
// Generated by (magic number): 80001
// Id's are bound by 507
// Id's are bound by 509
Capability Shader
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 483
ExecutionMode 4 OriginLowerLeft
EntryPoint Fragment 4 "main" 11 22 212 288 485 503 508
ExecutionMode 4 OriginUpperLeft
Source GLSL 450
Name 4 "main"
Name 9 "v"
@@ -27,52 +27,56 @@ Linked fragment stage:
Name 288 "uui"
Name 305 "b"
Name 342 "ub42"
Name 483 "FragColor"
Name 501 "uiv4"
Name 503 "ub"
Name 506 "uuv4"
Name 485 "FragColor"
Name 503 "uiv4"
Name 505 "ub"
Name 508 "uuv4"
Decorate 22(ui) Flat
Decorate 288(uui) Flat
Decorate 503(uiv4) Flat
Decorate 508(uuv4) Flat
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32
7: TypeVector 6(float) 4
8: TypePointer Function 7(fvec4)
10: TypePointer UniformConstant 7(fvec4)
11(uv4): 10(ptr) Variable UniformConstant
10: TypePointer Input 7(fvec4)
11(uv4): 10(ptr) Variable Input
18: TypeInt 32 1
19: TypePointer Function 18(int)
21: TypePointer UniformConstant 18(int)
22(ui): 21(ptr) Variable UniformConstant
21: TypePointer Input 18(int)
22(ui): 21(ptr) Variable Input
141: TypeInt 32 0
142: 141(int) Constant 0
143: TypePointer Function 6(float)
178: TypeBool
179: TypeVector 178(bool) 4
180: TypePointer UniformConstant 179(bvec4)
181(ub41): 180(ptr) Variable UniformConstant
211: TypePointer UniformConstant 6(float)
212(uf): 211(ptr) Variable UniformConstant
180: TypePointer Private 179(bvec4)
181(ub41): 180(ptr) Variable Private
211: TypePointer Input 6(float)
212(uf): 211(ptr) Variable Input
284: TypePointer Function 141(int)
287: TypePointer UniformConstant 141(int)
288(uui): 287(ptr) Variable UniformConstant
287: TypePointer Input 141(int)
288(uui): 287(ptr) Variable Input
304: TypePointer Function 178(bool)
342(ub42): 180(ptr) Variable UniformConstant
396: 18(int) Constant 2
403: 18(int) Constant 1
433: TypeVector 6(float) 3
452: 6(float) Constant 1073741824
459: 6(float) Constant 1065353216
464: 18(int) Constant 66
470: 18(int) Constant 17
482: TypePointer Output 7(fvec4)
483(FragColor): 482(ptr) Variable Output
499: TypeVector 18(int) 4
500: TypePointer UniformConstant 499(ivec4)
501(uiv4): 500(ptr) Variable UniformConstant
502: TypePointer UniformConstant 178(bool)
503(ub): 502(ptr) Variable UniformConstant
504: TypeVector 141(int) 4
505: TypePointer UniformConstant 504(ivec4)
506(uuv4): 505(ptr) Variable UniformConstant
342(ub42): 180(ptr) Variable Private
398: 18(int) Constant 2
405: 18(int) Constant 1
435: TypeVector 6(float) 3
454: 6(float) Constant 1073741824
461: 6(float) Constant 1065353216
466: 18(int) Constant 66
472: 18(int) Constant 17
484: TypePointer Output 7(fvec4)
485(FragColor): 484(ptr) Variable Output
501: TypeVector 18(int) 4
502: TypePointer Input 501(ivec4)
503(uiv4): 502(ptr) Variable Input
504: TypePointer Private 178(bool)
505(ub): 504(ptr) Variable Private
506: TypeVector 141(int) 4
507: TypePointer Input 506(ivec4)
508(uuv4): 507(ptr) Variable Input
4(main): 2 Function None 3
5: Label
9(v): 8(ptr) Variable Function
@@ -80,7 +84,7 @@ Linked fragment stage:
188(f): 143(ptr) Variable Function
285(u): 284(ptr) Variable Function
305(b): 304(ptr) Variable Function
484: 8(ptr) Variable Function
486: 8(ptr) Variable Function
12: 7(fvec4) Load 11(uv4)
13: 7(fvec4) ExtInst 1(GLSL.std.450) 11(Radians) 12
Store 9(v) 13
@@ -529,137 +533,142 @@ Linked fragment stage:
388: 18(int) Load 20(i)
389: 18(int) Load 22(ui)
390: 178(bool) INotEqual 388 389
391: 18(int) Load 20(i)
392: 18(int) Load 22(ui)
393: 178(bool) IEqual 391 392
394: 178(bool) LogicalAnd 390 393
395: 18(int) Load 20(i)
397: 178(bool) INotEqual 395 396
398: 178(bool) LogicalNotEqual 394 397
SelectionMerge 392 None
BranchConditional 390 391 392
391: Label
393: 18(int) Load 20(i)
394: 18(int) Load 22(ui)
395: 178(bool) IEqual 393 394
Branch 392
392: Label
396: 178(bool) Phi 390 386 395 391
397: 18(int) Load 20(i)
399: 178(bool) INotEqual 397 398
400: 178(bool) LogicalNotEqual 396 399
Branch 387
387: Label
399: 178(bool) Phi 384 365 398 386
SelectionMerge 401 None
BranchConditional 399 400 401
400: Label
402: 18(int) Load 20(i)
404: 18(int) IAdd 402 403
Store 20(i) 404
Branch 401
401: Label
405: 6(float) Load 212(uf)
406: 6(float) Load 212(uf)
407: 6(float) FAdd 405 406
401: 178(bool) Phi 384 365 400 392
SelectionMerge 403 None
BranchConditional 401 402 403
402: Label
404: 18(int) Load 20(i)
406: 18(int) IAdd 404 405
Store 20(i) 406
Branch 403
403: Label
407: 6(float) Load 212(uf)
408: 6(float) Load 212(uf)
409: 6(float) FMul 407 408
409: 6(float) FAdd 407 408
410: 6(float) Load 212(uf)
411: 6(float) FSub 409 410
411: 6(float) FMul 409 410
412: 6(float) Load 212(uf)
413: 6(float) FDiv 411 412
Store 188(f) 413
414: 7(fvec4) Load 9(v)
415: 6(float) ExtInst 1(GLSL.std.450) 66(Length) 414
416: 6(float) Load 188(f)
417: 6(float) FAdd 416 415
Store 188(f) 417
418: 7(fvec4) Load 9(v)
419: 7(fvec4) Load 9(v)
420: 6(float) ExtInst 1(GLSL.std.450) 67(Distance) 418 419
421: 6(float) Load 188(f)
422: 6(float) FAdd 421 420
Store 188(f) 422
423: 7(fvec4) Load 9(v)
424: 7(fvec4) Load 9(v)
425: 6(float) Dot 423 424
426: 6(float) Load 188(f)
427: 6(float) FAdd 426 425
Store 188(f) 427
413: 6(float) FSub 411 412
414: 6(float) Load 212(uf)
415: 6(float) FDiv 413 414
Store 188(f) 415
416: 7(fvec4) Load 9(v)
417: 6(float) ExtInst 1(GLSL.std.450) 66(Length) 416
418: 6(float) Load 188(f)
419: 6(float) FAdd 418 417
Store 188(f) 419
420: 7(fvec4) Load 9(v)
421: 7(fvec4) Load 9(v)
422: 6(float) ExtInst 1(GLSL.std.450) 67(Distance) 420 421
423: 6(float) Load 188(f)
424: 6(float) FAdd 423 422
Store 188(f) 424
425: 7(fvec4) Load 9(v)
426: 7(fvec4) Load 9(v)
427: 6(float) Dot 425 426
428: 6(float) Load 188(f)
429: 6(float) Load 212(uf)
430: 6(float) FMul 428 429
431: 6(float) Load 188(f)
432: 6(float) FAdd 431 430
Store 188(f) 432
434: 7(fvec4) Load 9(v)
435: 433(fvec3) VectorShuffle 434 434 0 1 2
429: 6(float) FAdd 428 427
Store 188(f) 429
430: 6(float) Load 188(f)
431: 6(float) Load 212(uf)
432: 6(float) FMul 430 431
433: 6(float) Load 188(f)
434: 6(float) FAdd 433 432
Store 188(f) 434
436: 7(fvec4) Load 9(v)
437: 433(fvec3) VectorShuffle 436 436 0 1 2
438: 433(fvec3) ExtInst 1(GLSL.std.450) 68(Cross) 435 437
439: 6(float) CompositeExtract 438 0
440: 6(float) Load 188(f)
441: 6(float) FAdd 440 439
Store 188(f) 441
437: 435(fvec3) VectorShuffle 436 436 0 1 2
438: 7(fvec4) Load 9(v)
439: 435(fvec3) VectorShuffle 438 438 0 1 2
440: 435(fvec3) ExtInst 1(GLSL.std.450) 68(Cross) 437 439
441: 6(float) CompositeExtract 440 0
442: 6(float) Load 188(f)
443: 6(float) Load 212(uf)
444: 178(bool) FOrdEqual 442 443
445: 178(bool) LogicalNot 444
SelectionMerge 447 None
BranchConditional 445 446 447
446: Label
448: 6(float) Load 188(f)
449: 6(float) Load 212(uf)
450: 178(bool) FOrdNotEqual 448 449
451: 6(float) Load 188(f)
453: 178(bool) FOrdNotEqual 451 452
454: 178(bool) LogicalAnd 450 453
Branch 447
447: Label
455: 178(bool) Phi 444 401 454 446
SelectionMerge 457 None
BranchConditional 455 456 457
456: Label
458: 6(float) Load 188(f)
460: 6(float) FAdd 458 459
Store 188(f) 460
Branch 457
457: Label
461: 18(int) Load 22(ui)
462: 18(int) Load 20(i)
463: 18(int) BitwiseAnd 462 461
Store 20(i) 463
465: 18(int) Load 20(i)
466: 18(int) BitwiseOr 465 464
Store 20(i) 466
467: 18(int) Load 22(ui)
468: 18(int) Load 20(i)
469: 18(int) BitwiseXor 468 467
Store 20(i) 469
471: 18(int) Load 20(i)
472: 18(int) SMod 471 470
Store 20(i) 472
443: 6(float) FAdd 442 441
Store 188(f) 443
444: 6(float) Load 188(f)
445: 6(float) Load 212(uf)
446: 178(bool) FOrdEqual 444 445
447: 178(bool) LogicalNot 446
SelectionMerge 449 None
BranchConditional 447 448 449
448: Label
450: 6(float) Load 188(f)
451: 6(float) Load 212(uf)
452: 178(bool) FOrdNotEqual 450 451
453: 6(float) Load 188(f)
455: 178(bool) FOrdNotEqual 453 454
456: 178(bool) LogicalAnd 452 455
Branch 449
449: Label
457: 178(bool) Phi 446 403 456 448
SelectionMerge 459 None
BranchConditional 457 458 459
458: Label
460: 6(float) Load 188(f)
462: 6(float) FAdd 460 461
Store 188(f) 462
Branch 459
459: Label
463: 18(int) Load 22(ui)
464: 18(int) Load 20(i)
465: 18(int) BitwiseAnd 464 463
Store 20(i) 465
467: 18(int) Load 20(i)
468: 18(int) BitwiseOr 467 466
Store 20(i) 468
469: 18(int) Load 22(ui)
470: 18(int) Load 20(i)
471: 18(int) BitwiseXor 470 469
Store 20(i) 471
473: 18(int) Load 20(i)
474: 18(int) ShiftRightArithmetic 473 396
474: 18(int) SMod 473 472
Store 20(i) 474
475: 18(int) Load 22(ui)
476: 18(int) Load 20(i)
477: 18(int) ShiftLeftLogical 476 475
Store 20(i) 477
475: 18(int) Load 20(i)
476: 18(int) ShiftRightArithmetic 475 398
Store 20(i) 476
477: 18(int) Load 22(ui)
478: 18(int) Load 20(i)
479: 18(int) Not 478
479: 18(int) ShiftLeftLogical 478 477
Store 20(i) 479
480: 178(bool) Load 305(b)
481: 178(bool) LogicalNot 480
Store 305(b) 481
485: 178(bool) Load 305(b)
SelectionMerge 487 None
BranchConditional 485 486 496
486: Label
488: 18(int) Load 20(i)
489: 6(float) ConvertSToF 488
490: 7(fvec4) CompositeConstruct 489 489 489 489
491: 6(float) Load 188(f)
480: 18(int) Load 20(i)
481: 18(int) Not 480
Store 20(i) 481
482: 178(bool) Load 305(b)
483: 178(bool) LogicalNot 482
Store 305(b) 483
487: 178(bool) Load 305(b)
SelectionMerge 489 None
BranchConditional 487 488 498
488: Label
490: 18(int) Load 20(i)
491: 6(float) ConvertSToF 490
492: 7(fvec4) CompositeConstruct 491 491 491 491
493: 7(fvec4) FAdd 490 492
494: 7(fvec4) Load 9(v)
495: 7(fvec4) FAdd 493 494
Store 484 495
Branch 487
496: Label
497: 7(fvec4) Load 9(v)
Store 484 497
Branch 487
487: Label
498: 7(fvec4) Load 484
Store 483(FragColor) 498
493: 6(float) Load 188(f)
494: 7(fvec4) CompositeConstruct 493 493 493 493
495: 7(fvec4) FAdd 492 494
496: 7(fvec4) Load 9(v)
497: 7(fvec4) FAdd 495 496
Store 486 497
Branch 489
498: Label
499: 7(fvec4) Load 9(v)
Store 486 499
Branch 489
489: Label
500: 7(fvec4) Load 486
Store 485(FragColor) 500
Return
FunctionEnd