HLSL: Fix #1249: Always execute both sides of ternary "?:".

This is semantically required by HLSL, and frequently results in using
OpSelect instead of control flow.
This commit is contained in:
John Kessenich 2018-02-20 21:29:05 -07:00
parent a5cae08259
commit 4bee531fc1
17 changed files with 776 additions and 850 deletions

View file

@ -135,13 +135,13 @@ void main()
77: TypePointer Uniform 7(int)
106: 7(int) Constant 10
111: 7(int) Constant 1
114: TypePointer Output 10(float)
117: 10(float) Constant 1092616192
113: TypePointer Output 10(float)
116: 10(float) Constant 1092616192
5(main): 3 Function None 4
6: Label
59(param): 58(ptr) Variable Function
99(i): 19(ptr) Variable Function
113: 16(ptr) Variable Function
118: 16(ptr) Variable Function
Line 1 30 0
61: 60(ptr) AccessChain 56 18
62: 53(S) Load 61
@ -216,24 +216,24 @@ void main()
Branch 100
102: Label
Line 1 49 0
115: 114(ptr) AccessChain 52(outv) 32
116: 10(float) Load 115
118: 37(bool) FOrdLessThan 116 117
114: 113(ptr) AccessChain 52(outv) 32
115: 10(float) Load 114
117: 37(bool) FOrdLessThan 115 116
SelectionMerge 120 None
BranchConditional 118 119 123
BranchConditional 117 119 123
119: Label
Line 1 50 0
121: 11(fvec4) Load 52(outv)
122: 11(fvec4) ExtInst 2(GLSL.std.450) 13(Sin) 121
Store 52(outv) 122
Store 113 122
Store 118 122
Branch 120
123: Label
Line 1 51 0
124: 11(fvec4) Load 52(outv)
125: 11(fvec4) ExtInst 2(GLSL.std.450) 14(Cos) 124
Store 52(outv) 125
Store 113 125
Store 118 125
Branch 120
120: Label
Return