yum-mirror/slang

Making it easier to work with shaders

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

Ellie Hermaszewskaformatf65d756bf

master
1.4 KiB60 linesraw
1// metal-command-queue.h
2#pragma once
3
4#include "metal-base.h"
5#include "metal-device.h"
6
7namespace gfx
8{
9
10using namespace Slang;
11
12namespace metal
13{
14
15class CommandQueueImpl : public ICommandQueue, public ComObject
16{
17public:
18    SLANG_COM_OBJECT_IUNKNOWN_ALL
19    ICommandQueue* getInterface(const Guid& guid);
20
21public:
22    RefPtr<DeviceImpl> m_device;
23    Desc m_desc;
24    NS::SharedPtr<MTL::CommandQueue> m_commandQueue;
25
26    struct FenceWaitInfo
27    {
28        RefPtr<FenceImpl> fence;
29        uint64_t waitValue;
30    };
31    List<FenceWaitInfo> m_pendingWaitFences;
32
33    ~CommandQueueImpl();
34
35    void init(DeviceImpl* device, NS::SharedPtr<MTL::CommandQueue> commandQueue);
36
37    virtual SLANG_NO_THROW void SLANG_MCALL waitOnHost() override;
38
39    virtual SLANG_NO_THROW Result SLANG_MCALL getNativeHandle(InteropHandle* outHandle) override;
40
41    virtual SLANG_NO_THROW const Desc& SLANG_MCALL getDesc() override;
42
43    virtual SLANG_NO_THROW Result SLANG_MCALL
44    waitForFenceValuesOnDevice(GfxCount fenceCount, IFence** fences, uint64_t* waitValues) override;
45
46    void queueSubmitImpl(
47        uint32_t count,
48        ICommandBuffer* const* commandBuffers,
49        IFence* fence,
50        uint64_t valueToSignal);
51
52    virtual SLANG_NO_THROW void SLANG_MCALL executeCommandBuffers(
53        GfxCount count,
54        ICommandBuffer* const* commandBuffers,
55        IFence* fence,
56        uint64_t valueToSignal) override;
57};
58
59} // namespace metal
60} // namespace gfx