On 7 September 2012 09:32, Eric Anholt <span dir="ltr"><<a href="mailto:eric@anholt.net" target="_blank">eric@anholt.net</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>Paul Berry <<a href="mailto:stereotype441@gmail.com" target="_blank">stereotype441@gmail.com</a>> writes:<br>
<br>
> Currently, gen{6,7}_blorp_emit_surface_state assumes that the src and<br>
> dst surfaces are mapped to miplevel 0 and layer 0 (thus no surface<br>
> offset is required). This is a bug, since the user might try to blit<br>
> to and from levels/layers other than 0.<br>
<br>
</div><div>> diff --git a/src/mesa/drivers/dri/i965/brw_blorp.cpp b/src/mesa/drivers/dri/i965/brw_blorp.cpp<br>
> index 7322a04..6acc591 100644<br>
> --- a/src/mesa/drivers/dri/i965/brw_blorp.cpp<br>
> +++ b/src/mesa/drivers/dri/i965/brw_blorp.cpp<br>
<br>
</div><div>> this->mt = mt;<br>
> - this->level = level;<br>
> - this->layer = layer;<br>
> this->width = mt->level[level].width;<br>
> this->height = mt->level[level].height;<br>
> +<br>
> + /* Construct a dummy renderbuffer just to extract tile offsets. */<br>
> + struct intel_renderbuffer rb;<br>
> + <a href="http://rb.mt" target="_blank">rb.mt</a> = mt;<br>
> + rb.mt_level = level;<br>
> + rb.mt_layer = layer;<br>
> + intel_renderbuffer_set_draw_offset(&rb);<br>
> + x_offset = rb.draw_x;<br>
> + y_offset = rb.draw_y;<br>
<br>
</div>I know you're just moving the code here, but as a fixup, please just use<br>
intel_miptree_get_image_offset directly.<br>
</blockquote></div><br>Ok, I will do that before pushing.<br>