From 4d8c3fd96684802a71c8852cb750cf2bf01cc2f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tapani=20P=C3=A4lli?= Date: Mon, 4 May 2015 11:03:56 +0300 Subject: [PATCH] nir: workaround for sampler index calculation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Tapani Pälli --- src/glsl/nir/nir_lower_samplers.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/glsl/nir/nir_lower_samplers.cpp b/src/glsl/nir/nir_lower_samplers.cpp index cf8ab83..8b5243c 100644 --- a/src/glsl/nir/nir_lower_samplers.cpp +++ b/src/glsl/nir/nir_lower_samplers.cpp @@ -78,7 +78,8 @@ lower_sampler(nir_tex_instr *instr, const struct gl_shader_program *shader_progr instr->sampler_index *= glsl_get_length(deref->type); switch (deref_array->deref_array_type) { case nir_deref_array_type_direct: - instr->sampler_index += deref_array->base_offset; + if (deref->child->type->base_type != GLSL_TYPE_STRUCT) + instr->sampler_index += deref_array->base_offset; if (deref_array->deref.child) ralloc_asprintf_append(&name, "[%u]", deref_array->base_offset); break; -- 2.1.0