[Mesa-dev] [PATCH 2/2] st/mesa: Invalidate external textures when (re-)binding

Philipp Zabel p.zabel at pengutronix.de
Wed May 25 13:17:41 UTC 2016


Use the invalidate_resource pipe callback to invalidate external
textures when they are (re-)bound. This is needed to comply with the
requirement from the GL_OES_EGL_image_external extension that a call
to glBindTexture guarantees that all further sampling will return
values that correspond to the values in the external texture at or
after the time that glBindTexture was called.

Signed-off-by: Philipp Zabel <p.zabel at pengutronix.de>
---
 src/mesa/state_tracker/st_atom_texture.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/mesa/state_tracker/st_atom_texture.c b/src/mesa/state_tracker/st_atom_texture.c
index 4b7ad77..96be2b2 100644
--- a/src/mesa/state_tracker/st_atom_texture.c
+++ b/src/mesa/state_tracker/st_atom_texture.c
@@ -410,6 +410,10 @@ update_single_texture(struct st_context *st,
       }
    }
 
+   if (texObj->TargetIndex == TEXTURE_EXTERNAL_INDEX &&
+       st->pipe->invalidate_resource)
+         st->pipe->invalidate_resource(st->pipe, stObj->pt);
+
    *sampler_view =
       st_get_texture_sampler_view_from_stobj(st, stObj, view_format,
                                              glsl_version);
-- 
2.8.1



More information about the mesa-dev mailing list