From 43e1b7cdc70b2fcac8a3e8ee72f5bc91726f4ec5 Mon Sep 17 00:00:00 2001 From: lucy96chen <47800040+lucy96chen@users.noreply.github.com> Date: Thu, 26 May 2022 10:54:35 -0700 Subject: Split render-vk.h/.cpp into a set of smaller files (#2244) * Some preliminary work on splitting render-vk * render-vk split, tests currently crash on null reference * fixed circular include --- tools/gfx/vulkan/vk-command-queue.h | 64 +++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 tools/gfx/vulkan/vk-command-queue.h (limited to 'tools/gfx/vulkan/vk-command-queue.h') diff --git a/tools/gfx/vulkan/vk-command-queue.h b/tools/gfx/vulkan/vk-command-queue.h new file mode 100644 index 000000000..c7d4e3eb4 --- /dev/null +++ b/tools/gfx/vulkan/vk-command-queue.h @@ -0,0 +1,64 @@ +// vk-command-queue.h +#pragma once + +#include "vk-base.h" +#include "vk-device.h" + +namespace gfx +{ + +using namespace Slang; + +namespace vk +{ + +class CommandQueueImpl + : public ICommandQueue + , public ComObject +{ +public: + SLANG_COM_OBJECT_IUNKNOWN_ALL + ICommandQueue* getInterface(const Guid& guid); + +public: + Desc m_desc; + RefPtr m_renderer; + VkQueue m_queue; + uint32_t m_queueFamilyIndex; + struct FenceWaitInfo + { + RefPtr fence; + uint64_t waitValue; + }; + List m_pendingWaitFences; + VkSemaphore m_pendingWaitSemaphores[2] = {VK_NULL_HANDLE, VK_NULL_HANDLE}; + List m_submitCommandBuffers; + VkSemaphore m_semaphore; + ~CommandQueueImpl(); + + void init(DeviceImpl* renderer, VkQueue queue, uint32_t queueFamilyIndex); + + virtual SLANG_NO_THROW void SLANG_MCALL waitOnHost() override; + + virtual SLANG_NO_THROW Result SLANG_MCALL getNativeHandle(InteropHandle* outHandle) override; + + virtual SLANG_NO_THROW const Desc& SLANG_MCALL getDesc() override; + + virtual SLANG_NO_THROW Result SLANG_MCALL waitForFenceValuesOnDevice( + GfxCount fenceCount, IFence** fences, uint64_t* waitValues) override; + + void queueSubmitImpl( + uint32_t count, + ICommandBuffer* const* commandBuffers, + IFence* fence, + uint64_t valueToSignal); + + virtual SLANG_NO_THROW void SLANG_MCALL executeCommandBuffers( + GfxCount count, + ICommandBuffer* const* commandBuffers, + IFence* fence, + uint64_t valueToSignal) override; +}; + +} // namespace vk +} // namespace gfx -- cgit v1.2.3