SDL: gpu: Vulkan should fail if the best device is non-conformant

From a4fa04f2d4d4d22bd2ed7786e4bed55774cfc533 Mon Sep 17 00:00:00 2001
From: Ethan Lee <[EMAIL REDACTED]>
Date: Thu, 29 Jan 2026 09:52:48 -0500
Subject: [PATCH] gpu: Vulkan should fail if the best device is non-conformant

---
 src/gpu/vulkan/SDL_gpu_vulkan.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/src/gpu/vulkan/SDL_gpu_vulkan.c b/src/gpu/vulkan/SDL_gpu_vulkan.c
index be3598f991061..693cc5eec7bf0 100644
--- a/src/gpu/vulkan/SDL_gpu_vulkan.c
+++ b/src/gpu/vulkan/SDL_gpu_vulkan.c
@@ -12181,6 +12181,21 @@ static Uint8 VULKAN_INTERNAL_DeterminePhysicalDevice(VulkanRenderer *renderer, V
         renderer->vkGetPhysicalDeviceProperties2KHR(
             renderer->physicalDevice,
             &renderer->physicalDeviceProperties);
+
+        /* FIXME: This is very much a last resort to avoid WIP drivers.
+         *
+         * As far as I know, the only drivers available to users that are also
+         * non-conformant are incomplete Mesa drivers. hasvk is one example.
+         *
+         * It'd be nice to detect this sooner, but if this device is truly the
+         * best device on the system, it's the same outcome anyhow.
+         * -flibit
+         */
+        if (renderer->physicalDeviceDriverProperties.conformanceVersion.major < 1) {
+            SDL_stack_free(physicalDevices);
+            SDL_stack_free(physicalDeviceExtensions);
+            return 0;
+        }
     } else {
         renderer->physicalDeviceProperties.pNext = NULL;