From: Topi Pohjolainen Date: Thu, 22 Jun 2017 18:28:15 +0000 (+0300) Subject: i965: Prepare tex (sub)image for isl based X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=f1caa6194eb88ada096942bab99f7b331544e0e9;p=mesa.git i965: Prepare tex (sub)image for isl based Reviewed-by: Jason Ekstrand Reviewed-by: Kenneth Graunke Signed-off-by: Topi Pohjolainen --- diff --git a/src/mesa/drivers/dri/i965/intel_tex_image.c b/src/mesa/drivers/dri/i965/intel_tex_image.c index e165cf60bb5..b042b23d9f3 100644 --- a/src/mesa/drivers/dri/i965/intel_tex_image.c +++ b/src/mesa/drivers/dri/i965/intel_tex_image.c @@ -198,9 +198,16 @@ intel_set_texture_image_mt(struct brw_context *brw, struct intel_texture_object *intel_texobj = intel_texture_object(texobj); struct intel_texture_image *intel_image = intel_texture_image(image); - _mesa_init_teximage_fields(&brw->ctx, image, - mt->logical_width0, mt->logical_height0, 1, - 0, internal_format, mt->format); + if (mt->surf.size > 0) { + _mesa_init_teximage_fields(&brw->ctx, image, + mt->surf.logical_level0_px.width, + mt->surf.logical_level0_px.height, 1, + 0, internal_format, mt->format); + } else { + _mesa_init_teximage_fields(&brw->ctx, image, + mt->logical_width0, mt->logical_height0, 1, + 0, internal_format, mt->format); + } brw->ctx.Driver.FreeTextureImageBuffer(&brw->ctx, image); @@ -455,7 +462,12 @@ intel_gettexsubimage_tiled_memcpy(struct gl_context *ctx, /* Since we are going to write raw data to the miptree, we need to resolve * any pending fast color clears before we start. */ - assert(image->mt->logical_depth0 == 1); + if (image->mt->surf.size > 0) { + assert(image->mt->surf.logical_level0_px.depth == 1); + assert(image->mt->surf.logical_level0_px.array_len == 1); + } else { + assert(image->mt->logical_depth0 == 1); + } intel_miptree_access_raw(brw, image->mt, level, 0, true); bo = image->mt->bo; diff --git a/src/mesa/drivers/dri/i965/intel_tex_subimage.c b/src/mesa/drivers/dri/i965/intel_tex_subimage.c index e686ba93d2a..88cfa814a36 100644 --- a/src/mesa/drivers/dri/i965/intel_tex_subimage.c +++ b/src/mesa/drivers/dri/i965/intel_tex_subimage.c @@ -150,7 +150,13 @@ intel_texsubimage_tiled_memcpy(struct gl_context * ctx, /* Since we are going to write raw data to the miptree, we need to resolve * any pending fast color clears before we start. */ - assert(image->mt->logical_depth0 == 1); + if (image->mt->surf.size > 0) { + assert(image->mt->surf.logical_level0_px.depth == 1); + assert(image->mt->surf.logical_level0_px.array_len == 1); + } else { + assert(image->mt->logical_depth0 == 1); + } + intel_miptree_access_raw(brw, image->mt, level, 0, true); bo = image->mt->bo;