[PATCH v3 0/1] MR9859: Draft: winevulkan: Use correct time domain for calibrated timestamps
I am not sure how to address this fully, but the following patch should at least make it accurate before the machine suspends. -- v3: winevulkan: Use correct time domain for calibrated timestamps https://gitlab.winehq.org/wine/wine/-/merge_requests/9859
From: Etaash Mathamsetty <etaash.mathamsetty@gmail.com> --- dlls/winevulkan/vulkan.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/dlls/winevulkan/vulkan.c b/dlls/winevulkan/vulkan.c index 0f49148ee15..7e9eba3f230 100644 --- a/dlls/winevulkan/vulkan.c +++ b/dlls/winevulkan/vulkan.c @@ -585,11 +585,7 @@ void wine_vkGetPhysicalDeviceExternalFencePropertiesKHR(VkPhysicalDevice client_ static inline VkTimeDomainEXT get_performance_counter_time_domain(void) { #if !defined(__APPLE__) && defined(HAVE_CLOCK_GETTIME) -# ifdef CLOCK_MONOTONIC_RAW - return VK_TIME_DOMAIN_CLOCK_MONOTONIC_RAW_EXT; -# else return VK_TIME_DOMAIN_CLOCK_MONOTONIC_EXT; -# endif #else FIXME("No mapping for VK_TIME_DOMAIN_QUERY_PERFORMANCE_COUNTER_EXT on this platform.\n"); return VK_TIME_DOMAIN_QUERY_PERFORMANCE_COUNTER_EXT; @@ -616,7 +612,7 @@ static inline uint64_t convert_timestamp(VkTimeDomainEXT host_domain, VkTimeDoma return value; /* Convert between MONOTONIC time in ns -> QueryPerformanceCounter */ - if ((host_domain == VK_TIME_DOMAIN_CLOCK_MONOTONIC_RAW_EXT || host_domain == VK_TIME_DOMAIN_CLOCK_MONOTONIC_EXT) + if (host_domain == VK_TIME_DOMAIN_CLOCK_MONOTONIC_EXT && target_domain == VK_TIME_DOMAIN_QUERY_PERFORMANCE_COUNTER_EXT) return convert_monotonic_timestamp(value); -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/9859
I am not sure how to address this fully, but the following patch should at least make it accurate before the machine suspends.
Most likely I will implement something like what I & Paul Gofman proposed here: https://github.com/ValveSoftware/Proton/pull/9347#issuecomment-3702738942, https://github.com/ValveSoftware/Proton/pull/9347#issuecomment-3716997750 -- https://gitlab.winehq.org/wine/wine/-/merge_requests/9859#note_126484
Rémi Bernon (@rbernon) commented about dlls/winevulkan/vulkan.c:
/* Map our monotonic times -> QPC */ if (supports_monotonic_raw && performance_counter_domain == VK_TIME_DOMAIN_CLOCK_MONOTONIC_RAW_EXT) out_time_domains[out_time_domain_count++] = VK_TIME_DOMAIN_QUERY_PERFORMANCE_COUNTER_EXT;
What about these? -- https://gitlab.winehq.org/wine/wine/-/merge_requests/9859#note_126487
Is this because we don't use CLOCK_MONOTONIC_RAW in ntdll for QPC when we need to make sure both QPC / vulkan clock source match? -- https://gitlab.winehq.org/wine/wine/-/merge_requests/9859#note_126488
If that's the case, isn't this actually a regression from https://gitlab.winehq.org/wine/wine/-/merge_requests/8916? If we cannot have a BOOTTIME clock source here, IMO we should revert that MR instead. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/9859#note_126490
participants (3)
-
Etaash Mathamsetty -
Etaash Mathamsetty (@etaash.mathamsetty) -
Rémi Bernon (@rbernon)