From: Duncan Hopkins Date: Wed, 25 Sep 2019 10:52:37 +0000 (+0100) Subject: zink. Changed sampler default name. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=cc472a2a7c6c99eb228ef138acadc16337a48ede;p=mesa.git zink. Changed sampler default name. Changed the sampler variable name from 'sampler' to 'sampler_' to stop symbol classes in the Metal MSL shaders, as 'sampler' is a keyword. Improves human readability when debugging issues. Reviewed-by: Erik Faye-Lund Part-of: --- diff --git a/src/mesa/program/prog_to_nir.c b/src/mesa/program/prog_to_nir.c index 31ad0cb58c5..14dc89183a0 100644 --- a/src/mesa/program/prog_to_nir.c +++ b/src/mesa/program/prog_to_nir.c @@ -541,7 +541,9 @@ ptn_tex(struct ptn_compile *c, nir_alu_dest dest, nir_ssa_def **src, if (!var) { const struct glsl_type *type = glsl_sampler_type(instr->sampler_dim, false, false, GLSL_TYPE_FLOAT); - var = nir_variable_create(b->shader, nir_var_uniform, type, "sampler"); + char samplerName[20]; + snprintf(samplerName, sizeof(samplerName), "sampler_%d", prog_inst->TexSrcUnit); + var = nir_variable_create(b->shader, nir_var_uniform, type, samplerName); var->data.binding = prog_inst->TexSrcUnit; var->data.explicit_binding = true; c->sampler_vars[prog_inst->TexSrcUnit] = var;