yum-mirror/slang
Making it easier to work with shaders
git clone https://git.yummers.dev/yum-mirror/slang
f65d756bf
master
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 : 18SLANG_COM_OBJECT_IUNKNOWN_ALL 19ICommandQueue * getInterface (const Guid & guid ); 20 21public : 22RefPtr < DeviceImpl > m_device ; 23Desc m_desc ; 24NS ::SharedPtr < MTL ::CommandQueue > m_commandQueue ; 25 26struct FenceWaitInfo 27 { 28RefPtr < FenceImpl > fence ; 29uint64_t waitValue ; 30 }; 31List < FenceWaitInfo > m_pendingWaitFences ; 32 33 ~CommandQueueImpl (); 34 35void init (DeviceImpl * device ,NS ::SharedPtr < MTL ::CommandQueue > commandQueue ); 36 37virtual SLANG_NO_THROW void SLANG_MCALL waitOnHost ()override ; 38 39virtual SLANG_NO_THROW Result SLANG_MCALL getNativeHandle ( InteropHandle * outHandle) override; 40 41virtual SLANG_NO_THROW const Desc & SLANG_MCALL getDesc () override; 42 43virtual SLANG_NO_THROW Result SLANG_MCALL 44waitForFenceValuesOnDevice ( GfxCount fenceCount, IFence ** fences, uint64_t * waitValues) override; 45 46void queueSubmitImpl ( 47uint32_t count, 48ICommandBuffer * const * commandBuffers, 49IFence * fence, 50uint64_t valueToSignal); 51 52virtual SLANG_NO_THROW void SLANG_MCALL executeCommandBuffers ( 53GfxCount count, 54ICommandBuffer * const * commandBuffers, 55IFence * fence, 56uint64_t valueToSignal) override; 57}; 58 59} // namespace metal 60} // namespace gfx