summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/i965
diff options
context:
space:
mode:
authorPaul Berry <[email protected]>2012-07-24 14:48:51 -0700
committerPaul Berry <[email protected]>2012-07-26 15:02:10 -0700
commit4df2848786d4778a2ce7dbf2e046e191036ccb56 (patch)
tree11b4cfe161d05f067a47550017b712c1095db541 /src/mesa/drivers/dri/i965
parentf37f1a72095653d4806280e5ef74373781c55184 (diff)
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 <[email protected]>
Diffstat (limited to 'src/mesa/drivers/dri/i965')
-rw-r--r--src/mesa/drivers/dri/i965/brw_blorp_blit.cpp12
1 files changed, 6 insertions, 6 deletions
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;