tests: Print the file name instead of the test name in test logs.

Some test programs, particularly the shader runner, are built from
many different files nowadays, and a line number is relatively
cumbersome to use if you don't know which file that line comes from.
This commit is contained in:
Giovanni Mascellani
2024-10-23 23:47:21 +02:00
committed by Henri Verbeet
parent 73be28a252
commit 3264378fa0
Notes: Henri Verbeet 2024-12-03 14:55:39 +01:00
Approved-by: Giovanni Mascellani (@giomasce)
Approved-by: Henri Verbeet (@hverbeet)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1221
10 changed files with 469 additions and 438 deletions

View File

@@ -43,53 +43,58 @@ static void vkd3d_test_end_todo(void);
* Use assert_that() for conditions that should always be true.
* todo_if() and bug_if() do not influence assert_that().
*/
#define assert_that assert_that_(__LINE__)
#define assert_that assert_that_(__FILE__, __LINE__)
#define ok ok_(__LINE__)
#define ok ok_(__FILE__, __LINE__)
#define skip skip_(__LINE__)
#define skip skip_(__FILE__, __LINE__)
#define trace trace_(__LINE__)
#define trace trace_(__FILE__, __LINE__)
#define assert_that_(line) \
#define assert_that_(file, line) \
do { \
const char *vkd3d_file = file; \
unsigned int vkd3d_line = line; \
VKD3D_TEST_ASSERT_THAT
#define VKD3D_TEST_ASSERT_THAT(...) \
vkd3d_test_assert_that(vkd3d_line, __VA_ARGS__); } while (0)
vkd3d_test_assert_that(vkd3d_file, vkd3d_line, __VA_ARGS__); } while (0)
#define ok_(line) \
#define ok_(file, line) \
do { \
const char *vkd3d_file = file; \
unsigned int vkd3d_line = line; \
VKD3D_TEST_OK
#define VKD3D_TEST_OK(...) \
vkd3d_test_ok(vkd3d_line, __VA_ARGS__); } while (0)
vkd3d_test_ok(vkd3d_file, vkd3d_line, __VA_ARGS__); } while (0)
#define todo_(line) \
#define todo_(file, line) \
do { \
const char *vkd3d_file = file; \
unsigned int vkd3d_line = line; \
VKD3D_TEST_TODO
#define VKD3D_TEST_TODO(...) \
vkd3d_test_todo(vkd3d_line, __VA_ARGS__); } while (0)
vkd3d_test_todo(vkd3d_file, vkd3d_line, __VA_ARGS__); } while (0)
#define skip_(line) \
#define skip_(file, line) \
do { \
const char *vkd3d_file = file; \
unsigned int vkd3d_line = line; \
VKD3D_TEST_SKIP
#define VKD3D_TEST_SKIP(...) \
vkd3d_test_skip(vkd3d_line, __VA_ARGS__); } while (0)
vkd3d_test_skip(vkd3d_file, vkd3d_line, __VA_ARGS__); } while (0)
#define trace_(line) \
#define trace_(file, line) \
do { \
const char *vkd3d_file = file; \
unsigned int vkd3d_line = line; \
VKD3D_TEST_TRACE
#define VKD3D_TEST_TRACE(...) \
vkd3d_test_trace(vkd3d_line, __VA_ARGS__); } while (0)
vkd3d_test_trace(vkd3d_file, vkd3d_line, __VA_ARGS__); } while (0)
#define todo_if(is_todo) \
for (vkd3d_test_start_todo(is_todo); vkd3d_test_loop_todo(); vkd3d_test_end_todo())
@@ -135,45 +140,59 @@ broken(bool condition)
return condition && vkd3d_test_platform_is_windows();
}
static void vkd3d_test_printf(unsigned int line, const char *msg)
/* basename() is not reentrant, basename_r() is not standard and this simple
* implementation should be enough for us. */
static const char *vkd3d_basename(const char *filename)
{
const char *p;
if ((p = strrchr(filename, '/')))
filename = ++p;
if ((p = strrchr(filename, '\\')))
filename = ++p;
return filename;
}
static void vkd3d_test_printf(const char *file, unsigned int line, const char *msg)
{
unsigned int i;
printf("%s:%u: ", vkd3d_test_name, line);
printf("%s:%u: ", vkd3d_basename(file), line);
for (i = 0; i < vkd3d_test_state.context_count; ++i)
printf("%s: ", vkd3d_test_state.context[i]);
printf("%s", msg);
}
static void
vkd3d_test_check_assert_that(unsigned int line, bool result, const char *fmt, va_list args)
vkd3d_test_check_assert_that(const char *file, unsigned int line, bool result, const char *fmt, va_list args)
{
if (result)
{
vkd3d_atomic_increment_u32(&vkd3d_test_state.success_count);
if (vkd3d_test_state.debug_level > 1)
vkd3d_test_printf(line, "Test succeeded.\n");
vkd3d_test_printf(file, line, "Test succeeded.\n");
}
else
{
vkd3d_atomic_increment_u32(&vkd3d_test_state.failure_count);
vkd3d_test_printf(line, "Test failed: ");
vkd3d_test_printf(file, line, "Test failed: ");
vprintf(fmt, args);
}
}
static void VKD3D_PRINTF_FUNC(3, 4) VKD3D_UNUSED
vkd3d_test_assert_that(unsigned int line, bool result, const char *fmt, ...)
static void VKD3D_PRINTF_FUNC(4, 5) VKD3D_UNUSED
vkd3d_test_assert_that(const char *file, unsigned int line, bool result, const char *fmt, ...)
{
va_list args;
va_start(args, fmt);
vkd3d_test_check_assert_that(line, result, fmt, args);
vkd3d_test_check_assert_that(file, line, result, fmt, args);
va_end(args);
}
static void
vkd3d_test_check_ok(unsigned int line, bool result, const char *fmt, va_list args)
vkd3d_test_check_ok(const char *file, unsigned int line, bool result, const char *fmt, va_list args)
{
bool is_todo = vkd3d_test_state.todo_level && !vkd3d_test_platform_is_windows();
bool is_bug = vkd3d_test_state.bug_level && !vkd3d_test_platform_is_windows();
@@ -184,9 +203,9 @@ vkd3d_test_check_ok(unsigned int line, bool result, const char *fmt, va_list arg
if (is_todo)
result = !result;
if (result)
vkd3d_test_printf(line, "Fixed bug: ");
vkd3d_test_printf(file, line, "Fixed bug: ");
else
vkd3d_test_printf(line, "Bug: ");
vkd3d_test_printf(file, line, "Bug: ");
vprintf(fmt, args);
}
else if (is_todo)
@@ -194,48 +213,48 @@ vkd3d_test_check_ok(unsigned int line, bool result, const char *fmt, va_list arg
if (result)
{
vkd3d_atomic_increment_u32(&vkd3d_test_state.todo_success_count);
vkd3d_test_printf(line, "Todo succeeded: ");
vkd3d_test_printf(file, line, "Todo succeeded: ");
}
else
{
vkd3d_atomic_increment_u32(&vkd3d_test_state.todo_count);
vkd3d_test_printf(line, "Todo: ");
vkd3d_test_printf(file, line, "Todo: ");
}
vprintf(fmt, args);
}
else
{
vkd3d_test_check_assert_that(line, result, fmt, args);
vkd3d_test_check_assert_that(file, line, result, fmt, args);
}
}
static void VKD3D_PRINTF_FUNC(3, 4) VKD3D_UNUSED
vkd3d_test_ok(unsigned int line, bool result, const char *fmt, ...)
static void VKD3D_PRINTF_FUNC(4, 5) VKD3D_UNUSED
vkd3d_test_ok(const char *file, unsigned int line, bool result, const char *fmt, ...)
{
va_list args;
va_start(args, fmt);
vkd3d_test_check_ok(line, result, fmt, args);
vkd3d_test_check_ok(file, line, result, fmt, args);
va_end(args);
}
static void VKD3D_PRINTF_FUNC(2, 3) VKD3D_UNUSED
vkd3d_test_skip(unsigned int line, const char *fmt, ...)
static void VKD3D_PRINTF_FUNC(3, 4) VKD3D_UNUSED
vkd3d_test_skip(const char *file, unsigned int line, const char *fmt, ...)
{
va_list args;
va_start(args, fmt);
vkd3d_test_printf(line, "Test skipped: ");
vkd3d_test_printf(file, line, "Test skipped: ");
vprintf(fmt, args);
va_end(args);
vkd3d_atomic_increment_u32(&vkd3d_test_state.skip_count);
}
static void VKD3D_PRINTF_FUNC(2, 3) VKD3D_UNUSED
vkd3d_test_trace(unsigned int line, const char *fmt, ...)
static void VKD3D_PRINTF_FUNC(3, 4) VKD3D_UNUSED
vkd3d_test_trace(const char *file, unsigned int line, const char *fmt, ...)
{
va_list args;
va_start(args, fmt);
vkd3d_test_printf(line, "");
vkd3d_test_printf(file, line, "");
vprintf(fmt, args);
va_end(args);
}

