2021-09-11 14:56:04 -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]
|
2024-03-19 04:36:23 -07:00
|
|
|
todo(glsl) draw quad
|
2024-02-10 11:16:22 -08:00
|
|
|
probe (0, 0) rgba (0.8, 0.0, 0.0, 0.0)
|
2022-12-02 12:20:59 -08:00
|
|
|
|
|
|
|
|
2023-09-14 02:29:24 -07:00
|
|
|
[pixel shader fail(sm<6)]
|
2023-11-15 12:41:33 -08:00
|
|
|
// On SM1 this gives hr 0x88760b59.
|
2022-12-02 12:20:59 -08:00
|
|
|
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]
|
2024-03-19 04:36:23 -07:00
|
|
|
todo(glsl) draw quad
|
2024-02-10 11:16:22 -08:00
|
|
|
probe (0, 0) rgba (1.0, 2.0, 3.0, 4.0)
|
2022-12-05 16:38:50 -08:00
|
|
|
|
|
|
|
|
|
|
|
[sampler 0]
|
|
|
|
filter linear linear linear
|
|
|
|
address clamp clamp clamp
|
|
|
|
|
|
|
|
|
2024-01-24 11:11:17 -08:00
|
|
|
[srv 0]
|
|
|
|
size (2d, 1, 1)
|
2022-12-05 16:38:50 -08:00
|
|
|
1.0 2.0 3.0 4.0
|
|
|
|
|
|
|
|
|
2022-12-05 10:13:57 -08:00
|
|
|
[pixel shader fail]
|
2022-12-05 16:38:50 -08:00
|
|
|
static Texture2D tex;
|
|
|
|
sampler sam;
|
|
|
|
|
|
|
|
float4 main() : sv_target
|
|
|
|
{
|
|
|
|
return tex.Sample(sam, int3(0, 0, 0));
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2022-12-05 10:13:57 -08:00
|
|
|
[pixel shader]
|
2022-12-05 16:38:50 -08:00
|
|
|
// This is allowed in 10.0.10011.16384 but not in 9.29.952.3111
|
|
|
|
static Texture2D tex;
|
|
|
|
|
|
|
|
float4 main() : sv_target
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2023-09-27 10:17:40 -07:00
|
|
|
[pixel shader]
|
2022-12-05 16:38:50 -08:00
|
|
|
// This is allowed in 10.0.10011.16384 but not in 9.29.952.3111
|
|
|
|
static Texture2D tex;
|
|
|
|
sampler sam;
|
|
|
|
|
|
|
|
float4 main() : sv_target
|
|
|
|
{
|
|
|
|
if (0)
|
|
|
|
return tex.Sample(sam, int3(0, 0, 0));
|
|
|
|
else
|
|
|
|
return float4(0, 1, 2, 3);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
[pixel shader todo]
|
|
|
|
// This is allowed in 10.0.10011.16384 but not in 9.29.952.3111
|
|
|
|
static Texture2D tex;
|
|
|
|
sampler sam;
|
|
|
|
uniform uint i;
|
|
|
|
|
|
|
|
float4 main() : sv_target
|
|
|
|
{
|
|
|
|
float4 unused = tex.Sample(sam, int3(0, 1, 2));
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2022-12-05 10:13:57 -08:00
|
|
|
[pixel shader fail]
|
2022-12-05 16:38:50 -08:00
|
|
|
static Texture2D tex1;
|
|
|
|
sampler sam;
|
|
|
|
|
|
|
|
float4 main() : sv_target
|
|
|
|
{
|
|
|
|
static Texture2D tex2 = tex1;
|
|
|
|
return tex2.Sample(sam, int3(0, 0, 0));
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2022-12-05 10:13:57 -08:00
|
|
|
[pixel shader fail]
|
2022-12-05 16:38:50 -08:00
|
|
|
static Texture2D tex1;
|
|
|
|
sampler sam;
|
|
|
|
|
|
|
|
float4 main(Texture2D tex2) : sv_target
|
|
|
|
{
|
|
|
|
tex2 = tex1;
|
|
|
|
return tex2.Sample(sam, int3(0, 0, 0));
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2023-11-15 12:41:33 -08:00
|
|
|
[pixel shader todo(sm<4)]
|
2022-12-05 16:38:50 -08:00
|
|
|
Texture2D real_tex;
|
|
|
|
static Texture2D tex = real_tex;
|
|
|
|
sampler sam;
|
|
|
|
|
|
|
|
float4 main() : sv_target
|
|
|
|
{
|
|
|
|
return tex.Sample(sam, int3(0, 0, 0));
|
|
|
|
}
|
|
|
|
|
|
|
|
[test]
|
2024-03-19 04:36:23 -07:00
|
|
|
todo(sm<4 | glsl) draw quad
|
2024-02-10 11:16:22 -08:00
|
|
|
probe (0, 0) rgba (1, 2, 3, 4)
|
2022-12-05 16:38:50 -08:00
|
|
|
|
|
|
|
|
2023-11-15 12:41:33 -08:00
|
|
|
[pixel shader todo(sm<4)]
|
2022-12-05 16:38:50 -08:00
|
|
|
Texture2D real_tex;
|
|
|
|
static Texture2D tex;
|
|
|
|
sampler sam;
|
|
|
|
|
|
|
|
float4 main() : sv_target
|
|
|
|
{
|
|
|
|
tex = real_tex;
|
|
|
|
return tex.Sample(sam, int3(0, 0, 0));
|
|
|
|
}
|
|
|
|
|
|
|
|
[test]
|
2024-03-19 04:36:23 -07:00
|
|
|
todo(sm<4 | glsl) draw quad
|
2024-02-10 11:16:22 -08:00
|
|
|
probe (0, 0) rgba (1, 2, 3, 4)
|
2022-12-05 16:38:50 -08:00
|
|
|
|
|
|
|
|
|
|
|
[require]
|
|
|
|
shader model >= 5.0
|
|
|
|
|
|
|
|
|
|
|
|
[uav 1]
|
|
|
|
format r32 float
|
2024-01-24 11:11:17 -08:00
|
|
|
size (2d, 1, 1)
|
2022-12-05 16:38:50 -08:00
|
|
|
|
|
|
|
0.5
|
|
|
|
|
|
|
|
|
2023-09-27 10:17:40 -07:00
|
|
|
[pixel shader]
|
2022-12-05 16:38:50 -08:00
|
|
|
// This is allowed in 10.0.10011.16384 but not in 9.29.952.3111
|
|
|
|
static RWTexture2D<float> tex;
|
|
|
|
|
|
|
|
float4 main() : sv_target
|
|
|
|
{
|
|
|
|
if (0)
|
|
|
|
{
|
|
|
|
tex[int2(0, 0)] = 2;
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|