From c334f84238efd80e41c8b7ad232eaa03e342c9f8 Mon Sep 17 00:00:00 2001 From: Erik Faye-Lund Date: Mon, 20 Jul 2020 18:06:47 +0200 Subject: [PATCH] mesa/program: fix shadow property for samplers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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: 1c0f92d8a8c ("nir: Create sampler variables in prog_to_nir.") Reviewed-by: Marek Olšák Part-of: (cherry picked from commit c33e8d7d522c250443d903b5732224988855b9a9) --- .pick_status.json | 2 +- src/mesa/program/prog_to_nir.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index 65565d55ebe..edd8863022e 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -121,7 +121,7 @@ "description": "mesa/program: fix shadow property for samplers", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "master_sha": null, "because_sha": "1c0f92d8a8c480a5803c3ce45b2a6d46bfcd280f" }, diff --git a/src/mesa/program/prog_to_nir.c b/src/mesa/program/prog_to_nir.c index 31ad0cb58c5..2948206ef6a 100644 --- a/src/mesa/program/prog_to_nir.c +++ b/src/mesa/program/prog_to_nir.c @@ -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]; if (!var) { 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); var = nir_variable_create(b->shader, nir_var_uniform, type, "sampler"); var->data.binding = prog_inst->TexSrcUnit; var->data.explicit_binding = true;