-- v4: ci: Build Mesa for release. tests: Pop the test context when leaving its scope. tests: Add llvmpipe among the Mesa drivers. tests: Print the device name. tests: Skip some tests that crash on llvmpipe. tests: Mark some test failures as todo on llvmpipe.
From: Giovanni Mascellani gmascellani@codeweavers.com
--- tests/d3d12.c | 16 ++++++++++++++++ tests/d3d12_crosstest.h | 13 +++++++++++++ 2 files changed, 29 insertions(+)
diff --git a/tests/d3d12.c b/tests/d3d12.c index b8d20a581..993c15faf 100644 --- a/tests/d3d12.c +++ b/tests/d3d12.c @@ -19214,8 +19214,16 @@ static void test_descriptors_visibility(void) root_signature_desc.NumStaticSamplers = 2; root_signature_desc.pStaticSamplers = sampler_desc; hr = create_root_signature(device, &root_signature_desc, &context.root_signature); + /* llvmpipe (from Mesa 24.0.4) has maxBoundDescriptorSet == 8, which is less than we need. */ + todo_if(is_llvmpipe_device(device)) ok(SUCCEEDED(hr), "Failed to create root signature, hr %#x.\n", hr);
+ if (FAILED(hr)) + { + destroy_test_context(&context); + return; + } + context.pipeline_state = create_pipeline_state(device, context.root_signature, context.render_target_desc.Format, &vs, &ps, NULL); @@ -20858,8 +20866,16 @@ static void test_depth_stencil_sampling(void) root_signature_desc.NumStaticSamplers = 2; root_signature_desc.pStaticSamplers = sampler_desc; hr = create_root_signature(device, &root_signature_desc, &context.root_signature); + /* llvmpipe (from Mesa 24.0.4) has maxBoundDescriptorSet == 8, which is less than we need. */ + todo_if(is_llvmpipe_device(device)) ok(SUCCEEDED(hr), "Failed to create root signature, hr %#x.\n", hr);
+ if (FAILED(hr)) + { + destroy_test_context(&context); + return; + } + pso_compare = create_pipeline_state(device, context.root_signature, context.render_target_desc.Format, NULL, &ps_compare, NULL); pso_depth = create_pipeline_state(device, diff --git a/tests/d3d12_crosstest.h b/tests/d3d12_crosstest.h index 6c0a4ef12..e24016459 100644 --- a/tests/d3d12_crosstest.h +++ b/tests/d3d12_crosstest.h @@ -401,6 +401,11 @@ static inline bool is_mesa_intel_device(ID3D12Device *device) return false; }
+static inline bool is_llvmpipe_device(ID3D12Device *device) +{ + return false; +} + static inline bool is_nvidia_device(ID3D12Device *device) { return false; @@ -649,6 +654,14 @@ static inline bool is_mesa_intel_device(ID3D12Device *device) return properties.driverID == VK_DRIVER_ID_INTEL_OPEN_SOURCE_MESA_KHR; }
+static inline bool is_llvmpipe_device(ID3D12Device *device) +{ + VkPhysicalDeviceDriverPropertiesKHR properties; + + get_driver_properties(device, &properties); + return properties.driverID == VK_DRIVER_ID_MESA_LLVMPIPE; +} + static inline bool is_nvidia_device(ID3D12Device *device) { VkPhysicalDeviceDriverPropertiesKHR properties;
From: Giovanni Mascellani gmascellani@codeweavers.com
--- tests/d3d12.c | 18 ++++++++++++++ tests/d3d12_crosstest.h | 52 ++++++++++++++++++++++++++++++++++------- 2 files changed, 62 insertions(+), 8 deletions(-)
diff --git a/tests/d3d12.c b/tests/d3d12.c index 993c15faf..a08a6394f 100644 --- a/tests/d3d12.c +++ b/tests/d3d12.c @@ -19588,6 +19588,15 @@ static void test_null_srv(void) queue = context.queue; device = context.device;
+ if (is_llvmpipe_device_gte(device, 23, 2, 1)) + { + /* llvmpipe crashes when mutable descriptors are used. I don't + * know yet whether this is a bug in vkd3d or Mesa. */ + skip("Test crashes on llvmpipe, skipping.\n"); + destroy_test_context(&context); + return; + } + context.root_signature = create_texture_root_signature(context.device, D3D12_SHADER_VISIBILITY_PIXEL, 4, 0);
@@ -19803,6 +19812,15 @@ static void test_null_uav(void) command_list = context.list; queue = context.queue;
+ if (is_llvmpipe_device_gte(device, 23, 2, 1)) + { + /* llvmpipe crashes when mutable descriptors are used. I don't + * know yet whether this is a bug in vkd3d or Mesa. */ + skip("Test crashes on llvmpipe, skipping.\n"); + destroy_test_context(&context); + return; + } + descriptor_ranges[0].RangeType = D3D12_DESCRIPTOR_RANGE_TYPE_UAV; descriptor_ranges[0].NumDescriptors = 1; descriptor_ranges[0].BaseShaderRegister = 1; diff --git a/tests/d3d12_crosstest.h b/tests/d3d12_crosstest.h index e24016459..a27b62e77 100644 --- a/tests/d3d12_crosstest.h +++ b/tests/d3d12_crosstest.h @@ -406,6 +406,12 @@ static inline bool is_llvmpipe_device(ID3D12Device *device) return false; }
+static inline bool is_llvmpipe_device_gte(ID3D12Device *device, + uint32_t major, uint32_t minor, uint32_t patch) +{ + return false; +} + static inline bool is_nvidia_device(ID3D12Device *device) { return false; @@ -564,7 +570,8 @@ static ID3D12Device *create_device(void) return SUCCEEDED(hr) ? device : NULL; }
-static bool get_driver_properties(ID3D12Device *device, VkPhysicalDeviceDriverPropertiesKHR *driver_properties) +static bool get_driver_properties(ID3D12Device *device, VkPhysicalDeviceProperties *device_properties, + VkPhysicalDeviceDriverPropertiesKHR *driver_properties) { PFN_vkGetPhysicalDeviceProperties2KHR pfn_vkGetPhysicalDeviceProperties2KHR; VkPhysicalDeviceProperties2 device_properties2; @@ -588,6 +595,8 @@ static bool get_driver_properties(ID3D12Device *device, VkPhysicalDeviceDriverPr device_properties2.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2; device_properties2.pNext = driver_properties; pfn_vkGetPhysicalDeviceProperties2KHR(vk_physical_device, &device_properties2); + if (device_properties) + *device_properties = device_properties2.properties; return true; }
@@ -618,7 +627,7 @@ LOAD_VK_PFN(vkGetInstanceProcAddr)
if (SUCCEEDED(hr = create_vkd3d_device(instance, D3D_FEATURE_LEVEL_11_0, &IID_ID3D12Device, (void **)&device))) { - if (get_driver_properties(device, &driver_properties)) + if (get_driver_properties(device, NULL, &driver_properties)) trace("Driver name: %s, driver info: %s.\n", driver_properties.driverName, driver_properties.driverInfo);
ID3D12Device_Release(device); @@ -641,7 +650,7 @@ static inline bool is_mesa_device(ID3D12Device *device) { VkPhysicalDeviceDriverPropertiesKHR properties;
- get_driver_properties(device, &properties); + get_driver_properties(device, NULL, &properties); return properties.driverID == VK_DRIVER_ID_MESA_RADV_KHR || properties.driverID == VK_DRIVER_ID_INTEL_OPEN_SOURCE_MESA_KHR; } @@ -650,7 +659,7 @@ static inline bool is_mesa_intel_device(ID3D12Device *device) { VkPhysicalDeviceDriverPropertiesKHR properties;
- get_driver_properties(device, &properties); + get_driver_properties(device, NULL, &properties); return properties.driverID == VK_DRIVER_ID_INTEL_OPEN_SOURCE_MESA_KHR; }
@@ -658,15 +667,42 @@ static inline bool is_llvmpipe_device(ID3D12Device *device) { VkPhysicalDeviceDriverPropertiesKHR properties;
- get_driver_properties(device, &properties); + get_driver_properties(device, NULL, &properties); return properties.driverID == VK_DRIVER_ID_MESA_LLVMPIPE; }
+static inline bool is_llvmpipe_device_gte(ID3D12Device *device, + uint32_t major, uint32_t minor, uint32_t patch) +{ + VkPhysicalDeviceDriverPropertiesKHR driver_properties; + VkPhysicalDeviceProperties device_properties; + + get_driver_properties(device, &device_properties, &driver_properties); + if (driver_properties.driverID != VK_DRIVER_ID_MESA_LLVMPIPE) + return false; + + if (device_properties.driverVersion == 1) + { + uint32_t driver_major, driver_minor, driver_patch; + + /* llvmpipe doesn't provide a valid driverVersion value, so we resort to parsing the + * driverInfo string. */ + if (sscanf(driver_properties.driverInfo, "Mesa %u.%u.%u", + &driver_major, &driver_minor, &driver_patch) == 3) + { + device_properties.driverVersion = VK_MAKE_API_VERSION(0, + driver_major, driver_minor, driver_patch); + } + } + + return device_properties.driverVersion >= VK_MAKE_API_VERSION(0, major, minor, patch); +} + static inline bool is_nvidia_device(ID3D12Device *device) { VkPhysicalDeviceDriverPropertiesKHR properties;
- get_driver_properties(device, &properties); + get_driver_properties(device, NULL, &properties); return properties.driverID == VK_DRIVER_ID_NVIDIA_PROPRIETARY_KHR; }
@@ -674,7 +710,7 @@ static inline bool is_radv_device(ID3D12Device *device) { VkPhysicalDeviceDriverPropertiesKHR properties;
- get_driver_properties(device, &properties); + get_driver_properties(device, NULL, &properties); return properties.driverID == VK_DRIVER_ID_MESA_RADV_KHR; }
@@ -682,7 +718,7 @@ static inline bool is_mvk_device(ID3D12Device *device) { VkPhysicalDeviceDriverPropertiesKHR properties;
- get_driver_properties(device, &properties); + get_driver_properties(device, NULL, &properties); return properties.driverID == VK_DRIVER_ID_MOLTENVK; }
From: Giovanni Mascellani gmascellani@codeweavers.com
--- tests/d3d12_crosstest.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/tests/d3d12_crosstest.h b/tests/d3d12_crosstest.h index a27b62e77..6b532bda8 100644 --- a/tests/d3d12_crosstest.h +++ b/tests/d3d12_crosstest.h @@ -606,6 +606,7 @@ static bool get_driver_properties(ID3D12Device *device, VkPhysicalDeviceProperti static void init_adapter_info(void) { VkPhysicalDeviceDriverPropertiesKHR driver_properties; + VkPhysicalDeviceProperties device_properties; struct vkd3d_instance *instance; ID3D12Device *device; void *libvulkan; @@ -627,8 +628,9 @@ LOAD_VK_PFN(vkGetInstanceProcAddr)
if (SUCCEEDED(hr = create_vkd3d_device(instance, D3D_FEATURE_LEVEL_11_0, &IID_ID3D12Device, (void **)&device))) { - if (get_driver_properties(device, NULL, &driver_properties)) - trace("Driver name: %s, driver info: %s.\n", driver_properties.driverName, driver_properties.driverInfo); + if (get_driver_properties(device, &device_properties, &driver_properties)) + trace("Driver name: %s, driver info: %s, device name: %s.\n", driver_properties.driverName, + driver_properties.driverInfo, device_properties.deviceName);
ID3D12Device_Release(device); }
From: Giovanni Mascellani gmascellani@codeweavers.com
--- tests/d3d12_crosstest.h | 1 + 1 file changed, 1 insertion(+)
diff --git a/tests/d3d12_crosstest.h b/tests/d3d12_crosstest.h index 6b532bda8..99641425d 100644 --- a/tests/d3d12_crosstest.h +++ b/tests/d3d12_crosstest.h @@ -654,6 +654,7 @@ static inline bool is_mesa_device(ID3D12Device *device)
get_driver_properties(device, NULL, &properties); return properties.driverID == VK_DRIVER_ID_MESA_RADV_KHR + || properties.driverID == VK_DRIVER_ID_MESA_LLVMPIPE || properties.driverID == VK_DRIVER_ID_INTEL_OPEN_SOURCE_MESA_KHR; }
From: Giovanni Mascellani gmascellani@codeweavers.com
--- tests/d3d12.c | 3 +++ 1 file changed, 3 insertions(+)
diff --git a/tests/d3d12.c b/tests/d3d12.c index a08a6394f..ac4f242f6 100644 --- a/tests/d3d12.c +++ b/tests/d3d12.c @@ -32472,7 +32472,10 @@ static void test_resource_allocation_info(void) ok(infos1[i].SizeInBytes == sizes[i], "Got unexpected size %"PRIu64".\n", infos1[i].SizeInBytes);
if (!i) + { + vkd3d_test_pop_context(); continue; + }
ok(infos1[i].Offset - infos1[i - 1].Offset >= infos1[i - 1].SizeInBytes, "Got unexpected prev size %"PRIu64", prev offset %"PRIu64", offset %"PRIu64".\n",
From: Giovanni Mascellani gmascellani@codeweavers.com
Otherwise it trips on a few failed assertions in d3d12.c. --- gitlab/image.docker | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gitlab/image.docker b/gitlab/image.docker index fb3ed6260..9807e3060 100644 --- a/gitlab/image.docker +++ b/gitlab/image.docker @@ -75,7 +75,7 @@ RUN export DEBIAN_FRONTEND=noninteractive; \ cd mesa && \ mkdir build && \ cd build && \ - meson setup -Dprefix=/opt/mesa24 -Dplatforms= -Dvideo-codecs= -Dvulkan-drivers=swrast -Dgallium-drivers=swrast -Dopengl=true -Degl=enabled -Dglvnd=true -Dshared-glapi=enabled -Dglx=disabled -Dgles1=disabled -Dgles2=disabled .. && \ + meson setup --buildtype release -Dprefix=/opt/mesa24 -Dplatforms= -Dvideo-codecs= -Dvulkan-drivers=swrast -Dgallium-drivers=swrast -Dopengl=true -Degl=enabled -Dglvnd=true -Dshared-glapi=enabled -Dglx=disabled -Dgles1=disabled -Dgles2=disabled .. && \ meson install && \ cd ../.. && \ rm -fr mesa && \
This merge request was approved by Henri Verbeet.