Lines Matching refs:swapchain
276 VkSwapchainKHR HandleFromSwapchain(Swapchain* swapchain) { in HandleFromSwapchain() argument
277 return VkSwapchainKHR(reinterpret_cast<uint64_t>(swapchain)); in HandleFromSwapchain()
333 void OrphanSwapchain(VkDevice device, Swapchain* swapchain) { in OrphanSwapchain() argument
334 if (swapchain->surface.swapchain_handle != HandleFromSwapchain(swapchain)) in OrphanSwapchain()
336 for (uint32_t i = 0; i < swapchain->num_images; i++) { in OrphanSwapchain()
337 if (!swapchain->images[i].dequeued) in OrphanSwapchain()
338 ReleaseSwapchainImage(device, nullptr, -1, swapchain->images[i]); in OrphanSwapchain()
340 swapchain->surface.swapchain_handle = VK_NULL_HANDLE; in OrphanSwapchain()
341 swapchain->timing.clear(); in OrphanSwapchain()
344 uint32_t get_num_ready_timings(Swapchain& swapchain) { in get_num_ready_timings() argument
345 if (swapchain.timing.size() < MIN_NUM_FRAMES_AGO) { in get_num_ready_timings()
350 const size_t num_timings = swapchain.timing.size() - MIN_NUM_FRAMES_AGO + 1; in get_num_ready_timings()
352 TimingInfo& ti = swapchain.timing.editItemAt(i); in get_num_ready_timings()
368 swapchain.surface.window.get(), ti.native_frame_id_, in get_num_ready_timings()
396 ti.calculate(swapchain.refresh_duration); in get_num_ready_timings()
404 void copy_ready_timings(Swapchain& swapchain, in copy_ready_timings() argument
407 if (swapchain.timing.empty()) { in copy_ready_timings()
412 size_t last_ready = swapchain.timing.size() - 1; in copy_ready_timings()
413 while (!swapchain.timing[last_ready].ready()) { in copy_ready_timings()
424 const TimingInfo& ti = swapchain.timing[i]; in copy_ready_timings()
434 swapchain.timing.removeItemsAt(0, num_to_remove); in copy_ready_timings()
1272 Swapchain* swapchain = new (mem) in CreateSwapchainKHR() local
1311 Swapchain::Image& img = swapchain->images[i]; in CreateSwapchainKHR()
1362 Swapchain::Image& img = swapchain->images[i]; in CreateSwapchainKHR()
1364 if (!swapchain->shared) { in CreateSwapchainKHR()
1381 swapchain->~Swapchain(); in CreateSwapchainKHR()
1382 allocator->pfnFree(allocator->pUserData, swapchain); in CreateSwapchainKHR()
1386 surface.swapchain_handle = HandleFromSwapchain(swapchain); in CreateSwapchainKHR()
1398 Swapchain* swapchain = SwapchainFromHandle(swapchain_handle); in DestroySwapchainKHR() local
1399 if (!swapchain) in DestroySwapchainKHR()
1401 bool active = swapchain->surface.swapchain_handle == swapchain_handle; in DestroySwapchainKHR()
1402 ANativeWindow* window = active ? swapchain->surface.window.get() : nullptr; in DestroySwapchainKHR()
1404 if (window && swapchain->frame_timestamps_enabled) { in DestroySwapchainKHR()
1407 for (uint32_t i = 0; i < swapchain->num_images; i++) in DestroySwapchainKHR()
1408 ReleaseSwapchainImage(device, window, -1, swapchain->images[i]); in DestroySwapchainKHR()
1410 swapchain->surface.swapchain_handle = VK_NULL_HANDLE; in DestroySwapchainKHR()
1413 swapchain->~Swapchain(); in DestroySwapchainKHR()
1414 allocator->pfnFree(allocator->pUserData, swapchain); in DestroySwapchainKHR()
1424 Swapchain& swapchain = *SwapchainFromHandle(swapchain_handle); in GetSwapchainImagesKHR() local
1425 ALOGW_IF(swapchain.surface.swapchain_handle != swapchain_handle, in GetSwapchainImagesKHR()
1431 uint32_t n = swapchain.num_images; in GetSwapchainImagesKHR()
1432 if (*count < swapchain.num_images) { in GetSwapchainImagesKHR()
1437 images[i] = swapchain.images[i].image; in GetSwapchainImagesKHR()
1440 *count = swapchain.num_images; in GetSwapchainImagesKHR()
1454 Swapchain& swapchain = *SwapchainFromHandle(swapchain_handle); in AcquireNextImageKHR() local
1455 ANativeWindow* window = swapchain.surface.window.get(); in AcquireNextImageKHR()
1459 if (swapchain.surface.swapchain_handle != swapchain_handle) in AcquireNextImageKHR()
1466 if (swapchain.shared) { in AcquireNextImageKHR()
1472 device, swapchain.images[*image_index].image, -1, semaphore, vk_fence); in AcquireNextImageKHR()
1487 for (idx = 0; idx < swapchain.num_images; idx++) { in AcquireNextImageKHR()
1488 if (swapchain.images[idx].buffer.get() == buffer) { in AcquireNextImageKHR()
1489 swapchain.images[idx].dequeued = true; in AcquireNextImageKHR()
1490 swapchain.images[idx].dequeue_fence = fence_fd; in AcquireNextImageKHR()
1494 if (idx == swapchain.num_images) { in AcquireNextImageKHR()
1511 device, swapchain.images[idx].image, fence_clone, semaphore, vk_fence); in AcquireNextImageKHR()
1521 swapchain.images[idx].dequeued = false; in AcquireNextImageKHR()
1522 swapchain.images[idx].dequeue_fence = -1; in AcquireNextImageKHR()
1538 return AcquireNextImageKHR(device, pAcquireInfo->swapchain, in AcquireNextImage2KHR()
1613 Swapchain& swapchain = in QueuePresentKHR() local
1616 Swapchain::Image& img = swapchain.images[image_idx]; in QueuePresentKHR()
1618 (regions && !swapchain.mailbox_mode) ? ®ions[sc] : nullptr; in QueuePresentKHR()
1633 if (swapchain.surface.swapchain_handle == in QueuePresentKHR()
1635 ANativeWindow* window = swapchain.surface.window.get(); in QueuePresentKHR()
1677 if (!swapchain.frame_timestamps_enabled) { in QueuePresentKHR()
1682 swapchain.frame_timestamps_enabled = true; in QueuePresentKHR()
1696 swapchain.timing.push_back(TimingInfo(time, nativeFrameId)); in QueuePresentKHR()
1697 while (swapchain.timing.size() > MAX_TIMING_INFOS) { in QueuePresentKHR()
1698 swapchain.timing.removeAt(0); in QueuePresentKHR()
1731 if (swapchain.shared && swapchain_result == VK_SUCCESS) { in QueuePresentKHR()
1753 OrphanSwapchain(device, &swapchain); in QueuePresentKHR()
1764 if (swapchain.pre_transform != window_transform_hint) { in QueuePresentKHR()
1793 Swapchain& swapchain = *SwapchainFromHandle(swapchain_handle); in GetRefreshCycleDurationGOOGLE() local
1796 pDisplayTimingProperties->refreshDuration = swapchain.get_refresh_duration(); in GetRefreshCycleDurationGOOGLE()
1809 Swapchain& swapchain = *SwapchainFromHandle(swapchain_handle); in GetPastPresentationTimingGOOGLE() local
1810 ANativeWindow* window = swapchain.surface.window.get(); in GetPastPresentationTimingGOOGLE()
1813 if (!swapchain.frame_timestamps_enabled) { in GetPastPresentationTimingGOOGLE()
1816 swapchain.frame_timestamps_enabled = true; in GetPastPresentationTimingGOOGLE()
1821 copy_ready_timings(swapchain, count, timings); in GetPastPresentationTimingGOOGLE()
1823 *count = get_num_ready_timings(swapchain); in GetPastPresentationTimingGOOGLE()
1835 Swapchain& swapchain = *SwapchainFromHandle(swapchain_handle); in GetSwapchainStatusKHR() local
1838 if (swapchain.surface.swapchain_handle != swapchain_handle) { in GetSwapchainStatusKHR()
1855 Swapchain* swapchain = SwapchainFromHandle(pSwapchains[idx]); in SetHdrMetadataEXT() local
1856 if (!swapchain) in SetHdrMetadataEXT()
1859 if (swapchain->surface.swapchain_handle != pSwapchains[idx]) continue; in SetHdrMetadataEXT()
1861 ANativeWindow* window = swapchain->surface.window.get(); in SetHdrMetadataEXT()
1911 ALOG_ASSERT(info->swapchain != VK_NULL_HANDLE, in InterceptBindImageMemory2()
1913 const Swapchain* swapchain = SwapchainFromHandle(info->swapchain); in InterceptBindImageMemory2() local
1915 info->imageIndex < swapchain->num_images, in InterceptBindImageMemory2()
1919 swapchain->images[info->imageIndex].buffer.get(); in InterceptBindImageMemory2()