From 1d28650b551bb516fdff99d0a196c1fa133f6d05 Mon Sep 17 00:00:00 2001 From: Roland Scheidegger Date: Tue, 13 May 2014 02:20:32 +0200 Subject: [PATCH] llvmpipe: kill off llvmpipe_variant_count Unused except it was increased for both fs and setup shader variants created. Probably some leftover from ages ago. Reviewed-by: Jose Fonseca --- src/gallium/drivers/llvmpipe/lp_context.c | 4 ---- src/gallium/drivers/llvmpipe/lp_context.h | 10 +--------- src/gallium/drivers/llvmpipe/lp_state_fs.c | 2 -- src/gallium/drivers/llvmpipe/lp_state_setup.c | 8 +++----- 4 files changed, 4 insertions(+), 20 deletions(-) diff --git a/src/gallium/drivers/llvmpipe/lp_context.c b/src/gallium/drivers/llvmpipe/lp_context.c index ac074085589..d9696c2067d 100644 --- a/src/gallium/drivers/llvmpipe/lp_context.c +++ b/src/gallium/drivers/llvmpipe/lp_context.c @@ -47,10 +47,6 @@ #include "lp_setup.h" -/** shared by all contexts */ -unsigned llvmpipe_variant_count; - - static void llvmpipe_destroy( struct pipe_context *pipe ) { struct llvmpipe_context *llvmpipe = llvmpipe_context( pipe ); diff --git a/src/gallium/drivers/llvmpipe/lp_context.h b/src/gallium/drivers/llvmpipe/lp_context.h index ee8033cd28e..ee0831fbb6d 100644 --- a/src/gallium/drivers/llvmpipe/lp_context.h +++ b/src/gallium/drivers/llvmpipe/lp_context.h @@ -156,14 +156,6 @@ struct llvmpipe_context { }; -/** - * Fragment and setup variant count, used to trigger garbage collection. - * This is global since all variants in all contexts will be free when - * we do garbage collection. - */ -extern unsigned llvmpipe_variant_count; - - struct pipe_context * llvmpipe_create_context( struct pipe_screen *screen, void *priv ); @@ -171,7 +163,7 @@ struct pipe_resource * llvmpipe_user_buffer_create(struct pipe_screen *screen, void *ptr, unsigned bytes, - unsigned bind_flags); + unsigned bind_flags); static INLINE struct llvmpipe_context * diff --git a/src/gallium/drivers/llvmpipe/lp_state_fs.c b/src/gallium/drivers/llvmpipe/lp_state_fs.c index a26b9812c9f..655891cffb1 100644 --- a/src/gallium/drivers/llvmpipe/lp_state_fs.c +++ b/src/gallium/drivers/llvmpipe/lp_state_fs.c @@ -3165,8 +3165,6 @@ llvmpipe_update_fs(struct llvmpipe_context *lp) LP_COUNT_ADD(llvm_compile_time, dt); LP_COUNT_ADD(nr_llvm_compiles, 2); /* emit vs. omit in/out test */ - llvmpipe_variant_count++; - /* Put the new variant into the list */ if (variant) { insert_at_head(&shader->variants, &variant->list_item_local); diff --git a/src/gallium/drivers/llvmpipe/lp_state_setup.c b/src/gallium/drivers/llvmpipe/lp_state_setup.c index 10ede56b343..870459f5126 100644 --- a/src/gallium/drivers/llvmpipe/lp_state_setup.c +++ b/src/gallium/drivers/llvmpipe/lp_state_setup.c @@ -946,7 +946,7 @@ llvmpipe_update_setup(struct llvmpipe_context *lp) foreach(li, &lp->setup_variants_list) { if(li->base->key.size == key->size && - memcmp(&li->base->key, key, key->size) == 0) { + memcmp(&li->base->key, key, key->size) == 0) { variant = li->base; break; } @@ -957,19 +957,17 @@ llvmpipe_update_setup(struct llvmpipe_context *lp) } else { if (lp->nr_setup_variants >= LP_MAX_SETUP_VARIANTS) { - cull_setup_variants(lp); + cull_setup_variants(lp); } variant = generate_setup_variant(key, lp); if (variant) { insert_at_head(&lp->setup_variants_list, &variant->list_item_global); lp->nr_setup_variants++; - llvmpipe_variant_count++; } } - lp_setup_set_setup_variant(lp->setup, - variant); + lp_setup_set_setup_variant(lp->setup, variant); } void -- 2.30.2