summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/llvmpipe/lp_scene.c
diff options
context:
space:
mode:
authorKeith Whitwell <keithw@vmware.com>2010-09-12 14:29:00 +0100
committerKeith Whitwell <keithw@vmware.com>2010-09-12 14:58:43 +0100
commit51b1d4f03c78251851b6f29aae93ea5c4a0f184c (patch)
tree93f154d7dec9cbdfc0b0185ac7d672122acf2a04 /src/gallium/drivers/llvmpipe/lp_scene.c
parent67763488b1fea01d6eb1c7d9e05ecb175918c3af (diff)
llvmpipe: fix wierd performance regression in isosurf
I really don't understand the mechanism behind this, but it seems like the way data blocks for a scene are malloced, and in particular whether we treat them as stack or a queue, and whether we retain the most recently allocated or least recently allocated has a real affect (~5%) on isosurf framerates... This is probably specific to my distro or even just my machine, but none the less, it's nicer not to see the framerates go in the wrong direction.
Diffstat (limited to 'src/gallium/drivers/llvmpipe/lp_scene.c')
-rw-r--r--src/gallium/drivers/llvmpipe/lp_scene.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_scene.c b/src/gallium/drivers/llvmpipe/lp_scene.c
index f6c6941507..c0732e4ab7 100644
--- a/src/gallium/drivers/llvmpipe/lp_scene.c
+++ b/src/gallium/drivers/llvmpipe/lp_scene.c
@@ -58,7 +58,9 @@ lp_scene_create( struct pipe_context *pipe )
return NULL;
scene->pipe = pipe;
- scene->data.head = &scene->data.first;
+
+ scene->data.head =
+ CALLOC_STRUCT(data_block);
pipe_mutex_init(scene->mutex);
@@ -73,7 +75,8 @@ void
lp_scene_destroy(struct lp_scene *scene)
{
pipe_mutex_destroy(scene->mutex);
- assert(scene->data.head == &scene->data.first);
+ assert(scene->data.head->next == NULL);
+ FREE(scene->data.head);
FREE(scene);
}
@@ -240,14 +243,13 @@ lp_scene_end_rasterization(struct lp_scene *scene )
struct data_block_list *list = &scene->data;
struct data_block *block, *tmp;
- for (block = list->head; block; block = tmp) {
+ for (block = list->head->next; block; block = tmp) {
tmp = block->next;
- if (block != &list->first)
- FREE(block);
+ FREE(block);
}
- list->head = &list->first;
list->head->next = NULL;
+ list->head->used = 0;
}
lp_fence_reference(&scene->fence, NULL);