i965/miptree: Relax size alignment for linear surfaces
authorTopi Pohjolainen <topi.pohjolainen@intel.com>
Wed, 28 Jun 2017 09:11:16 +0000 (12:11 +0300)
committerTopi Pohjolainen <topi.pohjolainen@intel.com>
Fri, 21 Jul 2017 21:14:16 +0000 (00:14 +0300)
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
src/mesa/drivers/dri/i965/intel_mipmap_tree.c

index 984529d883b20d24bbfb09e0bc6b49e6d40f47bd..73637b0fc52799fce087c0f380180924a5f4a104 100644 (file)
@@ -822,7 +822,12 @@ make_surface(struct brw_context *brw, GLenum target, mesa_format format,
       }
    }
 
-   assert(mt->surf.size % mt->surf.row_pitch == 0);
+   /* In case of linear the buffer gets padded by fixed 64 bytes and therefore
+    * the size may not be multiple of row_pitch.
+    * See isl_apply_surface_padding().
+    */
+   if (mt->surf.tiling != ISL_TILING_LINEAR)
+      assert(mt->surf.size % mt->surf.row_pitch == 0);
 
    if (!bo) {
       mt->bo = brw_bo_alloc_tiled(brw->bufmgr, "isl-miptree",