From: Timothy Arceri Date: Wed, 1 Nov 2017 01:43:45 +0000 (+1100) Subject: nir: skip lowering sampler if there is no dereference X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=440d08fe932be89f56fc8ebec94c8393a6626369;p=mesa.git nir: skip lowering sampler if there is no dereference This avoids a crash on the output of nir_lower_bitmap(). Reviewed-by: Nicolai Hähnle --- diff --git a/src/compiler/nir/nir_lower_samplers_as_deref.c b/src/compiler/nir/nir_lower_samplers_as_deref.c index bdbd8672f40..3e819f7fa75 100644 --- a/src/compiler/nir/nir_lower_samplers_as_deref.c +++ b/src/compiler/nir/nir_lower_samplers_as_deref.c @@ -157,8 +157,10 @@ static bool lower_sampler(nir_tex_instr *instr, struct lower_samplers_as_deref_state *state, nir_builder *b) { + if (!instr->texture) + return false; + /* In GLSL, we only fill out the texture field. The sampler is inferred */ - assert(instr->texture != NULL); assert(instr->sampler == NULL); b->cursor = nir_before_instr(&instr->instr);