diff options
author | Jason Ekstrand <[email protected]> | 2017-08-01 11:50:59 -0700 |
---|---|---|
committer | Jason Ekstrand <[email protected]> | 2017-08-02 09:13:13 -0700 |
commit | 077b200096d07d514734f5ffb5208fed8500fa0f (patch) | |
tree | 38417bd209d16c570ee39847c9d726beeea65df7 /src/intel | |
parent | 0ab04ba979b7eb360176e6abad1d296e9da94985 (diff) |
anv: Pull the API version from anv_extensions.py
This way everything stays in sync and we only have the one version
number.
Reviewed-by: Lionel Landwerlin <[email protected]>
Diffstat (limited to 'src/intel')
-rw-r--r-- | src/intel/vulkan/anv_device.c | 2 | ||||
-rw-r--r-- | src/intel/vulkan/anv_extensions.py | 11 | ||||
-rw-r--r-- | src/intel/vulkan/anv_private.h | 1 |
3 files changed, 13 insertions, 1 deletions
diff --git a/src/intel/vulkan/anv_device.c b/src/intel/vulkan/anv_device.c index 70b5cd1ec68..793e519ad97 100644 --- a/src/intel/vulkan/anv_device.c +++ b/src/intel/vulkan/anv_device.c @@ -794,7 +794,7 @@ void anv_GetPhysicalDeviceProperties( }; *pProperties = (VkPhysicalDeviceProperties) { - .apiVersion = VK_MAKE_VERSION(1, 0, 54), + .apiVersion = anv_physical_device_api_version(pdevice), .driverVersion = vk_get_driver_version(), .vendorID = 0x8086, .deviceID = pdevice->chipset_id, diff --git a/src/intel/vulkan/anv_extensions.py b/src/intel/vulkan/anv_extensions.py index 7307cacbcac..f4bfcf197bf 100644 --- a/src/intel/vulkan/anv_extensions.py +++ b/src/intel/vulkan/anv_extensions.py @@ -91,6 +91,10 @@ class VkVersion: ver_list.append(str(self.patch)) return '.'.join(ver_list) + def c_vk_version(self): + ver_list = [str(self.major), str(self.minor), str(self.patch)] + return 'VK_MAKE_VERSION(' + ', '.join(ver_list) + ')' + def __int_ver(self): # This is just an expansion of VK_VERSION patch = self.patch if self.patch is not None else 0 @@ -173,6 +177,12 @@ VkResult anv_EnumerateInstanceExtensionProperties( return vk_outarray_status(&out); } +uint32_t +anv_physical_device_api_version(struct anv_physical_device *dev) +{ + return ${MAX_API_VERSION.c_vk_version()}; +} + bool anv_physical_device_extension_supported(struct anv_physical_device *device, const char *name) @@ -218,6 +228,7 @@ if __name__ == '__main__': _init_exts_from_xml(args.xml) template_env = { + 'MAX_API_VERSION': MAX_API_VERSION, 'instance_extensions': [e for e in EXTENSIONS if e.type == 'instance'], 'device_extensions': [e for e in EXTENSIONS if e.type == 'device'], } diff --git a/src/intel/vulkan/anv_private.h b/src/intel/vulkan/anv_private.h index 818f6990dc7..c3644914328 100644 --- a/src/intel/vulkan/anv_private.h +++ b/src/intel/vulkan/anv_private.h @@ -685,6 +685,7 @@ VkResult anv_init_wsi(struct anv_physical_device *physical_device); void anv_finish_wsi(struct anv_physical_device *physical_device); bool anv_instance_extension_supported(const char *name); +uint32_t anv_physical_device_api_version(struct anv_physical_device *dev); bool anv_physical_device_extension_supported(struct anv_physical_device *dev, const char *name); |