SPV: Emit OpSelect when a selection node is simple enough.

Also, ensures it has a type, no disallowed side effects,
or performance trade offs.
This commit is contained in:
John Kessenich 2017-01-26 20:31:11 -07:00
parent 509177d136
commit 433e9ff896
6 changed files with 321 additions and 322 deletions

View file

@ -3,7 +3,7 @@ Warning, version 450 is not yet complete; most version-specific features are pre
// Module Version 10000
// Generated by (magic number): 80001
// Id's are bound by 378
// Id's are bound by 374
Capability Shader
Capability SampledRect
@ -16,7 +16,7 @@ Warning, version 450 is not yet complete; most version-specific features are pre
Capability StorageImageWriteWithoutFormat
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 132 142 152 248 362 377
EntryPoint Fragment 4 "main" 132 142 152 248 362 373
ExecutionMode 4 OriginUpperLeft
Source GLSL 450
Name 4 "main"
@ -42,7 +42,7 @@ Warning, version 450 is not yet complete; most version-specific features are pre
Name 248 "value"
Name 357 "wo2D"
Name 362 "fragData"
Name 377 "ic4D"
Name 373 "ic4D"
Decorate 15(i1D) DescriptorSet 0
Decorate 15(i1D) Binding 0
Decorate 27(i2D) DescriptorSet 0
@ -76,7 +76,7 @@ Warning, version 450 is not yet complete; most version-specific features are pre
Decorate 357(wo2D) DescriptorSet 0
Decorate 357(wo2D) Binding 1
Decorate 357(wo2D) NonReadable
Decorate 377(ic4D) Flat
Decorate 373(ic4D) Flat
2: TypeVoid
3: TypeFunction 2
6: TypeInt 32 1
@ -163,16 +163,15 @@ Warning, version 450 is not yet complete; most version-specific features are pre
357(wo2D): 356(ptr) Variable UniformConstant
361: TypePointer Output 125(fvec4)
362(fragData): 361(ptr) Variable Output
368: TypeBool
375: TypeVector 6(int) 4
376: TypePointer Input 375(ivec4)
377(ic4D): 376(ptr) Variable Input
367: TypeBool
371: TypeVector 6(int) 4
372: TypePointer Input 371(ivec4)
373(ic4D): 372(ptr) Variable Input
4(main): 2 Function None 3
5: Label
9(iv): 8(ptr) Variable Function
127(v): 126(ptr) Variable Function
229(ui): 228(ptr) Variable Function
363: 126(ptr) Variable Function
Store 9(iv) 11
16: 13 Load 15(i1D)
17: 6(int) ImageQuerySize 16
@ -498,22 +497,13 @@ Warning, version 450 is not yet complete; most version-specific features are pre
359: 29(ivec2) Load 142(ic2D)
360: 125(fvec4) Load 127(v)
ImageWrite 358 359 360
364: 18(int) Load 229(ui)
365: 20(ptr) AccessChain 9(iv) 237
366: 6(int) Load 365
367: 18(int) Bitcast 366
369: 368(bool) INotEqual 364 367
SelectionMerge 371 None
BranchConditional 369 370 373
370: Label
372: 125(fvec4) Load 127(v)
Store 363 372
Branch 371
373: Label
Store 363 129
Branch 371
371: Label
374: 125(fvec4) Load 363
Store 362(fragData) 374
363: 18(int) Load 229(ui)
364: 20(ptr) AccessChain 9(iv) 237
365: 6(int) Load 364
366: 18(int) Bitcast 365
368: 367(bool) INotEqual 363 366
369: 125(fvec4) Load 127(v)
370: 125(fvec4) Select 368 369 129
Store 362(fragData) 370
Return
FunctionEnd