i965/blorp: Don't create a dummy renderbuffer just to fetch image offsets.
authorPaul Berry <stereotype441@gmail.com>
Mon, 10 Sep 2012 18:30:14 +0000 (11:30 -0700)
committerPaul Berry <stereotype441@gmail.com>
Wed, 12 Sep 2012 21:44:12 +0000 (14:44 -0700)
This is unnecessary--the image offsets can be read directly out of the
miptree using intel_miptree_get_image_offset.

src/mesa/drivers/dri/i965/brw_blorp.cpp

index 6acc59187d461e2ff6259ebc27723c65cb8e3b7f..af1156c39b147af8e19be7a31e7b4abfab529725 100644 (file)
@@ -53,14 +53,7 @@ brw_blorp_mip_info::set(struct intel_mipmap_tree *mt,
    this->width = mt->level[level].width;
    this->height = mt->level[level].height;
 
-   /* Construct a dummy renderbuffer just to extract tile offsets. */
-   struct intel_renderbuffer rb;
-   rb.mt = mt;
-   rb.mt_level = level;
-   rb.mt_layer = layer;
-   intel_renderbuffer_set_draw_offset(&rb);
-   x_offset = rb.draw_x;
-   y_offset = rb.draw_y;
+   intel_miptree_get_image_offset(mt, level, 0, layer, &x_offset, &y_offset);
 }
 
 void