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_5.h
7 use ctypes::c_void;
8 use shared::basetsd::UINT16;
9 use shared::dxgi::IDXGIResource;
10 use shared::dxgi1_2::{DXGI_OFFER_RESOURCE_PRIORITY, IDXGIOutputDuplication};
11 use shared::dxgi1_3::{IDXGIDevice3, IDXGIDevice3Vtbl};
12 use shared::dxgi1_4::{
13     IDXGIFactory4, IDXGIFactory4Vtbl, IDXGIOutput4, IDXGIOutput4Vtbl, IDXGISwapChain3,
14     IDXGISwapChain3Vtbl,
15 };
16 use shared::dxgiformat::DXGI_FORMAT;
17 use shared::minwindef::UINT;
18 use um::unknwnbase::IUnknown;
19 use um::winnt::HRESULT;
20 RIDL!{#[uuid(0x80a07424, 0xab52, 0x42eb, 0x83, 0x3c, 0x0c, 0x42, 0xfd, 0x28, 0x2d, 0x98)]
21 interface IDXGIOutput5(IDXGIOutput5Vtbl): IDXGIOutput4(IDXGIOutput4Vtbl) {
22     fn DuplicateOutput1(
23         pDevice: *mut IUnknown,
24         Flags: UINT,
25         SupportedFormatsCount: UINT,
26         pSupportedFormats: *const DXGI_FORMAT,
27         ppOutputDuplication: *mut *mut IDXGIOutputDuplication,
28     )-> HRESULT,
29 }}
30 ENUM!{enum DXGI_HDR_METADATA_TYPE {
31     DXGI_HDR_METADATA_TYPE_NONE = 0,
32     DXGI_HDR_METADATA_TYPE_HDR10 = 1,
33 }}
34 STRUCT!{struct DXGI_HDR_METADATA_HDR10 {
35     RedPrimary: [UINT16; 2],
36     GreenPrimary: [UINT16; 2],
37     BluePrimary: [UINT16; 2],
38     WhitePoint: [UINT16; 2],
39     MaxMasteringLuminance: UINT,
40     MinMasteringLuminance: UINT,
41     MaxContentLightLevel: UINT16,
42     MaxFrameAverageLightLevel: UINT16,
43 }}
44 RIDL!{#[uuid(0x3d585d5a, 0xbd4a, 0x489e, 0xb1, 0xf4, 0x3d, 0xbc, 0xb6, 0x45, 0x2f, 0xfb)]
45 interface IDXGISwapChain4(IDXGISwapChain4Vtbl): IDXGISwapChain3(IDXGISwapChain3Vtbl) {
46     fn SetHDRMetaData(
47         Type: DXGI_HDR_METADATA_TYPE,
48         Size: UINT,
49         pMetaData: *mut c_void,
50     )-> HRESULT,
51 }}
52 ENUM!{enum DXGI_OFFER_RESOURCE_FLAGS {
53     DXGI_OFFER_RESOURCE_FLAG_ALLOW_DECOMMIT = 0x1,
54 }}
55 ENUM!{enum DXGI_RECLAIM_RESOURCE_RESULTS {
56     DXGI_RECLAIM_RESOURCE_RESULT_OK = 0,
57     DXGI_RECLAIM_RESOURCE_RESULT_DISCARDED = 1,
58     DXGI_RECLAIM_RESOURCE_RESULT_NOT_COMMITTED = 2,
59 }}
60 RIDL!{#[uuid(0x95b4f95f, 0xd8da, 0x4ca4, 0x9e, 0xe6, 0x3b, 0x76, 0xd5, 0x96, 0x8a, 0x10)]
61 interface IDXGIDevice4(IDXGIDevice4Vtbl): IDXGIDevice3(IDXGIDevice3Vtbl) {
62     fn OfferResources1(
63         NumResources: UINT,
64         ppResources: *mut *mut IDXGIResource,
65         Priority: DXGI_OFFER_RESOURCE_PRIORITY,
66         Flags: UINT,
67     ) -> HRESULT,
68     fn ReclaimResources1(
69         NumResources: UINT,
70         ppResources: *mut *mut IDXGIResource,
71         pResults: *mut DXGI_RECLAIM_RESOURCE_RESULTS,
72     ) -> HRESULT,
73 }}
74 ENUM!{enum DXGI_FEATURE {
75     DXGI_FEATURE_PRESENT_ALLOW_TEARING = 0,
76 }}
77 RIDL!{#[uuid(0x7632e1f5, 0xee65, 0x4dca, 0x87, 0xfd, 0x84, 0xcd, 0x75, 0xf8, 0x83, 0x8d)]
78 interface IDXGIFactory5(IDXGIFactory5Vtbl): IDXGIFactory4(IDXGIFactory4Vtbl) {
79     fn CheckFeatureSupport(
80         Feature: DXGI_FEATURE,
81         pFeatureSupportData: *mut c_void,
82         FeatureSupportDataSize: UINT,
83     ) -> HRESULT,
84 }}
85 DEFINE_GUID!{IID_IDXGIOutput5,
86     0x80A07424, 0xAB52, 0x42EB, 0x83, 0x3C, 0x0C, 0x42, 0xFD, 0x28, 0x2D, 0x98}
87 DEFINE_GUID!{IID_IDXGISwapChain4,
88     0x3D585D5A, 0xBD4A, 0x489E, 0xB1, 0xF4, 0x3D, 0xBC, 0xB6, 0x45, 0x2F, 0xFB}
89 DEFINE_GUID!{IID_IDXGIDevice4,
90     0x95B4F95F, 0xD8DA, 0x4CA4, 0x9E, 0xE6, 0x3B, 0x76, 0xD5, 0x96, 0x8A, 0x10}
91 DEFINE_GUID!{IID_IDXGIFactory5,
92     0x7632e1f5, 0xee65, 0x4dca, 0x87, 0xfd, 0x84, 0xcd, 0x75, 0xf8, 0x83, 0x8d}
93