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

Ilia Mirkin imirkin at alum.mit.edu
Wed May 25 13:23:33 UTC 2016


Iirc invalidate_resource is to allow backend to discard the contents...
On May 25, 2016 9:18 AM, "Philipp Zabel" <p.zabel at pengutronix.de> wrote:

> 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
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20160525/e517f881/attachment.html>


More information about the mesa-dev mailing list