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 contents of dxgi1_4.h
7 use ctypes::c_void;
8 use shared::basetsd::UINT64;
9 use shared::dxgi1_2::{IDXGIAdapter2, IDXGIAdapter2Vtbl};
10 use shared::dxgi1_3::{
11     IDXGIFactory3, IDXGIFactory3Vtbl, IDXGIOutput3, IDXGIOutput3Vtbl, IDXGISwapChain2,
12     IDXGISwapChain2Vtbl,
13 };
14 use shared::dxgiformat::DXGI_FORMAT;
15 use shared::dxgitype::DXGI_COLOR_SPACE_TYPE;
16 use shared::guiddef::REFGUID;
17 use shared::minwindef::{DWORD, UINT};
18 use um::unknwnbase::IUnknown;
19 use um::winnt::{HANDLE, HRESULT, LUID};
20 ENUM!{enum DXGI_MEMORY_SEGMENT_GROUP {
21     DXGI_MEMORY_SEGMENT_GROUP_LOCAL = 0,
22     DXGI_MEMORY_SEGMENT_GROUP_NON_LOCAL = 1,
23 }}
24 ENUM!{enum DXGI_OVERLAY_COLOR_SPACE_SUPPORT_FLAG {
25     DXGI_OVERLAY_COLOR_SPACE_SUPPORT_FLAG_PRESENT = 0x1,
26 }}
27 ENUM!{enum DXGI_SWAP_CHAIN_COLOR_SPACE_SUPPORT_FLAG {
28     DXGI_SWAP_CHAIN_COLOR_SPACE_SUPPORT_FLAG_PRESENT = 0x1,
29     DXGI_SWAP_CHAIN_COLOR_SPACE_SUPPORT_FLAG_OVERLAY_PRESENT = 0x2,
30 }}
31 STRUCT!{struct DXGI_QUERY_VIDEO_MEMORY_INFO {
32     Budget: UINT64,
33     CurrentUsage: UINT64,
34     AvailableForReservation: UINT64,
35     CurrentReservation: UINT64,
36 }}
37 RIDL!{#[uuid(0x645967a4, 0x1392, 0x4310, 0xa7, 0x98, 0x80, 0x53, 0xce, 0x3e, 0x93, 0xfd)]
38 interface IDXGIAdapter3(IDXGIAdapter3Vtbl): IDXGIAdapter2(IDXGIAdapter2Vtbl) {
39     fn RegisterHardwareContentProtectionTeardownStatusEvent(
40         hEvent: HANDLE,
41         pdwCookie: *mut DWORD,
42     ) -> HRESULT,
43     fn UnregisterHardwareContentProtectionTeardownStatus(
44         dwCookie: DWORD,
45     ) -> (),
46     fn QueryVideoMemoryInfo(
47         NodeIndex: UINT,
48         MemorySegmentGroup: DXGI_MEMORY_SEGMENT_GROUP,
49         pVideoMemoryInfo: *mut DXGI_QUERY_VIDEO_MEMORY_INFO,
50     ) -> HRESULT,
51     fn SetVideoMemoryReservation(
52         NodeIndex: UINT,
53         MemorySegmentGroup: DXGI_MEMORY_SEGMENT_GROUP,
54         Reservation: UINT64,
55     ) -> HRESULT,
56     fn RegisterVideoMemoryBudgetChangeNotificationEvent(
57         hEvent: HANDLE,
58         pdwCookie: *mut DWORD,
59     ) -> HRESULT,
60     fn UnregisterVideoMemoryBudgetChangeNotification(
61         dwCookie: DWORD,
62     ) -> (),
63 }}
64 RIDL!{#[uuid(0x1bc6ea02, 0xef36, 0x464f, 0xbf, 0x0c, 0x21, 0xca, 0x39, 0xe5, 0x16, 0x8a)]
65 interface IDXGIFactory4(IDXGIFactory4Vtbl): IDXGIFactory3(IDXGIFactory3Vtbl) {
66     fn EnumAdapterByLuid(
67         AdapterLuid: LUID,
68         riid: REFGUID,
69         ppvAdapter: *mut *mut c_void,
70     ) -> HRESULT,
71     fn EnumWarpAdapter(
72         riid: REFGUID,
73         ppvAdapter: *mut *mut c_void,
74     ) -> HRESULT,
75 }}
76 RIDL!{#[uuid(0xdc7dca35, 0x2196, 0x414d, 0x9f, 0x53, 0x61, 0x78, 0x84, 0x03, 0x2a, 0x60)]
77 interface IDXGIOutput4(IDXGIOutput4Vtbl): IDXGIOutput3(IDXGIOutput3Vtbl) {
78     fn CheckOverlayColorSpaceSupport(
79         Format: DXGI_FORMAT,
80         ColorSpace: DXGI_COLOR_SPACE_TYPE,
81         pConcernedDevice: *mut IUnknown,
82         pFlags: *mut UINT,
83     ) -> HRESULT,
84 }}
85 RIDL!{#[uuid(0x94d99bdb, 0xf1f8, 0x4ab0, 0xb2, 0x36, 0x7d, 0xa0, 0x17, 0x0e, 0xda, 0xb1)]
86 interface IDXGISwapChain3(IDXGISwapChain3Vtbl): IDXGISwapChain2(IDXGISwapChain2Vtbl) {
87     fn GetCurrentBackBufferIndex() -> UINT,
88     fn CheckColorSpaceSupport(
89         ColorSpace: DXGI_COLOR_SPACE_TYPE,
90         pColorSpaceSupport: *mut UINT,
91     ) -> HRESULT,
92     fn SetColorSpace1(
93         ColorSpace: DXGI_COLOR_SPACE_TYPE,
94     ) -> HRESULT,
95     fn ResizeBuffers1(
96         BufferCount: UINT,
97         Width: UINT,
98         Height: UINT,
99         Format: DXGI_FORMAT,
100         SwapChainFlags: UINT,
101         pCreationNodeMask: *const UINT,
102         ppPresentQueue: *mut *mut IUnknown,
103     ) -> HRESULT,
104 }}
105 DEFINE_GUID!{IID_IDXGISwapChain3,
106     0x94d99bdb, 0xf1f8, 0x4ab0, 0xb2, 0x36, 0x7d, 0xa0, 0x17, 0x0e, 0xda, 0xb1}
107 DEFINE_GUID!{IID_IDXGIOutput4,
108     0xdc7dca35, 0x2196, 0x414d, 0x9f, 0x53, 0x61, 0x78, 0x84, 0x03, 0x2a, 0x60}
109 DEFINE_GUID!{IID_IDXGIFactory4,
110     0x1bc6ea02, 0xef36, 0x464f, 0xbf, 0x0c, 0x21, 0xca, 0x39, 0xe5, 0x16, 0x8a}
111 DEFINE_GUID!{IID_IDXGIAdapter3,
112     0x645967a4, 0x1392, 0x4310, 0xa7, 0x98, 0x80, 0x53, 0xce, 0x3e, 0x93, 0xfd}
113