yum-mirror/slang

Making it easier to work with shaders

git clone https://git.yummers.dev/yum-mirror/slang

Ellie Hermaszewskaformatf65d756bf

master
1.3 KiB49 linesraw
1// d3d12-command-queue.h
2#pragma once
3
4#include "d3d12-base.h"
5
6namespace gfx
7{
8namespace d3d12
9{
10
11using namespace Slang;
12
13class CommandQueueImpl : public ICommandQueue, public ComObject
14{
15public:
16    SLANG_COM_OBJECT_IUNKNOWN_ALL
17    ICommandQueue* getInterface(const Guid& guid);
18    void breakStrongReferenceToDevice() { m_renderer.breakStrongReference(); }
19
20    virtual SLANG_NO_THROW Result SLANG_MCALL getNativeHandle(InteropHandle* handle) override;
21
22public:
23    BreakableReference<DeviceImpl> m_renderer;
24    ComPtr<ID3D12Device> m_device;
25    ComPtr<ID3D12CommandQueue> m_d3dQueue;
26    ComPtr<ID3D12Fence> m_fence;
27    uint64_t m_fenceValue = 0;
28    HANDLE globalWaitHandle;
29    Desc m_desc;
30    uint32_t m_queueIndex = 0;
31
32    Result init(DeviceImpl* device, uint32_t queueIndex);
33    ~CommandQueueImpl();
34    virtual SLANG_NO_THROW const Desc& SLANG_MCALL getDesc() override;
35
36    virtual SLANG_NO_THROW void SLANG_MCALL executeCommandBuffers(
37        GfxCount count,
38        ICommandBuffer* const* commandBuffers,
39        IFence* fence,
40        uint64_t valueToSignal) override;
41
42    virtual SLANG_NO_THROW void SLANG_MCALL waitOnHost() override;
43
44    virtual SLANG_NO_THROW Result SLANG_MCALL
45    waitForFenceValuesOnDevice(GfxCount fenceCount, IFence** fences, uint64_t* waitValues) override;
46};
47
48} // namespace d3d12
49} // namespace gfx