diff --git a/tests/d3d12.c b/tests/d3d12.c index a5efb8ce..f58ad070 100644 --- a/tests/d3d12.c +++ b/tests/d3d12.c @@ -7795,7 +7795,7 @@ static void test_draw_uav_only(void) transition_resource_state(command_list, resource, D3D12_RESOURCE_STATE_UNORDERED_ACCESS, D3D12_RESOURCE_STATE_COPY_SOURCE); - bug_if(is_radv_device(context.device)) + bug_if(is_radv_device(context.device) || is_macos_lt(15, 0, 0)) check_sub_resource_uint(resource, 0, queue, command_list, 500, 0); ID3D12DescriptorHeap_Release(cpu_descriptor_heap); @@ -24071,6 +24071,7 @@ static void test_decrement_uav_counter(void) ID3D12GraphicsCommandList_Dispatch(command_list, tests[i].decrement_count, 1, 1); counter = read_uav_counter(&context, counter_buffer, 0); + bug_if(is_macos_lt(15, 0, 0)) ok(counter == tests[i].expected_value, "Got %u, expected %u.\n", counter, tests[i].expected_value); @@ -24448,8 +24449,8 @@ static void test_atomic_instructions(void) unsigned int expected = test->expected_result[j]; bool is_bug; - is_bug = test->i.x < 0 - && (!strcmp(instructions[j], "atomic_imax") || !strcmp(instructions[j], "atomic_imin")); + is_bug = is_macos_lt(15, 0, 0) || (test->i.x < 0 + && (!strcmp(instructions[j], "atomic_imax") || !strcmp(instructions[j], "atomic_imin"))); /* Fixed at least on radv with mesa >= 21.3.7. */ bug_if(is_bug) @@ -37764,6 +37765,7 @@ static void test_clock_calibration(void) hr = ID3D12CommandQueue_GetClockCalibration(context.queue, &gpu_times[1], &cpu_times[1]); ok(hr == S_OK, "Failed to retrieve calibrated timestamps, hr %#x.\n", hr); + bug_if(is_macos_lt(15, 0, 0)) ok(gpu_times[1] > gpu_times[0], "Inconsistent GPU timestamps %"PRIu64" and %"PRIu64".\n", gpu_times[0], gpu_times[1]); ok(cpu_times[1] > cpu_times[0], "Inconsistent CPU timestamps %"PRIu64" and %"PRIu64".\n", diff --git a/tests/d3d12_crosstest.h b/tests/d3d12_crosstest.h index 95ce9d23..f9810342 100644 --- a/tests/d3d12_crosstest.h +++ b/tests/d3d12_crosstest.h @@ -56,6 +56,10 @@ typedef int HRESULT; #include #include +#ifdef __APPLE__ +# include +#endif + #ifdef VKD3D_CROSSTEST # include "vkd3d_dxgi1_4.h" #else @@ -527,6 +531,11 @@ static inline bool is_mvk_device(ID3D12Device *device) return false; } +static inline bool is_macos_lt(unsigned int major, unsigned int minor, unsigned int patch) +{ + return false; +} + static inline bool is_depth_clip_enable_supported(ID3D12Device *device) { return true; @@ -846,6 +855,38 @@ static inline bool is_mvk_device(ID3D12Device *device) return properties.driverID == VK_DRIVER_ID_MOLTENVK; } +#ifdef __APPLE__ + +static inline bool is_macos_lt(unsigned int major, unsigned int minor, unsigned int patch) +{ + char str[256]; + size_t size = sizeof(str); + unsigned int version[3]; + int ret; + + ret = sysctlbyname("kern.osproductversion", str, &size, NULL, 0); + assert(!ret); + + ret = sscanf(str, "%u.%u.%u", &version[0], &version[1], &version[2]); + for (; ret < ARRAY_SIZE(version); ++ret) + version[ret] = 0; + + if (version[0] != major) + return version[0] < major; + if (version[1] != minor) + return version[1] < minor; + return version[2] < patch; +} + +#else + +static inline bool is_macos_lt(unsigned int major, unsigned int minor, unsigned int patch) +{ + return false; +} + +#endif + static inline bool is_depth_clip_enable_supported(ID3D12Device *device) { VkPhysicalDevice vk_physical_device = vkd3d_get_vk_physical_device(device);