1 // Licensed under the Apache License, Version 2.0
2 // <LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
3 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your option.
4 // All files in the project carrying such notice may not be copied, modified, or distributed
5 // except according to those terms.
6 //! Mappings for the content of d3d11on12.h
7 use ctypes::c_void;
8 use shared::guiddef::IID;
9 use shared::minwindef::UINT;
10 use um::d3d11::{ID3D11Device, ID3D11DeviceContext, ID3D11Resource};
11 use um::d3d12::D3D12_RESOURCE_STATES;
12 use um::d3dcommon::D3D_FEATURE_LEVEL;
13 use um::unknwnbase::{IUnknown, IUnknownVtbl};
14 use um::winnt::HRESULT;
15 FN!{stdcall PFN_D3D11ON12_CREATE_DEVICE(
16     *mut IUnknown,
17     UINT,
18     *const D3D_FEATURE_LEVEL,
19     UINT,
20     *mut *mut IUnknown,
21     UINT,
22     UINT,
23     *mut *mut ID3D11Device,
24     *mut *mut ID3D11DeviceContext,
25     *mut D3D_FEATURE_LEVEL,
26 ) -> HRESULT}
27 extern "system" {
D3D11On12CreateDevice( pDevice: *mut IUnknown, Flags: UINT, pFeatureLevels: *const D3D_FEATURE_LEVEL, FeatureLevels: UINT, ppCommandQueues: *mut *mut IUnknown, NumQueues: UINT, NodeMask: UINT, ppDevice: *mut *mut ID3D11Device, ppImmediateContext: *mut *mut ID3D11DeviceContext, pChosenFeatureLevel: *mut D3D_FEATURE_LEVEL, ) -> HRESULT28     pub fn D3D11On12CreateDevice(
29         pDevice: *mut IUnknown,
30         Flags: UINT,
31         pFeatureLevels: *const D3D_FEATURE_LEVEL,
32         FeatureLevels: UINT,
33         ppCommandQueues: *mut *mut IUnknown,
34         NumQueues: UINT,
35         NodeMask: UINT,
36         ppDevice: *mut *mut ID3D11Device,
37         ppImmediateContext: *mut *mut ID3D11DeviceContext,
38         pChosenFeatureLevel: *mut D3D_FEATURE_LEVEL,
39     ) -> HRESULT;
40 }
41 STRUCT!{struct D3D11_RESOURCE_FLAGS {
42     BindFlags: UINT,
43     MiscFlags: UINT,
44     CPUAccessFlags: UINT,
45     StructureByteStride: UINT,
46 }}
47 RIDL!{#[uuid(0x85611e73, 0x70a9, 0x490e, 0x96, 0x14, 0xa9, 0xe3, 0x02, 0x77, 0x79, 0x04)]
48 interface ID3D11On12Device(ID3D11On12DeviceVtbl): IUnknown(IUnknownVtbl) {
49     fn CreateWrappedResource(
50         pResource12: *mut IUnknown,
51         pFlags11: *const D3D11_RESOURCE_FLAGS,
52         InState: D3D12_RESOURCE_STATES,
53         OutState: D3D12_RESOURCE_STATES,
54         riid: *const IID,
55         ppResource11: *mut *mut c_void,
56     ) -> HRESULT,
57     fn ReleaseWrappedResources(
58         ppResources: *mut *mut ID3D11Resource,
59         NumResources: UINT,
60     ) -> (),
61     fn AcquireWrappedResources(
62         ppResources: *mut *mut ID3D11Resource,
63         NumResources: UINT,
64     ) -> (),
65 }}
66 DEFINE_GUID!{IID_ID3D11On12Device,
67     0x85611e73, 0x70a9, 0x490e, 0x96, 0x14, 0xa9, 0xe3, 0x02, 0x77, 0x79, 0x04}
68