[Mesa-dev] [PATCH 3/5] llvmpipe: kill off llvmpipe_variant_count

sroland at vmware.com sroland at vmware.com
Mon May 12 19:02:39 PDT 2014


From: Roland Scheidegger <sroland at vmware.com>

Unused except it was increased for both fs and setup shader variants created.
Probably some leftover from ages ago.
---
 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 ac07408..d9696c2 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 ee8033c..ee0831f 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 5e28f0e..aa3f920 100644
--- a/src/gallium/drivers/llvmpipe/lp_state_fs.c
+++ b/src/gallium/drivers/llvmpipe/lp_state_fs.c
@@ -3174,8 +3174,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 1d79a4a..edd1923 100644
--- a/src/gallium/drivers/llvmpipe/lp_state_setup.c
+++ b/src/gallium/drivers/llvmpipe/lp_state_setup.c
@@ -955,7 +955,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;
       }
@@ -966,19 +966,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
-- 
1.9.1


More information about the mesa-dev mailing list