zink: fix detection of KHR_maintenance1/2
authorHoe Hao Cheng <haochengho12907@gmail.com>
Sat, 13 Feb 2021 18:29:34 +0000 (02:29 +0800)
committerMarge Bot <eric+marge@anholt.net>
Sat, 13 Feb 2021 19:03:45 +0000 (19:03 +0000)
Since some extensions never got their dedicated feature structs, not all
extensions promoted to core Vulkan have the relevant feature bits in
`VkPhysicalDeviceVulkanXYFeatures`. Those extensions are supported by
the device when the device version is high enough.

For those extensions, set the screen flags directly if the device
version is sufficient, otherwise check for the extension as usual.

Fixes: efe6f00e ("zink/codegen: do not enable extensions that are now core")
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9030>

src/gallium/drivers/zink/zink_device_info.py

index 726ea887f4557b7b89b8f45c3d3fdbae487c9aa5..da41d2c45396b63ab276878ab12b477ed85a1b0a 100644 (file)
@@ -270,6 +270,10 @@ zink_get_physical_device_info(struct zink_screen *screen)
                if (!strcmp(extensions[i].extensionName, "${ext.name}")) {
                   support_${ext.name_with_vendor()} = true;
                }
+        %if not (ext.has_features or ext.has_properties):
+            } else {
+               info->have_${ext.name_with_vendor()} = true;
+        %endif
             }
          %endif
          %endfor
@@ -359,7 +363,7 @@ zink_get_physical_device_info(struct zink_screen *screen)
             conditions += "&& (" + cond + ")\\n"
     conditions = conditions.strip()
 %>\
-      info->have_${ext.name_with_vendor()} = support_${ext.name_with_vendor()}
+      info->have_${ext.name_with_vendor()} |= support_${ext.name_with_vendor()}
          ${conditions};
 </%helpers:guard>
         %endfor