radeonsi: fix freeing descriptor buffers
authorChristian König <christian.koenig@amd.com>
Sat, 8 Mar 2014 13:52:25 +0000 (14:52 +0100)
committerChristian König <christian.koenig@amd.com>
Sat, 8 Mar 2014 15:08:15 +0000 (16:08 +0100)
That structure member is a pointer, so the loop with
the Elements macro only freed up the first entry.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
src/gallium/drivers/radeonsi/si_descriptors.c

index 9b10d011b9ce2df14306debe6b0fe841ada685a9..06b29d42b8be63cb7592d0ab298a423e493e1fbc 100644 (file)
@@ -387,7 +387,7 @@ static void si_release_buffer_resources(struct si_buffer_resources *buffers)
 {
        int i;
 
-       for (i = 0; i < Elements(buffers->buffers); i++) {
+       for (i = 0; i < buffers->num_buffers; i++) {
                pipe_resource_reference(&buffers->buffers[i], NULL);
        }