nvk: Wire up MESA_VK_VERSION_OVERRIDE

We'll probably drop this once we have Vulkan 1.3 but this makes it a bit
easier to test stuff right now.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26359>
This commit is contained in:
Faith Ekstrand 2023-11-24 13:29:56 -06:00 committed by Marge Bot
parent b07a58157d
commit 28ae3210e1
2 changed files with 7 additions and 2 deletions

View file

@ -15,7 +15,10 @@
VKAPI_ATTR VkResult VKAPI_CALL
nvk_EnumerateInstanceVersion(uint32_t *pApiVersion)
{
*pApiVersion = VK_MAKE_VERSION(1, 0, VK_HEADER_VERSION);
uint32_t version_override = vk_get_version_override();
*pApiVersion = version_override ? version_override :
VK_MAKE_VERSION(1, 0, VK_HEADER_VERSION);
return VK_SUCCESS;
}

View file

@ -421,13 +421,15 @@ nvk_get_device_properties(const struct nvk_instance *instance,
const struct nv_device_info *info,
struct vk_properties *properties)
{
uint32_t version_override = vk_get_version_override();
const VkSampleCountFlagBits sample_counts = VK_SAMPLE_COUNT_1_BIT |
VK_SAMPLE_COUNT_2_BIT |
VK_SAMPLE_COUNT_4_BIT |
VK_SAMPLE_COUNT_8_BIT;
*properties = (struct vk_properties) {
.apiVersion = VK_MAKE_VERSION(1, 0, VK_HEADER_VERSION),
.apiVersion = version_override ? version_override :
VK_MAKE_VERSION(1, 0, VK_HEADER_VERSION),
.driverVersion = vk_get_driver_version(),
.vendorID = NVIDIA_VENDOR_ID,
.deviceID = info->device_id,