diff options
author | Duncan Hopkins <[email protected]> | 2019-09-25 11:52:37 +0100 |
---|---|---|
committer | Marge Bot <[email protected]> | 2020-05-14 12:24:28 +0000 |
commit | cc472a2a7c6c99eb228ef138acadc16337a48ede (patch) | |
tree | 1548472c3ac8a51d6f191a0a2be27ac7d3faa796 /src/mesa/program | |
parent | b1f023307768570a621c3050222bd32c546d72a9 (diff) |
zink. Changed sampler default name.
Changed the sampler variable name from 'sampler' to 'sampler_<num>' 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 <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4211>
Diffstat (limited to 'src/mesa/program')
-rw-r--r-- | src/mesa/program/prog_to_nir.c | 4 |
1 files changed, 3 insertions, 1 deletions
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; |