diff options
| author | Ian Elliott <ian@lunarg.com> | 2015-10-27 11:06:33 -0600 |
|---|---|---|
| committer | Ian Elliott <ian@lunarg.com> | 2015-10-27 11:06:33 -0600 |
| commit | 55234c44d18f7370d21bd2858ee99ea74159ce49 (patch) | |
| tree | f18e7b52c9d0d68f2e0b5997a6dcc039f20ca7dc | |
| parent | 5ef45e9842856e8de3d6a214612ff68a8ff05fc7 (diff) | |
| download | usermoji-55234c44d18f7370d21bd2858ee99ea74159ce49.tar.xz | |
tri/cube: Adjust demo_resize() to API changes.
| -rw-r--r-- | demos/cube.c | 4 | ||||
| -rw-r--r-- | demos/tri.c | 7 |
2 files changed, 7 insertions, 4 deletions
diff --git a/demos/cube.c b/demos/cube.c index b1c4c6f1..d2c20d06 100644 --- a/demos/cube.c +++ b/demos/cube.c @@ -1892,10 +1892,12 @@ static void demo_resize(struct demo *demo) for (i = 0; i < demo->swapchainImageCount; i++) { vkDestroyImageView(demo->device, demo->buffers[i].view); - vkDestroyCommandBuffer(demo->device, demo->buffers[i].cmd); + vkFreeCommandBuffers(demo->device, demo->cmd_pool, 1, &demo->buffers[i].cmd); } free(demo->buffers); + vkDestroyCommandPool(demo->device, demo->cmd_pool); + // Second, re-perform the demo_prepare() function, which will re-create the // swapchain: diff --git a/demos/tri.c b/demos/tri.c index 9b512aef..850a4b14 100644 --- a/demos/tri.c +++ b/demos/tri.c @@ -2270,10 +2270,9 @@ static void demo_resize(struct demo *demo) vkDestroyDescriptorPool(demo->device, demo->desc_pool); if (demo->setup_cmd) { - vkDestroyCommandBuffer(demo->device, demo->setup_cmd); - demo->setup_cmd = 0; // Must clear this value + vkFreeCommandBuffers(demo->device, demo->cmd_pool, 1, &demo->setup_cmd); } - vkDestroyCommandBuffer(demo->device, demo->draw_cmd); + vkFreeCommandBuffers(demo->device, demo->cmd_pool, 1, &demo->draw_cmd); vkDestroyCommandPool(demo->device, demo->cmd_pool); vkDestroyPipeline(demo->device, demo->pipeline); @@ -2299,6 +2298,8 @@ static void demo_resize(struct demo *demo) vkDestroyImage(demo->device, demo->depth.image); vkFreeMemory(demo->device, demo->depth.mem); + free(demo->buffers); + // Second, re-perform the demo_prepare() function, which will re-create the // swapchain: demo_prepare(demo); |
