anv: Add a fence_reset_reset_temporary helper
authorJason Ekstrand <jason@jlekstrand.net>
Wed, 4 Dec 2019 19:01:35 +0000 (13:01 -0600)
committerJason Ekstrand <jason@jlekstrand.net>
Fri, 6 Dec 2019 19:58:07 +0000 (19:58 +0000)
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
src/intel/vulkan/anv_private.h
src/intel/vulkan/anv_queue.c

index 81e11c8d72d0c8c3ae52ac7060143aaf51d9129f..96254f620d801f0e5e8d4fc864e8c691ecd020f9 100644 (file)
@@ -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;
index abcedfd95d185631ff27787cb558efc551cad4f9..7bdcb5e2b7f9fb327a59c4d28ff55c5050c91cae 100644 (file)
@@ -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;