aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBas Nieuwenhuizen <[email protected]>2018-02-26 22:54:06 +0100
committerBas Nieuwenhuizen <[email protected]>2018-03-01 01:07:18 +0100
commit6968d782d3063c639e80dbcf6df944902d72692f (patch)
treed991b132505a200a526d12deba8656c8aa787f59
parent2a404c6f923880cfd0bc04f9db1890cadce8bd92 (diff)
radv: Implement waiting on non-submitted fences.
Fixes: f4e499ec79 "radv: add initial non-conformant radv vulkan driver" Reviewed-by: Dave Airlie <[email protected]>
-rw-r--r--src/amd/vulkan/radv_device.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/amd/vulkan/radv_device.c b/src/amd/vulkan/radv_device.c
index 24ea3b689ec..8eadd8f2037 100644
--- a/src/amd/vulkan/radv_device.c
+++ b/src/amd/vulkan/radv_device.c
@@ -2946,8 +2946,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)