2023-01-26 10:13:20 -03:00
|
|
|
[pixel shader]
|
2023-01-26 11:40:02 -03:00
|
|
|
float fun(float a[2])
|
|
|
|
{
|
|
|
|
return 10 * a[0] + a[1];
|
|
|
|
}
|
|
|
|
|
|
|
|
float4 main() : sv_target
|
|
|
|
{
|
2024-12-18 00:21:53 -06:00
|
|
|
float f[2] = {0.02, 0.05};
|
2023-01-26 11:40:02 -03:00
|
|
|
|
|
|
|
return fun(f);
|
|
|
|
}
|
|
|
|
|
|
|
|
[test]
|
2024-11-22 15:45:54 +08:00
|
|
|
draw quad
|
2024-12-18 00:21:53 -06:00
|
|
|
probe (0, 0) rgba (0.25, 0.25, 0.25, 0.25) 1
|
2023-01-26 11:40:02 -03:00
|
|
|
|
|
|
|
|
|
|
|
[pixel shader fail]
|
|
|
|
float fun(float a[2])
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
float4 main() : sv_target
|
|
|
|
{
|
|
|
|
int f[2] = {2, 5};
|
|
|
|
|
|
|
|
return fun(f);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
[pixel shader fail]
|
|
|
|
float fun(float a[1])
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
float4 main() : sv_target
|
|
|
|
{
|
|
|
|
float f = 4;
|
|
|
|
|
|
|
|
return fun(f);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
[pixel shader fail]
|
|
|
|
float fun(int a[2])
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
float4 main() : sv_target
|
|
|
|
{
|
|
|
|
float f[2] = {1, 2};
|
|
|
|
|
|
|
|
return fun(f);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2023-01-26 10:13:20 -03:00
|
|
|
[pixel shader]
|
2023-01-26 11:40:02 -03:00
|
|
|
float4 fun(float a[2][4])
|
|
|
|
{
|
|
|
|
float4 res;
|
|
|
|
|
2024-12-18 00:21:53 -06:00
|
|
|
res.x = 0.1 * a[0][0] + 0.01 * a[1][0];
|
|
|
|
res.y = 0.1 * a[0][1] + 0.01 * a[1][1];
|
|
|
|
res.z = 0.1 * a[0][2] + 0.01 * a[1][2];
|
|
|
|
res.w = 0.1 * a[0][3] + 0.01 * a[1][3];
|
2023-01-26 11:40:02 -03:00
|
|
|
return res;
|
|
|
|
}
|
|
|
|
|
|
|
|
float4 main() : sv_target
|
|
|
|
{
|
|
|
|
float f[2][4] = {1, 2, 3, 4, 5, 6, 7, 8};
|
|
|
|
|
|
|
|
return fun(f);
|
|
|
|
}
|
|
|
|
|
|
|
|
[test]
|
2024-11-22 15:45:54 +08:00
|
|
|
draw quad
|
2024-12-18 00:21:53 -06:00
|
|
|
probe (0, 0) rgba (0.15, 0.26, 0.37, 0.48) 1
|
2023-01-26 10:13:20 -03:00
|
|
|
|
|
|
|
|
|
|
|
[pixel shader fail]
|
|
|
|
float fun(float a[2])
|
|
|
|
{
|
|
|
|
return a[2]; // out of bounds.
|
|
|
|
}
|
|
|
|
|
|
|
|
float4 main() : sv_target
|
|
|
|
{
|
|
|
|
float f[2] = {1, 2};
|
|
|
|
|
|
|
|
return fun(f);
|
|
|
|
}
|
2023-01-26 11:40:02 -03:00
|
|
|
|
|
|
|
|
|
|
|
[pixel shader fail]
|
|
|
|
float fun(float a[2])
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
float4 main() : sv_target
|
|
|
|
{
|
|
|
|
float f[3] = {1, 2, 3};
|
|
|
|
|
|
|
|
return fun(f);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
% Implicit size arrays are not allowed.
|
2023-09-14 19:29:24 +10:00
|
|
|
[pixel shader fail(sm<6)]
|
2023-01-26 11:40:02 -03:00
|
|
|
float fun(float a[])
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
float4 main() : sv_target
|
|
|
|
{
|
|
|
|
float f[2] = {1, 2};
|
|
|
|
|
|
|
|
return fun(f);
|
|
|
|
}
|
|
|
|
|
|
|
|
[pixel shader fail]
|
|
|
|
float4 fun(float a[4])
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
float4 main() : sv_target
|
|
|
|
{
|
|
|
|
float4 v = {1, 2, 3, 4};
|
|
|
|
|
|
|
|
return fun(v);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
% Arrays with the same number of components are allowed.
|
2023-01-23 17:02:40 -03:00
|
|
|
[pixel shader]
|
2023-01-26 11:40:02 -03:00
|
|
|
float fun(float a[2][3])
|
|
|
|
{
|
2024-12-18 00:21:53 -06:00
|
|
|
return 0.1*a[0][0] + 0.01*a[0][2] + 0.001*a[1][2];
|
2023-01-26 11:40:02 -03:00
|
|
|
}
|
|
|
|
|
|
|
|
float4 main() : sv_target
|
|
|
|
{
|
|
|
|
float f[3][2] = {1, 2, 3, 4, 5, 6};
|
|
|
|
|
|
|
|
return fun(f);
|
|
|
|
}
|
|
|
|
|
|
|
|
[test]
|
2024-11-22 15:45:54 +08:00
|
|
|
draw quad
|
2024-12-18 00:21:53 -06:00
|
|
|
probe (0, 0) rgba (0.136, 0.136, 0.136, 0.136) 1
|
2023-01-26 11:40:02 -03:00
|
|
|
|
|
|
|
|
2023-01-23 17:02:40 -03:00
|
|
|
[pixel shader]
|
2023-01-26 11:40:02 -03:00
|
|
|
float fun(float a[2][3])
|
|
|
|
{
|
2024-12-18 00:21:53 -06:00
|
|
|
return 0.1*a[0][0] + 0.01*a[1][0] + 0.001*a[1][2];
|
2023-01-26 11:40:02 -03:00
|
|
|
}
|
|
|
|
|
|
|
|
float4 main() : sv_target
|
|
|
|
{
|
|
|
|
float f[6] = {7, 8, 9, 0, 1, 2};
|
|
|
|
|
|
|
|
return fun(f);
|
|
|
|
}
|
|
|
|
|
|
|
|
[test]
|
2024-11-22 15:45:54 +08:00
|
|
|
draw quad
|
2024-12-18 00:21:53 -06:00
|
|
|
probe (0, 0) rgba (0.702, 0.702, 0.702, 0.702) 1
|