From 0a86d766ef0d98abd3373609a637bf137203e994 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Thu, 5 Aug 2010 17:57:48 -0700 Subject: ir_to_mesa: Handle texture-array samplers Fixes piglit test array_texture. --- src/mesa/program/ir_to_mesa.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/mesa/program/ir_to_mesa.cpp b/src/mesa/program/ir_to_mesa.cpp index 26fbc4349ab..f5e5f7d7b87 100644 --- a/src/mesa/program/ir_to_mesa.cpp +++ b/src/mesa/program/ir_to_mesa.cpp @@ -2040,10 +2040,12 @@ ir_to_mesa_visitor::visit(ir_texture *ir) switch (sampler->type->sampler_dimensionality) { case GLSL_SAMPLER_DIM_1D: - inst->tex_target = TEXTURE_1D_INDEX; + inst->tex_target = (sampler->type->sampler_array) + ? TEXTURE_1D_ARRAY_INDEX : TEXTURE_1D_INDEX; break; case GLSL_SAMPLER_DIM_2D: - inst->tex_target = TEXTURE_2D_INDEX; + inst->tex_target = (sampler->type->sampler_array) + ? TEXTURE_2D_ARRAY_INDEX : TEXTURE_2D_INDEX; break; case GLSL_SAMPLER_DIM_3D: inst->tex_target = TEXTURE_3D_INDEX; -- cgit v1.2.3