SDL: gpu: Check Vulkan device features for IsDeviceSuitable

From 0852307b5867cbbbd0a72dc56046e06e73190620 Mon Sep 17 00:00:00 2001
From: Ethan Lee <[EMAIL REDACTED]>
Date: Fri, 27 Sep 2024 19:39:40 -0400
Subject: [PATCH] gpu: Check Vulkan device features for IsDeviceSuitable

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

diff --git a/src/gpu/vulkan/SDL_gpu_vulkan.c b/src/gpu/vulkan/SDL_gpu_vulkan.c
index ab80372196be0..84c073657aca9 100644
--- a/src/gpu/vulkan/SDL_gpu_vulkan.c
+++ b/src/gpu/vulkan/SDL_gpu_vulkan.c
@@ -10826,6 +10826,7 @@ static Uint8 VULKAN_INTERNAL_IsDeviceSuitable(
     VkQueueFamilyProperties *queueProps;
     bool supportsPresent;
     VkPhysicalDeviceProperties deviceProperties;
+    VkPhysicalDeviceFeatures deviceFeatures;
     Uint32 i;
 
     const Uint8 *devicePriority = renderer->preferLowPower ? DEVICE_PRIORITY_LOWPOWER : DEVICE_PRIORITY_HIGHPERFORMANCE;
@@ -10852,6 +10853,16 @@ static Uint8 VULKAN_INTERNAL_IsDeviceSuitable(
         return 0;
     }
 
+    renderer->vkGetPhysicalDeviceFeatures(
+        physicalDevice,
+        &deviceFeatures);
+    if (!deviceFeatures.independentBlend ||
+        !deviceFeatures.imageCubeArray ||
+        !deviceFeatures.depthClamp ||
+        !deviceFeatures.shaderClipDistance) {
+        return 0;
+    }
+
     if (!VULKAN_INTERNAL_CheckDeviceExtensions(
             renderer,
             physicalDevice,