Lines Matching defs:chain
208 struct wsi_swapchain *chain,
215 memset(chain, 0, sizeof(*chain));
217 vk_object_base_init(NULL, &chain->base, VK_OBJECT_TYPE_SWAPCHAIN_KHR);
219 chain->wsi = wsi;
220 chain->device = device;
221 chain->alloc = *pAllocator;
222 chain->use_prime_blit = false;
224 chain->cmd_pools =
227 if (!chain->cmd_pools)
237 result = wsi->CreateCommandPool(device, &cmd_pool_info, &chain->alloc,
238 &chain->cmd_pools[i]);
246 wsi_swapchain_finish(chain);
304 wsi_swapchain_finish(struct wsi_swapchain *chain)
306 if (chain->fences) {
307 for (unsigned i = 0; i < chain->image_count; i++)
308 chain->wsi->DestroyFence(chain->device, chain->fences[i], &chain->alloc);
310 vk_free(&chain->alloc, chain->fences);
313 for (uint32_t i = 0; i < chain->wsi->queue_family_count; i++) {
314 chain->wsi->DestroyCommandPool(chain->device, chain->cmd_pools[i],
315 &chain->alloc);
317 vk_free(&chain->alloc, chain->cmd_pools);
319 vk_object_base_finish(&chain->base);
323 wsi_destroy_image(const struct wsi_swapchain *chain,
326 const struct wsi_device *wsi = chain->wsi;
330 wsi->FreeCommandBuffers(chain->device, chain->cmd_pools[i],
333 vk_free(&chain->alloc, image->prime.blit_cmd_buffers);
336 wsi->FreeMemory(chain->device, image->memory, &chain->alloc);
337 wsi->DestroyImage(chain->device, image->image, &chain->alloc);
338 wsi->FreeMemory(chain->device, image->prime.memory, &chain->alloc);
339 wsi->DestroyBuffer(chain->device, image->prime.buffer, &chain->alloc);