From 98efb278b79de8d73cd09347e02d213084c5207d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Fri, 5 Sep 2014 19:02:56 +0200 Subject: [PATCH] hack --- src/mesa/state_tracker/st_texture.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/mesa/state_tracker/st_texture.c b/src/mesa/state_tracker/st_texture.c index af9b767..8cc3aa3 100644 --- a/src/mesa/state_tracker/st_texture.c +++ b/src/mesa/state_tracker/st_texture.c @@ -475,12 +475,14 @@ st_texture_get_sampler_view(struct st_context *st, /* Couldn't find a slot for our context, create a new one */ if (!free) { + mtx_lock(&stObj->base.Mutex); /* Haven't even found a free one, resize the array */ GLuint old_size = stObj->num_sampler_views * sizeof(void *); GLuint new_size = old_size + sizeof(void *); stObj->sampler_views = REALLOC(stObj->sampler_views, old_size, new_size); free = &stObj->sampler_views[stObj->num_sampler_views++]; *free = NULL; + mtx_unlock(&stObj->base.Mutex); } /* Add just any sampler view to be used as a template */ @@ -496,6 +498,7 @@ st_texture_release_sampler_view(struct st_context *st, { GLuint i; + mtx_lock(&stObj->base.Mutex); for (i = 0; i < stObj->num_sampler_views; ++i) { struct pipe_sampler_view **sv = &stObj->sampler_views[i]; @@ -504,6 +507,7 @@ st_texture_release_sampler_view(struct st_context *st, break; } } + mtx_unlock(&stObj->base.Mutex); } void @@ -511,8 +515,10 @@ st_texture_release_all_sampler_views(struct st_texture_object *stObj) { GLuint i; + mtx_lock(&stObj->base.Mutex); for (i = 0; i < stObj->num_sampler_views; ++i) pipe_sampler_view_reference(&stObj->sampler_views[i], NULL); + mtx_unlock(&stObj->base.Mutex); } -- 1.9.1