From 41810c823d62c472279d5e098a517e35c30093fe Mon Sep 17 00:00:00 2001
From: Sylvain <[EMAIL REDACTED]>
Date: Thu, 5 Sep 2024 10:56:16 +0200
Subject: [PATCH] Compilation without vulkan: SDL_GPU_VULKAN is always defined
for some plateform (at android, macos), test against 0 or 1
---
src/gpu/SDL_gpu.c | 2 +-
src/render/sdlgpu/SDL_shaders_gpu.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/gpu/SDL_gpu.c b/src/gpu/SDL_gpu.c
index c6ac6ed286b4a..d972dfcd295e0 100644
--- a/src/gpu/SDL_gpu.c
+++ b/src/gpu/SDL_gpu.c
@@ -127,7 +127,7 @@ static const SDL_GPUBootstrap *backends[] = {
#ifdef SDL_GPU_D3D12
&D3D12Driver,
#endif
-#ifdef SDL_GPU_VULKAN
+#if defined(SDL_GPU_VULKAN) && SDL_GPU_VULKAN
&VulkanDriver,
#endif
#ifdef SDL_GPU_D3D11
diff --git a/src/render/sdlgpu/SDL_shaders_gpu.c b/src/render/sdlgpu/SDL_shaders_gpu.c
index ae60b3bb69b94..8b49ec0522971 100644
--- a/src/render/sdlgpu/SDL_shaders_gpu.c
+++ b/src/render/sdlgpu/SDL_shaders_gpu.c
@@ -33,7 +33,7 @@ typedef struct GPU_ShaderModuleSource
SDL_GPUShaderFormat format;
} GPU_ShaderModuleSource;
-#ifdef SDL_GPU_VULKAN
+#if defined(SDL_GPU_VULKAN) && SDL_GPU_VULKAN
#define IF_VULKAN(...) __VA_ARGS__
#define HAVE_SPIRV_SHADERS 1
#include "shaders/spir-v.h"