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