summaryrefslogtreecommitdiff
path: root/tools/gfx/d3d12/d3d12-command-queue.h
diff options
context:
space:
mode:
authorlucy96chen <47800040+lucy96chen@users.noreply.github.com>2022-05-17 10:56:14 -0700
committerGitHub <noreply@github.com>2022-05-17 10:56:14 -0700
commit5a3aa6159e0ef0241b528812e1d138f0d7055f22 (patch)
tree71d286e06030ee73f0b739e071cd58dd05d507d1 /tools/gfx/d3d12/d3d12-command-queue.h
parent716e75b9ed1acfaee3dc7f3bc347ad17fca65e05 (diff)
Split render-d3d12.h/cpp into a set of smaller files (#2231)
* Split render-d3d12 into numerous smaller files to make the code easier to parse * Added all new D3D12 files created from splitting render-d3d12 * Fixed several uses of attachment still floating around; Changed resource-d3d12 and descriptor-heap-d3d12 to match naming conventions of new d3d12 implementation header files * Readded files with name changes because changing them from inside VS apparently results in them being treated as new files * Merged in externals changes from master * Small cleanup changes * Rerun CI Co-authored-by: Theresa Foley <10618364+tangent-vector@users.noreply.github.com>
Diffstat (limited to 'tools/gfx/d3d12/d3d12-command-queue.h')
-rw-r--r--tools/gfx/d3d12/d3d12-command-queue.h51
1 files changed, 51 insertions, 0 deletions
diff --git a/tools/gfx/d3d12/d3d12-command-queue.h b/tools/gfx/d3d12/d3d12-command-queue.h
new file mode 100644
index 000000000..f11df5894
--- /dev/null
+++ b/tools/gfx/d3d12/d3d12-command-queue.h
@@ -0,0 +1,51 @@
+// d3d12-command-queue.h
+#pragma once
+
+#include "d3d12-base.h"
+
+namespace gfx
+{
+namespace d3d12
+{
+
+using namespace Slang;
+
+class CommandQueueImpl
+ : public ICommandQueue
+ , public ComObject
+{
+public:
+ SLANG_COM_OBJECT_IUNKNOWN_ALL
+ ICommandQueue* getInterface(const Guid& guid);
+ void breakStrongReferenceToDevice() { m_renderer.breakStrongReference(); }
+
+ virtual SLANG_NO_THROW Result SLANG_MCALL getNativeHandle(InteropHandle* handle) override;
+
+public:
+ BreakableReference<DeviceImpl> m_renderer;
+ ComPtr<ID3D12Device> m_device;
+ ComPtr<ID3D12CommandQueue> m_d3dQueue;
+ ComPtr<ID3D12Fence> m_fence;
+ uint64_t m_fenceValue = 0;
+ HANDLE globalWaitHandle;
+ Desc m_desc;
+ uint32_t m_queueIndex = 0;
+
+ Result init(DeviceImpl* device, uint32_t queueIndex);
+ ~CommandQueueImpl();
+ virtual SLANG_NO_THROW const Desc& SLANG_MCALL getDesc() override;
+
+ virtual SLANG_NO_THROW void SLANG_MCALL executeCommandBuffers(
+ GfxCount count,
+ ICommandBuffer* const* commandBuffers,
+ IFence* fence,
+ uint64_t valueToSignal) override;
+
+ virtual SLANG_NO_THROW void SLANG_MCALL waitOnHost() override;
+
+ virtual SLANG_NO_THROW Result SLANG_MCALL waitForFenceValuesOnDevice(
+ GfxCount fenceCount, IFence** fences, uint64_t* waitValues) override;
+};
+
+} // namespace d3d12
+} // namespace gfx