<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Sep 9, 2015 at 1:04 PM, Ian Romanick <span dir="ltr"><<a href="mailto:idr@freedesktop.org" target="_blank">idr@freedesktop.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">From: Ian Romanick <<a href="mailto:ian.d.romanick@intel.com">ian.d.romanick@intel.com</a>><br>
<br>
We may have been called from glGenerateTextureMipmap with CurrentUnit<br>
still set to 0, so we don't know when we can skip binding the texture.<br>
Assume that _mesa_BindTexture will be fast if we're rebinding the same<br>
texture.<br>
<br>
Signed-off-by: Ian Romanick <<a href="mailto:ian.d.romanick@intel.com">ian.d.romanick@intel.com</a>><br>
Bugzilla: <a href="https://bugs.freedesktop.org/show_bug.cgi?id=91847" rel="noreferrer" target="_blank">https://bugs.freedesktop.org/show_bug.cgi?id=91847</a><br>
Cc: "11.0" <<a href="mailto:mesa-stable@lists.freedesktop.org">mesa-stable@lists.freedesktop.org</a>><br>
---<br>
This patch seems to resolve the problems seen in the apitrace attached<br>
to the bug. I'm working on a piglit test.<br>
<br>
src/mesa/drivers/common/meta_generate_mipmap.c | 8 ++++++--<br>
1 file changed, 6 insertions(+), 2 deletions(-)<br>
<br>
diff --git a/src/mesa/drivers/common/meta_generate_mipmap.c b/src/mesa/drivers/common/meta_generate_mipmap.c<br>
index 0655f05..6731478 100644<br>
--- a/src/mesa/drivers/common/meta_generate_mipmap.c<br>
+++ b/src/mesa/drivers/common/meta_generate_mipmap.c<br>
@@ -202,8 +202,12 @@ _mesa_meta_GenerateMipmap(struct gl_context *ctx, GLenum target,<br>
samplerSave = ctx->Texture.Unit[ctx->Texture.CurrentUnit].Sampler ?<br>
ctx->Texture.Unit[ctx->Texture.CurrentUnit].Sampler->Name : 0;<br>
<br>
- if (currentTexUnitSave != 0)<br>
- _mesa_BindTexture(target, texObj->Name);<br>
+ /* We may have been called from glGenerateTextureMipmap with CurrentUnit<br>
+ * still set to 0, so we don't know when we can skip binding the texture.<br>
+ * Assume that _mesa_BindTexture will be fast if we're rebinding the same<br>
+ * texture.<br>
+ */<br>
+ _mesa_BindTexture(target, texObj->Name);<br>
<br>
if (!mipmap->Sampler) {<br>
_mesa_GenSamplers(1, &mipmap->Sampler);<br>
<span class=""><font color="#888888">--<br>
2.1.0<br>
<br>
_______________________________________________<br>
mesa-stable mailing list<br>
<a href="mailto:mesa-stable@lists.freedesktop.org">mesa-stable@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/mesa-stable" rel="noreferrer" target="_blank">http://lists.freedesktop.org/mailman/listinfo/mesa-stable</a><br>
</font></span></blockquote></div><br></div><div class="gmail_extra">You can now remove the temporary variable currentTexUnitSave.</div><div class="gmail_extra">With that change this patch is:</div><div class="gmail_extra">Reviewed-by: Anuj Phogat <<a href="mailto:anuj.phogat@gmail.com">anuj.phogat@gmail.com</a>></div></div>