Lines Matching defs:chain
190 struct wsi_swapchain *chain,
197 memset(chain, 0, sizeof(*chain));
199 chain->wsi = wsi;
200 chain->device = device;
201 chain->alloc = *pAllocator;
202 chain->use_prime_blit = false;
204 chain->cmd_pools =
207 if (!chain->cmd_pools)
217 result = wsi->CreateCommandPool(device, &cmd_pool_info, &chain->alloc,
218 &chain->cmd_pools[i]);
226 wsi_swapchain_finish(chain);
284 wsi_swapchain_finish(struct wsi_swapchain *chain)
286 for (unsigned i = 0; i < ARRAY_SIZE(chain->fences); i++)
287 chain->wsi->DestroyFence(chain->device, chain->fences[i], &chain->alloc);
289 for (uint32_t i = 0; i < chain->wsi->queue_family_count; i++) {
290 chain->wsi->DestroyCommandPool(chain->device, chain->cmd_pools[i],
291 &chain->alloc);
293 vk_free(&chain->alloc, chain->cmd_pools);
330 wsi_create_native_image(const struct wsi_swapchain *chain,
337 const struct wsi_device *wsi = chain->wsi;
370 modifier_props = vk_alloc(&chain->alloc,
390 image_modifiers = vk_alloc(&chain->alloc,
450 result = wsi->CreateImage(chain->device, &image_info,
451 &chain->alloc, &image->image);
456 wsi->GetImageMemoryRequirements(chain->device, image->image, &reqs);
481 result = wsi->AllocateMemory(chain->device, &memory_info,
482 &chain->alloc, &image->memory);
486 result = wsi->BindImageMemory(chain->device, image->image,
498 result = wsi->GetMemoryFdKHR(chain->device, &memory_get_fd_info, &fd);
520 wsi->GetImageSubresourceLayout(chain->device, image->image,
544 wsi->GetImageSubresourceLayout(chain->device, image->image,
555 vk_free(&chain->alloc, modifier_props);
556 vk_free(&chain->alloc, image_modifiers);
561 vk_free(&chain->alloc, modifier_props);
562 vk_free(&chain->alloc, image_modifiers);
563 wsi_destroy_image(chain, image);
571 wsi_create_prime_image(const struct wsi_swapchain *chain,
576 const struct wsi_device *wsi = chain->wsi;
600 result = wsi->CreateBuffer(chain->device, &prime_buffer_info,
601 &chain->alloc, &image->prime.buffer);
606 wsi->GetBufferMemoryRequirements(chain->device, image->prime.buffer, &reqs);
631 result = wsi->AllocateMemory(chain->device, &prime_memory_info,
632 &chain->alloc, &image->prime.memory);
636 result = wsi->BindBufferMemory(chain->device, image->prime.buffer,
662 result = wsi->CreateImage(chain->device, &image_info,
663 &chain->alloc, &image->image);
667 wsi->GetImageMemoryRequirements(chain->device, image->image, &reqs);
682 result = wsi->AllocateMemory(chain->device, &memory_info,
683 &chain->alloc, &image->memory);
687 result = wsi->BindImageMemory(chain->device, image->image,
693 vk_zalloc(&chain->alloc,
705 .commandPool = chain->cmd_pools[i],
709 result = wsi->AllocateCommandBuffers(chain->device, &cmd_buffer_info,
754 result = wsi->GetMemoryFdKHR(chain->device, &linear_memory_get_fd_info, &fd);
768 wsi_destroy_image(chain, image);
774 wsi_destroy_image(const struct wsi_swapchain *chain,
777 const struct wsi_device *wsi = chain->wsi;
781 wsi->FreeCommandBuffers(chain->device, chain->cmd_pools[i],
784 vk_free(&chain->alloc, image->prime.blit_cmd_buffers);
787 wsi->FreeMemory(chain->device, image->memory, &chain->alloc);
788 wsi->DestroyImage(chain->device, image->image, &chain->alloc);
789 wsi->FreeMemory(chain->device, image->prime.memory, &chain->alloc);
790 wsi->DestroyBuffer(chain->device, image->prime.buffer, &chain->alloc);