2021-09-09 19:06:38 -07:00
|
|
|
[pixel shader]
|
2020-10-03 14:24:25 -07:00
|
|
|
float myfunc()
|
|
|
|
{
|
|
|
|
return 0.6;
|
|
|
|
}
|
|
|
|
static float a = myfunc() + 0.2;
|
|
|
|
static float b;
|
2021-03-17 22:22:23 -07:00
|
|
|
static const float c;
|
2020-10-03 14:24:25 -07:00
|
|
|
float4 main() : sv_target
|
|
|
|
{
|
2021-03-17 22:22:23 -07:00
|
|
|
return float4(a, b, c, 0);
|
2020-10-03 14:24:25 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
[test]
|
2021-09-09 19:06:38 -07:00
|
|
|
draw quad
|
|
|
|
todo probe all rgba (0.8, 0.0, 0.0, 0.0)
|
2022-12-02 12:20:59 -08:00
|
|
|
|
|
|
|
|
|
|
|
[pixel shader fail]
|
|
|
|
static uint i;
|
|
|
|
|
|
|
|
float4 main() : sv_target
|
|
|
|
{
|
|
|
|
return 1 / i;
|
|
|
|
}
|
2022-12-08 09:52:11 -08:00
|
|
|
|
|
|
|
|
|
|
|
[pixel shader]
|
|
|
|
static struct
|
|
|
|
{
|
|
|
|
float4 x;
|
|
|
|
float4 y;
|
|
|
|
} x;
|
|
|
|
|
|
|
|
float4 main() : sv_target
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
[pixel shader]
|
|
|
|
static struct
|
|
|
|
{
|
|
|
|
float4 x;
|
|
|
|
float3 y;
|
|
|
|
} x;
|
|
|
|
|
|
|
|
float4 main() : sv_target
|
|
|
|
{
|
|
|
|
return float4(1, 2, 3, 4) + x.x;
|
|
|
|
}
|
|
|
|
|
|
|
|
[test]
|
|
|
|
draw quad
|
|
|
|
probe all rgba (1.0, 2.0, 3.0, 4.0)
|