summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/r300/r300_context.c
diff options
context:
space:
mode:
authorCorbin Simpson <MostAwesomeDude@gmail.com>2009-10-16 08:39:59 -0700
committerCorbin Simpson <MostAwesomeDude@gmail.com>2009-10-16 08:43:02 -0700
commitfc8a156cfc539b9c04dc3527e4fc61cb4b0b688e (patch)
treed9eafbd3c0645c66f0223143e1e9dcce56d3d3c9 /src/gallium/drivers/r300/r300_context.c
parent3924d8611513eea74446d655b554596ab66381ff (diff)
r300g: Use a hash table to look up vertex info.
Need to move rs_block to this, too. Also, I'm getting massive amounts of flicker for some reason; I bet we've gotta re-re-examine PSC and friends. :C
Diffstat (limited to 'src/gallium/drivers/r300/r300_context.c')
-rw-r--r--src/gallium/drivers/r300/r300_context.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/gallium/drivers/r300/r300_context.c b/src/gallium/drivers/r300/r300_context.c
index b243f88bb5..a1156d2de6 100644
--- a/src/gallium/drivers/r300/r300_context.c
+++ b/src/gallium/drivers/r300/r300_context.c
@@ -89,10 +89,23 @@ static boolean r300_draw_arrays(struct pipe_context* pipe, unsigned mode,
return r300_draw_elements(pipe, NULL, 0, mode, start, count);
}
-static void r300_destroy_context(struct pipe_context* context) {
+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;
+ u_hash_table_foreach(r300->shader_hash_table, r300_clear_hash_table,
+ NULL);
+ u_hash_table_destroy(r300->shader_hash_table);
+
draw_destroy(r300->draw);
/* Free the OQ BO. */
@@ -167,6 +180,9 @@ 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 = u_hash_table_create(r300_shader_key_hash,
+ r300_shader_key_compare);
+
r300->blend_color_state = CALLOC_STRUCT(r300_blend_color_state);
r300->rs_block = CALLOC_STRUCT(r300_rs_block);
r300->scissor_state = CALLOC_STRUCT(r300_scissor_state);