Skip to content
Snippets Groups Projects
Commit c33e8d7d authored by Erik Faye-Lund's avatar Erik Faye-Lund Committed by Marge Bot
Browse files

mesa/program: fix shadow property for samplers


When creating a sampler-type, we need to pass the correct vaclue for
the "is_shadow"-parameter to glsl_sampler_type(), otherwise the compiler
backend will have no clue about this being a shadow-sampler.

Fixes: 1c0f92d8 ("nir: Create sampler variables in prog_to_nir.")
Reviewed-by: default avatarMarek Olšák <marek.olsak@amd.com>
Part-of: <mesa/mesa!5986>
parent 4b04800e
No related branches found
No related tags found
No related merge requests found
...@@ -540,7 +540,7 @@ ptn_tex(struct ptn_compile *c, nir_alu_dest dest, nir_ssa_def **src, ...@@ -540,7 +540,7 @@ ptn_tex(struct ptn_compile *c, nir_alu_dest dest, nir_ssa_def **src,
nir_variable *var = c->sampler_vars[prog_inst->TexSrcUnit]; nir_variable *var = c->sampler_vars[prog_inst->TexSrcUnit];
if (!var) { if (!var) {
const struct glsl_type *type = const struct glsl_type *type =
glsl_sampler_type(instr->sampler_dim, false, false, GLSL_TYPE_FLOAT); glsl_sampler_type(instr->sampler_dim, instr->is_shadow, false, GLSL_TYPE_FLOAT);
char samplerName[20]; char samplerName[20];
snprintf(samplerName, sizeof(samplerName), "sampler_%d", prog_inst->TexSrcUnit); snprintf(samplerName, sizeof(samplerName), "sampler_%d", prog_inst->TexSrcUnit);
var = nir_variable_create(b->shader, nir_var_uniform, type, samplerName); var = nir_variable_create(b->shader, nir_var_uniform, type, samplerName);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment