About Social Code
aboutsummaryrefslogtreecommitdiff
path: root/src/kosmickrisp/vulkan/kk_queue.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/kosmickrisp/vulkan/kk_queue.h')
-rw-r--r--src/kosmickrisp/vulkan/kk_queue.h42
1 files changed, 42 insertions, 0 deletions
diff --git a/src/kosmickrisp/vulkan/kk_queue.h b/src/kosmickrisp/vulkan/kk_queue.h
new file mode 100644
index 00000000000..0633559d867
--- /dev/null
+++ b/src/kosmickrisp/vulkan/kk_queue.h
@@ -0,0 +1,42 @@
+/*
+ * Copyright © 2022 Collabora Ltd. and Red Hat Inc.
+ * Copyright 2025 LunarG, Inc.
+ * Copyright 2025 Google LLC
+ * SPDX-License-Identifier: MIT
+ */
+
+#ifndef KK_QUEUE_H
+#define KK_QUEUE_H 1
+
+#include "kk_private.h"
+
+#include "kosmickrisp/bridge/mtl_types.h"
+
+#include "vk_queue.h"
+
+struct kk_queue {
+ struct vk_queue vk;
+ /* We require one queue per command buffer no to lock. Main will handle all
+ * work, but if we are in a render pass and we require to massage inputs,
+ * then pre_gfx will be used to submit compute work that handles that so we
+ * don't have to break the render encoder. */
+ struct {
+ struct mtl_command_queue *mtl_handle;
+ } main, pre_gfx;
+
+ mtl_fence *wait_fence;
+};
+
+static inline struct kk_device *
+kk_queue_device(struct kk_queue *queue)
+{
+ return (struct kk_device *)queue->vk.base.device;
+}
+
+VkResult kk_queue_init(struct kk_device *dev, struct kk_queue *queue,
+ const VkDeviceQueueCreateInfo *pCreateInfo,
+ uint32_t index_in_family);
+
+void kk_queue_finish(struct kk_device *dev, struct kk_queue *queue);
+
+#endif