public H1CommandAllocatorPoolDX12(H1CommandListType type, Device deviceRef) { m_Type = type; // assign device reference m_DeviceRef = deviceRef; }
public void StallForProducer(H1CommandListType ProducerType, H1CommandListType ConsumerType, long fenceValue) { H1CommandQueue producerQueue = GetQueue(ProducerType); H1CommandQueue consumerQueue = GetQueue(ConsumerType); // consumer queue wait for producer queue to reach to the certain fence value consumerQueue.Queue.Wait(producerQueue.FenceValue, fenceValue); }
public void StallForProducer(H1CommandListType ProducerType, H1CommandListType ConsumerType) { H1CommandQueue producerQueue = GetQueue(ProducerType); H1CommandQueue consumerQueue = GetQueue(ConsumerType); // consumer queue wait for producer queue to reach to the 'NextFrameFenceValue' consumerQueue.Queue.Wait(producerQueue.FenceValue, producerQueue.Fence.NextFrameFenceValue); }
public Boolean CreateCommandList(H1CommandListType type, H1CommandContext commandContext) { H1CommandContext commandContextDX12 = commandContext; if (commandContextDX12 == null) { return(false); // inappropriate type for command context DX12 } // request command allocator from command queue and create command list switch (type) { case H1CommandListType.Direct: { H1CommandQueue graphicsQueueDX12 = m_GraphicsQueue; graphicsQueueDX12.RequestAllocator(commandContextDX12); commandContextDX12.CommandList = m_DeviceRef.CreateCommandList(CommandListType.Direct, commandContextDX12.Allocator, null); break; } case H1CommandListType.Bundle: { commandContextDX12.CommandList = m_DeviceRef.CreateCommandList(CommandListType.Bundle, null, null); break; } case H1CommandListType.Compute: { H1CommandQueue computeQueueDX12 = m_ComputeQueue; computeQueueDX12.RequestAllocator(commandContextDX12); commandContextDX12.CommandList = m_DeviceRef.CreateCommandList(CommandListType.Compute, commandContextDX12.Allocator, null); break; } case H1CommandListType.Copy: { H1CommandQueue copyQueueDX12 = m_ComputeQueue; copyQueueDX12.RequestAllocator(commandContextDX12); commandContextDX12.CommandList = m_DeviceRef.CreateCommandList(CommandListType.Copy, commandContextDX12.Allocator, null); break; } } return(true); }
public void WaitForFence(H1CommandListType type, Int64 fenceValue) { H1CommandQueue cmdQueue = GetQueue(type); if (cmdQueue.IsFenceComplete(fenceValue)) { return; // the cmd queue is already completed with fenceValue } // @TODO by mini-engine // think about how this might affect a multi-threaded situation // suppose thread A wants to wait for fence 100, then thread B comes along and wants to wait for 99 // if the fence can only have one event set on completion, then thread B has to wait for 100 before it knows 99 is ready // maybe insert sequential events? { // @TODO - synchronization needed cmdQueue.FenceValue.SetEventOnCompletion(fenceValue, cmdQueue.Fence.FenceEvent.Handle); cmdQueue.Fence.FenceEvent.WaitOne(); cmdQueue.Fence.UpdateLastCompletedFenceValue(fenceValue); } }
public H1CommandQueue GetQueue(H1CommandListType type) { H1CommandQueue commandQueue = null; switch (type) { case H1CommandListType.Compute: commandQueue = m_ComputeQueue; break; case H1CommandListType.Copy: commandQueue = m_CopyQueue; break; default: commandQueue = m_GraphicsQueue; break; } return(commandQueue); }
public H1CommandQueue(H1CommandListType type) { m_Type = type; }
public H1ComputeCommandContext(H1CommandListManager commandListManagerRef, H1CommandListType type) : base(commandListManagerRef, type) { }
public H1GraphicsCommandContext(H1CommandListManager commandListManagerRef, H1CommandListType type) : base(commandListManagerRef, type) { }
public H1CommandContext(H1CommandListManager commandListManagerRef, H1CommandListType type) { m_Type = type; m_CommandListManagerRef = commandListManagerRef; }