<div dir="ltr">Reviewed-by: Jason Ekstrand <<a href="mailto:jason@jlekstrand.net">jason@jlekstrand.net</a>><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jul 18, 2017 at 1:46 AM, Topi Pohjolainen <span dir="ltr"><<a href="mailto:topi.pohjolainen@gmail.com" target="_blank">topi.pohjolainen@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Signed-off-by: Topi Pohjolainen <<a href="mailto:topi.pohjolainen@intel.com">topi.pohjolainen@intel.com</a>><br>
---<br>
src/mesa/drivers/dri/i965/<wbr>intel_mipmap_tree.c | 13 +++++++++++++<br>
1 file changed, 13 insertions(+)<br>
<br>
diff --git a/src/mesa/drivers/dri/i965/<wbr>intel_mipmap_tree.c b/src/mesa/drivers/dri/i965/<wbr>intel_mipmap_tree.c<br>
index 879036ce77..a0b129adb4 100644<br>
--- a/src/mesa/drivers/dri/i965/<wbr>intel_mipmap_tree.c<br>
+++ b/src/mesa/drivers/dri/i965/<wbr>intel_mipmap_tree.c<br>
@@ -1435,9 +1435,22 @@ intel_miptree_get_image_<wbr>offset(const struct intel_mipmap_tree *mt,<br>
GLuint level, GLuint slice,<br>
GLuint *x, GLuint *y)<br>
{<br>
+ if (level == 0 && slice == 0) {<br>
+ *x = mt->level[0].level_x;<br>
+ *y = mt->level[0].level_y;<br>
+ return;<br>
+ }<br>
+<br>
if (mt->surf.size > 0) {<br>
uint32_t x_offset_sa, y_offset_sa;<br>
<br>
+ /* Miptree itself can have an offset only if it represents a single<br>
+ * slice in an imported buffer object.<br>
+ * See intel_miptree_create_for_dri_<wbr>image().<br>
+ */<br>
+ assert(mt->level[0].level_x == 0);<br>
+ assert(mt->level[0].level_y == 0);<br>
+<br>
/* Given level is relative to level zero while the miptree may be<br>
* represent just a subset of all levels starting from 'first_level'.<br>
*/<br>
<span class="HOEnZb"><font color="#888888">--<br>
2.11.0<br>
<br>
______________________________<wbr>_________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer" target="_blank">https://lists.freedesktop.org/<wbr>mailman/listinfo/mesa-dev</a><br>
</font></span></blockquote></div><br></div>