diff --git a/crates/metal2vulkan-validation/profiles/vk12-floor.json b/crates/metal2vulkan-validation/profiles/vk12-floor.json index 744331b2d..8d6bee6fe 100644 --- a/crates/metal2vulkan-validation/profiles/vk12-floor.json +++ b/crates/metal2vulkan-validation/profiles/vk12-floor.json @@ -1013,6 +1013,11 @@ }, "m2v_unrequired_properties": { "properties": { + "VkPhysicalDeviceProperties": { + "limits": { + "strictLines": false + } + }, "VkPhysicalDeviceVulkan11Properties": { "subgroupQuadOperationsInAllStages": false } diff --git a/scripts/regen-device-profiles/README.md b/scripts/regen-device-profiles/README.md index a2eb063fc..de40e2ab7 100644 --- a/scripts/regen-device-profiles/README.md +++ b/scripts/regen-device-profiles/README.md @@ -23,7 +23,7 @@ per-profile checks; nothing in the product reads them at runtime. |---|---|---| | `gpuinfo` | raw vulkan.gpuinfo.org report, `api/v2/getreport.php?id=N`, pinned by SHA-256 | typed conversion through the pinned Vulkan-Headers `vk.xml` | | `khronos` | a pinned KhronosGroup/Vulkan-Profiles file | one profile and its capability blocks, verbatim; profile renamed; a profile that states no formats gets the Required Format Support tables (below); a source marked `layer_presentation` gets the block `m2v_layer_presentation`: each feature its core version requires that it omits, and each member the product reads of the core property structures of its version (`CORE_PROPERTIES`, or the value a feature it states makes exact, `FEATURE_EXACT_PROPERTIES`) and of the property structures of the extensions it lists (`EXTENSION_PROPERTIES`) that it omits, at the value the product's reader takes, and each format several of its blocks state, at the union of their flags (the layer keeps the last block's entry of a format; the reader ORs them), so that `VK_LAYER_KHRONOS_profiles` reports the profile as the product reads it (the regeneration fails on a version or an extension property structure the product reads whose values it does not model) | -| `derived` | `VP_LUNARG_minimum_requirements_1_2` | features reduced to `vk.xml`'s unconditional 1.0–1.2 requirements; a base value the Vulkan 1.2 specification contradicts replaced by the specification's (`SPEC_CORRECTIONS`, named in `provenance.spec_corrections`; the regeneration fails when the base states another value or none); plus the Vulkan 1.2 Required Format Support tables (below), and the block `m2v_unrequired_properties`: the weakest value the specification permits for each property the product reads, and `VK_LAYER_KHRONOS_profiles` sets, that the base leaves without a requirement (quad operations in all stages), which the layer would otherwise take from the device | +| `derived` | `VP_LUNARG_minimum_requirements_1_2` | features reduced to `vk.xml`'s unconditional 1.0–1.2 requirements; a base value the Vulkan 1.2 specification contradicts replaced by the specification's (`SPEC_CORRECTIONS`, named in `provenance.spec_corrections`; the regeneration fails when the base states another value or none); plus the Vulkan 1.2 Required Format Support tables (below), and the block `m2v_unrequired_properties`: the weakest value the specification permits for each property the product reads, and `VK_LAYER_KHRONOS_profiles` sets, that the base leaves without a requirement (strict lines, quad operations in all stages), which the layer would otherwise take from the device | | `vulkaninfo` | a local `vulkaninfo --json` capture, and for a Vulkan 1.3+ device its `corpus-vulkan --capture-formats` supplement | the capture's profile (a portability-subset one where the device has the subset); identical queue families collapsed (schema `uniqueItems`); an extension the pinned registry does not define and a pointer member written as `NULL` removed and named in `provenance.unmapped`; each format's `VkFormatProperties3` from the supplement | gpuinfo's own profile export (`api/v3/getprofile.php`) returned HTTP 500 for every report when diff --git a/scripts/regen-device-profiles/regen_device_profiles.py b/scripts/regen-device-profiles/regen_device_profiles.py index e0543e46f..ebc7ef258 100755 --- a/scripts/regen-device-profiles/regen_device_profiles.py +++ b/scripts/regen-device-profiles/regen_device_profiles.py @@ -81,6 +81,7 @@ GPUINFO_DISPLAY = "https://vulkan.gpuinfo.org/displayreport.php?id={}" # and keeps the device's value whatever a profile states. UNREQUIRED_PROPERTIES_BLOCK = "m2v_unrequired_properties" UNREQUIRED_PROPERTIES = { + "VkPhysicalDeviceProperties": {"limits": {"strictLines": False}}, "VkPhysicalDeviceVulkan11Properties": {"subgroupQuadOperationsInAllStages": False}, } @@ -1309,10 +1310,15 @@ def derive(registry, data, source, formats): "dropped_features": sorted(dropped), "spec_corrections": sorted(corrected), } + def flattened(struct, members): + nested = members.get("limits") if struct == "VkPhysicalDeviceProperties" else None + return nested if nested is not None else members + stated = {(struct, member) for block in capabilities.values() - for struct, members in block.get("properties", {}).items() for member in members} + for struct, members in block.get("properties", {}).items() + for member in flattened(struct, members)} restated = sorted(f"{struct}.{member}" for struct, members in UNREQUIRED_PROPERTIES.items() - for member in members if (struct, member) in stated) + for member in flattened(struct, members) if (struct, member) in stated) if restated: raise SystemExit(f"{source['name']}: the base profile now states {restated}") capabilities[UNREQUIRED_PROPERTIES_BLOCK] = { diff --git a/scripts/regen-device-profiles/test_device_profiles.py b/scripts/regen-device-profiles/test_device_profiles.py index 285b47e34..1deaecb5b 100644 --- a/scripts/regen-device-profiles/test_device_profiles.py +++ b/scripts/regen-device-profiles/test_device_profiles.py @@ -276,6 +276,7 @@ class DeriveTest(unittest.TestCase): doc = self.derive({"VkPhysicalDeviceVulkan11Properties": {"subgroupSize": 1}}) block = doc["capabilities"][regen.UNREQUIRED_PROPERTIES_BLOCK] self.assertEqual(block, {"properties": { + "VkPhysicalDeviceProperties": {"limits": {"strictLines": False}}, "VkPhysicalDeviceVulkan11Properties": {"subgroupQuadOperationsInAllStages": False}}}) [profile] = doc["profiles"].values() self.assertIn(regen.UNREQUIRED_PROPERTIES_BLOCK, profile["capabilities"]) @@ -285,6 +286,14 @@ class DeriveTest(unittest.TestCase): stated = {"VkPhysicalDeviceVulkan11Properties": {"subgroupQuadOperationsInAllStages": True}} with self.assertRaises(SystemExit): self.derive(stated) + with self.assertRaises(SystemExit): + self.derive({"VkPhysicalDeviceProperties": {"limits": {"strictLines": True}}}) + + def test_a_limit_is_told_apart_from_the_limits_a_base_states(self): + doc = self.derive({"VkPhysicalDeviceProperties": {"limits": {"maxImageDimension1D": 4096}}}) + block = doc["capabilities"][regen.UNREQUIRED_PROPERTIES_BLOCK] + self.assertEqual(block["properties"]["VkPhysicalDeviceProperties"], + {"limits": {"strictLines": False}}) PRESENTATION_REGISTRY = b"""