From cc42581a345ab7fff74b49783581050aaddeba58 Mon Sep 17 00:00:00 2001 From: Giovanni Mascellani Date: Thu, 26 Jun 2025 10:23:28 +0200 Subject: [PATCH] tests/hlsl: Test uint64 comparisons. --- tests/hlsl/arithmetic-uint.shader_test | 62 ++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) diff --git a/tests/hlsl/arithmetic-uint.shader_test b/tests/hlsl/arithmetic-uint.shader_test index 925972525..b25dc4409 100644 --- a/tests/hlsl/arithmetic-uint.shader_test +++ b/tests/hlsl/arithmetic-uint.shader_test @@ -259,3 +259,65 @@ uniform 0 uint 0x000bfffe uniform 1 uint 0xffffffff draw quad probe (0, 0) u32(0, 2, 1, 0x3333) + +[require] +shader model >= 6.0 +int64 + +[rtv 0] +format r32g32b32a32-float +size (2d, 640, 480) + +[pixel shader] +uniform uint64_t2 a; + +float4 main() : SV_TARGET +{ + uint64_t x = a.x; + uint64_t y = a.y; + return float4(x == y, y == x, x != y, y != x); +} + +[test] +uniform 0 uint64_t2 42000000000 5000000000 +draw quad +probe (0, 0) f32(0.0, 0.0, 1.0, 1.0) +uniform 0 uint64_t2 42000000000 42000000000 +draw quad +probe (0, 0) f32(1.0, 1.0, 0.0, 0.0) + +[pixel shader] +uniform uint64_t2 a; + +float4 main() : SV_TARGET +{ + uint64_t x = a.x; + uint64_t y = a.y; + return float4(x <= y, y <= x, x >= y, y >= x); +} + +[test] +uniform 0 uint64_t2 42000000000 5000000000 +draw quad +probe (0, 0) f32(0.0, 1.0, 1.0, 0.0) +uniform 0 uint64_t2 42000000000 42000000000 +draw quad +probe (0, 0) f32(1.0, 1.0, 1.0, 1.0) + +[pixel shader] +uniform uint64_t2 a; + +float4 main() : SV_TARGET +{ + uint64_t x = a.x; + uint64_t y = a.y; + return float4(x < y, y < x, x > y, y > x); +} + +[test] +uniform 0 uint64_t2 42000000000 5000000000 +draw quad +probe (0, 0) f32(0.0, 1.0, 1.0, 0.0) +uniform 0 uint64_t2 42000000000 42000000000 +draw quad +probe (0, 0) f32(0.0, 0.0, 0.0, 0.0)