コード例 #1
0
        public unsafe void ExecuteCommandList(ID3D12CommandList commandList)
        {
            Guard.NotNull(commandList, nameof(commandList));
            var ptr = commandList.NativePointer;

            ExecuteCommandLists(1, new IntPtr(&ptr));
        }
コード例 #2
0
 public void ExecuteCommandList(ID3D12CommandList commandList)
 {
     unsafe
     {
         IntPtr ptr = commandList.NativePointer;
         ExecuteCommandLists(1, new IntPtr(&ptr));
     }
 }
コード例 #3
0
        private long ExecuteCommandLists(params CompiledCommandList[] commandLists)
        {
            CommandAllocatorPool commandAllocatorPool;
            ID3D12CommandQueue   commandQueue;
            ID3D12Fence          fence;
            long fenceValue;

            switch (commandLists[0].Builder.CommandListType)
            {
            case CommandListType.Compute:
                commandAllocatorPool = ComputeAllocatorPool;
                commandQueue         = NativeComputeCommandQueue;

                fence      = NativeComputeFence;
                fenceValue = NextComputeFenceValue++;
                break;

            case CommandListType.Copy:
                commandAllocatorPool = CopyAllocatorPool;
                commandQueue         = NativeCopyCommandQueue;

                fence      = NativeCopyFence;
                fenceValue = NextCopyFenceValue++;
                break;

            case CommandListType.Direct:
                commandAllocatorPool = DirectAllocatorPool;
                commandQueue         = NativeDirectCommandQueue;

                fence      = NativeDirectFence;
                fenceValue = NextDirectFenceValue++;
                break;

            default:
                throw new NotSupportedException("This command list type is not supported.");
            }

            ID3D12CommandList[] nativeCommandLists = new ID3D12CommandList[commandLists.Length];

            for (int i = 0; i < commandLists.Length; i++)
            {
                nativeCommandLists[i] = commandLists[i].NativeCommandList;
                commandAllocatorPool.Enqueue(commandLists[i].NativeCommandAllocator, fenceValue);
            }

            commandQueue.ExecuteCommandLists(nativeCommandLists);
            commandQueue.Signal(fence, fenceValue);

            return(fenceValue);
        }
コード例 #4
0
    public void ExecuteCommandList(ID3D12CommandList commandList)
    {
        IntPtr ptr = commandList.NativePointer;

        ExecuteCommandLists(1, &ptr);
    }