swr: remove LLVM dependency from source generation rules.
[mesa.git] / src / gallium / drivers / swr / swr_context.cpp
index 78b8fdf619b369015a1100d41e2dc01e34e73b95..3a5d9e07ab3aa2d847b6b9a504bbb1f8a507b5eb 100644 (file)
@@ -300,6 +300,21 @@ swr_destroy(struct pipe_context *pipe)
 
    /* Idle core before deleting context */
    SwrWaitForIdle(ctx->swrContext);
+
+   for (unsigned i = 0; i < PIPE_MAX_COLOR_BUFS; i++) {
+      pipe_surface_reference(&ctx->framebuffer.cbufs[i], NULL);
+   }
+
+   pipe_surface_reference(&ctx->framebuffer.zsbuf, NULL);
+
+   for (unsigned i = 0; i < ARRAY_SIZE(ctx->sampler_views[0]); i++) {
+      pipe_sampler_view_reference(&ctx->sampler_views[PIPE_SHADER_FRAGMENT][i], NULL);
+   }
+
+   for (unsigned i = 0; i < ARRAY_SIZE(ctx->sampler_views[0]); i++) {
+      pipe_sampler_view_reference(&ctx->sampler_views[PIPE_SHADER_VERTEX][i], NULL);
+   }
+
    if (ctx->swrContext)
       SwrDestroyContext(ctx->swrContext);
 
@@ -338,7 +353,6 @@ swr_create_context(struct pipe_screen *p_screen, void *priv, unsigned flags)
    SWR_CREATECONTEXT_INFO createInfo;
    createInfo.driver = GL;
    createInfo.privateStateSize = sizeof(swr_draw_context);
-   createInfo.maxSubContexts = 0;
    createInfo.pfnLoadTile = swr_LoadHotTile;
    createInfo.pfnStoreTile = swr_StoreHotTile;
    createInfo.pfnClearTile = swr_StoreHotTileClear;