Skip to content

Commit c96ad61

Browse files
committed
Fix spec constants
Signed-off-by: Isaac Marovitz <isaacryu@icloud.com>
1 parent 46938a4 commit c96ad61

1 file changed

Lines changed: 3 additions & 8 deletions

File tree

XenosRecomp/shader_common.h

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,17 +42,12 @@ struct PushConstants
4242

4343
using namespace metal;
4444

45-
#ifdef SPEC_CONSTANTS
46-
constant uint G_SPEC_CONSTANT [[function_constant(0)]];
47-
#endif
45+
constant uint G_SPEC_CONSTANTS [[function_constant(0)]];
46+
constant uint G_SPEC_CONSTANTS_VAL = is_function_constant_defined(G_SPEC_CONSTANTS) ? G_SPEC_CONSTANTS : 0;
4847

4948
uint g_SpecConstants()
5049
{
51-
#ifdef SPEC_CONSTANTS
52-
return G_SPEC_CONSTANT;
53-
#else
54-
return 0;
55-
#endif
50+
return G_SPEC_CONSTANTS_VAL;
5651
}
5752

5853
struct PushConstants

0 commit comments

Comments
 (0)