[Mesa-dev] [PATCH 13/17] i965/miptree: Relax size alignment for linear surfaces

Topi Pohjolainen topi.pohjolainen at gmail.com
Fri Jul 21 15:01:04 UTC 2017


Signed-off-by: Topi Pohjolainen <topi.pohjolainen at intel.com>
---
 src/mesa/drivers/dri/i965/intel_mipmap_tree.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
index 984529d883..73637b0fc5 100644
--- a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
+++ b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
@@ -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",
-- 
2.11.0



More information about the mesa-dev mailing list