tests/shader-runner: Test shaders with dxcompiler.

The location of dxcompiler should be set during configuration with
'DXCOMPILER_LIBS=-L/path/to/dxcompiler', and then at runtime with
LD_LIBRARY_PATH, WINEPATH or PATH as applicable.

A new 'fail(sm<6)' decoration is needed on many shader declarations
because dxcompiler succeeds on many shaders which fail with fxc. The
opposite case is less common and is flagged with 'fail(sm>=6)'. A few
tests cause dxcompiler to crash or hang, so these are avoided using
[require], which now skips tests until reset instead of exiting. Also,
'todo(sm<6)' and 'todo(sm>=6)' are used to separate checking of results.
This commit is contained in:
Conor McCarthy
2023-09-14 19:29:24 +10:00
committed by Alexandre Julliard
parent d211160b89
commit 57280673e5
Notes: Alexandre Julliard 2023-10-11 22:53:48 +02:00
Approved-by: Giovanni Mascellani (@giomasce)
Approved-by: Zebediah Figura (@zfigura)
Approved-by: Henri Verbeet (@hverbeet)
Approved-by: Alexandre Julliard (@julliard)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/346
133 changed files with 1284 additions and 572 deletions

View File

@@ -13,7 +13,7 @@ float4 main() : sv_target
[test]
uniform 0 float4 1.0 2.0 3.0 4.0
draw quad
todo(sm>=6) draw quad
probe all rgba (1.0, 2.0, 3.0, 4.0)
[pixel shader]
@@ -31,7 +31,7 @@ float4 main() : sv_target
[test]
uniform 0 float4 1.0 2.0 3.0 4.0
draw quad
todo(sm>=6) draw quad
probe all rgba (1.0, 2.0, 3.0, 4.0)
% SM1 buffer offset allocation follows different rules than SM4.
@@ -72,7 +72,7 @@ uniform 0 float4 0.0 1.0 2.0 3.0
uniform 4 float4 4.0 5.0 6.0 7.0
uniform 8 float4 8.0 9.0 10.0 11.0
uniform 12 float4 12.0 13.0 14.0 15.0
draw quad
todo(sm>=6) draw quad
probe all rgba (0.0, 2.0, 4.0, 8.0)
@@ -93,7 +93,7 @@ float4 main() : sv_target
uniform 0 float4 0.0 1.0 2.0 3.0
uniform 4 float4 4.0 5.0 6.0 7.0
uniform 8 float4 8.0 9.0 10.0 11.0
draw quad
todo(sm>=6) draw quad
probe all rgba (0.0, 4.0, 8.0, 9.0)
@@ -119,11 +119,11 @@ uniform 0 float4 0.0 1.0 2.0 3.0
uniform 4 float4 4.0 5.0 6.0 7.0
uniform 8 float4 8.0 9.0 10.0 11.0
uniform 12 float4 12.0 13.0 14.0 15.0
draw quad
todo(sm>=6) draw quad
probe all rgba (0.0, 4.0, 5.0, 6.0)
[pixel shader fail]
[pixel shader fail(sm<6)]
// Elements cannot overlap if buffer is used.
cbuffer buffer
{
@@ -134,9 +134,17 @@ cbuffer buffer
float4 main() : sv_target
{
return c;
return float4(c, a[1].x, b[0].x, b[1].x);
}
[test]
uniform 0 float4 1.0 0.0 0.0 0.0
uniform 4 float4 2.0 0.0 0.0 0.0
uniform 8 float4 3.0 0.0 0.0 0.0
uniform 12 float4 4.0 0.0 0.0 0.0
todo draw quad
probe all rgba (1.0, 3.0, 3.0, 4.0)
[pixel shader]
// Elements can overlap if buffer is not used.
@@ -168,7 +176,7 @@ float4 main() : sv_target
uniform 0 float4 1.0 2.0 3.0 4.0
uniform 4 float4 5.0 6.0 7.0 8.0
uniform 8 float4 9.0 10.0 11.0 12.0
draw quad
todo(sm>=6) draw quad
probe all rgba (509, 610, 711, 812)
@@ -196,7 +204,7 @@ uniform 0 float4 0.0 1.0 2.0 3.0
uniform 4 float4 4.0 5.0 6.0 7.0
uniform 8 float4 8.0 9.0 10.0 11.0
uniform 12 float4 12.0 13.0 14.0 15.0
draw quad
todo(sm>=6) draw quad
probe all rgba (12468.0, 13509.0, 14010.0, 15011.0)
@@ -213,7 +221,7 @@ float4 main() : sv_target
[test]
uniform 0 float4 1.0 2.0 3.0 4.0
draw quad
todo(sm>=6) draw quad
probe all rgba (2.0, 3.0, 2.0, 3.0)
@@ -230,7 +238,7 @@ float4 main() : sv_target
}
[pixel shader fail]
[pixel shader fail(sm<6)]
// Matrices must be aligned.
cbuffer buffer
{
@@ -243,7 +251,7 @@ float4 main() : sv_target
}
[pixel shader fail]
[pixel shader fail(sm<6)]
// Arrays must be aligned.
cbuffer buffer
{
@@ -256,7 +264,7 @@ float4 main() : sv_target
}
[pixel shader fail]
[pixel shader fail(sm<6)]
// Structs must be aligned.
struct apple
{
@@ -318,11 +326,11 @@ float4 main() : sv_target
uniform 0 float 1.0
uniform 1 float 2.0
uniform 4 float4 5.0 6.0 7.0 8.0
draw quad
todo(sm>=6) draw quad
probe all rgba (512.0, 612.0, 712.0, 812.0)
[pixel shader fail]
[pixel shader fail(sm<6)]
// packoffset cannot be used unless all elements use it.
cbuffer buffer
{
@@ -349,7 +357,7 @@ float4 main() : sv_target
[test]
uniform 0 float4 1.0 2.0 3.0 4.0
draw quad
todo(sm>=6) draw quad
probe all rgba (3.0, 4.0, 3.0, 4.0)
@@ -491,7 +499,7 @@ float4 main() : sv_target
uniform 0 float4 1.0 0.0 0.0 0.0
uniform 4 float4 0.0 2.0 0.0 0.0
uniform 8 float4 0.0 0.0 3.0 0.0
draw quad
todo(sm>=6) draw quad
probe all rgba (1.0, 2.0, 0.0, 4.0)
@@ -541,14 +549,14 @@ float4 main() : sv_target
}
[test]
draw quad
todo(sm>=6) draw quad
probe all rgba (1.0, 1.0, 1.0, 1.0)
% Samplers cannot have packoffset(), unless register() is also specified, or they are not used.
% Note: In SM1 the rules are different: packoffset() is allowed for samplers, but they cannot be
% used together with other numeric fields, which seems like a bug.
[pixel shader fail todo]
[pixel shader fail(sm<6) todo]
Texture2D tex;
cbuffer buffer
@@ -599,7 +607,7 @@ float4 main() : sv_target
% When packoffset is used in one field, resources are also expected to have a reservation.
[pixel shader fail]
[pixel shader fail(sm<6)]
cbuffer buffer
{
float4 foo : packoffset(c0);
@@ -611,7 +619,7 @@ float4 main() : sv_target
return 0;
}
[pixel shader fail]
[pixel shader fail(sm<6)]
cbuffer buffer
{
float4 foo : packoffset(c0);
@@ -649,7 +657,7 @@ float4 main() : sv_target
}
% Using register() alone is considered manual packing for resources, so the other fields expect packoffset().
[pixel shader fail]
[pixel shader fail(sm<6)]
cbuffer buffer
{
float4 foo;
@@ -661,7 +669,7 @@ float4 main() : sv_target
return 0;
}
[pixel shader fail]
[pixel shader fail(sm<6)]
cbuffer buffer
{
float4 foo;
@@ -718,5 +726,5 @@ uniform 0 float4 0.0 1.0 2.0 3.0
uniform 4 float4 4.0 5.0 6.0 7.0
uniform 8 float4 8.0 9.0 10.0 11.0
uniform 12 float4 12.0 13.0 14.0 15.0
draw quad
todo(sm>=6) draw quad
probe all rgba (124.0, 135.0, 146.0, 150.5)