HLSL: Implement switch/case/default.
This commit is contained in:
parent
2f47bc9781
commit
d02dc5d05a
7 changed files with 514 additions and 7 deletions
55
Test/hlsl.switch.frag
Normal file
55
Test/hlsl.switch.frag
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
float4 PixelShaderFunction(float4 input, int c, int d) : COLOR0
|
||||
{
|
||||
switch(c)
|
||||
{
|
||||
}
|
||||
|
||||
switch(c)
|
||||
{
|
||||
default:
|
||||
}
|
||||
|
||||
switch (c) {
|
||||
case 1:
|
||||
++input;
|
||||
break;
|
||||
case 2:
|
||||
--input;
|
||||
break;
|
||||
}
|
||||
|
||||
switch (c) {
|
||||
case 1:
|
||||
++input;
|
||||
break;
|
||||
case 2:
|
||||
switch (d) {
|
||||
case 2:
|
||||
input += 2.0;
|
||||
break;
|
||||
case 3:
|
||||
input += 3.0;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
input += 4.0;
|
||||
}
|
||||
|
||||
switch (c) {
|
||||
case 1:
|
||||
}
|
||||
|
||||
switch (c) {
|
||||
case 1:
|
||||
case 2:
|
||||
case 3:
|
||||
++input;
|
||||
break;
|
||||
case 4:
|
||||
case 5:
|
||||
--input;
|
||||
}
|
||||
|
||||
return input;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue