From c907b947130c884de09e48e1ecbeecc9afc9f75b Mon Sep 17 00:00:00 2001 From: Luca Barbieri Date: Mon, 23 Aug 2010 16:43:04 +0200 Subject: nvfx: emit bo relocations only when needed Should improve performance, possibly significantly. --- src/gallium/drivers/nvfx/nvfx_context.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/gallium/drivers/nvfx/nvfx_context.c') diff --git a/src/gallium/drivers/nvfx/nvfx_context.c b/src/gallium/drivers/nvfx/nvfx_context.c index 2f775f92cf..5a2fa14c88 100644 --- a/src/gallium/drivers/nvfx/nvfx_context.c +++ b/src/gallium/drivers/nvfx/nvfx_context.c @@ -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,8 +75,6 @@ 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. @@ -103,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); -- cgit v1.2.3