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: 1c0f92d8a8 ("nir: Create sampler variables in prog_to_nir.")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5986>
(cherry picked from commit c33e8d7d52)
This commit is contained in:
Erik Faye-Lund 2020-07-20 18:06:47 +02:00 committed by Eric Engestrom
parent f9fdd9dfc1
commit c334f84238
2 changed files with 2 additions and 2 deletions

View file

@ -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"
},

View file

@ -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;