[Mesa-dev] [PATCH] intel/blorp_blit: Simplify uncompressed level0 extent assignment

Nanley Chery nanleychery at gmail.com
Mon Sep 26 21:42:58 UTC 2016


From: Nanley Chery <nanleychery at gmail.com>

These values are the same. Avoid the extra computation.

Signed-off-by: Nanley Chery <nanley.g.chery at intel.com>
---

v2: Add a sample count assertion (Jason)

 src/intel/blorp/blorp_blit.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/src/intel/blorp/blorp_blit.c b/src/intel/blorp/blorp_blit.c
index af46389..8fa3e8d 100644
--- a/src/intel/blorp/blorp_blit.c
+++ b/src/intel/blorp/blorp_blit.c
@@ -1774,16 +1774,15 @@ surf_convert_to_uncompressed(const struct isl_device *isl_dev,
    *x /= fmtl->bw;
    *y /= fmtl->bh;
 
-   info->surf.logical_level0_px.width =
-      DIV_ROUND_UP(info->surf.logical_level0_px.width, fmtl->bw);
-   info->surf.logical_level0_px.height =
-      DIV_ROUND_UP(info->surf.logical_level0_px.height, fmtl->bh);
-
    assert(info->surf.phys_level0_sa.width % fmtl->bw == 0);
    assert(info->surf.phys_level0_sa.height % fmtl->bh == 0);
    info->surf.phys_level0_sa.width /= fmtl->bw;
    info->surf.phys_level0_sa.height /= fmtl->bh;
 
+   assert(info->surf.samples == 1);
+   info->surf.logical_level0_px.width = info->surf.phys_level0_sa.width;
+   info->surf.logical_level0_px.height = info->surf.phys_level0_sa.height;
+
    assert(info->tile_x_sa % fmtl->bw == 0);
    assert(info->tile_y_sa % fmtl->bh == 0);
    info->tile_x_sa /= fmtl->bw;
-- 
2.10.0



More information about the mesa-dev mailing list