mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-24 15:20:10 +01:00
st/mesa: recreate sampler view on context change v3
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 v3: add XXX comment Signed-off-by: Christian König <christian.koenig@amd.com> Cc: "10.0 10.1" <mesa-stable@lists.freedesktop.org> Reviewed-by: Brian Paul <brianp@vmware.com>
This commit is contained in:
parent
eabfadf4af
commit
92e543c45d
1 changed files with 10 additions and 0 deletions
|
|
@ -198,6 +198,16 @@ 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 */
|
||||
/* XXX: This isn't optimal, we should try to use more than one view.
|
||||
Otherwise we create/destroy the view all the time
|
||||
*/
|
||||
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;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue