st/mesa: call resource_changed when binding a EGLImage to a texture
authorLucas Stach <l.stach@pengutronix.de>
Tue, 20 Mar 2018 11:14:12 +0000 (12:14 +0100)
committerLucas Stach <l.stach@pengutronix.de>
Thu, 12 Jul 2018 09:02:04 +0000 (11:02 +0200)
When a EGLImage is newly bound to a texture, we need to make sure the
driver is informed that the resource might have changed. Fixes stale
texture content on Etnaviv when binding an existing EGLImage to an
existing texture object.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
src/mesa/state_tracker/st_cb_eglimage.c

index bb092a2f6ef12c4062dc43c57e10a5d6ecb8c56a..4f33cb4bb0621d79abea1ce37178cf3d6b2d9906 100644 (file)
@@ -229,6 +229,7 @@ st_bind_egl_image(struct gl_context *ctx,
    pipe_resource_reference(&stObj->pt, stimg->texture);
    st_texture_release_all_sampler_views(st, stObj);
    pipe_resource_reference(&stImage->pt, stObj->pt);
+   st->pipe->screen->resource_changed(st->pipe->screen, stImage->pt);
 
    stObj->surface_format = stimg->format;
    stObj->level_override = stimg->level;