Skip to content
Snippets Groups Projects
Commit 08cc5027 authored by Conor McCarthy's avatar Conor McCarthy Committed by Alexandre Julliard
Browse files

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

parent f55b1528
No related branches found
No related tags found
1 merge request!718vkd3d-shader/dxil: Implement miscellaneous arithmetic DX intrinsics.
......@@ -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)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment