Mesa (master): glsl/nir: fetch the type for images from the deref instruction

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Apr 12 07:04:38 UTC 2019


Module: Mesa
Branch: master
Commit: 0b2e8d9e17452c62d1cc08ca290b0984ae592899
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=0b2e8d9e17452c62d1cc08ca290b0984ae592899

Author: Karol Herbst <kherbst at redhat.com>
Date:   Thu Mar 28 23:47:07 2019 +0100

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 <kherbst at redhat.com>
Reviewed-by: Jason Ekstrand <jason at jlekstrand.net>
Reviewed-by: Marek Olšák <marek.olsak at amd.com>

---

 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. */




More information about the mesa-commit mailing list