ir_to_mesa: Handle texture-array samplers
authorIan Romanick <ian.d.romanick@intel.com>
Fri, 6 Aug 2010 00:57:48 +0000 (17:57 -0700)
committerIan Romanick <ian.d.romanick@intel.com>
Fri, 6 Aug 2010 00:57:48 +0000 (17:57 -0700)
Fixes piglit test array_texture.

src/mesa/program/ir_to_mesa.cpp

index 26fbc4349ab791271b38c60d2f9ee418c7b14401..f5e5f7d7b877bd1e3a767d44f289419a47a6f05a 100644 (file)
@@ -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;