From bbc7866fa02caefd16d6c6ead0d79ed61ddb73dd Mon Sep 17 00:00:00 2001 From: Anees Iqbal Date: Sun, 1 Nov 2026 16:35:05 -0800 Subject: [PATCH] Read nonStrictWideLinesUseParallelogram from the maintenance5 properties The profile reader took VkPhysicalDeviceMaintenance5Properties' members only through VkPhysicalDeviceVulkan14Properties, so a capture of a Vulkan 1.3 device exposing VK_KHR_maintenance5, which carries only the extension's structure, read nonStrictWideLinesUseParallelogram as false, and the runtime would announce or band wide lines its device draws as Metal's parallelogram. PROPERTY_STRUCTS now lists VkPhysicalDeviceMaintenance5Properties and its KHR name; the member is still read only where maintenance5 is exposed (the extension or 1.4). The profile generator's EXTENSION_PROPERTIES states the member at the value the reader takes when a requirements document lists the extension and omits it (false). Nothing moves: every committed capture that carries the extension structure also carries the Vulkan 1.4 one, with the same value (golden_hashes passes unblessed). The runtime-sources pin, which hashes this file, is rewritten in the next commit. Verified: nextest device::tests::description (23 pass), among them the new wide_line_parallelograms_read_the_maintenance5_structure (a 1.3 document with the extension and either structure name reads true, without the extension false, a 1.4 document's Vulkan 1.4 block true); negative control: with the two names left out of PROPERTY_STRUCTS the test fails; golden_hashes and fast_paths pass; scripts/regen-device- profiles test_device_profiles.py and check_device_profiles.py clean. (Carried to development from steelbrain/reims-graphics-kext 5651992284.) --- crates/metal2vulkan/src/device/khronos.rs | 2 + .../src/device/tests/description.rs | 44 +++++++++++++++++++ .../regen_device_profiles.py | 1 + 3 files changed, 47 insertions(+) diff --git a/crates/metal2vulkan/src/device/khronos.rs b/crates/metal2vulkan/src/device/khronos.rs index 56a8fe9c2..0c1e69b9b 100644 --- a/crates/metal2vulkan/src/device/khronos.rs +++ b/crates/metal2vulkan/src/device/khronos.rs @@ -1086,6 +1086,8 @@ const PROPERTY_STRUCTS: &[&str] = &[ "VkPhysicalDeviceSubgroupSizeControlPropertiesEXT", "VkPhysicalDeviceMaintenance4Properties", "VkPhysicalDeviceMaintenance4PropertiesKHR", + "VkPhysicalDeviceMaintenance5Properties", + "VkPhysicalDeviceMaintenance5PropertiesKHR", "VkPhysicalDevicePushDescriptorProperties", "VkPhysicalDevicePushDescriptorPropertiesKHR", "VkPhysicalDeviceVertexAttributeDivisorProperties", diff --git a/crates/metal2vulkan/src/device/tests/description.rs b/crates/metal2vulkan/src/device/tests/description.rs index 4d9d16b6e..dd5dc5880 100644 --- a/crates/metal2vulkan/src/device/tests/description.rs +++ b/crates/metal2vulkan/src/device/tests/description.rs @@ -460,6 +460,50 @@ fn acceleration_structure_limits_read_their_property_structure() { assert_eq!(l.max_descriptor_set_acceleration_structures, 0); } +/// `nonStrictWideLinesUseParallelogram` is read where `VK_KHR_maintenance5` is exposed, from its +/// extension's property structure as from the Vulkan 1.4 one (a capture of a Vulkan 1.3 device +/// carries only the first), and is false without the extension or where unstated. +#[test] +fn wide_line_parallelograms_read_the_maintenance5_structure() { + assert!( + profile("amd-780m-radv") + .limits + .non_strict_wide_lines_use_parallelogram + ); + assert!( + !profile("lavapipe") + .limits + .non_strict_wide_lines_use_parallelogram + ); + let read = |api: &str, blocks: &str| { + DeviceDescription::from_khronos_json(&doc(api, r#""a""#, blocks), None) + .unwrap() + .limits + .non_strict_wide_lines_use_parallelogram + }; + let extension = r#""extensions": {"VK_KHR_maintenance5": 1}"#; + for structure in [ + "VkPhysicalDeviceMaintenance5PropertiesKHR", + "VkPhysicalDeviceMaintenance5Properties", + ] { + let props = format!( + r#""properties": {{"{structure}": {{"nonStrictWideLinesUseParallelogram": true}}}}"# + ); + assert!( + read("1.3.0", &format!(r#""a": {{{extension}, {props}}}"#)), + "{structure}" + ); + assert!( + !read("1.3.0", &format!(r#""a": {{{props}}}"#)), + "{structure}" + ); + } + let v14 = r#""properties": {"VkPhysicalDeviceVulkan14Properties": + {"nonStrictWideLinesUseParallelogram": true}}"#; + assert!(read("1.4.0", &format!(r#""a": {{{v14}}}"#))); + assert!(!read("1.3.0", &format!(r#""a": {{{extension}}}"#))); +} + #[test] fn profile_documents_imply_version_required_features() { // The LunarG baseline lists 1.2 structures but not every member 1.2 requires. diff --git a/scripts/regen-device-profiles/regen_device_profiles.py b/scripts/regen-device-profiles/regen_device_profiles.py index f786faa0a..e0543e46f 100755 --- a/scripts/regen-device-profiles/regen_device_profiles.py +++ b/scripts/regen-device-profiles/regen_device_profiles.py @@ -238,6 +238,7 @@ EXTENSION_PROPERTIES = { "requiredSubgroupSizeStages": [], }, "VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT": {"maxVertexAttribDivisor": 0}, + "VkPhysicalDeviceMaintenance5Properties": {"nonStrictWideLinesUseParallelogram": False}, "VkPhysicalDeviceSampleLocationsPropertiesEXT": { "sampleLocationSampleCounts": [], "variableSampleLocations": False,