From 6ef95bdce2f63bc83f2c48745b1880145286e902 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Tue, 17 May 2016 16:01:06 -0400 Subject: [PATCH] Metal: make constant arrays have unique names. This lets us compile a bunch of shaders as one big file without conflicts! --- mojoshader.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/mojoshader.c b/mojoshader.c index b203cf10..933023e3 100644 --- a/mojoshader.c +++ b/mojoshader.c @@ -4080,8 +4080,7 @@ static inline const char *get_METAL_const_array_varname_in_buf(Context *ctx, const int base, const int size, char *buf, const size_t buflen) { - const char *type = ctx->shader_type_str; - snprintf(buf, buflen, "%s_const_array_%d_%d", type, base, size); + snprintf(buf, buflen, "%s_const_array_%d_%d", ctx->mainfn, base, size); return buf; } // get_METAL_const_array_varname_in_buf