Skip to content

Commit cf49b05

Browse files
committed
Fix spec constants
Signed-off-by: Isaac Marovitz <isaacryu@icloud.com>
1 parent 5d3ed80 commit cf49b05

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
@@ -41,17 +41,12 @@ struct PushConstants
4141

4242
using namespace metal;
4343

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

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

5752
struct PushConstants

0 commit comments

Comments
 (0)