Loading vulkan/libvulkan/swapchain.cpp +12 −5 Original line number Original line Diff line number Diff line Loading @@ -370,9 +370,6 @@ uint32_t get_num_ready_timings(Swapchain& swapchain) { nullptr, //&first_composition_start_time, nullptr, //&first_composition_start_time, nullptr, //&last_composition_start_time, nullptr, //&last_composition_start_time, nullptr, //&composition_finish_time, nullptr, //&composition_finish_time, // TODO(ianelliott): Maybe ask if this one is // supported, at startup time (since it may not be // supported): &actual_present_time, &actual_present_time, nullptr, //&dequeue_ready_time, nullptr, //&dequeue_ready_time, nullptr /*&reads_done_time*/); nullptr /*&reads_done_time*/); Loading @@ -399,7 +396,6 @@ uint32_t get_num_ready_timings(Swapchain& swapchain) { return num_ready; return num_ready; } } // TODO(ianelliott): DEAL WITH RETURN VALUE (e.g. VK_INCOMPLETE)!!! void copy_ready_timings(Swapchain& swapchain, void copy_ready_timings(Swapchain& swapchain, uint32_t* count, uint32_t* count, VkPastPresentationTimingGOOGLE* timings) { VkPastPresentationTimingGOOGLE* timings) { Loading Loading @@ -1773,6 +1769,10 @@ VkResult GetPastPresentationTimingGOOGLE( ATRACE_CALL(); ATRACE_CALL(); Swapchain& swapchain = *SwapchainFromHandle(swapchain_handle); Swapchain& swapchain = *SwapchainFromHandle(swapchain_handle); if (swapchain.surface.swapchain_handle != swapchain_handle) { return VK_ERROR_OUT_OF_DATE_KHR; } ANativeWindow* window = swapchain.surface.window.get(); ANativeWindow* window = swapchain.surface.window.get(); VkResult result = VK_SUCCESS; VkResult result = VK_SUCCESS; Loading @@ -1783,8 +1783,15 @@ VkResult GetPastPresentationTimingGOOGLE( } } if (timings) { if (timings) { // TODO(ianelliott): plumb return value (e.g. VK_INCOMPLETE) // Get the latest ready timing count before copying, since the copied // timing info will be erased in copy_ready_timings function. uint32_t n = get_num_ready_timings(swapchain); copy_ready_timings(swapchain, count, timings); copy_ready_timings(swapchain, count, timings); // Check the *count here against the recorded ready timing count, since // *count can be overwritten per spec describes. if (*count < n) { result = VK_INCOMPLETE; } } else { } else { *count = get_num_ready_timings(swapchain); *count = get_num_ready_timings(swapchain); } } Loading Loading
vulkan/libvulkan/swapchain.cpp +12 −5 Original line number Original line Diff line number Diff line Loading @@ -370,9 +370,6 @@ uint32_t get_num_ready_timings(Swapchain& swapchain) { nullptr, //&first_composition_start_time, nullptr, //&first_composition_start_time, nullptr, //&last_composition_start_time, nullptr, //&last_composition_start_time, nullptr, //&composition_finish_time, nullptr, //&composition_finish_time, // TODO(ianelliott): Maybe ask if this one is // supported, at startup time (since it may not be // supported): &actual_present_time, &actual_present_time, nullptr, //&dequeue_ready_time, nullptr, //&dequeue_ready_time, nullptr /*&reads_done_time*/); nullptr /*&reads_done_time*/); Loading @@ -399,7 +396,6 @@ uint32_t get_num_ready_timings(Swapchain& swapchain) { return num_ready; return num_ready; } } // TODO(ianelliott): DEAL WITH RETURN VALUE (e.g. VK_INCOMPLETE)!!! void copy_ready_timings(Swapchain& swapchain, void copy_ready_timings(Swapchain& swapchain, uint32_t* count, uint32_t* count, VkPastPresentationTimingGOOGLE* timings) { VkPastPresentationTimingGOOGLE* timings) { Loading Loading @@ -1773,6 +1769,10 @@ VkResult GetPastPresentationTimingGOOGLE( ATRACE_CALL(); ATRACE_CALL(); Swapchain& swapchain = *SwapchainFromHandle(swapchain_handle); Swapchain& swapchain = *SwapchainFromHandle(swapchain_handle); if (swapchain.surface.swapchain_handle != swapchain_handle) { return VK_ERROR_OUT_OF_DATE_KHR; } ANativeWindow* window = swapchain.surface.window.get(); ANativeWindow* window = swapchain.surface.window.get(); VkResult result = VK_SUCCESS; VkResult result = VK_SUCCESS; Loading @@ -1783,8 +1783,15 @@ VkResult GetPastPresentationTimingGOOGLE( } } if (timings) { if (timings) { // TODO(ianelliott): plumb return value (e.g. VK_INCOMPLETE) // Get the latest ready timing count before copying, since the copied // timing info will be erased in copy_ready_timings function. uint32_t n = get_num_ready_timings(swapchain); copy_ready_timings(swapchain, count, timings); copy_ready_timings(swapchain, count, timings); // Check the *count here against the recorded ready timing count, since // *count can be overwritten per spec describes. if (*count < n) { result = VK_INCOMPLETE; } } else { } else { *count = get_num_ready_timings(swapchain); *count = get_num_ready_timings(swapchain); } } Loading