Merge branch '7.8' into master
[mesa.git] / src / mesa / state_tracker / st_context.c
index 0358a70726123082e7d4b3f48622daff910443f5..0885ad77c7c9db616edc56b7f5b06006ba93f970 100644 (file)
@@ -30,9 +30,9 @@
 #include "vbo/vbo.h"
 #include "shader/shader_api.h"
 #include "glapi/glapi.h"
+#include "st_context.h"
 #include "st_public.h"
 #include "st_debug.h"
-#include "st_context.h"
 #include "st_cb_accum.h"
 #include "st_cb_bitmap.h"
 #include "st_cb_blit.h"
@@ -215,8 +215,8 @@ static void st_destroy_context_priv( struct st_context *st )
    st_destroy_drawtex(st);
 #endif
 
-   for (i = 0; i < Elements(st->state.sampler_texture); i++) {
-      pipe_texture_reference(&st->state.sampler_texture[i], NULL);
+   for (i = 0; i < Elements(st->state.sampler_views); i++) {
+      pipe_sampler_view_reference(&st->state.sampler_views[i], NULL);
    }
 
    for (i = 0; i < Elements(st->state.constants); i++) {
@@ -272,7 +272,8 @@ void st_destroy_context( struct st_context *st )
 GLboolean
 st_make_current(struct st_context *st,
                 struct st_framebuffer *draw,
-                struct st_framebuffer *read)
+                struct st_framebuffer *read,
+                void *winsys_drawable_handle )
 {
    /* Call this periodically to detect when the user has begun using
     * GL rendering from multiple threads.
@@ -280,10 +281,13 @@ st_make_current(struct st_context *st,
    _glapi_check_multithread();
 
    if (st) {
-      if (!_mesa_make_current(st->ctx, &draw->Base, &read->Base))
+      if (!_mesa_make_current(st->ctx, &draw->Base, &read->Base)) {
+         st->pipe->priv = NULL;
          return GL_FALSE;
+      }
 
       _mesa_check_init_viewport(st->ctx, draw->InitWidth, draw->InitHeight);
+      st->winsys_drawable_handle = winsys_drawable_handle;
 
       return GL_TRUE;
    }