From 0feedec9e6b630f930605d9681911fe9e2b705ce Mon Sep 17 00:00:00 2001 From: Emma Anholt Date: Mon, 11 Jul 2022 15:50:50 -0700 Subject: [PATCH] zink: Do the timestamp-to-ns math in a double to have better precision. Fixes arb_timer_query-timestamp-get on my radv system, where the GPU has been on for many days and the timestamp would only increment every once in a while. Part of fixing #6808 Fixes: 7a40b734ee2b ("zink: handle timestamp queries") Reviewed-by: Mike Blumenkrantz Part-of: --- src/gallium/drivers/zink/zink_query.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gallium/drivers/zink/zink_query.c b/src/gallium/drivers/zink/zink_query.c index 2c560b1..dbe4444 100644 --- a/src/gallium/drivers/zink/zink_query.c +++ b/src/gallium/drivers/zink/zink_query.c @@ -273,7 +273,7 @@ timestamp_to_nanoseconds(struct zink_screen *screen, uint64_t *timestamp) * can be obtained from VkPhysicalDeviceLimits::timestampPeriod * - 17.5. Timestamp Queries */ - *timestamp *= screen->info.props.limits.timestampPeriod; + *timestamp *= (double)screen->info.props.limits.timestampPeriod; } static VkQueryType -- 2.7.4