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

Commit b7409b0

Browse files
committed
[Direct3D11OnDirect3D12] Update method comment from MSDN doc
1 parent f889cba commit b7409b0

File tree

2 files changed

+20
-4
lines changed

2 files changed

+20
-4
lines changed

Source/SharpDX.Direct3D11/Device.cs

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -667,12 +667,28 @@ private void CreateDevice(Adapter adapter, DriverType driverType, DeviceCreation
667667
}
668668
}
669669

670-
public static Device CreateFromDirect3D12(ComObject d3d12Device, Direct3D11.DeviceCreationFlags flags, Direct3D.FeatureLevel[] featureLevels, DXGI.Adapter adapter, params ComObject[] commandQueues)
671-
{
670+
/// <summary>
671+
/// <p> Creates a device that uses Direct3D 11 functionality in Direct3D 12, specifying a pre-existing D3D12 device to use for D3D11 interop. </p>
672+
/// </summary>
673+
/// <param name="d3D12Device"><dd> <p> Specifies a pre-existing D3D12 device to use for D3D11 interop. May not be <c>null</c>. </p> </dd></param>
674+
/// <param name="flags"><dd> <p> Any of those documented for <strong>D3D11CreateDeviceAndSwapChain</strong>. Specifies which runtime layers to enable (see the <strong><see cref="SharpDX.Direct3D11.DeviceCreationFlags"/></strong> enumeration); values can be bitwise OR'd together. <em>Flags</em> must be compatible with device flags, and its <em>NodeMask</em> must be a subset of the <em>NodeMask</em> provided to the present API. </p> </dd></param>
675+
/// <param name="featureLevels"><dd> <p> An array of any of the following: </p> <ul> <li><see cref="SharpDX.Direct3D.FeatureLevel.Level_12_1"/></li> <li><see cref="SharpDX.Direct3D.FeatureLevel.Level_12_0"/></li> <li><see cref="SharpDX.Direct3D.FeatureLevel.Level_11_1"/></li> <li><see cref="SharpDX.Direct3D.FeatureLevel.Level_11_0"/></li> <li><see cref="SharpDX.Direct3D.FeatureLevel.Level_10_1"/></li> <li><see cref="SharpDX.Direct3D.FeatureLevel.Level_10_0"/></li> <li><see cref="SharpDX.Direct3D.FeatureLevel.Level_9_3"/></li> <li><see cref="SharpDX.Direct3D.FeatureLevel.Level_9_2"/></li> <li><see cref="SharpDX.Direct3D.FeatureLevel.Level_9_1"/></li> </ul> <p> The first feature level which is less than or equal to the D3D12 device's feature level will be used to perform D3D11 validation. Creation will fail if no acceptable feature levels are provided. Providing <c>null</c> will default to the D3D12 device's feature level. </p> </dd></param>
676+
/// <param name="commandQueues"><dd> <p> An array of unique queues for D3D11On12 to use. Valid queue types: 3D command queue. </p> </dd></param>
677+
/// <returns>The Direct3D11 device created around the specified Direct3D12 device</returns>
678+
/// <remarks>
679+
/// <p> The function signature PFN_D3D11ON12_CREATE_DEVICE is provided as a typedef, so that you can use dynamic linking techniques (GetProcAddress) instead of statically linking. </p>
680+
/// </remarks>
681+
/// <msdn-id>dn933209</msdn-id>
682+
/// <unmanaged>HRESULT D3D11On12CreateDevice([In] IUnknown* pDevice,[In] D3D11_CREATE_DEVICE_FLAG Flags,[In, Buffer, Optional] const D3D_FEATURE_LEVEL* pFeatureLevels,[In] unsigned int FeatureLevels,[In, Buffer, Optional] const IUnknown** ppCommandQueues,[In] unsigned int NumQueues,[In] unsigned int NodeMask,[Out] ID3D11Device** ppDevice,[Out, Optional] ID3D11DeviceContext** ppImmediateContext,[Out, Optional] D3D_FEATURE_LEVEL* pChosenFeatureLevel)</unmanaged>
683+
/// <unmanaged-short>D3D11On12CreateDevice</unmanaged-short>
684+
public static Device CreateFromDirect3D12(ComObject d3D12Device, Direct3D11.DeviceCreationFlags flags, Direct3D.FeatureLevel[] featureLevels, DXGI.Adapter adapter, params ComObject[] commandQueues)
685+
{
686+
if(d3D12Device == null) throw new ArgumentNullException(nameof(d3D12Device));
672687
Device devOut;
673688
DeviceContext contextOut;
674-
Direct3D.FeatureLevel featurelevelOut;
675-
D3D11.On12CreateDevice(d3d12Device, flags, featureLevels, featureLevels == null ? 0 : featureLevels.Length, commandQueues, commandQueues.Length, 0, out devOut, out contextOut, out featurelevelOut);
689+
FeatureLevel featurelevelOut;
690+
D3D11.On12CreateDevice(d3D12Device, flags, featureLevels, featureLevels == null ? 0 : featureLevels.Length, commandQueues, commandQueues.Length, 0, out devOut, out contextOut, out featurelevelOut);
691+
contextOut.Dispose();
676692
return devOut;
677693
}
678694
}

Source/Tools/SharpGen/MSDNDoc.zip

13.3 KB
Binary file not shown.

0 commit comments

Comments
 (0)