Skip to content
This repository was archived by the owner on Mar 30, 2019. It is now read-only.

Commit 5a73369

Browse files
committed
Revert "Refactoring Direct3D12 to use constructor logic instead of Factory Create logic."
This reverts commit 7dcca8b.
1 parent 7dcca8b commit 5a73369

9 files changed

Lines changed: 184 additions & 323 deletions

File tree

Source/SharpDX.Direct3D12/CommandAllocator.cs

Lines changed: 0 additions & 42 deletions
This file was deleted.

Source/SharpDX.Direct3D12/CommandQueue.cs

Lines changed: 8 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -25,59 +25,23 @@ namespace SharpDX.Direct3D12
2525
{
2626
public partial class CommandQueue
2727
{
28-
/// <summary>
29-
/// Initializes a new instance of the <see cref="CommandQueue"/> class.
30-
/// </summary>
31-
/// <param name="device">The device with which to associate the command queue.</param>
32-
/// <param name="description"><see cref="CommandQueueDescription"/> structure that describes the queue.</param>
33-
public CommandQueue(Device device, CommandQueueDescription description)
34-
: base(IntPtr.Zero)
35-
{
36-
device.CreateCommandQueue(
37-
ref description,
38-
Utilities.GetGuidFromType(typeof(CommandQueue)),
39-
this);
40-
}
41-
4228
/// <summary>
4329
/// <p>Submits a command list for execution.</p>
4430
/// </summary>
45-
/// <param name="commandList">The <see cref="SharpDX.Direct3D12.CommandList"/> be executed.</param>
31+
/// <param name="numCommandLists"><dd> <p> The number of command lists to be executed. </p> </dd></param>
32+
/// <param name="commandListsOut"><dd> <p> The array of <strong><see cref="SharpDX.Direct3D12.CommandList"/></strong> command lists to be executed. </p> </dd></param>
4633
/// <remarks>
4734
/// <p> The driver is free to patch the submitted command lists. It is the calling application?s responsibility to ensure that the graphics processing unit (GPU) is not currently reading the any of the submitted command lists from a previous execution. </p><p> Applications are encouraged to batch together command list executions to reduce fixed costs associated with submitted commands to the GPU. </p>
4835
/// </remarks>
36+
/// <include file='.\..\Documentation\CodeComments.xml' path="/comments/comment[@id='ID3D12CommandQueue::ExecuteCommandLists']/*"/>
37+
/// <msdn-id>dn788631</msdn-id>
38+
/// <unmanaged>void ID3D12CommandQueue::ExecuteCommandLists([In] unsigned int NumCommandLists,[In, Buffer] const ID3D12CommandList** ppCommandLists)</unmanaged>
39+
/// <unmanaged-short>ID3D12CommandQueue::ExecuteCommandLists</unmanaged-short>
4940
public unsafe void ExecuteCommandList(CommandList commandList)
5041
{
42+
if(commandList == null) throw new ArgumentNullException("commandList");
5143
var ptr = commandList.NativePointer;
52-
ExecuteCommandLists(1, new IntPtr(&ptr));
53-
}
54-
55-
/// <summary>
56-
/// Submits an array of command lists for execution.
57-
/// </summary>
58-
/// <param name="commandLists">
59-
/// The array of <see cref="SharpDX.Direct3D12.CommandList"/> command lists to be executed.
60-
/// </param>
61-
/// <remarks>
62-
/// The driver is free to patch the submitted command lists.
63-
/// It is the calling application's responsibility to ensure that the graphics processing unit (GPU) is not currently reading the any of the submitted command lists from a previous execution.
64-
/// Applications are encouraged to batch together command list executions to reduce fixed costs associated with submitted commands to the GPU.
65-
/// </remarks>
66-
public unsafe void ExecuteCommandLists(params SharpDX.Direct3D12.CommandList[] commandLists)
67-
{
68-
var commandListsPtr = (IntPtr*)0;
69-
70-
int count = 0;
71-
if (commandLists != null)
72-
{
73-
count = commandLists.Length;
74-
IntPtr* tempPtr = stackalloc IntPtr[count];
75-
commandListsPtr = tempPtr;
76-
for (int i = 0; i < count; i++)
77-
commandListsPtr[i] = (commandLists[i] == null) ? IntPtr.Zero : commandLists[i].NativePointer;
78-
}
79-
80-
ExecuteCommandLists(count, new IntPtr(commandListsPtr));
44+
this.ExecuteCommandLists(1, new IntPtr(&ptr));
8145
}
8246
}
8347
}

Source/SharpDX.Direct3D12/CommandQueueDescription.cs

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -21,22 +21,10 @@ namespace SharpDX.Direct3D12
2121
{
2222
public partial struct CommandQueueDescription
2323
{
24-
public CommandQueueDescription(CommandListType type, CommandQueueFlags flags = CommandQueueFlags.None)
24+
public CommandQueueDescription(CommandListType type, CommandQueueFlags flags = CommandQueueFlags.None) : this()
2525
{
2626
Type = type;
27-
Priority = 0;
2827
Flags = flags;
29-
NodeMask = 0;
30-
}
31-
32-
public CommandQueueDescription(
33-
CommandListType type,
34-
int nodeMask)
35-
{
36-
Type = type;
37-
Priority = 0;
38-
Flags = CommandQueueFlags.None;
39-
NodeMask = nodeMask;
4028
}
4129
}
4230
}

Source/SharpDX.Direct3D12/DescriptorHeap.cs

Lines changed: 0 additions & 42 deletions
This file was deleted.

0 commit comments

Comments
 (0)