Mesa (master): vulkan: Portable wsi_common_get_current_time()
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Mon Nov 30 08:03:10 UTC 2020
Module: Mesa
Branch: master
Commit: 4e074a6d5272bd99536cd12a1ff6afdc6ece2890
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=4e074a6d5272bd99536cd12a1ff6afdc6ece2890
Author: James Park <jpark37 at lagfreegames.com>
Date: Thu Nov 26 19:42:54 2020 -0800
vulkan: Portable wsi_common_get_current_time()
Use os_time_get_nano(), which has a Windows implementation.
Reviewed-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7783>
---
src/vulkan/wsi/wsi_common.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/src/vulkan/wsi/wsi_common.c b/src/vulkan/wsi/wsi_common.c
index 309f2fa99d5..c1c4f718bd3 100644
--- a/src/vulkan/wsi/wsi_common.c
+++ b/src/vulkan/wsi/wsi_common.c
@@ -24,11 +24,11 @@
#include "wsi_common_private.h"
#include "util/macros.h"
#include "util/os_file.h"
+#include "util/os_time.h"
#include "util/xmlconfig.h"
#include "vk_util.h"
#include <time.h>
-#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
@@ -671,7 +671,5 @@ wsi_common_queue_present(const struct wsi_device *wsi,
uint64_t
wsi_common_get_current_time(void)
{
- struct timespec current;
- clock_gettime(CLOCK_MONOTONIC, ¤t);
- return current.tv_nsec + current.tv_sec * 1000000000ull;
+ return os_time_get_nano();
}
More information about the mesa-commit
mailing list