vkd3d/tests/hlsl/hard-copy-prop.shader_test
Elizabeth Figura d3ba810c98 tests: Stop probing all pixels when drawing a uniform colour.
This is simply unnecessary and wastes time.

As part of this, simply remove the "all" directive. Only for a couple of tests
is it even potentially interesting to validate all pixels (e.g.
nointerpolation.shader_test), and for those "all" is replaced with an explicit
(0, 0, 640, 480) rect.

In all other cases we just probe (0, 0).
2024-06-13 23:55:31 +02:00

77 lines
1.2 KiB
Plaintext

[pixel shader todo(sm<4)]
float cond;
float4 main() : sv_target
{
float4 a = {1, 2, 3, 4};
float4 b;
// invalidate a
if (cond)
a = float4(-1, -2, -3, -4);
b = a;
a.y = 357;
return b.y;
}
[test]
uniform 0 float 0.0
todo(sm<4 | glsl) draw quad
probe (0, 0) rgba (2.0, 2.0, 2.0, 2.0)
uniform 0 float 1.0
todo(sm<4 | glsl) draw quad
probe (0, 0) rgba (-2.0, -2.0, -2.0, -2.0)
[pixel shader todo(sm<4)]
float cond;
float4 main() : sv_target
{
float2 r = {1, 2};
float2 tmp;
// invalidate r
if (cond)
r = float2(10, 20);
tmp = r;
r = tmp;
return r.y;
}
[test]
uniform 0 float 0.0
todo(sm<4 | glsl) draw quad
probe (0, 0) rgba (2.0, 2.0, 2.0, 2.0)
uniform 0 float 1.0
todo(sm<4 | glsl) draw quad
probe (0, 0) rgba (20.0, 20.0, 20.0, 20.0)
[pixel shader todo(sm<4)]
float cond;
float4 main() : sv_target
{
float2 r = {3, 4};
// invalidate r
if (cond)
r = float2(30, 40);
r = r;
r = float2(1, r.y);
return float4(r, 0, 0);
}
[test]
uniform 0 float 0.0
todo(sm<4 | glsl) draw quad
probe (0, 0) rgba (1.0, 4.0, 0.0, 0.0)
uniform 0 float 1.0
todo(sm<4 | glsl) draw quad
probe (0, 0) rgba (1.0, 40.0, 0.0, 0.0)