From cf6e518f1e68d9ef89c40f7138d357b529cec56d Mon Sep 17 00:00:00 2001 From: Conor McCarthy Date: Tue, 19 Mar 2024 00:21:27 +1000 Subject: [PATCH] tests/hlsl: Add tests for asdouble(). --- tests/hlsl/cast-64-bit.shader_test | 31 ++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/tests/hlsl/cast-64-bit.shader_test b/tests/hlsl/cast-64-bit.shader_test index 1e33d811..41a1af4d 100644 --- a/tests/hlsl/cast-64-bit.shader_test +++ b/tests/hlsl/cast-64-bit.shader_test @@ -36,6 +36,37 @@ todo(sm<6) draw quad probe all rgbaui (0, 0xc0120000, 0x80000000, 0x40210000) +[pixel shader todo] +uniform uint4 u; + +float4 main() : sv_target +{ + // Low bits, high bits + double2 d = asdouble(u.xz, u.yw); + return float4(d, 0, 0); +} + +[test] +uniform 0 uint4 0xc000000 0x40020000 0x80000000 0xc04be000 +todo draw quad +probe all rgba (2.25, -55.75001526, 0.0, 0.0) 1 + + +[pixel shader todo] +uniform uint2 u; + +float4 main() : sv_target +{ + double d = asdouble(u.x, u.y); + return float4(d, 0, 0, 0); +} + +[test] +uniform 0 uint4 0x80000000 0xc04be000 0 0 +todo draw quad +probe all rgba (-55.75001526, 0.0, 0.0, 0.0) 1 + + [require] shader model >= 6.0 int64