Merge remote branch 'origin/master' into nv50-compiler
[mesa.git] / src / gallium / drivers / nvfx / nvfx_context.c
index 80b36fb7b91557b8cf646059f69f4dcc63e9ebcd..5a2fa14c887b773070ae1de4c8af2840b2f39d88 100644 (file)
@@ -46,6 +46,9 @@ nvfx_destroy(struct pipe_context *pipe)
        if (nvfx->draw)
                draw_destroy(nvfx->draw);
 
+       if(nvfx->screen->cur_ctx == nvfx)
+               nvfx->screen->cur_ctx = NULL;
+
        FREE(nvfx);
 }
 
@@ -72,9 +75,11 @@ nvfx_create(struct pipe_screen *pscreen, void *priv)
        nvfx->pipe.clear = nvfx_clear;
        nvfx->pipe.flush = nvfx_flush;
 
-       screen->base.channel->user_private = nvfx;
-
        nvfx->is_nv4x = screen->is_nv4x;
+       /* TODO: it seems that nv30 might have fixed function clipping usable with vertex programs
+        * However, my code for that doesn't work, so use vp clipping for all cards, which works.
+        */
+       nvfx->use_vp_clipping = TRUE;
 
        nvfx_init_query_functions(nvfx);
        nvfx_init_surface_functions(nvfx);
@@ -99,6 +104,7 @@ nvfx_create(struct pipe_screen *pscreen, void *priv)
        nvfx->hw_pointsprite_control = -1;
        nvfx->hw_vp_output = -1;
        nvfx->use_vertex_buffers = -1;
+       nvfx->relocs_needed = NVFX_RELOCATE_ALL;
 
        LIST_INITHEAD(&nvfx->render_cache);