2021-09-01 15:20:51 -07:00
|
|
|
[pixel shader fail]
|
|
|
|
/* The same function signature cannot be defined twice. */
|
|
|
|
|
|
|
|
float func(int arg)
|
|
|
|
{
|
|
|
|
return 0.1;
|
|
|
|
}
|
|
|
|
|
|
|
|
float func(int arg)
|
|
|
|
{
|
|
|
|
return 0.1;
|
|
|
|
}
|
|
|
|
|
|
|
|
float4 main() : sv_target
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2023-09-08 14:07:47 -07:00
|
|
|
|
2022-10-30 15:21:12 -07:00
|
|
|
[pixel shader todo]
|
2021-09-01 15:20:51 -07:00
|
|
|
/* Test a basic overload. */
|
|
|
|
float func(int arg)
|
|
|
|
{
|
|
|
|
return 0.1;
|
|
|
|
}
|
|
|
|
|
|
|
|
float func(uint arg)
|
|
|
|
{
|
|
|
|
return 0.2;
|
|
|
|
}
|
|
|
|
|
|
|
|
float4 main() : sv_target
|
|
|
|
{
|
|
|
|
int i = 1;
|
|
|
|
uint u = 1;
|
|
|
|
return float4(func(i), func(u), func(int2(1, 1)), func(uint2(1, 1)));
|
|
|
|
}
|
|
|
|
|
|
|
|
[test]
|
2023-09-14 02:29:24 -07:00
|
|
|
todo(sm<6) draw quad
|
2024-02-10 11:16:22 -08:00
|
|
|
probe (0, 0) rgba (0.1, 0.2, 0.1, 0.2)
|
2023-09-08 14:07:47 -07:00
|
|
|
|
|
|
|
|
2023-11-16 10:39:22 -08:00
|
|
|
[pixel shader fail todo]
|
|
|
|
float func(int arg)
|
|
|
|
{
|
|
|
|
return 1.0;
|
|
|
|
}
|
|
|
|
|
|
|
|
float func(uint arg)
|
|
|
|
{
|
|
|
|
return 2.0;
|
|
|
|
}
|
|
|
|
|
|
|
|
float4 main() : sv_target
|
|
|
|
{
|
|
|
|
return func(3); // whether 3 is signed or unsigned is unspecified.
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
[pixel shader todo]
|
|
|
|
float func(int arg)
|
|
|
|
{
|
|
|
|
return 1.0;
|
|
|
|
}
|
|
|
|
|
|
|
|
float func(uint arg)
|
|
|
|
{
|
|
|
|
return 2.0;
|
|
|
|
}
|
|
|
|
|
|
|
|
float4 main() : sv_target
|
|
|
|
{
|
|
|
|
int a = 3;
|
|
|
|
uint b = 3l;
|
|
|
|
|
|
|
|
return float4(func(a), func(b), func(3u), func(3lu));
|
|
|
|
}
|
|
|
|
|
|
|
|
[test]
|
|
|
|
todo(sm<6) draw quad
|
2024-02-10 11:16:22 -08:00
|
|
|
todo(sm<6) probe (0,0) rgba (1.0, 2.0, 2.0, 2.0)
|
2023-11-16 10:39:22 -08:00
|
|
|
|
|
|
|
|
2023-09-08 14:07:47 -07:00
|
|
|
% float and float1 can be defined separately...
|
|
|
|
|
2023-09-08 14:40:22 -07:00
|
|
|
[pixel shader]
|
2023-09-08 14:07:47 -07:00
|
|
|
void func(float arg) {}
|
|
|
|
void func(float1 arg) {}
|
|
|
|
|
|
|
|
float4 main() : sv_target
|
|
|
|
{
|
|
|
|
return 1.0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
% ...but invoking them is considered ambiguous and fails.
|
|
|
|
|
2023-09-08 14:40:22 -07:00
|
|
|
[pixel shader fail todo]
|
2023-09-08 14:07:47 -07:00
|
|
|
|
|
|
|
void func(float arg) {}
|
|
|
|
void func(float1 arg) {}
|
|
|
|
|
|
|
|
float4 main() : sv_target
|
|
|
|
{
|
|
|
|
float x = 1.0;
|
|
|
|
func(x);
|
|
|
|
return 1.0;
|
|
|
|
}
|
|
|
|
|
2023-09-08 14:40:22 -07:00
|
|
|
[pixel shader fail todo]
|
2023-09-08 14:07:47 -07:00
|
|
|
|
|
|
|
void func(float arg) {}
|
|
|
|
void func(float1 arg) {}
|
|
|
|
|
|
|
|
float4 main() : sv_target
|
|
|
|
{
|
|
|
|
float1 x = {1.0};
|
|
|
|
func(x);
|
|
|
|
return 1.0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
% This holds true even if one variant isn't actually defined.
|
|
|
|
|
|
|
|
[pixel shader fail todo]
|
|
|
|
|
|
|
|
void func(float arg);
|
|
|
|
void func(float1 arg) {}
|
|
|
|
|
|
|
|
float4 main() : sv_target
|
|
|
|
{
|
|
|
|
float1 x = {1.0};
|
|
|
|
func(x);
|
|
|
|
return 1.0;
|
|
|
|
}
|