r300g: remove useless code
authorMarek Olšák <maraeo@gmail.com>
Fri, 28 Oct 2011 15:44:02 +0000 (17:44 +0200)
committerMarek Olšák <maraeo@gmail.com>
Fri, 28 Oct 2011 17:29:04 +0000 (19:29 +0200)
src/gallium/drivers/r300/r300_context.c
src/gallium/drivers/r300/r300_context.h
src/gallium/drivers/r300/r300_emit.c
src/gallium/drivers/r300/r300_query.c

index cacad9fbad2529e58ad573ae760d19f5a699a0ca..fb9f34a1ed3aed005f62372ddc91daf48cc3b0a5 100644 (file)
@@ -62,7 +62,6 @@ static void r300_release_referenced_objects(struct r300_context *r300)
             (struct pipe_framebuffer_state*)r300->fb_state.state;
     struct r300_textures_state *textures =
             (struct r300_textures_state*)r300->textures_state.state;
-    struct r300_query *query, *temp;
     unsigned i;
 
     /* Framebuffer state. */
@@ -84,12 +83,6 @@ static void r300_release_referenced_objects(struct r300_context *r300)
     pipe_resource_reference(&r300->dummy_vb, NULL);
     pipe_resource_reference(&r300->vbo, NULL);
 
-    /* If there are any queries pending or not destroyed, remove them now. */
-    foreach_s(query, temp, &r300->query_list) {
-        remove_from_list(query);
-        FREE(query);
-    }
-
     r300->context.delete_depth_stencil_alpha_state(&r300->context,
                                                    r300->dsa_decompress_zmask);
 }
@@ -408,8 +401,6 @@ struct pipe_context* r300_create_context(struct pipe_screen* screen,
 
     r300->context.destroy = r300_destroy_context;
 
-    make_empty_list(&r300->query_list);
-
     util_slab_create(&r300->pool_transfers,
                      sizeof(struct pipe_transfer), 64,
                      UTIL_SLAB_SINGLETHREADED);
index b89d6ecce173765bd915719ec1190b66b82c5d82..08353567f44505c6f389caab5078ca357bd5dcb3 100644 (file)
@@ -293,12 +293,6 @@ struct r300_query {
     /* The buffer where query results are stored. */
     struct pb_buffer *buf;
     struct radeon_winsys_cs_handle *cs_buf;
-    /* The size of the buffer. */
-    unsigned buffer_size;
-
-    /* Linked list members. */
-    struct r300_query* prev;
-    struct r300_query* next;
 };
 
 struct r300_surface {
index 2fb448a433afb6c63ac128f19566d6b315edb1be..d93a5786ff80032957fc4ee8307dadfc5de5b530 100644 (file)
@@ -675,8 +675,8 @@ void r300_emit_query_end(struct r300_context* r300)
     query->num_results += query->num_pipes;
 
     /* XXX grab all the results and reset the counter. */
-    if (query->num_results >= query->buffer_size / 4 - 4) {
-        query->num_results = (query->buffer_size / 4) / 2;
+    if (query->num_results >= query->buf->size / 4 - 4) {
+        query->num_results = (query->buf->size / 4) / 2;
         fprintf(stderr, "r300: Rewinding OQBO...\n");
     }
 }
index 3177ce63b995736ab144b83647a4d237d4363241..9e784b5fecfb716b0841f525b4e95a8a93902fad 100644 (file)
@@ -45,17 +45,14 @@ static struct pipe_query *r300_create_query(struct pipe_context *pipe,
         return NULL;
 
     q->type = query_type;
-    q->buffer_size = 4096;
 
     if (r300screen->caps.family == CHIP_FAMILY_RV530)
         q->num_pipes = r300screen->info.r300_num_z_pipes;
     else
         q->num_pipes = r300screen->info.r300_num_gb_pipes;
 
-    insert_at_tail(&r300->query_list, q);
-
     /* Open up the occlusion query buffer. */
-    q->buf = r300->rws->buffer_create(r300->rws, q->buffer_size, 4096,
+    q->buf = r300->rws->buffer_create(r300->rws, 4096, 4096,
                                          PIPE_BIND_CUSTOM, PIPE_USAGE_STAGING);
     q->cs_buf = r300->rws->buffer_get_cs_handle(q->buf);
 
@@ -68,7 +65,6 @@ static void r300_destroy_query(struct pipe_context* pipe,
     struct r300_query* q = r300_query(query);
 
     pb_reference(&q->buf, NULL);
-    remove_from_list(q);
     FREE(query);
 }