diff options
author | Michel Dänzer <[email protected]> | 2018-07-12 16:29:51 +0200 |
---|---|---|
committer | Michel Dänzer <[email protected]> | 2018-07-12 17:39:12 +0200 |
commit | 34e89e4d3802ec9b4d7da178757bd82c44310653 (patch) | |
tree | 8f3ba9ecd6a527804c22e069c5a4476b1a04b1c0 /src/mesa/state_tracker | |
parent | c2587ac4e58353657c3a38e259bc55ee1216716e (diff) |
gallium: Check pipe_screen::resource_changed before dereferencing it
It's optional, only implemented by the etnaviv driver so far.
Fixes: 501d0edeca32 "st/mesa: call resource_changed when binding a
EGLImage to a texture"
Fixes: a37cf630b4d1 "gallium: add pipe_screen::resource_changed callback
wrappers"
Reviewed-by: Lucas Stach <[email protected]>
Diffstat (limited to 'src/mesa/state_tracker')
-rw-r--r-- | src/mesa/state_tracker/st_cb_eglimage.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/mesa/state_tracker/st_cb_eglimage.c b/src/mesa/state_tracker/st_cb_eglimage.c index 4f33cb4bb06..0db2efc01cf 100644 --- a/src/mesa/state_tracker/st_cb_eglimage.c +++ b/src/mesa/state_tracker/st_cb_eglimage.c @@ -229,7 +229,8 @@ 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); + if (st->pipe->screen->resource_changed) + st->pipe->screen->resource_changed(st->pipe->screen, stImage->pt); stObj->surface_format = stimg->format; stObj->level_override = stimg->level; |