tests/hlsl: Add tests for mad() and fma().

This commit is contained in:
Conor McCarthy 2024-03-15 12:40:26 +10:00 committed by Alexandre Julliard
parent f55b152811
commit 08cc5027cf
Notes: Alexandre Julliard 2024-03-18 23:25:32 +01:00
Approved-by: Giovanni Mascellani (@giomasce)
Approved-by: Henri Verbeet (@hverbeet)
Approved-by: Alexandre Julliard (@julliard)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/718

View File

@ -91,6 +91,38 @@ uniform 0 float4 1.0 0.0 0.0 0.0
draw quad
probe all rgba (1e99, 1e99, 1e99, 1e99)
[pixel shader todo]
uniform float4 a, b, c;
float4 main() : sv_target
{
return mad(a, b, c);
}
[test]
uniform 0 float4 1.00000007 -42.1 4.0 45.0
uniform 4 float4 1.625 -5.0 4.125 5.0
uniform 8 float4 1.00000007 -1.0 0.5 -0.5
todo draw quad
probe all rgba (2.62500024, 209.5, 17.0, 224.5) 1
% precise mad() is not allowed to fuse, even though unfused is less precise.
[pixel shader todo]
uniform float4 a, b, c;
float4 main() : sv_target
{
precise float4 ret = mad(a, b, c);
return ret;
}
[test]
uniform 0 float4 1.00000007 -42.1 4.0 45.0
uniform 4 float4 1.625 -5.0 4.125 5.0
uniform 8 float4 1.00000007 -1.0 0.5 -0.5
todo draw quad
todo probe all rgba (2.62500048, 209.5, 17.0, 224.5)
[require]
shader model >= 5.0
float64
@ -140,3 +172,18 @@ float4 main() : SV_TARGET
uniform 0 double2 1.5e300 2.0e299
todo(sm<6) draw quad
probe all rgba (7.5, 7.5, 7.5, 7.5)
[pixel shader todo]
uniform double2 a, b, c;
float4 main() : sv_target
{
return float4(fma(a, b, c), 0, 0);
}
[test]
uniform 0 double2 1.00000007 -42.1
uniform 4 double2 1.625 -5.0
uniform 8 double2 1.00000007 -1.0
todo draw quad
probe all rgba (2.62500024, 209.5, 0.0, 0.0)