浏览代码

Make deviceRank an Uint64 to avoid potential overflow issues in case of future GPUs with huge VRAM

suleyth 1 月之前
父节点
当前提交
618f85fafe
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      src/gpu/vulkan/SDL_gpu_vulkan.c

+ 2 - 2
src/gpu/vulkan/SDL_gpu_vulkan.c

@@ -11252,7 +11252,7 @@ static Uint8 VULKAN_INTERNAL_IsDeviceSuitable(
     VkPhysicalDevice physicalDevice,
     VkPhysicalDevice physicalDevice,
     VulkanExtensions *physicalDeviceExtensions,
     VulkanExtensions *physicalDeviceExtensions,
     Uint32 *queueFamilyIndex,
     Uint32 *queueFamilyIndex,
-    Uint16 *deviceRank)
+    Uint64 *deviceRank)
 {
 {
     Uint32 queueFamilyCount, queueFamilyRank, queueFamilyBest;
     Uint32 queueFamilyCount, queueFamilyRank, queueFamilyBest;
     VkQueueFamilyProperties *queueProps;
     VkQueueFamilyProperties *queueProps;
@@ -11411,7 +11411,7 @@ static Uint8 VULKAN_INTERNAL_DeterminePhysicalDevice(VulkanRenderer *renderer)
     Uint32 i, physicalDeviceCount;
     Uint32 i, physicalDeviceCount;
     Sint32 suitableIndex;
     Sint32 suitableIndex;
     Uint32 queueFamilyIndex, suitableQueueFamilyIndex;
     Uint32 queueFamilyIndex, suitableQueueFamilyIndex;
-    Uint16 deviceRank, highestRank;
+    Uint64 deviceRank, highestRank;
 
 
     vulkanResult = renderer->vkEnumeratePhysicalDevices(
     vulkanResult = renderer->vkEnumeratePhysicalDevices(
         renderer->instance,
         renderer->instance,