tests: Add tests for ID3D12CommandQueue_GetClockCalibration().

Based on a vkd3d-proton patch by Hans-Kristian Arntzen.

Signed-off-by: Conor McCarthy <cmccarthy@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Conor McCarthy
2022-01-15 01:17:19 +10:00
committed by Alexandre Julliard
parent 2047bfa664
commit 3d044c4453
2 changed files with 44 additions and 0 deletions

View File

@@ -36013,6 +36013,35 @@ done:
destroy_test_context(&context);
}
static void test_clock_calibration(void)
{
uint64_t cpu_times[2] = {0}, gpu_times[2] = {0};
struct test_context context;
HRESULT hr;
if (!init_test_context(&context, NULL))
return;
hr = ID3D12CommandQueue_GetClockCalibration(context.queue, &gpu_times[0], &cpu_times[0]);
todo
ok(hr == S_OK, "Failed to retrieve calibrated timestamps, hr %#x.\n", hr);
vkd3d_sleep(100);
hr = ID3D12CommandQueue_GetClockCalibration(context.queue, &gpu_times[1], &cpu_times[1]);
todo
ok(hr == S_OK, "Failed to retrieve calibrated timestamps, hr %#x.\n", hr);
todo
ok(gpu_times[1] > gpu_times[0], "Inconsistent GPU timestamps %"PRIu64" and %"PRIu64".\n",
gpu_times[0], gpu_times[1]);
todo
ok(cpu_times[1] > cpu_times[0], "Inconsistent CPU timestamps %"PRIu64" and %"PRIu64".\n",
cpu_times[0], cpu_times[1]);
destroy_test_context(&context);
}
START_TEST(d3d12)
{
parse_args(argc, argv);
@@ -36190,4 +36219,5 @@ START_TEST(d3d12)
run_test(test_resource_arrays);
run_test(test_unbounded_resource_arrays);
run_test(test_unbounded_samplers);
run_test(test_clock_calibration);
}