summaryrefslogtreecommitdiffstats
path: root/src/amd/vulkan/radv_device.c
diff options
context:
space:
mode:
authorBas Nieuwenhuizen <[email protected]>2018-02-26 22:54:06 +0100
committerEmil Velikov <[email protected]>2018-03-20 16:57:25 +0000
commit2f0d53d417863ae062d7de0f260b3f5563bd447c (patch)
treea742d8f0b3768f3835ba85646b8c03c5b7b883b6 /src/amd/vulkan/radv_device.c
parent8f9d123b76a106fd858d0c27a736d266e89af4a7 (diff)
radv: Implement waiting on non-submitted fences.
Fixes: f4e499ec79 "radv: add initial non-conformant radv vulkan driver" Reviewed-by: Dave Airlie <[email protected]> (cherry picked from commit 6968d782d3063c639e80dbcf6df944902d72692f)
Diffstat (limited to 'src/amd/vulkan/radv_device.c')
-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 b8708dd6867..77c6bf4581b 100644
--- a/src/amd/vulkan/radv_device.c
+++ b/src/amd/vulkan/radv_device.c
@@ -2801,8 +2801,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)