aboutsummaryrefslogtreecommitdiffstats
path: root/src/intel
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2019-12-04 13:01:35 -0600
committerJason Ekstrand <[email protected]>2019-12-06 19:58:07 +0000
commitecc119a96e86a4292f98de7492d30508a6df3870 (patch)
tree3ff6f5e064d8134ff7e20f67aef1385091a6301b /src/intel
parentccb7d606f1a2939d5a784f1ec491cffc62e8f814 (diff)
anv: Add a fence_reset_reset_temporary helper
Reviewed-by: Lionel Landwerlin <[email protected]>
Diffstat (limited to 'src/intel')
-rw-r--r--src/intel/vulkan/anv_private.h3
-rw-r--r--src/intel/vulkan/anv_queue.c13
2 files changed, 14 insertions, 2 deletions
diff --git a/src/intel/vulkan/anv_private.h b/src/intel/vulkan/anv_private.h
index 81e11c8d72d..96254f620d8 100644
--- a/src/intel/vulkan/anv_private.h
+++ b/src/intel/vulkan/anv_private.h
@@ -2863,6 +2863,9 @@ struct anv_fence {
struct anv_fence_impl temporary;
};
+void anv_fence_reset_temporary(struct anv_device *device,
+ struct anv_fence *fence);
+
struct anv_event {
uint64_t semaphore;
struct anv_state state;
diff --git a/src/intel/vulkan/anv_queue.c b/src/intel/vulkan/anv_queue.c
index abcedfd95d1..7bdcb5e2b7f 100644
--- a/src/intel/vulkan/anv_queue.c
+++ b/src/intel/vulkan/anv_queue.c
@@ -1123,6 +1123,16 @@ anv_fence_impl_cleanup(struct anv_device *device,
impl->type = ANV_FENCE_TYPE_NONE;
}
+void
+anv_fence_reset_temporary(struct anv_device *device,
+ struct anv_fence *fence)
+{
+ if (fence->temporary.type == ANV_FENCE_TYPE_NONE)
+ return;
+
+ anv_fence_impl_cleanup(device, &fence->temporary);
+}
+
void anv_DestroyFence(
VkDevice _device,
VkFence _fence,
@@ -1157,8 +1167,7 @@ VkResult anv_ResetFences(
* first restored. The remaining operations described therefore
* operate on the restored payload.
*/
- if (fence->temporary.type != ANV_FENCE_TYPE_NONE)
- anv_fence_impl_cleanup(device, &fence->temporary);
+ anv_fence_reset_temporary(device, fence);
struct anv_fence_impl *impl = &fence->permanent;