diff --git a/src/virtio/vulkan/vn_device.c b/src/virtio/vulkan/vn_device.c index 38f96e41dca..6d924dfe1f8 100644 --- a/src/virtio/vulkan/vn_device.c +++ b/src/virtio/vulkan/vn_device.c @@ -1603,7 +1603,8 @@ vn_physical_device_init_extensions(struct vn_physical_device *physical_dev) } static VkResult -vn_physical_device_init_version(struct vn_physical_device *physical_dev) +vn_physical_device_init_renderer_version( + struct vn_physical_device *physical_dev) { struct vn_instance *instance = physical_dev->instance; @@ -1623,9 +1624,10 @@ vn_physical_device_init_version(struct vn_physical_device *physical_dev) return VK_ERROR_INITIALIZATION_FAILED; } - physical_dev->renderer_version = props.apiVersion; - if (physical_dev->renderer_version > instance->renderer_api_version) - physical_dev->renderer_version = instance->renderer_api_version; + /* device version for internal use is capped */ + physical_dev->renderer_version = + MIN3(props.apiVersion, instance->renderer_api_version, + instance->renderer_info.vk_xml_version); return VK_SUCCESS; } @@ -1636,7 +1638,7 @@ vn_physical_device_init(struct vn_physical_device *physical_dev) struct vn_instance *instance = physical_dev->instance; const VkAllocationCallbacks *alloc = &instance->base.base.alloc; - VkResult result = vn_physical_device_init_version(physical_dev); + VkResult result = vn_physical_device_init_renderer_version(physical_dev); if (result != VK_SUCCESS) return result; diff --git a/src/virtio/vulkan/vn_device.h b/src/virtio/vulkan/vn_device.h index 0986d7ab0d8..c2bac2425ac 100644 --- a/src/virtio/vulkan/vn_device.h +++ b/src/virtio/vulkan/vn_device.h @@ -74,7 +74,14 @@ struct vn_physical_device { struct vn_instance *instance; + /* Between the driver and the app, properties.properties.apiVersion is what + * we advertise and is capped by VN_MAX_API_VERSION and others. + * + * Between the driver and the renderer, renderer_version is the device + * version we can use internally. + */ uint32_t renderer_version; + struct vk_device_extension_table renderer_extensions; uint32_t *extension_spec_versions;