From: Karol Herbst Date: Thu, 28 Mar 2019 22:47:07 +0000 (+0100) Subject: glsl/nir: fetch the type for images from the deref instruction X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=0b2e8d9e17452c62d1cc08ca290b0984ae592899;p=mesa.git glsl/nir: fetch the type for images from the deref instruction fixes retrieving the sampler type for bindless images stored inside structs. Signed-off-by: Karol Herbst Reviewed-by: Jason Ekstrand Reviewed-by: Marek Olšák --- diff --git a/src/compiler/glsl/glsl_to_nir.cpp b/src/compiler/glsl/glsl_to_nir.cpp index 89edaa41d27..6c42bd9f5ac 100644 --- a/src/compiler/glsl/glsl_to_nir.cpp +++ b/src/compiler/glsl/glsl_to_nir.cpp @@ -1208,10 +1208,10 @@ nir_visitor::visit(ir_call *ir) /* Set the image variable dereference. */ exec_node *param = ir->actual_parameters.get_head(); ir_dereference *image = (ir_dereference *)param; - const glsl_type *type = - image->variable_referenced()->type->without_array(); + nir_deref_instr *deref = evaluate_deref(image); + const glsl_type *type = deref->type; - instr->src[0] = nir_src_for_ssa(&evaluate_deref(image)->dest.ssa); + instr->src[0] = nir_src_for_ssa(&deref->dest.ssa); param = param->get_next(); /* Set the intrinsic destination. */