SDL: Fixed building with SDL_LEAN_AND_MEAN (eb5a2)

From eb5a2e7e7f81c2e6af6a06097752f53b511d047c Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Sun, 3 Mar 2024 09:25:02 -0800
Subject: [PATCH] Fixed building with SDL_LEAN_AND_MEAN

Fixes https://github.com/libsdl-org/SDL/issues/9173
---
 src/render/vulkan/SDL_render_vulkan.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/render/vulkan/SDL_render_vulkan.c b/src/render/vulkan/SDL_render_vulkan.c
index fcce43c198c7..1222cc8f4383 100644
--- a/src/render/vulkan/SDL_render_vulkan.c
+++ b/src/render/vulkan/SDL_render_vulkan.c
@@ -237,7 +237,6 @@ typedef struct
     int height;
     VULKAN_Shader shader;
 
-#if SDL_HAVE_YUV
     /* Object passed to VkImageView and VkSampler for doing Ycbcr -> RGB conversion */
     VkSamplerYcbcrConversion samplerYcbcrConversion;
     /* Sampler created with samplerYcbcrConversion, passed to PSO as immutable sampler */
@@ -246,7 +245,6 @@ typedef struct
     VkDescriptorSetLayout descriptorSetLayoutYcbcr;
     /* Pipeline layout with immutable sampler descriptor set layout */
     VkPipelineLayout pipelineLayoutYcbcr;
-#endif
 
 } VULKAN_TextureData;
 
@@ -797,7 +795,7 @@ static VkResult VULKAN_AllocateImage(VULKAN_RenderData *rendererData, SDL_Proper
         samplerYcbcrConversionInfo.conversion = samplerYcbcrConversion;
         imageViewCreateInfo.pNext = &samplerYcbcrConversionInfo;
     }
-    
+
     result = vkCreateImageView(rendererData->device, &imageViewCreateInfo, NULL, &imageOut->imageView);
     if (result != VK_SUCCESS) {
         VULKAN_DestroyImage(rendererData, imageOut);
@@ -1566,7 +1564,7 @@ static SDL_bool VULKAN_DeviceExtensionsFound(VULKAN_RenderData *rendererData, in
             }
             foundExtensions &= foundExtension;
         }
-        
+
         SDL_free(extensionProperties);
     }
 
@@ -2502,7 +2500,7 @@ static int VULKAN_CreateTexture(SDL_Renderer *renderer, SDL_Texture *texture, SD
             samplerYcbcrConversionCreateInfo.components.r = VK_COMPONENT_SWIZZLE_B;
             samplerYcbcrConversionCreateInfo.components.b = VK_COMPONENT_SWIZZLE_R;
         }
-        
+
         switch (SDL_COLORSPACERANGE(texture->colorspace)) {
         case SDL_COLOR_RANGE_LIMITED:
             samplerYcbcrConversionCreateInfo.ycbcrRange = VK_SAMPLER_YCBCR_RANGE_ITU_NARROW_KHR;
@@ -4003,6 +4001,7 @@ SDL_Renderer *VULKAN_CreateRenderer(SDL_Window *window, SDL_PropertiesID create_
         return NULL;
     }
 
+#if SDL_HAVE_YUV
     if (rendererData->supportsKHRSamplerYCbCrConversion) {
         renderer->info.texture_formats[renderer->info.num_texture_formats++] = SDL_PIXELFORMAT_YV12;
         renderer->info.texture_formats[renderer->info.num_texture_formats++] = SDL_PIXELFORMAT_IYUV;
@@ -4010,6 +4009,7 @@ SDL_Renderer *VULKAN_CreateRenderer(SDL_Window *window, SDL_PropertiesID create_
         renderer->info.texture_formats[renderer->info.num_texture_formats++] = SDL_PIXELFORMAT_NV21;
         renderer->info.texture_formats[renderer->info.num_texture_formats++] = SDL_PIXELFORMAT_P010;
     }
+#endif
 
     return renderer;
 }