diff options
author | Anuj Phogat <[email protected]> | 2017-01-10 14:04:19 -0800 |
---|---|---|
committer | Anuj Phogat <[email protected]> | 2017-01-19 14:28:18 -0800 |
commit | 6de293284bff2d2f8e5b08ea21fc1e2ed68a181f (patch) | |
tree | 3f9a2f5b785639da2172680cadaadeac646b95fa /src/mesa | |
parent | c7e37a0cb8d46cde4e6ea1c7bb0d8e517995c726 (diff) |
i965: Remove unnecessary mt->compressed checks
It's harmless to use ALIGN_NPOT() for uncompressed formats
because they have block width/height = 1.
Signed-off-by: Anuj Phogat <[email protected]>
Reviewed-by: Alejandro PiƱeiro <[email protected]>
Diffstat (limited to 'src/mesa')
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_tex_layout.c | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_tex_layout.c b/src/mesa/drivers/dri/i965/brw_tex_layout.c index 2f4837e825e..684ae769c56 100644 --- a/src/mesa/drivers/dri/i965/brw_tex_layout.c +++ b/src/mesa/drivers/dri/i965/brw_tex_layout.c @@ -302,9 +302,7 @@ brw_miptree_layout_2d(struct intel_mipmap_tree *mt) _mesa_get_format_block_size(mt->format, &bw, &bh); mt->total_width = mt->physical_width0; - - if (mt->compressed) - mt->total_width = ALIGN_NPOT(mt->total_width, bw); + mt->total_width = ALIGN_NPOT(mt->total_width, bw); /* May need to adjust width to accommodate the placement of * the 2nd mipmap. This occurs when the alignment @@ -314,13 +312,8 @@ brw_miptree_layout_2d(struct intel_mipmap_tree *mt) if (mt->first_level != mt->last_level) { unsigned mip1_width; - if (mt->compressed) { - mip1_width = ALIGN_NPOT(minify(mt->physical_width0, 1), mt->halign) + - ALIGN_NPOT(minify(mt->physical_width0, 2), bw); - } else { - mip1_width = ALIGN_NPOT(minify(mt->physical_width0, 1), mt->halign) + - minify(mt->physical_width0, 2); - } + mip1_width = ALIGN_NPOT(minify(mt->physical_width0, 1), mt->halign) + + ALIGN_NPOT(minify(mt->physical_width0, 2), bw); if (mip1_width > mt->total_width) mt->total_width = mip1_width; @@ -335,8 +328,7 @@ brw_miptree_layout_2d(struct intel_mipmap_tree *mt) intel_miptree_set_level_info(mt, level, x, y, depth); img_height = ALIGN_NPOT(height, mt->valign); - if (mt->compressed) - img_height /= bh; + img_height /= bh; if (mt->array_layout == ALL_SLICES_AT_EACH_LOD) { /* Compact arrays with separated miplevels */ |