From f6ca70335348f45a5b6871221f30ccb2aaf7cd46 Mon Sep 17 00:00:00 2001 From: Anees Iqbal Date: Sun, 8 Nov 2026 03:59:46 -0800 Subject: [PATCH] Pooled class: ask a DRM_FORMAT_MOD_LINEAR image's import properties only beside the handle type they answer for What: modifier_image_limits chained VkExternalImageFormatProperties into every query, but since the pooled class (ModifierMemory::Own, 99f47fb7e8) it asks some without VkPhysicalDeviceExternalImageFormatInfo: the driver then leaves those properties untouched, and the validation layer warns (WARNING-vkGetPhysicalDeviceImageFormatProperties2-missing-external- info). It now chains them only where it names a handle type, the dma-buf and host allocation queries, and reads them only there, as before. Why: on lavapipe every validated device that runs the in-place check asks the pooled class's query, so 32 lane tests (43 failure lines) of dev 5ce05e1908's lavapipe leg failed their layer claim on this warning (no_copy_textures, in_place_textures, dma_buf_imports, device_copies, first_use_writes, linear_alignments, pitched_surfaces). Verified: at 5ce05e1908 on lavapipe (homelab-um870-1, job m3-max-8135), the lane's a_texture_made_before_its_verdict_moves_in_place_once_it_passes failed with ten of this warning and nothing else; the reruns at this commit follow in the tip's report. (cherry picked from commit d0df1fe68e76ede86d9987d16aad69d3375cfac6) --- crates/metal2vulkan-runtime/src/dma_buf.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/crates/metal2vulkan-runtime/src/dma_buf.rs b/crates/metal2vulkan-runtime/src/dma_buf.rs index 186a6189f..22aa40827 100644 --- a/crates/metal2vulkan-runtime/src/dma_buf.rs +++ b/crates/metal2vulkan-runtime/src/dma_buf.rs @@ -1428,8 +1428,14 @@ impl Device { if !view_formats.is_empty() { query = query.push_next(&mut list); } + // The import's properties are asked only beside the handle type they answer for: asked + // without one, the driver leaves them untouched, and the validation layer warns + // (`WARNING-vkGetPhysicalDeviceImageFormatProperties2-missing-external-info`). let mut imported = vk::ExternalImageFormatProperties::default(); - let mut properties = vk::ImageFormatProperties2::default().push_next(&mut imported); + let mut properties = vk::ImageFormatProperties2::default(); + if memory.handle_type().is_some() { + properties = properties.push_next(&mut imported); + } // SAFETY: the physical device is the instance's, whose device enables the extensions; // `query` and `properties` and their chains live for the call. let queried = unsafe {