<div dir="auto"><span style="font-family:sans-serif">Reviewed-by: Marek Olšák <<a href="mailto:marek.olsak@amd.com">marek.olsak@amd.com</a>></span></div><div class="gmail_extra"><br><div class="gmail_quote">On Dec 6, 2016 5:17 PM, "Philipp Zabel" <<a href="mailto:p.zabel@pengutronix.de">p.zabel@pengutronix.de</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">To comply with the requirement from the GL_OES_EGL_image_external<br>
extension that a call to glBindTexture guarantees that all further<br>
sampling will return values that correspond to the values in the<br>
external texture at or after the time that glBindTexture was called,<br>
do not bail out early from mesa_BindTextures if the target is<br>
external.<br>
This will later allow the state tracker to instruct the pipe driver<br>
to invalidate internal resources derived from the external texture.<br>
<br>
Signed-off-by: Philipp Zabel <<a href="mailto:p.zabel@pengutronix.de">p.zabel@pengutronix.de</a>><br>
---<br>
 src/mesa/main/texobj.c | 5 +++--<br>
 1 file changed, 3 insertions(+), 2 deletions(-)<br>
<br>
diff --git a/src/mesa/main/texobj.c b/src/mesa/main/texobj.c<br>
index e5b7070..25b959d 100644<br>
--- a/src/mesa/main/texobj.c<br>
+++ b/src/mesa/main/texobj.c<br>
@@ -1619,9 +1619,10 @@ bind_texture(struct gl_context *ctx,<br>
    assert(targetIndex < NUM_TEXTURE_TARGETS);<br>
<br>
    /* Check if this texture is only used by this context and is already bound.<br>
-    * If so, just return.<br>
+    * If so, just return. For GL_OES_image_external, rebinding the texture<br>
+    * always must invalidate cached resources.<br>
     */<br>
-   {<br>
+   if (targetIndex != TEXTURE_EXTERNAL_INDEX) {<br>
       bool early_out;<br>
       mtx_lock(&ctx->Shared->Mutex);<br>
       early_out = ((ctx->Shared->RefCount == 1)<br>
--<br>
2.10.2<br>
<br>
</blockquote></div></div>