[Mesa-dev] [PATCH 2/4] radv: Implement waiting on non-submitted fences.
Bas Nieuwenhuizen
bas at basnieuwenhuizen.nl
Mon Feb 26 23:37:27 UTC 2018
Fixes: f4e499ec79 "radv: add initial non-conformant radv vulkan driver"
---
src/amd/vulkan/radv_device.c | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/src/amd/vulkan/radv_device.c b/src/amd/vulkan/radv_device.c
index ca99ba50ba..3355fd0b4b 100644
--- a/src/amd/vulkan/radv_device.c
+++ b/src/amd/vulkan/radv_device.c
@@ -2964,8 +2964,17 @@ VkResult radv_WaitForFences(
if (fence->signalled)
continue;
- if (!fence->submitted)
- return VK_TIMEOUT;
+ if (!fence->submitted) {
+ while(radv_get_current_time() <= timeout && !fence->submitted)
+ /* Do nothing */;
+
+ if (!fence->submitted)
+ return VK_TIMEOUT;
+
+ /* Recheck as it may have been set by submitting operations. */
+ if (fence->signalled)
+ continue;
+ }
expired = device->ws->fence_wait(device->ws, fence->fence, true, timeout);
if (!expired)
--
2.16.1
More information about the mesa-dev
mailing list