vk/device: Destroy all batch buffers
authorJason Ekstrand <jason.ekstrand@intel.com>
Tue, 9 Jun 2015 18:40:22 +0000 (11:40 -0700)
committerJason Ekstrand <jason.ekstrand@intel.com>
Tue, 9 Jun 2015 19:36:23 +0000 (12:36 -0700)
Due to a copy+paste error, we were destroying all but the first batch or
surface state buffer.  Now we destroy them all.

src/vulkan/device.c

index d6bd78999191177fe65c67011a1dcca28431ebf5..843c1ed61f0738ce827987bae4152151a51e56d2 100644 (file)
@@ -2210,7 +2210,7 @@ anv_cmd_buffer_destroy(struct anv_device *device,
 
    /* Destroy all of the batch buffers */
    struct anv_batch_bo *bbo = cmd_buffer->last_batch_bo;
-   while (bbo->prev_batch_bo) {
+   while (bbo) {
       struct anv_batch_bo *prev = bbo->prev_batch_bo;
       anv_batch_bo_destroy(bbo, device);
       bbo = prev;
@@ -2219,7 +2219,7 @@ anv_cmd_buffer_destroy(struct anv_device *device,
 
    /* Destroy all of the surface state buffers */
    bbo = cmd_buffer->surface_batch_bo;
-   while (bbo->prev_batch_bo) {
+   while (bbo) {
       struct anv_batch_bo *prev = bbo->prev_batch_bo;
       anv_batch_bo_destroy(bbo, device);
       bbo = prev;