From 36204cf0f5ab98996856ea8d9dc7482c47bd5ba8 Mon Sep 17 00:00:00 2001
From: cosmonaut <[EMAIL REDACTED]>
Date: Thu, 14 Nov 2024 11:33:12 -0800
Subject: [PATCH] Revise format queries
---
src/SDL_shadercross.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/SDL_shadercross.c b/src/SDL_shadercross.c
index 63ed560..04a8ce8 100644
--- a/src/SDL_shadercross.c
+++ b/src/SDL_shadercross.c
@@ -2055,7 +2055,9 @@ SDL_GPUShaderFormat SDL_ShaderCross_GetSPIRVShaderFormats(void)
SDL_GPUShaderFormat supportedFormats = SDL_GPU_SHADERFORMAT_SPIRV | SDL_GPU_SHADERFORMAT_MSL;
/* SPIRV-Cross + DXC allows us to cross-compile to HLSL, then compile to DXIL */
+#ifdef SDL_SHADERCROSS_DXC
supportedFormats |= SDL_GPU_SHADERFORMAT_DXIL;
+#endif
/* SPIRV-Cross + FXC allows us to cross-compile to HLSL, then compile to DXBC */
if (d3dcompiler_dll != NULL) {
@@ -2069,9 +2071,9 @@ SDL_GPUShaderFormat SDL_ShaderCross_GetHLSLShaderFormats(void)
{
SDL_GPUShaderFormat supportedFormats = 0;
- /* DXC allows compilation from HLSL to DXIL and SPIRV */
+ /* DXC allows compilation from HLSL to SPIRV */
#ifdef SDL_SHADERCROSS_DXC
- supportedFormats |= SDL_GPU_SHADERFORMAT_DXIL | SDL_GPU_SHADERFORMAT_DXBC;
+ supportedFormats |= SDL_ShaderCross_GetSPIRVShaderFormats();
#endif
/* FXC allows compilation of HLSL to DXBC */