Module: Mesa
Branch: main
Commit: 28ae3210e1697c0506ca2581ebfceac22992da8f
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=28ae3210e1697c0506ca2581ebfceac22992da8f

Author: Faith Ekstrand <[email protected]>
Date:   Fri Nov 24 13:29:56 2023 -0600

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>

---

 src/nouveau/vulkan/nvk_instance.c        | 5 ++++-
 src/nouveau/vulkan/nvk_physical_device.c | 4 +++-
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/nouveau/vulkan/nvk_instance.c 
b/src/nouveau/vulkan/nvk_instance.c
index 2201650c297..c0b28add1f2 100644
--- a/src/nouveau/vulkan/nvk_instance.c
+++ b/src/nouveau/vulkan/nvk_instance.c
@@ -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;
 }
 
diff --git a/src/nouveau/vulkan/nvk_physical_device.c 
b/src/nouveau/vulkan/nvk_physical_device.c
index da426adce04..ace03c133f9 100644
--- a/src/nouveau/vulkan/nvk_physical_device.c
+++ b/src/nouveau/vulkan/nvk_physical_device.c
@@ -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,

Reply via email to