From: Eric Anholt Date: Wed, 31 Oct 2012 23:57:51 +0000 (-0700) Subject: i965: Add some checks for array textures in unsupported paths. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=c1fabea1c5a40c60176201f55253bd463fd146f5;p=mesa.git i965: Add some checks for array textures in unsupported paths. 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 --- diff --git a/src/mesa/drivers/dri/intel/intel_blit.c b/src/mesa/drivers/dri/intel/intel_blit.c index 36a2c6aadac..5658bd7131d 100644 --- a/src/mesa/drivers/dri/intel/intel_blit.c +++ b/src/mesa/drivers/dri/intel/intel_blit.c @@ -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); diff --git a/src/mesa/drivers/dri/intel/intel_tex_copy.c b/src/mesa/drivers/dri/intel/intel_tex_copy.c index f4366330f88..c744633c578 100644 --- a/src/mesa/drivers/dri/intel/intel_tex_copy.c +++ b/src/mesa/drivers/dri/intel/intel_tex_copy.c @@ -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 */ diff --git a/src/mesa/drivers/dri/intel/intel_tex_image.c b/src/mesa/drivers/dri/intel/intel_tex_image.c index 8e623f05b5a..55b721fb046 100644 --- a/src/mesa/drivers/dri/intel/intel_tex_image.c +++ b/src/mesa/drivers/dri/intel/intel_tex_image.c @@ -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 */