summaryrefslogtreecommitdiffstats
path: root/src/intel/vulkan/anv_extensions_gen.py
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2018-01-16 16:15:13 -0800
committerJason Ekstrand <[email protected]>2018-01-23 00:15:40 -0800
commit01b9701a5cd7a7607dbfa17f6037a7e46924dec1 (patch)
treeba12cc04e8e51402ceca50e03a7702f6f4be099b /src/intel/vulkan/anv_extensions_gen.py
parent920bd2c0bc605be288d3dd39ab7e900a8ad9e5ad (diff)
anv: Use tables for device extension wrangling
Reviewed-by: Samuel Iglesias Gonsálvez <[email protected]>
Diffstat (limited to 'src/intel/vulkan/anv_extensions_gen.py')
-rw-r--r--src/intel/vulkan/anv_extensions_gen.py42
1 files changed, 12 insertions, 30 deletions
diff --git a/src/intel/vulkan/anv_extensions_gen.py b/src/intel/vulkan/anv_extensions_gen.py
index b86d76326a4..33827ecd015 100644
--- a/src/intel/vulkan/anv_extensions_gen.py
+++ b/src/intel/vulkan/anv_extensions_gen.py
@@ -98,6 +98,12 @@ struct anv_device_extension_table {
};
};
+struct anv_physical_device;
+
+void
+anv_physical_device_get_supported_extensions(const struct anv_physical_device *device,
+ struct anv_device_extension_table *extensions);
+
#endif /* ANV_EXTENSIONS_H */
""")
@@ -152,39 +158,15 @@ const VkExtensionProperties anv_device_extensions[ANV_DEVICE_EXTENSION_COUNT] =
%endfor
};
-bool
-anv_physical_device_extension_supported(struct anv_physical_device *device,
- const char *name)
+void
+anv_physical_device_get_supported_extensions(const struct anv_physical_device *device,
+ struct anv_device_extension_table *extensions)
{
+ *extensions = (struct anv_device_extension_table) {
%for ext in device_extensions:
- if (strcmp(name, "${ext.name}") == 0)
- return ${ext.enable};
+ .${ext.name[3:]} = ${ext.enable},
%endfor
- return false;
-}
-
-VkResult anv_EnumerateDeviceExtensionProperties(
- VkPhysicalDevice physicalDevice,
- const char* pLayerName,
- uint32_t* pPropertyCount,
- VkExtensionProperties* pProperties)
-{
- ANV_FROM_HANDLE(anv_physical_device, device, physicalDevice);
- VK_OUTARRAY_MAKE(out, pProperties, pPropertyCount);
- (void)device;
-
-%for ext in device_extensions:
- if (${ext.enable}) {
- vk_outarray_append(&out, prop) {
- *prop = (VkExtensionProperties) {
- .extensionName = "${ext.name}",
- .specVersion = ${ext.ext_version},
- };
- }
- }
-%endfor
-
- return vk_outarray_status(&out);
+ };
}
""")