From 4df2848786d4778a2ce7dbf2e046e191036ccb56 Mon Sep 17 00:00:00 2001 From: Paul Berry Date: Tue, 24 Jul 2012 14:48:51 -0700 Subject: i965/msaa: use ROUND_DOWN_TO macro. No functional change. This patch modifies brw_blorp_blit.cpp to use the ROUND_DOWN_TO macro instead of open-coded bit manipulations, for clarity. Reviewed-by: Kenneth Graunke --- src/mesa/drivers/dri/i965/brw_blorp_blit.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/mesa/drivers/dri/i965') diff --git a/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp b/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp index bd156327463..296b99f762e 100644 --- a/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp +++ b/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp @@ -1733,14 +1733,14 @@ brw_blorp_blit_params::brw_blorp_blit_params(struct brw_context *brw, assert(dst_mt->msaa_layout == INTEL_MSAA_LAYOUT_IMS); switch (dst_mt->num_samples) { case 4: - x0 = (x0 * 2) & ~3; - y0 = (y0 * 2) & ~3; + x0 = ROUND_DOWN_TO(x0 * 2, 4); + y0 = ROUND_DOWN_TO(y0 * 2, 4); x1 = ALIGN(x1 * 2, 4); y1 = ALIGN(y1 * 2, 4); break; case 8: - x0 = (x0 * 4) & ~7; - y0 = (y0 * 2) & ~3; + x0 = ROUND_DOWN_TO(x0 * 4, 8); + y0 = ROUND_DOWN_TO(y0 * 2, 4); x1 = ALIGN(x1 * 4, 8); y1 = ALIGN(y1 * 2, 4); break; @@ -1770,8 +1770,8 @@ brw_blorp_blit_params::brw_blorp_blit_params(struct brw_context *brw, x_align /= (dst_mt->num_samples == 4 ? 2 : 4); y_align /= 2; } - x0 = (x0 & ~(x_align - 1)) * 2; - y0 = (y0 & ~(y_align - 1)) / 2; + x0 = ROUND_DOWN_TO(x0, x_align) * 2; + y0 = ROUND_DOWN_TO(y0, y_align) / 2; x1 = ALIGN(x1, x_align) * 2; y1 = ALIGN(y1, y_align) / 2; wm_prog_key.use_kill = true; -- cgit v1.2.3