mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-09-12 18:50:22 -07:00
tests: Move check_readback_data_vec4() to utils.h.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com> Signed-off-by: Giovanni Mascellani <gmascellani@codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
committed by
Alexandre Julliard
parent
1e8e0650c9
commit
e6ea409bbf
@@ -19,12 +19,12 @@
|
||||
*/
|
||||
|
||||
#define VK_NO_PROTOTYPES
|
||||
#define VKD3D_TEST_NO_DEFS
|
||||
#include "config.h"
|
||||
#include "vulkan/vulkan.h"
|
||||
#include "vkd3d_shader.h"
|
||||
#include "vkd3d.h"
|
||||
#include "shader_runner.h"
|
||||
#define VKD3D_TEST_NO_DEFS
|
||||
#include "vkd3d_test.h"
|
||||
|
||||
struct vulkan_resource
|
||||
@@ -832,36 +832,6 @@ struct vulkan_resource_readback
|
||||
VkBuffer buffer;
|
||||
};
|
||||
|
||||
static const struct vec4 *get_readback_vec4(const struct resource_readback *rb, unsigned int x, unsigned int y)
|
||||
{
|
||||
return (struct vec4 *)((uint8_t *)rb->data + y * rb->row_pitch + x * sizeof(struct vec4));
|
||||
}
|
||||
|
||||
static void check_readback_data_vec4(const struct resource_readback *rb,
|
||||
const RECT *rect, const struct vec4 *expected, unsigned int max_diff)
|
||||
{
|
||||
unsigned int x = 0, y = 0;
|
||||
struct vec4 got = {0};
|
||||
bool all_match = true;
|
||||
|
||||
for (y = rect->top; y < rect->bottom; ++y)
|
||||
{
|
||||
for (x = rect->left; x < rect->right; ++x)
|
||||
{
|
||||
got = *get_readback_vec4(rb, x, y);
|
||||
if (!compare_vec4(&got, expected, max_diff))
|
||||
{
|
||||
all_match = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!all_match)
|
||||
break;
|
||||
}
|
||||
ok(all_match, "Got {%.8e, %.8e, %.8e, %.8e}, expected {%.8e, %.8e, %.8e, %.8e} at (%u, %u).\n",
|
||||
got.x, got.y, got.z, got.w, expected->x, expected->y, expected->z, expected->w, x, y);
|
||||
}
|
||||
|
||||
static void vulkan_runner_probe_vec4(struct shader_runner *r, const RECT *rect, const struct vec4 *v, unsigned int ulps)
|
||||
{
|
||||
struct vulkan_shader_runner *runner = vulkan_shader_runner(r);
|
||||
|
Reference in New Issue
Block a user