r300g: Kill dead code for hashing custom state.
authorCorbin Simpson <MostAwesomeDude@gmail.com>
Wed, 27 Jan 2010 05:41:44 +0000 (21:41 -0800)
committerCorbin Simpson <MostAwesomeDude@gmail.com>
Wed, 27 Jan 2010 05:41:44 +0000 (21:41 -0800)
It just wasn't meant to be.

src/gallium/drivers/r300/r300_context.c
src/gallium/drivers/r300/r300_context.h
src/gallium/drivers/r300/r300_state_derived.c

index 3bf9c8b18dcd7aebccc6d6af880ae81410f42d94..5a689e0bd7f2d11412089da4204059e12c1aab2a 100644 (file)
 #include "r300_texture.h"
 #include "r300_winsys.h"
 
-static enum pipe_error r300_clear_hash_table(void* key, void* value,
-                                             void* data)
-{
-    FREE(key);
-    FREE(value);
-    return PIPE_OK;
-}
-
 static void r300_destroy_context(struct pipe_context* context)
 {
     struct r300_context* r300 = r300_context(context);
     struct r300_query* query, * temp;
 
     util_blitter_destroy(r300->blitter);
-
-    util_hash_table_foreach(r300->shader_hash_table, r300_clear_hash_table,
-        NULL);
-    util_hash_table_destroy(r300->shader_hash_table);
-
     draw_destroy(r300->draw);
 
     /* Free the OQ BO. */
@@ -183,9 +170,6 @@ struct pipe_context* r300_create_context(struct pipe_screen* screen,
     r300->context.is_texture_referenced = r300_is_texture_referenced;
     r300->context.is_buffer_referenced = r300_is_buffer_referenced;
 
-    r300->shader_hash_table = util_hash_table_create(r300_shader_key_hash,
-        r300_shader_key_compare);
-
     r300_setup_atoms(r300);
 
     r300->blend_color_state.state = CALLOC_STRUCT(r300_blend_color_state);
index 48c86fdad7a27f92d00bab58788da559413059dd..a25e46afaa59bc63455ae4fe1c62fc761fa7628c 100644 (file)
@@ -272,9 +272,6 @@ struct r300_context {
     struct r300_query *query_current;
     struct r300_query query_list;
 
-    /* Shader hash table. Used to store vertex formatting information, which
-     * depends on the combination of both currently loaded shaders. */
-    struct util_hash_table* shader_hash_table;
     /* Vertex formatting information. */
     struct r300_vertex_info* vertex_info;
 
index 99c2720897f18c4614172d66b16d5665000bb8b1..45a3e93df1a9666e444ea54f27c078cc38364256 100644 (file)
 /* r300_state_derived: Various bits of state which are dependent upon
  * currently bound CSO data. */
 
-struct r300_shader_key {
-    struct r300_vertex_shader* vs;
-    struct r300_fragment_shader* fs;
-};
-
-struct r300_shader_derived_value {
-    struct r300_vertex_format* vformat;
-    struct r300_rs_block* rs_block;
-};
-
-unsigned r300_shader_key_hash(void* key) {
-    struct r300_shader_key* shader_key = (struct r300_shader_key*)key;
-    unsigned vs = (intptr_t)shader_key->vs;
-    unsigned fs = (intptr_t)shader_key->fs;
-
-    return (vs << 16) | (fs & 0xffff);
-}
-
-int r300_shader_key_compare(void* key1, void* key2) {
-    struct r300_shader_key* shader_key1 = (struct r300_shader_key*)key1;
-    struct r300_shader_key* shader_key2 = (struct r300_shader_key*)key2;
-
-    return (shader_key1->vs == shader_key2->vs) &&
-        (shader_key1->fs == shader_key2->fs);
-}
-
 static void r300_draw_emit_attrib(struct r300_context* r300,
                                   enum attrib_emit emit,
                                   enum interp_mode interp,
@@ -440,32 +414,6 @@ static void r300_update_derived_shader_state(struct r300_context* r300)
 {
     struct r300_screen* r300screen = r300_screen(r300->context.screen);
 
-    /*
-    struct r300_shader_key* key;
-    struct r300_shader_derived_value* value;
-    key = CALLOC_STRUCT(r300_shader_key);
-    key->vs = r300->vs;
-    key->fs = r300->fs;
-
-    value = (struct r300_shader_derived_value*)
-        util_hash_table_get(r300->shader_hash_table, (void*)key);
-    if (value) {
-        //vformat = value->vformat;
-        rs_block = value->rs_block;
-
-        FREE(key);
-    } else {
-        rs_block = CALLOC_STRUCT(r300_rs_block);
-        value = CALLOC_STRUCT(r300_shader_derived_value);
-
-        r300_update_rs_block(r300, rs_block);
-
-        //value->vformat = vformat;
-        value->rs_block = rs_block;
-        util_hash_table_set(r300->shader_hash_table,
-            (void*)key, (void*)value);
-    } */
-
     /* Reset structures */
     memset(r300->rs_block, 0, sizeof(struct r300_rs_block));
     memset(r300->vertex_info, 0, sizeof(struct r300_vertex_info));