tests/hlsl: Do not test some details of float-to-half conversion.

Native implementations do not behave consistently.
This commit is contained in:
Giovanni Mascellani
2025-10-17 10:16:16 +02:00
committed by Henri Verbeet
parent 303790875b
commit 2b68f488f4
Notes: Henri Verbeet 2025-10-27 19:10:33 +01:00
Approved-by: Francisco Casas (@fcasas)
Approved-by: Henri Verbeet (@hverbeet)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1799

View File

@@ -46,6 +46,11 @@ uniform float4 f;
float4 main() : sv_target
{
half4 h = f;
/* WARP and AMD (but not NVIDIA) convert 65536.0f to 65504.0h rather than
* to infinity. We're not currently interested in modelling these details,
* so we flush 65504.0h to infinity manually. */
bool4 near_infinity = (abs(h) == 65504.0);
h /= !near_infinity;
return h * half4(2.0, 2.0, 0.5, 0.5);
}
@@ -56,9 +61,9 @@ probe (0, 0) f32(inf, inf, inf, 16384.0)
uniform 0 float4 -65536.0 -32768.0 -65536.0 -32768.0
draw quad
probe (0, 0) f32(-inf, -inf, -inf, -16384.0)
uniform 0 float4 0.000062 5.0e-8 0.000062 5.0e-8
uniform 0 float4 0.000062 5.97e-8 0.000062 5.97e-8
draw quad
probe (0, 0) rgba(0.00012397766, 1.1920929e-7, 0.000030994415, 0.0) 1
uniform 0 float4 -0.000062 -5.0e-8 -0.000062 -5.0e-8
probe (0, 0) f32(0.00012397766, 1.1920929e-7, 0.000030994415, 0.0) 1
uniform 0 float4 -0.000062 -5.97e-8 -0.000062 -5.97e-8
draw quad
probe (0, 0) rgba(-0.00012397766, -1.1920929e-7, -0.000030994415, 0.0) 1
probe (0, 0) f32(-0.00012397766, -1.1920929e-7, -0.000030994415, 0.0) 1