Explorar o código

vk_resource_manager: Add entry to VKFence to test its usage

ReinUsesLisp %!s(int64=6) %!d(string=hai) anos
pai
achega
e41da22c8d
Modificáronse 1 ficheiros con 8 adicións e 0 borrados
  1. 8 0
      src/video_core/renderer_vulkan/vk_resource_manager.h

+ 8 - 0
src/video_core/renderer_vulkan/vk_resource_manager.h

@@ -124,6 +124,14 @@ public:
 
     void OnFenceRemoval(VKFence* signaling_fence) override;
 
+    /**
+     * Do not use it paired with Watch. Use TryWatch instead.
+     * Returns true when the watch is free.
+     */
+    bool IsUsed() const {
+        return fence != nullptr;
+    }
+
 private:
     VKFence* fence{}; ///< Fence watching this resource. nullptr when the watch is free.
 };