diff options
author | Eric Anholt <[email protected]> | 2013-04-13 01:46:09 -0700 |
---|---|---|
committer | Eric Anholt <[email protected]> | 2013-04-21 12:28:04 -0700 |
commit | 47c0b5ecdd14ab5b07e4d3016e8dff7c9c3abb8b (patch) | |
tree | f2ea5c4e3860d6fd7911b50d4440f3fda6807163 /src/mesa/drivers/dri/intel | |
parent | 1842dd08b83269816fe8eb8f2dcc1252f606fe48 (diff) |
mesa: Introduce a globally-available minify() macro.
This matches u_minify()'s behavior, for consistency.
Reviewed-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/mesa/drivers/dri/intel')
-rw-r--r-- | src/mesa/drivers/dri/intel/intel_tex_layout.c | 12 | ||||
-rw-r--r-- | src/mesa/drivers/dri/intel/intel_tex_layout.h | 6 |
2 files changed, 6 insertions, 12 deletions
diff --git a/src/mesa/drivers/dri/intel/intel_tex_layout.c b/src/mesa/drivers/dri/intel/intel_tex_layout.c index 59d4bc319fe..fbb6520e7a1 100644 --- a/src/mesa/drivers/dri/intel/intel_tex_layout.c +++ b/src/mesa/drivers/dri/intel/intel_tex_layout.c @@ -170,11 +170,11 @@ void i945_miptree_layout_2d(struct intel_mipmap_tree *mt) GLuint mip1_width; if (mt->compressed) { - mip1_width = ALIGN(minify(mt->physical_width0), mt->align_w) - + ALIGN(minify(minify(mt->physical_width0)), mt->align_w); + mip1_width = ALIGN(minify(mt->physical_width0, 1), mt->align_w) + + ALIGN(minify(mt->physical_width0, 2), mt->align_w); } else { - mip1_width = ALIGN(minify(mt->physical_width0), mt->align_w) - + minify(minify(mt->physical_width0)); + mip1_width = ALIGN(minify(mt->physical_width0, 1), mt->align_w) + + minify(mt->physical_width0, 2); } if (mip1_width > mt->total_width) { @@ -208,7 +208,7 @@ void i945_miptree_layout_2d(struct intel_mipmap_tree *mt) y += img_height; } - width = minify(width); - height = minify(height); + width = minify(width, 1); + height = minify(height, 1); } } diff --git a/src/mesa/drivers/dri/intel/intel_tex_layout.h b/src/mesa/drivers/dri/intel/intel_tex_layout.h index 12ed16d8216..f353cf4eb43 100644 --- a/src/mesa/drivers/dri/intel/intel_tex_layout.h +++ b/src/mesa/drivers/dri/intel/intel_tex_layout.h @@ -32,12 +32,6 @@ #include "main/macros.h" - -static INLINE GLuint minify( GLuint d ) -{ - return MAX2(1, d>>1); -} - extern void i945_miptree_layout_2d(struct intel_mipmap_tree *mt); void |