tests/hlsl: Add uint64 wave op tests.

This commit is contained in:
Conor McCarthy
2024-12-03 12:11:16 +10:00
committed by Henri Verbeet
parent f0f8bb3f36
commit 50306a8b08
Notes: Henri Verbeet 2024-12-09 16:17:26 +01:00
Approved-by: Giovanni Mascellani (@giomasce)
Approved-by: Henri Verbeet (@hverbeet)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/820
3 changed files with 358 additions and 0 deletions

View File

@@ -203,6 +203,12 @@ static inline bool compare_uvec4(const struct uvec4 *v1, const struct uvec4 *v2)
return v1->x == v2->x && v1->y == v2->y && v1->z == v2->z && v1->w == v2->w;
}
static inline bool compare_u64vec2(const struct u64vec2 *v1, const struct u64vec2 *v2)
{
return compare_uint64(v1->x, v2->x, 0)
&& compare_uint64(v1->y, v2->y, 0);
}
static inline bool compare_vec(const struct vec4 *v1, const struct vec4 *v2,
unsigned int ulps, unsigned component_count)
{
@@ -278,6 +284,11 @@ static const struct uvec4 *get_readback_uvec4(const struct resource_readback *rb
return get_readback_data(rb, x, y, 0, sizeof(struct uvec4));
}
static const struct u64vec2 *get_readback_u64vec2(const struct resource_readback *rb, unsigned int x, unsigned int y)
{
return get_readback_data(rb, x, y, 0, sizeof(struct u64vec2));
}
#define check_readback_data_float(a, b, c, d) check_readback_data_float_(__FILE__, __LINE__, a, b, c, d)
static inline void check_readback_data_float_(const char *file, unsigned int line,
const struct resource_readback *rb, const RECT *rect, float expected, unsigned int max_diff)
@@ -493,6 +504,38 @@ static inline void check_readback_data_uvec4_(const char *file, unsigned int lin
got.x, got.y, got.z, got.w, expected->x, expected->y, expected->z, expected->w, x, y);
}
#define check_readback_data_i64vec2(a, b, c) \
check_readback_data_u64vec2_(__FILE__, __LINE__, a, b, (const struct u64vec2 *)(c))
#define check_readback_data_u64vec2(a, b, c) check_readback_data_u64vec2_(__FILE__, __LINE__, a, b, c)
static inline void check_readback_data_u64vec2_(const char *file, unsigned int line,
const struct resource_readback *rb, const RECT *rect, const struct u64vec2 *expected)
{
RECT r = {0, 0, rb->width, rb->height};
unsigned int x = 0, y = 0;
struct u64vec2 got = {0};
bool all_match = true;
if (rect)
r = *rect;
for (y = r.top; y < r.bottom; ++y)
{
for (x = r.left; x < r.right; ++x)
{
got = *get_readback_u64vec2(rb, x, y);
if (!compare_u64vec2(&got, expected))
{
all_match = false;
break;
}
}
if (!all_match)
break;
}
ok_(file, line)(all_match, "Got {0x%016"PRIx64", 0x%016"PRIx64"}, expected {0x%016"PRIx64", 0x%016"PRIx64"}"
" at (%u, %u).\n", got.x, got.y, expected->x, expected->y, x, y);
}
struct test_options
{
bool use_warp_device;