From 94436a938d09af3269d18127ebbed1e5c6d4c219 Mon Sep 17 00:00:00 2001
From: Caleb Cornett <[EMAIL REDACTED]>
Date: Fri, 13 Sep 2024 10:15:38 -0500
Subject: [PATCH] GPU: Remove unused and incorrect D16 format checks from
Vulkan driver
---
src/gpu/vulkan/SDL_gpu_vulkan.c | 40 ---------------------------------
1 file changed, 40 deletions(-)
diff --git a/src/gpu/vulkan/SDL_gpu_vulkan.c b/src/gpu/vulkan/SDL_gpu_vulkan.c
index 1e842e8774f42..2763ec8b44db9 100644
--- a/src/gpu/vulkan/SDL_gpu_vulkan.c
+++ b/src/gpu/vulkan/SDL_gpu_vulkan.c
@@ -1096,10 +1096,6 @@ struct VulkanRenderer
Uint32 minUBOAlignment;
- // Some drivers don't support D16 for some reason. Fun!
- VkFormat D16Format;
- VkFormat D16S8Format;
-
// Deferred resource destruction
VulkanTexture **texturesToDestroy;
@@ -11681,12 +11677,8 @@ static SDL_GPUDevice *VULKAN_CreateDevice(bool debugMode, bool preferLowPower, S
VulkanRenderer *renderer;
SDL_GPUDevice *result;
- VkResult vulkanResult;
Uint32 i;
- // Variables: Image Format Detection
- VkImageFormatProperties imageFormatProperties;
-
if (!SDL_Vulkan_LoadLibrary(NULL)) {
SDL_assert(!"This should have failed in PrepareDevice first!");
return NULL;
@@ -11833,38 +11825,6 @@ static SDL_GPUDevice *VULKAN_CreateDevice(bool debugMode, bool preferLowPower, S
renderer->fencePool.availableFences = SDL_malloc(
renderer->fencePool.availableFenceCapacity * sizeof(VulkanFenceHandle *));
- // Some drivers don't support D16, so we have to fall back to D32.
-
- vulkanResult = renderer->vkGetPhysicalDeviceImageFormatProperties(
- renderer->physicalDevice,
- VK_FORMAT_D16_UNORM,
- VK_IMAGE_TYPE_2D,
- VK_IMAGE_TILING_OPTIMAL,
- VK_IMAGE_ASPECT_DEPTH_BIT,
- 0,
- &imageFormatProperties);
-
- if (vulkanResult == VK_ERROR_FORMAT_NOT_SUPPORTED) {
- renderer->D16Format = VK_FORMAT_D32_SFLOAT;
- } else {
- renderer->D16Format = VK_FORMAT_D16_UNORM;
- }
-
- vulkanResult = renderer->vkGetPhysicalDeviceImageFormatProperties(
- renderer->physicalDevice,
- VK_FORMAT_D16_UNORM_S8_UINT,
- VK_IMAGE_TYPE_2D,
- VK_IMAGE_TILING_OPTIMAL,
- VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_STENCIL_BIT,
- 0,
- &imageFormatProperties);
-
- if (vulkanResult == VK_ERROR_FORMAT_NOT_SUPPORTED) {
- renderer->D16S8Format = VK_FORMAT_D32_SFLOAT_S8_UINT;
- } else {
- renderer->D16S8Format = VK_FORMAT_D16_UNORM_S8_UINT;
- }
-
// Deferred destroy storage
renderer->texturesToDestroyCapacity = 16;