File diff suppressed because it is too large Load Diff

View File

@@ -241,19 +241,19 @@ static HRESULT wait_for_fence(ID3D12Fence *fence, uint64_t value)
return ret == WAIT_OBJECT_0 ? S_OK : E_FAIL;
}
static void wait_queue_idle_(unsigned int line, ID3D12Device *device, ID3D12CommandQueue *queue)
static void wait_queue_idle_(const char *file, unsigned int line, ID3D12Device *device, ID3D12CommandQueue *queue)
{
ID3D12Fence *fence;
HRESULT hr;
hr = ID3D12Device_CreateFence(device, 0, D3D12_FENCE_FLAG_NONE,
&IID_ID3D12Fence, (void **)&fence);
assert_that_(line)(hr == S_OK, "Failed to create fence, hr %#x.\n", hr);
assert_that_(file, line)(hr == S_OK, "Failed to create fence, hr %#x.\n", hr);
hr = ID3D12CommandQueue_Signal(queue, fence, 1);
assert_that_(line)(hr == S_OK, "Failed to signal fence, hr %#x.\n", hr);
assert_that_(file, line)(hr == S_OK, "Failed to signal fence, hr %#x.\n", hr);
hr = wait_for_fence(fence, 1);
assert_that_(line)(hr == S_OK, "Failed to wait for fence, hr %#x.\n", hr);
assert_that_(file, line)(hr == S_OK, "Failed to wait for fence, hr %#x.\n", hr);
ID3D12Fence_Release(fence);
}

