2024-01-31 12:10:29 -08:00
|
|
|
[pixel shader todo(sm<4)]
|
2023-09-20 02:53:36 -07:00
|
|
|
uint4 v;
|
|
|
|
|
|
|
|
float4 main() : sv_target
|
|
|
|
{
|
|
|
|
switch (v.x)
|
|
|
|
{
|
|
|
|
case 0:
|
|
|
|
return 3.0;
|
|
|
|
case 1:
|
|
|
|
return 4.0;
|
|
|
|
default:
|
|
|
|
return 5.0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
[test]
|
2024-01-31 12:10:29 -08:00
|
|
|
if(sm<4) uniform 0 float4 3 0 0 0
|
|
|
|
if(sm>=4) uniform 0 uint4 3 0 0 0
|
2024-10-03 06:46:07 -07:00
|
|
|
todo(sm<4) draw quad
|
2024-02-10 11:16:22 -08:00
|
|
|
probe (0, 0) rgba (5.0, 5.0, 5.0, 5.0)
|
2024-01-31 12:10:29 -08:00
|
|
|
if(sm<4) uniform 0 float4 1 0 0 0
|
|
|
|
if(sm>=4) uniform 0 uint4 1 0 0 0
|
2024-10-03 06:46:07 -07:00
|
|
|
todo(sm<4) draw quad
|
2024-02-10 11:16:22 -08:00
|
|
|
probe (0, 0) rgba (4.0, 4.0, 4.0, 4.0)
|
2024-01-31 12:10:29 -08:00
|
|
|
if(sm<4) uniform 0 float4 0 0 0 0
|
|
|
|
if(sm>=4) uniform 0 uint4 0 0 0 0
|
2024-10-03 06:46:07 -07:00
|
|
|
todo(sm<4) draw quad
|
2024-02-10 11:16:22 -08:00
|
|
|
probe (0, 0) rgba (3.0, 3.0, 3.0, 3.0)
|
2023-09-20 02:53:36 -07:00
|
|
|
|
2024-01-31 12:10:29 -08:00
|
|
|
|
2024-01-12 01:47:21 -08:00
|
|
|
% just a default case
|
2024-01-31 12:10:29 -08:00
|
|
|
[pixel shader todo(sm<4)]
|
2024-01-12 01:47:21 -08:00
|
|
|
uint4 v;
|
|
|
|
|
|
|
|
float4 main() : sv_target
|
|
|
|
{
|
|
|
|
switch (v.x)
|
|
|
|
{
|
|
|
|
default:
|
|
|
|
return 5.0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
[test]
|
2024-01-31 12:10:29 -08:00
|
|
|
if(sm<4) uniform 0 float4 3 0 0 0
|
|
|
|
if(sm>=4) uniform 0 uint4 3 0 0 0
|
2024-10-03 06:46:07 -07:00
|
|
|
todo(sm<4) draw quad
|
2024-02-10 11:16:22 -08:00
|
|
|
probe (0, 0) rgba (5.0, 5.0, 5.0, 5.0)
|
2024-01-31 12:10:29 -08:00
|
|
|
if(sm<4) uniform 0 float4 1 0 0 0
|
|
|
|
if(sm>=4) uniform 0 uint4 1 0 0 0
|
2024-10-03 06:46:07 -07:00
|
|
|
todo(sm<4) draw quad
|
2024-02-10 11:16:22 -08:00
|
|
|
probe (0, 0) rgba (5.0, 5.0, 5.0, 5.0)
|
2024-01-31 12:10:29 -08:00
|
|
|
if(sm<4) uniform 0 float4 0 0 0 0
|
|
|
|
if(sm>=4) uniform 0 uint4 0 0 0 0
|
2024-10-03 06:46:07 -07:00
|
|
|
todo(sm<4) draw quad
|
2024-02-10 11:16:22 -08:00
|
|
|
probe (0, 0) rgba (5.0, 5.0, 5.0, 5.0)
|
2024-01-12 01:47:21 -08:00
|
|
|
|
2024-01-31 12:10:29 -08:00
|
|
|
|
2024-01-12 01:47:21 -08:00
|
|
|
% completely empty
|
|
|
|
[pixel shader fail]
|
|
|
|
uint4 v;
|
|
|
|
|
|
|
|
float4 main() : sv_target
|
|
|
|
{
|
|
|
|
switch (v.x)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-01-31 12:10:29 -08:00
|
|
|
|
2023-09-20 02:53:36 -07:00
|
|
|
% falling through is only supported for empty case statements
|
2024-01-31 12:10:29 -08:00
|
|
|
[pixel shader todo(sm<4)]
|
2023-09-20 02:53:36 -07:00
|
|
|
uint4 v;
|
|
|
|
|
|
|
|
float4 main() : sv_target
|
|
|
|
{
|
|
|
|
float4 c = {1.0, 2.0, 3.0, 4.0};
|
|
|
|
|
|
|
|
switch (v.x)
|
|
|
|
{
|
|
|
|
case 0:
|
|
|
|
case 1:
|
|
|
|
c.x += 0.1f;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
return c;
|
|
|
|
}
|
|
|
|
|
|
|
|
[test]
|
2024-01-31 12:10:29 -08:00
|
|
|
if(sm<4) uniform 0 float4 2 0 0 0
|
|
|
|
if(sm>=4) uniform 0 uint4 2 0 0 0
|
2024-10-03 06:46:07 -07:00
|
|
|
todo(sm<4) draw quad
|
2024-02-10 11:16:22 -08:00
|
|
|
probe (0, 0) rgba (1.0, 2.0, 3.0, 4.0)
|
2024-01-31 12:10:29 -08:00
|
|
|
if(sm<4) uniform 0 float4 1 0 0 0
|
|
|
|
if(sm>=4) uniform 0 uint4 1 0 0 0
|
2024-10-03 06:46:07 -07:00
|
|
|
todo(sm<4) draw quad
|
2024-02-10 11:16:22 -08:00
|
|
|
probe (0, 0) rgba (1.1, 2.0, 3.0, 4.0)
|
2024-01-31 12:10:29 -08:00
|
|
|
if(sm<4) uniform 0 float4 0 0 0 0
|
|
|
|
if(sm>=4) uniform 0 uint4 0 0 0 0
|
2024-10-03 06:46:07 -07:00
|
|
|
todo(sm<4) draw quad
|
2024-02-10 11:16:22 -08:00
|
|
|
probe (0, 0) rgba (1.1, 2.0, 3.0, 4.0)
|
2023-09-20 02:53:36 -07:00
|
|
|
|
2024-01-31 12:10:29 -08:00
|
|
|
|
2023-09-20 02:53:36 -07:00
|
|
|
% case value evaluation
|
2024-01-31 12:10:29 -08:00
|
|
|
[pixel shader todo(sm<4)]
|
2023-09-20 02:53:36 -07:00
|
|
|
uint4 v;
|
|
|
|
|
|
|
|
float4 main() : sv_target
|
|
|
|
{
|
|
|
|
float4 c = {1.0, 2.0, 3.0, 4.0};
|
|
|
|
|
|
|
|
switch (v.x)
|
|
|
|
{
|
|
|
|
case 1+1:
|
|
|
|
c += 0.1f;
|
|
|
|
break;
|
|
|
|
case 0:
|
|
|
|
c += 0.2f;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
return c;
|
|
|
|
}
|
|
|
|
|
|
|
|
[test]
|
2024-01-31 12:10:29 -08:00
|
|
|
if(sm<4) uniform 0 float4 2 0 0 0
|
|
|
|
if(sm>=4) uniform 0 uint4 2 0 0 0
|
2024-10-03 06:46:07 -07:00
|
|
|
todo(sm<4) draw quad
|
2024-02-10 11:16:22 -08:00
|
|
|
probe (0, 0) rgba (1.1, 2.1, 3.1, 4.1)
|
2024-01-31 12:10:29 -08:00
|
|
|
if(sm<4) uniform 0 float4 1 0 0 0
|
|
|
|
if(sm>=4) uniform 0 uint4 1 0 0 0
|
2024-10-03 06:46:07 -07:00
|
|
|
todo(sm<4) draw quad
|
2024-02-10 11:16:22 -08:00
|
|
|
probe (0, 0) rgba (1.0, 2.0, 3.0, 4.0)
|
2023-09-20 02:53:36 -07:00
|
|
|
|
2024-01-31 12:10:29 -08:00
|
|
|
|
2023-09-20 02:53:36 -07:00
|
|
|
% floats are accepted
|
2024-01-31 12:10:29 -08:00
|
|
|
[pixel shader fail(sm>=6) todo(sm<4)]
|
2023-09-20 02:53:36 -07:00
|
|
|
uint4 v;
|
|
|
|
|
|
|
|
float4 main() : sv_target
|
|
|
|
{
|
|
|
|
float4 c = {1.0, 2.0, 3.0, 4.0};
|
|
|
|
|
|
|
|
switch (v.x)
|
|
|
|
{
|
|
|
|
case 2.1f:
|
|
|
|
c += 0.1f;
|
|
|
|
break;
|
|
|
|
case 0.9f:
|
|
|
|
c += 0.2f;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
return c;
|
|
|
|
}
|
|
|
|
|
|
|
|
[test]
|
2024-01-31 12:10:29 -08:00
|
|
|
if(sm<4) uniform 0 float4 2 0 0 0
|
|
|
|
if(sm>=4) uniform 0 uint4 2 0 0 0
|
2024-10-03 06:46:07 -07:00
|
|
|
todo(sm<4) draw quad
|
2024-02-10 11:16:22 -08:00
|
|
|
probe (0, 0) rgba (1.1, 2.1, 3.1, 4.1)
|
2024-01-31 12:10:29 -08:00
|
|
|
if(sm<4) uniform 0 float4 1 0 0 0
|
|
|
|
if(sm>=4) uniform 0 uint4 1 0 0 0
|
2024-10-03 06:46:07 -07:00
|
|
|
todo(sm<4) draw quad
|
2024-02-10 11:16:22 -08:00
|
|
|
probe (0, 0) rgba (1.0, 2.0, 3.0, 4.0)
|
2023-09-20 02:53:36 -07:00
|
|
|
|
2024-01-31 12:10:29 -08:00
|
|
|
[pixel shader fail(sm<4 | sm>=6) todo(sm<4)]
|
2023-09-20 02:53:36 -07:00
|
|
|
float4 v;
|
|
|
|
|
|
|
|
float4 main() : sv_target
|
|
|
|
{
|
|
|
|
float4 c = {1.0, 2.0, 3.0, 4.0};
|
|
|
|
|
|
|
|
switch (v.x)
|
|
|
|
{
|
|
|
|
case 2.1f:
|
|
|
|
c += 0.1f;
|
|
|
|
break;
|
|
|
|
case 0.9f:
|
|
|
|
c += 0.2f;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
return c;
|
|
|
|
}
|
|
|
|
|
|
|
|
[test]
|
|
|
|
uniform 0 float4 2.0 0.0 0.0 0.0
|
2024-10-03 06:46:07 -07:00
|
|
|
todo(sm<4) draw quad
|
2024-02-10 11:16:22 -08:00
|
|
|
probe (0, 0) rgba (1.1, 2.1, 3.1, 4.1)
|
2023-09-20 02:53:36 -07:00
|
|
|
uniform 0 float4 1.0 0.0 0.0 0.0
|
2024-10-03 06:46:07 -07:00
|
|
|
todo(sm<4) draw quad
|
2024-02-10 11:16:22 -08:00
|
|
|
probe (0, 0) rgba (1.0, 2.0, 3.0, 4.0)
|
2023-09-20 02:53:36 -07:00
|
|
|
|
|
|
|
[pixel shader fail]
|
|
|
|
uint4 v;
|
|
|
|
|
|
|
|
float4 main() : sv_target
|
|
|
|
{
|
|
|
|
float4 c = {1.0, 2.0, 3.0, 4.0};
|
|
|
|
uint a = 1;
|
|
|
|
|
|
|
|
switch (v.x)
|
|
|
|
{
|
|
|
|
case 1+a:
|
|
|
|
c += 0.1f;
|
|
|
|
break;
|
|
|
|
case 0:
|
|
|
|
c += 0.2f;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
return c;
|
|
|
|
}
|
|
|
|
|
|
|
|
% duplicate cases
|
|
|
|
[pixel shader fail]
|
|
|
|
uint4 v;
|
|
|
|
|
|
|
|
float4 main() : sv_target
|
|
|
|
{
|
|
|
|
float4 c = {1.0, 2.0, 3.0, 4.0};
|
|
|
|
|
|
|
|
switch (v.x)
|
|
|
|
{
|
|
|
|
case 2:
|
|
|
|
c += 0.1f;
|
|
|
|
break;
|
|
|
|
case 1+1:
|
|
|
|
c += 0.2f;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
return c;
|
|
|
|
}
|
|
|
|
|
|
|
|
% multiple default cases
|
|
|
|
[pixel shader fail]
|
|
|
|
uint4 v;
|
|
|
|
|
|
|
|
float4 main() : sv_target
|
|
|
|
{
|
|
|
|
float4 c = {1.0, 2.0, 3.0, 4.0};
|
|
|
|
|
|
|
|
switch (v.x)
|
|
|
|
{
|
|
|
|
default:
|
|
|
|
case 2:
|
|
|
|
c += 0.1f;
|
|
|
|
break;
|
|
|
|
case 1:
|
|
|
|
c += 0.2f;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
return c;
|
|
|
|
}
|
|
|
|
|
|
|
|
% unterminated cases
|
2023-10-11 05:39:01 -07:00
|
|
|
[pixel shader fail(sm<6)]
|
2023-09-20 02:53:36 -07:00
|
|
|
uint4 v;
|
|
|
|
|
|
|
|
float4 main() : sv_target
|
|
|
|
{
|
|
|
|
float4 c = {1.0, 2.0, 3.0, 4.0};
|
|
|
|
|
|
|
|
switch (v.x)
|
|
|
|
{
|
|
|
|
case 0:
|
|
|
|
c += 0.1f;
|
|
|
|
case 1:
|
|
|
|
c += 0.2f;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
return c;
|
|
|
|
}
|
|
|
|
|
2023-10-11 05:39:01 -07:00
|
|
|
[pixel shader fail]
|
2023-09-20 02:53:36 -07:00
|
|
|
uint4 v;
|
|
|
|
|
|
|
|
float4 main() : sv_target
|
|
|
|
{
|
|
|
|
switch (v.x)
|
|
|
|
{
|
|
|
|
case 0:
|
|
|
|
return 3.0;
|
|
|
|
case 1:
|
|
|
|
return 4.0;
|
|
|
|
case 2:
|
|
|
|
}
|
|
|
|
return 0.0;
|
|
|
|
}
|
|
|
|
|
2023-10-11 05:39:01 -07:00
|
|
|
[pixel shader fail]
|
2023-09-20 02:53:36 -07:00
|
|
|
uint4 v;
|
|
|
|
|
|
|
|
float4 main() : sv_target
|
|
|
|
{
|
|
|
|
switch (v.x)
|
|
|
|
{
|
|
|
|
case 0:
|
|
|
|
return 3.0;
|
|
|
|
case 1:
|
|
|
|
return 4.0;
|
|
|
|
default:
|
|
|
|
}
|
|
|
|
return 0.0;
|
|
|
|
}
|
|
|
|
|
2023-10-11 05:39:01 -07:00
|
|
|
[pixel shader fail(sm<6)]
|
2023-09-20 02:53:36 -07:00
|
|
|
uint4 v;
|
|
|
|
|
|
|
|
float4 main() : sv_target
|
|
|
|
{
|
|
|
|
switch (v.x)
|
|
|
|
{
|
|
|
|
case 0:
|
|
|
|
return 3.0;
|
|
|
|
case 1:
|
|
|
|
return 4.0;
|
|
|
|
default:
|
|
|
|
discard;
|
|
|
|
}
|
|
|
|
return 0.0;
|
|
|
|
}
|
|
|
|
|
2023-10-11 05:39:01 -07:00
|
|
|
[pixel shader fail(sm<6)]
|
2023-09-20 02:53:36 -07:00
|
|
|
uint4 v;
|
|
|
|
|
|
|
|
float4 main() : sv_target
|
|
|
|
{
|
|
|
|
switch (v.x)
|
|
|
|
{
|
|
|
|
case 0:
|
|
|
|
return 3.0;
|
|
|
|
case 1:
|
|
|
|
return 4.0;
|
|
|
|
case 2:
|
|
|
|
discard;
|
|
|
|
}
|
|
|
|
return 0.0;
|
|
|
|
}
|
|
|
|
|
2023-10-11 05:39:01 -07:00
|
|
|
[pixel shader fail(sm<6)]
|
2023-09-20 02:53:36 -07:00
|
|
|
uint4 v;
|
|
|
|
|
|
|
|
float4 main() : sv_target
|
|
|
|
{
|
|
|
|
switch (v.x)
|
|
|
|
{
|
|
|
|
case 0:
|
|
|
|
discard;
|
|
|
|
case 1:
|
|
|
|
return 4.0;
|
|
|
|
}
|
|
|
|
return 0.0;
|
|
|
|
}
|
|
|
|
|
|
|
|
% more complicated breaks
|
2024-01-31 12:10:29 -08:00
|
|
|
[pixel shader todo(sm<4)]
|
2023-09-20 02:53:36 -07:00
|
|
|
uint4 v;
|
|
|
|
|
|
|
|
float4 main() : sv_target
|
|
|
|
{
|
|
|
|
float4 c = {1.0, 2.0, 3.0, 4.0};
|
|
|
|
|
|
|
|
switch (v.x)
|
|
|
|
{
|
|
|
|
case 2:
|
|
|
|
c += 0.1f;
|
|
|
|
if (true) break;
|
|
|
|
c = 9.0f;
|
|
|
|
case 1:
|
|
|
|
if (false) break;
|
|
|
|
c += 0.2f;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
case 0:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
return c;
|
|
|
|
}
|
|
|
|
|
|
|
|
[test]
|
2024-01-31 12:10:29 -08:00
|
|
|
if(sm<4) uniform 0 float4 2 0 0 0
|
|
|
|
if(sm>=4) uniform 0 uint4 2 0 0 0
|
2024-10-03 06:46:07 -07:00
|
|
|
todo(sm<4) draw quad
|
2024-02-10 11:16:22 -08:00
|
|
|
probe (0, 0) rgba (1.1, 2.1, 3.1, 4.1)
|
2024-01-31 12:10:29 -08:00
|
|
|
if(sm<4) uniform 0 float4 1 0 0 0
|
|
|
|
if(sm>=4) uniform 0 uint4 1 0 0 0
|
2024-10-03 06:46:07 -07:00
|
|
|
todo(sm<4) draw quad
|
2024-02-10 11:16:22 -08:00
|
|
|
probe (0, 0) rgba (1.2, 2.2, 3.2, 4.2)
|
2024-01-31 12:10:29 -08:00
|
|
|
if(sm<4) uniform 0 float4 0 0 0 0
|
|
|
|
if(sm>=4) uniform 0 uint4 0 0 0 0
|
2024-10-03 06:46:07 -07:00
|
|
|
todo(sm<4) draw quad
|
2024-02-10 11:16:22 -08:00
|
|
|
probe (0, 0) rgba (1.0, 2.0, 3.0, 4.0)
|
2023-09-20 02:53:36 -07:00
|
|
|
|
|
|
|
% switch breaks within a loop
|
2024-01-31 12:10:29 -08:00
|
|
|
[pixel shader todo(sm<4)]
|
2023-09-20 02:53:36 -07:00
|
|
|
uint4 v;
|
|
|
|
|
|
|
|
float4 main() : sv_target
|
|
|
|
{
|
|
|
|
float4 c = {1.0f, 2.0f, 3.0f, 4.0f};
|
|
|
|
|
|
|
|
for (int i = 0; i < 4; ++i)
|
|
|
|
{
|
|
|
|
switch (v.x)
|
|
|
|
{
|
|
|
|
case 2:
|
|
|
|
c += 1.0f;
|
|
|
|
break;
|
|
|
|
case 1:
|
|
|
|
c -= 1.0f;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
case 0:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return c;
|
|
|
|
}
|
|
|
|
|
|
|
|
[test]
|
2024-01-31 12:10:29 -08:00
|
|
|
if(sm<4) uniform 0 float4 2 0 0 0
|
|
|
|
if(sm>=4) uniform 0 uint4 2 0 0 0
|
2024-10-03 06:46:07 -07:00
|
|
|
todo(sm<4) draw quad
|
2024-02-10 11:16:22 -08:00
|
|
|
probe (0, 0) rgba (5.0, 6.0, 7.0, 8.0)
|
2023-09-20 02:53:36 -07:00
|
|
|
|
2024-01-31 12:10:29 -08:00
|
|
|
|
2023-09-20 02:53:36 -07:00
|
|
|
% default case placement
|
2024-01-31 12:10:29 -08:00
|
|
|
[pixel shader todo(sm<4)]
|
2023-09-20 02:53:36 -07:00
|
|
|
uint4 v;
|
|
|
|
|
|
|
|
float4 main() : sv_target
|
|
|
|
{
|
|
|
|
float4 c = {1.0f, 2.0f, 3.0f, 4.0f};
|
|
|
|
|
|
|
|
switch (v.x)
|
|
|
|
{
|
|
|
|
case 2:
|
|
|
|
c += 1.0f;
|
|
|
|
break;
|
|
|
|
case 1:
|
|
|
|
c -= 1.0f;
|
|
|
|
break;
|
|
|
|
case 3:
|
|
|
|
default:
|
|
|
|
case 0:
|
|
|
|
c += 3.0f;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
return c;
|
|
|
|
}
|
|
|
|
|
|
|
|
[test]
|
2024-01-31 12:10:29 -08:00
|
|
|
if(sm<4) uniform 0 float4 0 0 0 0
|
|
|
|
if(sm>=4) uniform 0 uint4 0 0 0 0
|
2024-10-03 06:46:07 -07:00
|
|
|
todo(sm<4) draw quad
|
2024-02-10 11:16:22 -08:00
|
|
|
probe (0, 0) rgba (4.0, 5.0, 6.0, 7.0)
|
2024-01-31 12:10:29 -08:00
|
|
|
if(sm<4) uniform 0 float4 2 0 0 0
|
|
|
|
if(sm>=4) uniform 0 uint4 2 0 0 0
|
2024-10-03 06:46:07 -07:00
|
|
|
todo(sm<4) draw quad
|
2024-02-10 11:16:22 -08:00
|
|
|
probe (0, 0) rgba (2.0, 3.0, 4.0, 5.0)
|
2024-01-31 12:10:29 -08:00
|
|
|
if(sm<4) uniform 0 float4 3 0 0 0
|
|
|
|
if(sm>=4) uniform 0 uint4 3 0 0 0
|
2024-10-03 06:46:07 -07:00
|
|
|
todo(sm<4) draw quad
|
2024-02-10 11:16:22 -08:00
|
|
|
probe (0, 0) rgba (4.0, 5.0, 6.0, 7.0)
|
2023-09-20 02:53:36 -07:00
|
|
|
|
2024-01-31 12:10:29 -08:00
|
|
|
|
|
|
|
[pixel shader todo(sm<4)]
|
2023-09-20 02:53:36 -07:00
|
|
|
uint4 v;
|
|
|
|
|
|
|
|
float4 main() : sv_target
|
|
|
|
{
|
|
|
|
float4 c = {1.0f, 2.0f, 3.0f, 4.0f};
|
|
|
|
|
|
|
|
switch (v.x)
|
|
|
|
{
|
|
|
|
case 2:
|
|
|
|
c += 1.0f;
|
|
|
|
break;
|
|
|
|
case 1:
|
|
|
|
c -= 1.0f;
|
|
|
|
break;
|
|
|
|
case 3:
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
case 0:
|
|
|
|
c += 3.0f;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
return c;
|
|
|
|
}
|
|
|
|
|
|
|
|
[test]
|
2024-01-31 12:10:29 -08:00
|
|
|
if(sm<4) uniform 0 float4 3 0 0 0
|
|
|
|
if(sm>=4) uniform 0 uint4 3 0 0 0
|
2024-10-03 06:46:07 -07:00
|
|
|
todo(sm<4) draw quad
|
2024-02-10 11:16:22 -08:00
|
|
|
probe (0, 0) rgba (1.0, 2.0, 3.0, 4.0)
|
2024-01-31 12:10:29 -08:00
|
|
|
if(sm<4) uniform 0 float4 0 0 0 0
|
|
|
|
if(sm>=4) uniform 0 uint4 0 0 0 0
|
2024-10-03 06:46:07 -07:00
|
|
|
todo(sm<4) draw quad
|
2024-02-10 11:16:22 -08:00
|
|
|
probe (0, 0) rgba (4.0, 5.0, 6.0, 7.0)
|
2024-01-31 12:10:29 -08:00
|
|
|
if(sm<4) uniform 0 float4 5 0 0 0
|
|
|
|
if(sm>=4) uniform 0 uint4 5 0 0 0
|
2024-10-03 06:46:07 -07:00
|
|
|
todo(sm<4) draw quad
|
2024-02-10 11:16:22 -08:00
|
|
|
probe (0, 0) rgba (1.0, 2.0, 3.0, 4.0)
|
2023-09-20 02:53:36 -07:00
|
|
|
|
|
|
|
% 'continue' is not supported in switches
|
2023-10-24 12:05:42 -07:00
|
|
|
[pixel shader fail(sm<6)]
|
2023-09-20 02:53:36 -07:00
|
|
|
uint4 v;
|
|
|
|
|
|
|
|
float4 main() : sv_target
|
|
|
|
{
|
|
|
|
float4 c = {1.0, 2.0, 3.0, 4.0};
|
|
|
|
uint i, j;
|
|
|
|
|
|
|
|
for (i = 0; i < v.z; i++)
|
|
|
|
{
|
|
|
|
switch (v.x)
|
|
|
|
{
|
|
|
|
case 0:
|
|
|
|
c += 0.1f;
|
|
|
|
continue;
|
|
|
|
break;
|
|
|
|
case 1:
|
|
|
|
c += 0.2f;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return c;
|
|
|
|
}
|
|
|
|
|
2024-01-31 12:10:29 -08:00
|
|
|
[pixel shader fail(sm<4) todo(sm<4)]
|
2023-09-20 02:53:36 -07:00
|
|
|
uint4 v;
|
|
|
|
|
|
|
|
float4 main() : sv_target
|
|
|
|
{
|
|
|
|
float4 c = {1.0, 2.0, 3.0, 4.0};
|
|
|
|
uint i, j;
|
|
|
|
|
|
|
|
for (i = 0; i < v.z; i++)
|
|
|
|
{
|
|
|
|
switch (v.x)
|
|
|
|
{
|
2024-02-02 02:17:36 -08:00
|
|
|
case 1:
|
2023-09-20 02:53:36 -07:00
|
|
|
for (j = 0; j < v.z; j++)
|
|
|
|
{
|
|
|
|
c += 1.0f;
|
|
|
|
if (v.w)
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
break;
|
2024-02-02 02:17:36 -08:00
|
|
|
case 0:
|
2023-09-20 02:53:36 -07:00
|
|
|
c += 2.0f;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return c;
|
|
|
|
}
|
|
|
|
|
|
|
|
[test]
|
2024-01-31 12:10:29 -08:00
|
|
|
if(sm<4) uniform 0 float4 1 0 3 1
|
|
|
|
if(sm>=4) uniform 0 uint4 1 0 3 1
|
2024-03-19 04:36:23 -07:00
|
|
|
todo(glsl) draw quad
|
2024-02-10 11:16:22 -08:00
|
|
|
probe (0, 0) rgba (10.0, 11.0, 12.0, 13.0)
|
2024-01-31 12:10:29 -08:00
|
|
|
if(sm<4) uniform 0 float4 0 0 3 1
|
|
|
|
if(sm>=4) uniform 0 uint4 0 0 3 1
|
2024-03-19 04:36:23 -07:00
|
|
|
todo(glsl) draw quad
|
2024-02-10 11:16:22 -08:00
|
|
|
probe (0, 0) rgba (7.0, 8.0, 9.0, 10.0)
|
2023-09-20 02:53:36 -07:00
|
|
|
|
|
|
|
% return from a switch nested in a loop
|
2024-01-31 12:10:29 -08:00
|
|
|
[pixel shader fail(sm<4) todo(sm<4)]
|
2023-09-20 02:53:36 -07:00
|
|
|
uint4 v;
|
|
|
|
|
|
|
|
float4 main() : sv_target
|
|
|
|
{
|
|
|
|
float4 c = {1.0, 2.0, 3.0, 4.0};
|
|
|
|
uint i, j;
|
|
|
|
|
|
|
|
for (i = 0; i < v.z; i++)
|
|
|
|
{
|
|
|
|
switch (v.x)
|
|
|
|
{
|
|
|
|
case 0:
|
|
|
|
c += 1.0f;
|
|
|
|
break;
|
|
|
|
case 1:
|
|
|
|
c += 2.0f;
|
|
|
|
return c;
|
|
|
|
}
|
|
|
|
c += 100.0f;
|
|
|
|
}
|
|
|
|
|
|
|
|
return c;
|
|
|
|
}
|
|
|
|
|
|
|
|
[test]
|
2024-01-31 12:10:29 -08:00
|
|
|
if(sm<4) uniform 0 float4 0 0 3 1
|
|
|
|
if(sm>=4) uniform 0 uint4 0 0 3 1
|
2024-03-19 04:36:23 -07:00
|
|
|
todo(glsl) draw quad
|
2024-02-10 11:16:22 -08:00
|
|
|
probe (0, 0) rgba (304.0, 305.0, 306.0, 307.0)
|
2024-01-31 12:10:29 -08:00
|
|
|
if(sm<4) uniform 0 float4 1 0 3 1
|
|
|
|
if(sm>=4) uniform 0 uint4 1 0 3 1
|
2024-03-19 04:36:23 -07:00
|
|
|
todo(glsl) draw quad
|
2024-02-10 11:16:22 -08:00
|
|
|
probe (0, 0) rgba (3.0, 4.0, 5.0, 6.0)
|
2024-02-13 22:50:39 -08:00
|
|
|
|
|
|
|
[require]
|
|
|
|
shader model >= 6.0
|
|
|
|
|
|
|
|
[pixel shader]
|
|
|
|
uint64_t2 v;
|
|
|
|
|
|
|
|
float4 main() : sv_target
|
|
|
|
{
|
|
|
|
// Need three cases because dxcompiler optimises two case values to a pair of vselect instructions.
|
|
|
|
switch (v.x)
|
|
|
|
{
|
|
|
|
case 0:
|
|
|
|
return 3.0;
|
|
|
|
case 0x100000002:
|
|
|
|
return 4.0;
|
|
|
|
case 3:
|
|
|
|
return 2.0;
|
|
|
|
default:
|
|
|
|
return 5.0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
[test]
|
|
|
|
uniform 0 uint64_t2 2 0
|
|
|
|
draw quad
|
2024-02-10 11:16:22 -08:00
|
|
|
probe (0, 0) rgba (5.0, 5.0, 5.0, 5.0)
|
2024-02-13 22:50:39 -08:00
|
|
|
uniform 0 uint64_t2 0x100000002 0
|
|
|
|
draw quad
|
2024-02-10 11:16:22 -08:00
|
|
|
probe (0, 0) rgba (4.0, 4.0, 4.0, 4.0)
|
2024-02-13 22:50:39 -08:00
|
|
|
uniform 0 uint64_t2 0 0
|
|
|
|
draw quad
|
2024-02-10 11:16:22 -08:00
|
|
|
probe (0, 0) rgba (3.0, 3.0, 3.0, 3.0)
|