2024-01-23 15:26:11 -08:00
|
|
|
[require]
|
|
|
|
shader model >= 4.0
|
|
|
|
|
|
|
|
|
2024-01-24 11:11:17 -08:00
|
|
|
[srv 0]
|
|
|
|
size (buffer, 4)
|
2024-01-23 15:26:11 -08:00
|
|
|
0.0 1.0 2.0 3.0
|
|
|
|
4.0 5.0 6.0 7.0
|
|
|
|
8.0 9.0 10.0 11.0
|
|
|
|
12.0 13.0 14.0 15.0
|
|
|
|
|
|
|
|
|
2024-01-24 11:35:39 -08:00
|
|
|
[pixel shader]
|
2024-01-23 15:26:11 -08:00
|
|
|
float4 a;
|
|
|
|
Buffer<float4> buffer;
|
|
|
|
float4 b;
|
|
|
|
|
|
|
|
float4 main() : sv_target
|
|
|
|
{
|
|
|
|
return float4(a.y, b.z, buffer[1].xw);
|
|
|
|
}
|
|
|
|
|
|
|
|
[test]
|
|
|
|
uniform 0 float4 100 200 300 400
|
|
|
|
uniform 4 float4 1000 2000 3000 4000
|
2024-01-24 11:35:39 -08:00
|
|
|
draw quad
|
2024-01-23 15:26:11 -08:00
|
|
|
probe all rgba (200, 3000, 4, 7)
|
|
|
|
|
|
|
|
|
2024-01-24 11:35:39 -08:00
|
|
|
[pixel shader]
|
2024-01-23 15:26:11 -08:00
|
|
|
float4 a;
|
|
|
|
Buffer<float3> buffer;
|
|
|
|
float4 b;
|
|
|
|
|
|
|
|
float4 main() : sv_target
|
|
|
|
{
|
|
|
|
return float4(b.w, buffer[2]);
|
|
|
|
}
|
|
|
|
|
|
|
|
[test]
|
|
|
|
uniform 0 float4 100 200 300 400
|
|
|
|
uniform 4 float4 1000 2000 3000 4000
|
2024-01-24 11:35:39 -08:00
|
|
|
draw quad
|
2024-01-23 15:26:11 -08:00
|
|
|
probe all rgba (4000.0, 8.0, 9.0, 10.0)
|
|
|
|
|
|
|
|
|
2024-01-24 11:11:17 -08:00
|
|
|
[srv 0]
|
|
|
|
size (2d, 1, 1)
|
2024-01-23 15:26:11 -08:00
|
|
|
-1.0 -1.0 -1.0 -1.0
|
|
|
|
|
|
|
|
[sampler 0]
|
|
|
|
filter linear linear linear
|
|
|
|
address clamp clamp clamp
|
|
|
|
|
2024-01-24 11:11:17 -08:00
|
|
|
[srv 1]
|
|
|
|
size (buffer, 1)
|
2024-01-23 15:26:11 -08:00
|
|
|
1.0 2.0 3.0 4.0
|
|
|
|
|
2024-01-24 11:35:39 -08:00
|
|
|
[pixel shader]
|
2024-01-23 15:26:11 -08:00
|
|
|
Texture2D tex;
|
|
|
|
sampler sam;
|
|
|
|
Buffer<float4> buffer;
|
|
|
|
|
|
|
|
float4 main() : sv_target
|
|
|
|
{
|
|
|
|
return float4(buffer[0].zw, tex.Sample(sam, float2(0, 0)).zw);
|
|
|
|
}
|
|
|
|
|
|
|
|
[test]
|
2024-01-24 11:35:39 -08:00
|
|
|
draw quad
|
2024-01-23 15:26:11 -08:00
|
|
|
probe all rgba (3.0, 4.0, -1.0, -1.0)
|
|
|
|
|
|
|
|
|
2024-01-24 11:11:17 -08:00
|
|
|
[srv 0]
|
|
|
|
size (buffer, 4)
|
2024-01-23 15:26:11 -08:00
|
|
|
0.0 1.0 2.0 3.0
|
|
|
|
4.0 5.0 6.0 7.0
|
|
|
|
8.0 9.0 10.0 11.0
|
|
|
|
12.0 13.0 14.0 15.0
|
|
|
|
|
|
|
|
|
2024-01-24 11:35:39 -08:00
|
|
|
[pixel shader]
|
2024-01-23 15:26:11 -08:00
|
|
|
Buffer buffer;
|
|
|
|
|
|
|
|
float4 main() : sv_target
|
|
|
|
{
|
|
|
|
return buffer.Load(1);
|
|
|
|
}
|
|
|
|
|
|
|
|
[test]
|
2024-01-24 11:35:39 -08:00
|
|
|
draw quad
|
2024-01-23 15:26:11 -08:00
|
|
|
probe all rgba (4.0, 5.0, 6.0, 7.0)
|
|
|
|
|
|
|
|
|
2024-01-24 11:35:39 -08:00
|
|
|
[pixel shader]
|
2024-01-23 15:26:11 -08:00
|
|
|
Buffer buffer;
|
|
|
|
|
|
|
|
float4 main() : sv_target
|
|
|
|
{
|
|
|
|
return buffer.Load(float2(2, 9999));
|
|
|
|
}
|
|
|
|
|
|
|
|
[test]
|
2024-01-24 11:35:39 -08:00
|
|
|
draw quad
|
2024-01-23 15:26:11 -08:00
|
|
|
probe all rgba (8.0, 9.0, 10.0, 11.0)
|
|
|
|
|
|
|
|
|
|
|
|
[pixel shader fail]
|
|
|
|
Buffer buffer;
|
|
|
|
sampler sam;
|
|
|
|
|
|
|
|
float4 main() : sv_target
|
|
|
|
{
|
|
|
|
return buffer.Sample(sam, 0);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
[pixel shader fail]
|
|
|
|
Buffer buffer;
|
|
|
|
|
|
|
|
float4 main() : sv_target
|
|
|
|
{
|
|
|
|
uint u1, u2;
|
|
|
|
|
|
|
|
buffer.GetDimensions(u1, u2);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2024-01-24 11:35:39 -08:00
|
|
|
[pixel shader]
|
2024-01-23 15:26:11 -08:00
|
|
|
Buffer buf;
|
|
|
|
uniform int u;
|
|
|
|
|
|
|
|
float4 main() : sv_target
|
|
|
|
{
|
|
|
|
return buf[u];
|
|
|
|
}
|
|
|
|
|
|
|
|
[test]
|
|
|
|
uniform 0 int 2
|
2024-01-24 11:35:39 -08:00
|
|
|
draw quad
|
2024-01-23 15:26:11 -08:00
|
|
|
probe all rgba (8.0, 9.0, 10.0, 11.0)
|
|
|
|
uniform 0 int 0
|
2024-01-24 11:35:39 -08:00
|
|
|
draw quad
|
2024-01-23 15:26:11 -08:00
|
|
|
probe all rgba (0.0, 1.0, 2.0, 3.0)
|
|
|
|
|
|
|
|
|
|
|
|
% Buffer doesn't have offset_dim or sample_index arguments allowed.
|
2024-01-24 11:35:39 -08:00
|
|
|
[pixel shader fail todo]
|
2024-01-23 15:26:11 -08:00
|
|
|
Buffer buffer;
|
|
|
|
|
|
|
|
float4 main() : sv_target
|
|
|
|
{
|
|
|
|
// This test fails because the output status must be an l-value.
|
|
|
|
buffer.Load(0, 0);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
[pixel shader fail]
|
|
|
|
Buffer buffer;
|
|
|
|
|
|
|
|
float4 main() : sv_target
|
|
|
|
{
|
|
|
|
uint u;
|
|
|
|
|
|
|
|
// This test fails because there is no overload for an argument in-between the load index and
|
|
|
|
// the output status.
|
|
|
|
buffer.Load(0, 0, u);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
[require]
|
|
|
|
shader model >= 5.0
|
|
|
|
|
|
|
|
|
|
|
|
[pixel shader todo]
|
|
|
|
Buffer buffer;
|
|
|
|
|
|
|
|
float4 main() : sv_target
|
|
|
|
{
|
|
|
|
uint width;
|
|
|
|
|
|
|
|
buffer.GetDimensions(width);
|
|
|
|
return width;
|
|
|
|
}
|
|
|
|
[test]
|
|
|
|
todo draw quad
|
|
|
|
probe all rgba (4.0, 4.0, 4.0, 4.0)
|