yum-mirror/slang

Making it easier to work with shaders

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

kaizhangNVFix metal issue (#6361)a70113c42

master
875 B38 linesraw
1// metal-fence.h
2#pragma once
3
4#include "metal-base.h"
5
6namespace gfx
7{
8
9using namespace Slang;
10
11namespace metal
12{
13
14class FenceImpl : public FenceBase
15{
16public:
17    RefPtr<DeviceImpl> m_device;
18    NS::SharedPtr<MTL::SharedEvent> m_event;
19    NS::SharedPtr<MTL::SharedEventListener> m_eventListener;
20
21    ~FenceImpl();
22
23    Result init(DeviceImpl* device, const IFence::Desc& desc);
24
25    virtual SLANG_NO_THROW Result SLANG_MCALL getCurrentValue(uint64_t* outValue) override;
26
27    virtual SLANG_NO_THROW Result SLANG_MCALL setCurrentValue(uint64_t value) override;
28
29    virtual SLANG_NO_THROW Result SLANG_MCALL getSharedHandle(InteropHandle* outHandle) override;
30
31    virtual SLANG_NO_THROW Result SLANG_MCALL
32    getNativeHandle(InteropHandle* outNativeHandle) override;
33
34    bool waitForFence(uint64_t value, uint64_t timeout);
35};
36
37} // namespace metal
38} // namespace gfx