st/mesa: ask pipe driver to recreate derived internal resources when (re-)binding...
authorPhilipp Zabel <p.zabel@pengutronix.de>
Thu, 19 Jan 2017 14:05:41 +0000 (15:05 +0100)
committerLucas Stach <l.stach@pengutronix.de>
Fri, 20 Jan 2017 14:30:30 +0000 (15:30 +0100)
Use the resource_changed callback to invalidate internal resources
derived from 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@pengutronix.de>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
src/mesa/state_tracker/st_atom_texture.c

index 76e512f52aaa8f4edd5c7cc980216440514f9f45..92023e0dc3ab9946a4972a5832252d313f4f66ef 100644 (file)
@@ -91,6 +91,10 @@ update_single_texture(struct st_context *st,
       stObj->prev_sRGBDecode = samp->sRGBDecode;
    }
 
+   if (texObj->TargetIndex == TEXTURE_EXTERNAL_INDEX &&
+       stObj->pt->screen->resource_changed)
+         stObj->pt->screen->resource_changed(stObj->pt->screen, stObj->pt);
+
    *sampler_view =
       st_get_texture_sampler_view_from_stobj(st, stObj, samp, glsl_version);
    return GL_TRUE;