From: Christian König <christian.koe...@amd.com> With shared glx contexts it is possible that a texture is create and used in one context and then used in another one resulting in incorrect sampler view usage.
v2: avoid template copy Signed-off-by: Christian König <christian.koe...@amd.com> Cc: "10.0 10.1" <mesa-sta...@lists.freedesktop.org> --- src/mesa/state_tracker/st_atom_texture.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/mesa/state_tracker/st_atom_texture.c b/src/mesa/state_tracker/st_atom_texture.c index 3557a3f..dc7f635 100644 --- a/src/mesa/state_tracker/st_atom_texture.c +++ b/src/mesa/state_tracker/st_atom_texture.c @@ -198,6 +198,13 @@ st_get_texture_sampler_view_from_stobj(struct st_texture_object *stObj, if (!stObj->sampler_view) { stObj->sampler_view = st_create_texture_sampler_view_from_stobj(pipe, stObj, samp, format); + + } else if (stObj->sampler_view->context != pipe) { + /* Recreate view in correct context, use existing view as template */ + struct pipe_sampler_view *sv = + pipe->create_sampler_view(pipe, stObj->pt, stObj->sampler_view); + pipe_sampler_view_reference(&stObj->sampler_view, NULL); + stObj->sampler_view = sv; } return stObj->sampler_view; -- 1.9.1 _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev