From cf49b058f4b62a6cbd57c9f305bf9b6f39c260fc Mon Sep 17 00:00:00 2001 From: Isaac Marovitz Date: Fri, 28 Mar 2025 00:35:56 -0400 Subject: [PATCH] Fix spec constants Signed-off-by: Isaac Marovitz --- XenosRecomp/shader_common.h | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/XenosRecomp/shader_common.h b/XenosRecomp/shader_common.h index 7a367cb..42c886c 100644 --- a/XenosRecomp/shader_common.h +++ b/XenosRecomp/shader_common.h @@ -41,17 +41,12 @@ struct PushConstants using namespace metal; -#ifdef SPEC_CONSTANTS -constant uint G_SPEC_CONSTANT [[function_constant(0)]]; -#endif +constant uint G_SPEC_CONSTANTS [[function_constant(0)]]; +constant uint G_SPEC_CONSTANTS_VAL = is_function_constant_defined(G_SPEC_CONSTANTS) ? G_SPEC_CONSTANTS : 0; uint g_SpecConstants() { -#ifdef SPEC_CONSTANTS - return G_SPEC_CONSTANT; -#else - return 0; -#endif + return G_SPEC_CONSTANTS_VAL; } struct PushConstants