1 module directx.d3d11on12;
2 /*-------------------------------------------------------------------------------------
3  *
4  * Copyright (c) Microsoft Corporation
5  *
6  *-------------------------------------------------------------------------------------*/
7 
8 version(Windows):
9 
10 public import directx.d3d11;
11 public import directx.d3d12;
12 
13 ///////////////////////////////////////////////////////////////////////////
14 // D3D11On12CreateDevice
15 // ------------------
16 //
17 // pDevice
18 //      Specifies a pre-existing D3D12 device to use for D3D11 interop.
19 //      May not be NULL.
20 // Flags
21 //      Any of those documented for D3D11CreateDeviceAndSwapChain.
22 // pFeatureLevels
23 //      Array of any of the following:
24 //          D3D_FEATURE_LEVEL_12_1
25 //          D3D_FEATURE_LEVEL_12_0
26 //          D3D_FEATURE_LEVEL_11_1
27 //          D3D_FEATURE_LEVEL_11_0
28 //          D3D_FEATURE_LEVEL_10_1
29 //          D3D_FEATURE_LEVEL_10_0
30 //          D3D_FEATURE_LEVEL_9_3
31 //          D3D_FEATURE_LEVEL_9_2
32 //          D3D_FEATURE_LEVEL_9_1
33 //       The first feature level which is less than or equal to the
34 //       D3D12 device's feature level will be used to perform D3D11 validation.
35 //       Creation will fail if no acceptable feature levels are provided.
36 //       Providing NULL will default to the D3D12 device's feature level.
37 // FeatureLevels
38 //      Size of feature levels array.
39 // ppCommandQueues
40 //      Array of unique queues for D3D11On12 to use. Valid queue types:
41 //          3D command queue.
42 //      Flags must be compatible with device flags, and its NodeMask must
43 //      be a subset of the NodeMask provided to this API.
44 // NumQueues
45 //      Size of command queue array.
46 // NodeMask
47 //      Which node of the D3D12 device to use.  Only 1 bit may be set.
48 // ppDevice
49 //      Pointer to returned interface. May be NULL.
50 // ppImmediateContext
51 //      Pointer to returned interface. May be NULL.
52 // pChosenFeatureLevel
53 //      Pointer to returned feature level. May be NULL.
54 //
55 // Return Values
56 //  Any of those documented for
57 //          D3D11CreateDevice
58 //
59 ///////////////////////////////////////////////////////////////////////////
60 
61 __gshared PFN_D3D11ON12_CREATE_DEVICE D3D11On12CreateDevice;
62 
63 extern(Windows)
64 alias PFN_D3D11ON12_CREATE_DEVICE = HRESULT function(
65     IUnknown pDevice,
66     UINT Flags,
67     const(D3D_FEATURE_LEVEL)* pFeatureLevels,
68     UINT FeatureLevels,
69     const(IUnknown)* ppCommandQueues,
70     UINT NumQueues,
71     UINT NodeMask,
72     ID3D11Device* ppDevice,
73     ID3D11DeviceContext* ppImmediateContext,
74     D3D_FEATURE_LEVEL* pChosenFeatureLevel);
75 
76 struct D3D11_RESOURCE_FLAGS
77 {
78     UINT BindFlags;
79     UINT MiscFlags;
80     UINT CPUAccessFlags;
81     UINT StructureByteStride;
82 }
83 
84 mixin(uuid!(ID3D11On12Device, "85611e73-70a9-490e-9614-a9e302777904"));
85 extern (C++) interface ID3D11On12Device : IUnknown {
86     HRESULT CreateWrappedResource(
87         IUnknown pResource12,
88         const(D3D11_RESOURCE_FLAGS)* pFlags11,
89         D3D12_RESOURCE_STATES InState,
90         D3D12_RESOURCE_STATES OutState,
91         REFIID riid,
92         void** ppResource11);
93 
94     void ReleaseWrappedResources(
95         const(ID3D11Resource)* ppResources,
96         UINT NumResources);
97 
98     void AcquireWrappedResources(
99         const(ID3D11Resource)* ppResources,
100         UINT NumResources);
101 }