tests: Add a test for the ABSNEG source modifier.

This commit is contained in:
Giovanni Mascellani
2025-05-29 21:53:50 +02:00
committed by Henri Verbeet
parent 10be58a74f
commit ed60dd5926
Notes: Henri Verbeet 2025-06-02 21:02:17 +02:00
Approved-by: Henri Verbeet (@hverbeet)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1527

View File

@@ -30,3 +30,57 @@ probe (0, 0) rgba(2, 8, 3, 1)
uniform 0 float -1.0
todo(msl) draw quad
probe (0, 0) rgba(1, 8, 3, 1)
[pixel shader]
uniform float4 u;
float4 main() : sv_target
{
return -abs(u);
}
[test]
uniform 0 float4 1.0 -3.0 10.0 -100.0
draw quad
probe (0, 0) rgba(-1.0, -3.0, -10.0, -100.0)
[require]
shader model >= 4.0
shader model < 4.1
[pixel shader dxbc-tpf-hex]
% The same as above, but in bytecode format so that we're sure that the
% ABSNEG source modifier is used.
% ps_5_0
% dcl_globalFlags refactoringAllowed
% dcl_constantbuffer CB0[1], immediateIndexed
% dcl_output o0.xyzw
% mov o0.xyzw, -|cb0[0].xyzw|
% ret
44584243 86f9f3f1 b27b0db4 49b8d2de 09b1ffaf 01000000 78020000 05000000
34000000 48010000 58010000 8c010000 dc010000 52444546 0c010000 01000000
68000000 01000000 3c000000 0005ffff 00010000 d8000000 52443131 3c000000
18000000 20000000 28000000 24000000 0c000000 00000000 5c000000 00000000
00000000 00000000 00000000 00000000 01000000 00000000 24476c6f 62616c73
00ababab 5c000000 01000000 80000000 10000000 00000000 00000000 a8000000
00000000 10000000 02000000 b4000000 00000000 ffffffff 00000000 ffffffff
00000000 7500666c 6f617434 00ababab 01000300 01000400 00000000 00000000
00000000 00000000 00000000 00000000 aa000000 4d696372 6f736f66 74202852
2920484c 534c2053 68616465 7220436f 6d70696c 65722031 302e302e 31303031
312e3136 33383400 4953474e 08000000 00000000 08000000 4f53474e 2c000000
01000000 08000000 20000000 00000000 00000000 03000000 00000000 0f000000
73765f74 61726765 7400abab 53484558 48000000 50000000 12000000 6a080001
59000004 468e2000 00000000 01000000 65000003 f2201000 00000000 36000007
f2201000 00000000 468e2080 c1000000 00000000 00000000 3e000001 53544154
94000000 02000000 00000000 00000000 01000000 01000000 00000000 00000000
01000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000
[test]
uniform 0 float4 1.0 -3.0 10.0 -100.0
todo(msl | glsl) draw quad
probe (0, 0) rgba(-1.0, -3.0, -10.0, -100.0)