i965: Add some checks for array textures in unsupported paths.
authorEric Anholt <eric@anholt.net>
Wed, 31 Oct 2012 23:57:51 +0000 (16:57 -0700)
committerEric Anholt <eric@anholt.net>
Mon, 19 Nov 2012 23:07:22 +0000 (15:07 -0800)
I noticed these in the next patch where these paths were using the Face
of a teximage but didn't have array handling.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
src/mesa/drivers/dri/intel/intel_blit.c
src/mesa/drivers/dri/intel/intel_tex_copy.c
src/mesa/drivers/dri/intel/intel_tex_image.c

index 36a2c6aadac797bc1d03bcb82c286a1da842aad7..5658bd7131d398448bf37b6449cde3de9a526400 100644 (file)
@@ -540,6 +540,9 @@ intel_set_teximage_alpha_to_one(struct gl_context *ctx,
    int width, height, depth;
    BATCH_LOCALS;
 
+   /* This target would require iterating over the slices, which we don't do */
+   assert(intel_image->base.Base.TexObject->Target != GL_TEXTURE_1D_ARRAY);
+
    intel_miptree_get_dimensions_for_image(&intel_image->base.Base,
                                           &width, &height, &depth);
    assert(depth == 1);
index f4366330f88278b23a6a5fc98988777724dc3c46..c744633c57842144310fa99673611f06fda7db00 100644 (file)
@@ -70,6 +70,11 @@ intel_copy_texsubimage(struct intel_context *intel,
       assert(region);
    }
 
+   if (intelImage->base.Base.TexObject->Target == GL_TEXTURE_1D_ARRAY ||
+       intelImage->base.Base.TexObject->Target == GL_TEXTURE_2D_ARRAY) {
+      perf_debug("no support for array textures\n");
+   }
+
    copy_supported = intelImage->base.Base.TexFormat == intel_rb_format(irb);
 
    /* Converting ARGB8888 to XRGB8888 is trivial: ignore the alpha bits */
index 8e623f05b5a2fefa6f38df6a973770cebc40bdc6..55b721fb0463dc1f0f30bec78ee23567bd60f442 100644 (file)
@@ -167,6 +167,12 @@ try_pbo_upload(struct gl_context *ctx,
       return false;
    }
 
+   if (image->TexObject->Target == GL_TEXTURE_1D_ARRAY ||
+       image->TexObject->Target == GL_TEXTURE_2D_ARRAY) {
+      DBG("%s: no support for array textures\n", __FUNCTION__);
+      return false;
+   }
+
    dst_buffer = intelImage->mt->region->bo;
    src_buffer = intel_bufferobj_source(intel, pbo, 64, &src_offset);
    /* note: potential 64-bit ptr to 32-bit int cast */