Explorar o código

renderer_vulkan/wrapper: Add fence handle

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

+ 17 - 0
src/video_core/renderer_vulkan/wrapper.h

@@ -615,6 +615,23 @@ public:
     }
     }
 };
 };
 
 
+class Fence : public Handle<VkFence, VkDevice, DeviceDispatch> {
+    using Handle<VkFence, VkDevice, DeviceDispatch>::Handle;
+
+public:
+    VkResult Wait(u64 timeout = std::numeric_limits<u64>::max()) const noexcept {
+        return dld->vkWaitForFences(owner, 1, &handle, true, timeout);
+    }
+
+    VkResult GetStatus() const noexcept {
+        return dld->vkGetFenceStatus(owner, handle);
+    }
+
+    void Reset() const {
+        Check(dld->vkResetFences(owner, 1, &handle));
+    }
+};
+
 class DescriptorPool : public Handle<VkDescriptorPool, VkDevice, DeviceDispatch> {
 class DescriptorPool : public Handle<VkDescriptorPool, VkDevice, DeviceDispatch> {
     using Handle<VkDescriptorPool, VkDevice, DeviceDispatch>::Handle;
     using Handle<VkDescriptorPool, VkDevice, DeviceDispatch>::Handle;