yum-mirror/slang
Making it easier to work with shaders
git clone https://git.yummers.dev/yum-mirror/slang
f65d756bf
master
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 : 16SLANG_COM_OBJECT_IUNKNOWN_ALL 17ICommandQueue * getInterface (const Guid & guid ); 18void breakStrongReferenceToDevice () {m_renderer .breakStrongReference (); } 19 20virtual SLANG_NO_THROW Result SLANG_MCALL getNativeHandle (InteropHandle * handle )override ; 21 22public : 23BreakableReference < DeviceImpl > m_renderer ; 24ComPtr < ID3D12Device > m_device ; 25ComPtr < ID3D12CommandQueue > m_d3dQueue ; 26ComPtr < ID3D12Fence > m_fence ; 27uint64_t m_fenceValue = 0 ; 28HANDLE globalWaitHandle ; 29Desc m_desc ; 30uint32_t m_queueIndex = 0 ; 31 32Result init (DeviceImpl * device ,uint32_t queueIndex ); 33 ~CommandQueueImpl (); 34virtual SLANG_NO_THROW const Desc & SLANG_MCALL getDesc ()override ; 35 36virtual SLANG_NO_THROW void SLANG_MCALL executeCommandBuffers ( 37GfxCount count, 38ICommandBuffer * const * commandBuffers, 39IFence * fence, 40uint64_t valueToSignal) override; 41 42virtual SLANG_NO_THROW void SLANG_MCALL waitOnHost () override; 43 44virtual SLANG_NO_THROW Result SLANG_MCALL 45waitForFenceValuesOnDevice ( GfxCount fenceCount, IFence ** fences, uint64_t * waitValues) override; 46}; 47 48} // namespace d3d12 49} // namespace gfx