HLSL: Implement ?: grammar productions.
Missing are implicit conversions between int/bool/etc.
This commit is contained in:
parent
b783d712ab
commit
00957f8110
5 changed files with 423 additions and 7 deletions
16
Test/hlsl.conditional.frag
Normal file
16
Test/hlsl.conditional.frag
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
float4 PixelShaderFunction(float4 input) : COLOR0
|
||||
{
|
||||
int a = 1 < 2 ? 3 < 4 ? 5 : 6 : 7;
|
||||
int b = 1 < 2 ? 3 > 4 ? 5 : 6 : 7;
|
||||
int c = 1 > 2 ? 3 > 4 ? 5 : 6 : 7;
|
||||
int d = 1 > 2 ? 3 < 4 ? 5 : 6 : 7;
|
||||
float4 ret = a * input +
|
||||
b * input +
|
||||
c * input +
|
||||
d * input;
|
||||
int e;
|
||||
e = a = b ? c = d : 10, b = a ? d = c : 11;
|
||||
float4 f;
|
||||
f = ret.x < input.y ? c * input : d * input;
|
||||
return e * ret + f;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue