From 0b2e8d9e17452c62d1cc08ca290b0984ae592899 Mon Sep 17 00:00:00 2001 From: Karol Herbst Date: Thu, 28 Mar 2019 23:47:07 +0100 Subject: [PATCH] glsl/nir: fetch the type for images from the deref instruction MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 --- src/compiler/glsl/glsl_to_nir.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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. */ -- 2.30.2