i965: Prepare tex (sub)image for isl based
authorTopi Pohjolainen <topi.pohjolainen@intel.com>
Thu, 22 Jun 2017 18:28:15 +0000 (21:28 +0300)
committerTopi Pohjolainen <topi.pohjolainen@intel.com>
Thu, 20 Jul 2017 08:32:21 +0000 (11:32 +0300)
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
src/mesa/drivers/dri/i965/intel_tex_image.c
src/mesa/drivers/dri/i965/intel_tex_subimage.c

index e165cf60bb5af942cb1d916db1fa167845148cad..b042b23d9f3473f79f5e7d4f793063d09dacbcd9 100644 (file)
@@ -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;
index e686ba93d2af514249d2d485c3a5aaf6fd8977ce..88cfa814a369044600491cfaafaeaf703f091f46 100644 (file)
@@ -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;