2022-02-24 06:06:14 -08:00
|
|
|
% Test implicit and explicit casts on function output parameters.
|
|
|
|
|
2022-10-30 15:21:12 -07:00
|
|
|
[pixel shader todo]
|
2022-02-24 06:06:14 -08:00
|
|
|
|
|
|
|
uniform float4 f;
|
|
|
|
|
|
|
|
void func(out float4 o)
|
|
|
|
{
|
|
|
|
o = f;
|
|
|
|
}
|
|
|
|
|
|
|
|
float4 main() : sv_target
|
|
|
|
{
|
|
|
|
int4 x;
|
|
|
|
func(x);
|
|
|
|
return x;
|
|
|
|
}
|
|
|
|
|
|
|
|
[test]
|
|
|
|
uniform 0 float4 -1.9 -1.0 2.9 4.0
|
2022-04-14 03:52:34 -07:00
|
|
|
todo draw quad
|
2022-02-24 06:06:14 -08:00
|
|
|
probe all rgba (-1.0, -1.0, 2.0, 4.0)
|
|
|
|
|
|
|
|
% As above, but cast "x" to float4 first.
|
2023-09-14 02:29:24 -07:00
|
|
|
% In SM 6 a cast seems to implicitly promote the type to const,
|
|
|
|
% so it fails to match the parameter of func().
|
2022-02-24 06:06:14 -08:00
|
|
|
|
2023-09-14 02:29:24 -07:00
|
|
|
[pixel shader todo fail(sm>=6)]
|
2022-02-24 06:06:14 -08:00
|
|
|
|
|
|
|
uniform float4 f;
|
|
|
|
|
|
|
|
void func(out float4 o)
|
|
|
|
{
|
|
|
|
o = f;
|
|
|
|
}
|
|
|
|
|
|
|
|
float4 main() : sv_target
|
|
|
|
{
|
|
|
|
int4 x;
|
|
|
|
func((float4)x);
|
|
|
|
return x;
|
|
|
|
}
|
|
|
|
|
|
|
|
[test]
|
|
|
|
uniform 0 float4 -1.9 -1.0 2.9 4.0
|
2022-04-14 03:52:34 -07:00
|
|
|
todo draw quad
|
2022-02-24 06:06:14 -08:00
|
|
|
probe all rgba (-1.0, -1.0, 2.0, 4.0)
|
|
|
|
|
|
|
|
% As above, but declare "x" as float4 and cast it to int4.
|
|
|
|
|
2023-09-14 02:29:24 -07:00
|
|
|
[pixel shader todo fail(sm>=6)]
|
2022-02-24 06:06:14 -08:00
|
|
|
|
|
|
|
uniform float4 f;
|
|
|
|
|
|
|
|
void func(out float4 o)
|
|
|
|
{
|
|
|
|
o = f;
|
|
|
|
}
|
|
|
|
|
|
|
|
float4 main() : sv_target
|
|
|
|
{
|
|
|
|
float4 x;
|
|
|
|
func((int4)x);
|
|
|
|
return x;
|
|
|
|
}
|
|
|
|
|
|
|
|
[test]
|
|
|
|
uniform 0 float4 -1.9 -1.0 2.9 4.0
|
2022-04-14 03:52:34 -07:00
|
|
|
todo draw quad
|
2022-02-24 06:06:14 -08:00
|
|
|
probe all rgba (-1.0, -1.0, 2.0, 4.0)
|
|
|
|
|
2022-03-07 17:55:44 -08:00
|
|
|
[require]
|
|
|
|
shader model >= 4.0
|
|
|
|
|
2022-10-30 15:21:12 -07:00
|
|
|
[pixel shader todo]
|
2023-09-14 02:29:24 -07:00
|
|
|
uniform int4 i;
|
2022-02-24 06:06:14 -08:00
|
|
|
|
|
|
|
void func(inout float4 a)
|
|
|
|
{
|
|
|
|
a += 0.1;
|
|
|
|
}
|
|
|
|
|
2023-09-14 02:29:24 -07:00
|
|
|
float4 main() : sv_target
|
2022-02-24 06:06:14 -08:00
|
|
|
{
|
|
|
|
int4 x = i;
|
|
|
|
func(x);
|
|
|
|
return x;
|
|
|
|
}
|
|
|
|
|
|
|
|
[test]
|
|
|
|
uniform 0 int4 -2 0 1 -3000000
|
2022-04-14 03:52:34 -07:00
|
|
|
todo draw quad
|
2022-02-24 06:06:14 -08:00
|
|
|
probe all rgba (-1.0, 0.0, 1.0, -3000000.0)
|