View File

@@ -22,18 +22,18 @@ VKD3D_AGILITY_SDK_EXPORTS
struct test_options test_options = {0};
#define recreate_command_list(a, b, c) recreate_command_list_(__LINE__, a, b, c)
static void recreate_command_list_(unsigned int line, ID3D12Device *device,
#define recreate_command_list(a, b, c) recreate_command_list_(__FILE__, __LINE__, a, b, c)
static void recreate_command_list_(const char *file, unsigned int line, ID3D12Device *device,
ID3D12CommandAllocator *allocator, ID3D12GraphicsCommandList **command_list)
{
HRESULT hr;
hr = ID3D12CommandAllocator_Reset(allocator);
ok_(line)(hr == S_OK, "Failed to reset command allocator, hr %#x.\n", hr);
ok_(file, line)(hr == S_OK, "Failed to reset command allocator, hr %#x.\n", hr);
ID3D12GraphicsCommandList_Release(*command_list);
hr = ID3D12Device_CreateCommandList(device, 0, D3D12_COMMAND_LIST_TYPE_DIRECT,
allocator, NULL, &IID_ID3D12GraphicsCommandList, (void **)command_list);
ok_(line)(hr == S_OK, "Failed to create command list, hr %#x.\n", hr);
ok_(file, line)(hr == S_OK, "Failed to create command list, hr %#x.\n", hr);
}
static void test_invalid_resource_barriers(void)

File diff suppressed because it is too large Load Diff

View File

@@ -29,9 +29,9 @@ VKD3D_AGILITY_SDK_EXPORTS
struct test_options test_options = {0};
#define check_preprocess(a, b, c, d, e) check_preprocess_(__LINE__, a, b, c, d, e)
static void check_preprocess_(int line, const char *source, const D3D_SHADER_MACRO *macros,
ID3DInclude *include, const char *present, const char *absent)
#define check_preprocess(a, b, c, d, e) check_preprocess_(__FILE__, __LINE__, a, b, c, d, e)
static void check_preprocess_(const char *file, int line, const char *source,
const D3D_SHADER_MACRO *macros, ID3DInclude *include, const char *present, const char *absent)
{
ID3D10Blob *blob, *errors;
const char *code;
@@ -39,20 +39,20 @@ static void check_preprocess_(int line, const char *source, const D3D_SHADER_MAC
HRESULT hr;
hr = D3DPreprocess(source, strlen(source), NULL, macros, include, &blob, &errors);
assert_that_(line)(hr == S_OK, "Failed to preprocess shader, hr %#x.\n", hr);
assert_that_(file, line)(hr == S_OK, "Failed to preprocess shader, hr %#x.\n", hr);
if (errors)
{
if (vkd3d_test_state.debug_level)
trace_(line)("%s\n", (char *)ID3D10Blob_GetBufferPointer(errors));
trace_(file, line)("%s\n", (char *)ID3D10Blob_GetBufferPointer(errors));
ID3D10Blob_Release(errors);
}
code = ID3D10Blob_GetBufferPointer(blob);
size = ID3D10Blob_GetBufferSize(blob);
if (present)
ok_(line)(vkd3d_memmem(code, size, present, strlen(present)),
ok_(file, line)(vkd3d_memmem(code, size, present, strlen(present)),
"\"%s\" not found in preprocessed shader.\n", present);
if (absent)
ok_(line)(!vkd3d_memmem(code, size, absent, strlen(absent)),
ok_(file, line)(!vkd3d_memmem(code, size, absent, strlen(absent)),
"\"%s\" found in preprocessed shader.\n", absent);
ID3D10Blob_Release(blob);
}
@@ -464,19 +464,20 @@ static void test_preprocess(void)
ID3D10Blob_Release(errors);
}
#define compile_shader(a, b) compile_shader_(__LINE__, a, b, 0)
#define compile_shader_flags(a, b, c) compile_shader_(__LINE__, a, b, c)
static ID3D10Blob *compile_shader_(unsigned int line, const char *source, const char *target, UINT flags)
#define compile_shader(a, b) compile_shader_(__FILE__, __LINE__, a, b, 0)
#define compile_shader_flags(a, b, c) compile_shader_(__FILE__, __LINE__, a, b, c)
static ID3D10Blob *compile_shader_(const char *file, unsigned int line,
const char *source, const char *target, UINT flags)
{
ID3D10Blob *blob = NULL, *errors = NULL;
HRESULT hr;
hr = D3DCompile(source, strlen(source), NULL, NULL, NULL, "main", target, flags, 0, &blob, &errors);
ok_(line)(hr == S_OK, "Failed to compile shader, hr %#x.\n", hr);
ok_(file, line)(hr == S_OK, "Failed to compile shader, hr %#x.\n", hr);
if (errors)
{
if (vkd3d_test_state.debug_level)
trace_(line)("%s\n", (char *)ID3D10Blob_GetBufferPointer(errors));
trace_(file, line)("%s\n", (char *)ID3D10Blob_GetBufferPointer(errors));
ID3D10Blob_Release(errors);
}
return blob;
@@ -1371,18 +1372,19 @@ static void test_get_blob_part(void)
ok(!refcount, "Got refcount %u.\n", refcount);
}
static void check_type_desc_(int line, const D3D12_SHADER_TYPE_DESC *type, const D3D12_SHADER_TYPE_DESC *expect)
#define check_type_desc(a, b) check_type_desc_(__FILE__, __LINE__, a, b)
static void check_type_desc_(const char *file, int line,
const D3D12_SHADER_TYPE_DESC *type, const D3D12_SHADER_TYPE_DESC *expect)
{
ok_(line)(type->Class == expect->Class, "Got class %#x.\n", type->Class);
ok_(line)(type->Type == expect->Type, "Got type %#x.\n", type->Type);
ok_(line)(type->Rows == expect->Rows, "Got %u rows.\n", type->Rows);
ok_(line)(type->Columns == expect->Columns, "Got %u columns.\n", type->Columns);
ok_(line)(type->Elements == expect->Elements, "Got %u elements.\n", type->Elements);
ok_(line)(type->Members == expect->Members, "Got %u members.\n", type->Members);
ok_(line)(type->Offset == expect->Offset, "Got offset %u.\n", type->Offset);
ok_(line)(!strcmp(type->Name, expect->Name), "Got name \"%s\".\n", type->Name);
ok_(file, line)(type->Class == expect->Class, "Got class %#x.\n", type->Class);
ok_(file, line)(type->Type == expect->Type, "Got type %#x.\n", type->Type);
ok_(file, line)(type->Rows == expect->Rows, "Got %u rows.\n", type->Rows);
ok_(file, line)(type->Columns == expect->Columns, "Got %u columns.\n", type->Columns);
ok_(file, line)(type->Elements == expect->Elements, "Got %u elements.\n", type->Elements);
ok_(file, line)(type->Members == expect->Members, "Got %u members.\n", type->Members);
ok_(file, line)(type->Offset == expect->Offset, "Got offset %u.\n", type->Offset);
ok_(file, line)(!strcmp(type->Name, expect->Name), "Got name \"%s\".\n", type->Name);
}
#define check_type_desc(a, b) check_type_desc_(__LINE__, a, b)
static void test_reflection(void)
{
@@ -2023,27 +2025,27 @@ static void test_default_values_reflection(void)
}
}
static void check_signature_element_(int line, const D3D12_SIGNATURE_PARAMETER_DESC *desc,
#define check_signature_element(a, b, c) check_signature_element_(__FILE__, __LINE__, a, b, c)
static void check_signature_element_(const char *file, int line, const D3D12_SIGNATURE_PARAMETER_DESC *desc,
const D3D12_SIGNATURE_PARAMETER_DESC *expect, bool is_todo)
{
todo_if(is_todo && strcmp(desc->SemanticName, expect->SemanticName))
ok_(line)(!strcmp(desc->SemanticName, expect->SemanticName), "Got name \"%s\".\n", desc->SemanticName);
ok_(file, line)(!strcmp(desc->SemanticName, expect->SemanticName), "Got name \"%s\".\n", desc->SemanticName);
todo_if(is_todo && desc->SemanticIndex != expect->SemanticIndex)
ok_(line)(desc->SemanticIndex == expect->SemanticIndex, "Got index %u.\n", desc->SemanticIndex);
ok_(file, line)(desc->SemanticIndex == expect->SemanticIndex, "Got index %u.\n", desc->SemanticIndex);
todo_if(is_todo && desc->Register != expect->Register)
ok_(line)(desc->Register == expect->Register, "Got register %u.\n", desc->Register);
ok_(file, line)(desc->Register == expect->Register, "Got register %u.\n", desc->Register);
todo_if(is_todo && desc->SystemValueType != expect->SystemValueType)
ok_(line)(desc->SystemValueType == expect->SystemValueType, "Got sysval %u.\n", desc->SystemValueType);
ok_(file, line)(desc->SystemValueType == expect->SystemValueType, "Got sysval %u.\n", desc->SystemValueType);
todo_if(is_todo && desc->ComponentType != expect->ComponentType)
ok_(line)(desc->ComponentType == expect->ComponentType, "Got data type %u.\n", desc->ComponentType);
ok_(file, line)(desc->ComponentType == expect->ComponentType, "Got data type %u.\n", desc->ComponentType);
todo_if(is_todo && desc->Mask != expect->Mask)
ok_(line)(desc->Mask == expect->Mask, "Got mask %#x.\n", desc->Mask);
ok_(file, line)(desc->Mask == expect->Mask, "Got mask %#x.\n", desc->Mask);
todo_if(desc->ReadWriteMask != expect->ReadWriteMask)
ok_(line)(desc->ReadWriteMask == expect->ReadWriteMask, "Got used mask %#x.\n", desc->ReadWriteMask);
ok_(file, line)(desc->ReadWriteMask == expect->ReadWriteMask, "Got used mask %#x.\n", desc->ReadWriteMask);
todo_if(is_todo && desc->Stream != expect->Stream)
ok_(line)(desc->Stream == expect->Stream, "Got stream %u.\n", desc->Stream);
ok_(file, line)(desc->Stream == expect->Stream, "Got stream %u.\n", desc->Stream);
}
#define check_signature_element(a, b, c) check_signature_element_(__LINE__, a, b, c)
static void test_signature_reflection(void)
{

View File

@@ -120,7 +120,7 @@ static struct resource *d3d12_runner_create_resource(struct shader_runner *r, co
if (params->desc.sample_count > 1 && params->desc.level_count > 1)
fatal_error("Multisampled texture has multiple levels.\n");
resource->resource = create_default_texture_(__LINE__, device, D3D12_RESOURCE_DIMENSION_TEXTURE2D,
resource->resource = create_default_texture_(__FILE__, __LINE__, device, D3D12_RESOURCE_DIMENSION_TEXTURE2D,
params->desc.width, params->desc.height, 1, params->desc.level_count, params->desc.sample_count,
params->desc.format, D3D12_RESOURCE_FLAG_ALLOW_RENDER_TARGET, initial_state);
ID3D12Device_CreateRenderTargetView(device, resource->resource,
@@ -169,9 +169,9 @@ static struct resource *d3d12_runner_create_resource(struct shader_runner *r, co
if (params->desc.sample_count > 1 && params->desc.level_count > 1)
fatal_error("Multisampled texture has multiple levels.\n");
resource->resource = create_default_texture_(__LINE__, device, D3D12_RESOURCE_DIMENSION_TEXTURE2D,
params->desc.width, params->desc.height, 1, params->desc.level_count,
params->desc.sample_count, params->desc.format,
resource->resource = create_default_texture_(__FILE__, __LINE__, device,
D3D12_RESOURCE_DIMENSION_TEXTURE2D, params->desc.width, params->desc.height, 1,
params->desc.level_count, params->desc.sample_count, params->desc.format,
/* Multisampled textures must have ALLOW_RENDER_TARGET set. */
(params->desc.sample_count > 1) ? D3D12_RESOURCE_FLAG_ALLOW_RENDER_TARGET : 0, initial_state);
if (params->data)

View File

@@ -1419,13 +1419,8 @@ static void run_tests(enum shading_language language)
void run_shader_tests_gl(void)
{
const char *test_name;
test_name = vkd3d_test_name;
vkd3d_test_name = "shader_runner_gl";
run_tests(SPIR_V);
run_tests(GLSL);
vkd3d_test_name = test_name;
}
#endif

View File

@@ -267,9 +267,9 @@ static const struct uvec4 *get_readback_uvec4(const struct resource_readback *rb
return get_readback_data(rb, x, y, 0, sizeof(struct uvec4));
}
#define check_readback_data_float(a, b, c, d) check_readback_data_float_(__LINE__, a, b, c, d)
static inline void check_readback_data_float_(unsigned int line, const struct resource_readback *rb,
const RECT *rect, float expected, unsigned int max_diff)
#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)
{
RECT r = {0, 0, rb->width, rb->height};
unsigned int x = 0, y;
@@ -293,12 +293,12 @@ static inline void check_readback_data_float_(unsigned int line, const struct re
if (!all_match)
break;
}
ok_(line)(all_match, "Got %.8e, expected %.8e at (%u, %u).\n", got, expected, x, y);
ok_(file, line)(all_match, "Got %.8e, expected %.8e at (%u, %u).\n", got, expected, x, y);
}
#define check_readback_data_double(a, b, c, d) check_readback_data_double_(__LINE__, a, b, c, d)
static inline void check_readback_data_double_(unsigned int line, const struct resource_readback *rb,
const RECT *rect, double expected, unsigned int max_diff)
#define check_readback_data_double(a, b, c, d) check_readback_data_double_(__FILE__, __LINE__, a, b, c, d)
static inline void check_readback_data_double_(const char *file, unsigned int line,
const struct resource_readback *rb, const RECT *rect, double expected, unsigned int max_diff)
{
RECT r = {0, 0, rb->width, rb->height};
unsigned int x = 0, y;
@@ -322,12 +322,12 @@ static inline void check_readback_data_double_(unsigned int line, const struct r
if (!all_match)
break;
}
ok_(line)(all_match, "Got %.15le, expected %.15le at (%u, %u).\n", got, expected, x, y);
ok_(file, line)(all_match, "Got %.15le, expected %.15le at (%u, %u).\n", got, expected, x, y);
}
#define check_readback_data_uint(a, b, c, d) check_readback_data_uint_(__LINE__, a, b, c, d)
static inline void check_readback_data_uint_(unsigned int line, struct resource_readback *rb,
const D3D12_BOX *box, unsigned int expected, unsigned int max_diff)
#define check_readback_data_uint(a, b, c, d) check_readback_data_uint_(__FILE__, __LINE__, a, b, c, d)
static inline void check_readback_data_uint_(const char *file, unsigned int line,
struct resource_readback *rb, const D3D12_BOX *box, unsigned int expected, unsigned int max_diff)
{
D3D12_BOX b = {0, 0, 0, rb->width, rb->height, rb->depth};
unsigned int x = 0, y = 0, z;
@@ -356,12 +356,12 @@ static inline void check_readback_data_uint_(unsigned int line, struct resource_
if (!all_match)
break;
}
ok_(line)(all_match, "Got 0x%08x, expected 0x%08x at (%u, %u, %u).\n", got, expected, x, y, z);
ok_(file, line)(all_match, "Got 0x%08x, expected 0x%08x at (%u, %u, %u).\n", got, expected, x, y, z);
}
#define check_readback_data_uint64(a, b, c, d) check_readback_data_uint64_(__LINE__, a, b, c, d)
static inline void check_readback_data_uint64_(unsigned int line, struct resource_readback *rb,
const D3D12_BOX *box, uint64_t expected, unsigned int max_diff)
#define check_readback_data_uint64(a, b, c, d) check_readback_data_uint64_(__FILE__, __LINE__, a, b, c, d)
static inline void check_readback_data_uint64_(const char *file, unsigned int line,
struct resource_readback *rb, const D3D12_BOX *box, uint64_t expected, unsigned int max_diff)
{
D3D12_BOX b = {0, 0, 0, rb->width, rb->height, rb->depth};
unsigned int x = 0, y = 0;
@@ -385,12 +385,12 @@ static inline void check_readback_data_uint64_(unsigned int line, struct resourc
if (!all_match)
break;
}
ok_(line)(all_match, "Got 0x%016"PRIx64", expected 0x%016"PRIx64" at (%u, %u).\n", got, expected, x, y);
ok_(file, line)(all_match, "Got 0x%016"PRIx64", expected 0x%016"PRIx64" at (%u, %u).\n", got, expected, x, y);
}
#define check_readback_data_vec2(a, b, c, d) check_readback_data_vec_(__LINE__, a, b, c, d, 2)
#define check_readback_data_vec4(a, b, c, d) check_readback_data_vec_(__LINE__, a, b, c, d, 4)
static inline void check_readback_data_vec_(unsigned int line, const struct resource_readback *rb,
#define check_readback_data_vec2(a, b, c, d) check_readback_data_vec_(__FILE__, __LINE__, a, b, c, d, 2)
#define check_readback_data_vec4(a, b, c, d) check_readback_data_vec_(__FILE__, __LINE__, a, b, c, d, 4)
static inline void check_readback_data_vec_(const char *file, unsigned int line, const struct resource_readback *rb,
const RECT *rect, const struct vec4 *expected, unsigned int max_diff, unsigned component_count)
{
RECT r = {0, 0, rb->width, rb->height};
@@ -415,14 +415,15 @@ static inline void check_readback_data_vec_(unsigned int line, const struct reso
if (!all_match)
break;
}
ok_(line)(all_match, "Got {%.8e, %.8e, %.8e, %.8e}, expected {%.8e, %.8e, %.8e, %.8e} at (%u, %u).\n",
ok_(file, line)(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);
}
#define check_readback_data_ivec4(a, b, c) check_readback_data_uvec4_(__LINE__, a, b, (const struct uvec4 *)(c))
#define check_readback_data_uvec4(a, b, c) check_readback_data_uvec4_(__LINE__, a, b, c)
static inline void check_readback_data_uvec4_(unsigned int line, const struct resource_readback *rb,
const RECT *rect, const struct uvec4 *expected)
#define check_readback_data_ivec4(a, b, c) \
check_readback_data_uvec4_(__FILE__, __LINE__, a, b, (const struct uvec4 *)(c))
#define check_readback_data_uvec4(a, b, c) check_readback_data_uvec4_(__FILE__, __LINE__, a, b, c)
static inline void check_readback_data_uvec4_(const char *file, unsigned int line,
const struct resource_readback *rb, const RECT *rect, const struct uvec4 *expected)
{
RECT r = {0, 0, rb->width, rb->height};
unsigned int x = 0, y = 0;
@@ -446,7 +447,8 @@ static inline void check_readback_data_uvec4_(unsigned int line, const struct re
if (!all_match)
break;
}
ok_(line)(all_match, "Got {0x%08x, 0x%08x, 0x%08x, 0x%08x}, expected {0x%08x, 0x%08x, 0x%08x, 0x%08x} at (%u, %u).\n",
ok_(file, line)(all_match,
"Got {0x%08x, 0x%08x, 0x%08x, 0x%08x}, expected {0x%08x, 0x%08x, 0x%08x, 0x%08x} at (%u, %u).\n",
got.x, got.y, got.z, got.w, expected->x, expected->y, expected->z, expected->w, x, y);
}

View File

@@ -55,7 +55,7 @@ HRESULT WINAPI D3D12SerializeRootSignature(const D3D12_ROOT_SIGNATURE_DESC *root
return vkd3d_serialize_root_signature(root_signature_desc, version, blob, error_blob);
}
static void wait_queue_idle_(unsigned int line, ID3D12Device *device, ID3D12CommandQueue *queue)
static void wait_queue_idle_(const char *file, unsigned int line, ID3D12Device *device, ID3D12CommandQueue *queue)
{
VkQueue vk_queue;