dxgi: Implement d3d11_swapchain_GetLastPresentCount().
[wine.git] / dlls / dxgi / dxgi_private.h
blobb3cd1164b9064df946cd407bc254232802c7aa4d
1 /*
2 * Copyright 2008 Henri Verbeet for CodeWeavers
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19 #ifndef __WINE_DXGI_PRIVATE_H
20 #define __WINE_DXGI_PRIVATE_H
22 #include "wine/debug.h"
23 #include "wine/heap.h"
25 #include <assert.h>
27 #define COBJMACROS
28 #include "winbase.h"
29 #include "wingdi.h"
30 #include "winuser.h"
31 #include "objbase.h"
32 #include "winnls.h"
34 #include "dxgi1_6.h"
35 #include "d3d10_1.h"
36 #include "d3d12.h"
37 #ifdef DXGI_INIT_GUID
38 #include "initguid.h"
39 #endif
40 #include "wine/wined3d.h"
41 #include "wine/winedxgi.h"
43 enum dxgi_frame_latency
45 DXGI_FRAME_LATENCY_MAX = 16,
48 /* Layered device */
49 enum dxgi_device_layer_id
51 DXGI_DEVICE_LAYER_DEBUG1 = 0x8,
52 DXGI_DEVICE_LAYER_THREAD_SAFE = 0x10,
53 DXGI_DEVICE_LAYER_DEBUG2 = 0x20,
54 DXGI_DEVICE_LAYER_SWITCH_TO_REF = 0x30,
55 DXGI_DEVICE_LAYER_D3D10_DEVICE = 0xffffffff,
58 struct layer_get_size_args
60 DWORD unknown0;
61 DWORD unknown1;
62 DWORD *unknown2;
63 DWORD *unknown3;
64 IDXGIAdapter *adapter;
65 WORD interface_major;
66 WORD interface_minor;
67 WORD version_build;
68 WORD version_revision;
71 struct dxgi_device_layer
73 enum dxgi_device_layer_id id;
74 HRESULT (WINAPI *init)(enum dxgi_device_layer_id id, DWORD *count, DWORD *values);
75 UINT (WINAPI *get_size)(enum dxgi_device_layer_id id, struct layer_get_size_args *args, DWORD unknown0);
76 HRESULT (WINAPI *create)(enum dxgi_device_layer_id id, void **layer_base, DWORD unknown0,
77 void *device_object, REFIID riid, void **device_layer);
80 /* TRACE helper functions */
81 const char *debug_dxgi_format(DXGI_FORMAT format) DECLSPEC_HIDDEN;
82 const char *debug_dxgi_mode(const DXGI_MODE_DESC *desc) DECLSPEC_HIDDEN;
83 const char *debug_dxgi_mode1(const DXGI_MODE_DESC1 *desc) DECLSPEC_HIDDEN;
84 void dump_feature_levels(const D3D_FEATURE_LEVEL *feature_levels, unsigned int level_count) DECLSPEC_HIDDEN;
86 DXGI_FORMAT dxgi_format_from_wined3dformat(enum wined3d_format_id format) DECLSPEC_HIDDEN;
87 enum wined3d_format_id wined3dformat_from_dxgi_format(DXGI_FORMAT format) DECLSPEC_HIDDEN;
88 void dxgi_sample_desc_from_wined3d(DXGI_SAMPLE_DESC *desc,
89 enum wined3d_multisample_type wined3d_type, unsigned int wined3d_quality) DECLSPEC_HIDDEN;
90 void wined3d_sample_desc_from_dxgi(enum wined3d_multisample_type *wined3d_type,
91 unsigned int *wined3d_quality, const DXGI_SAMPLE_DESC *dxgi_desc) DECLSPEC_HIDDEN;
92 void wined3d_display_mode_from_dxgi(struct wined3d_display_mode *wined3d_mode,
93 const DXGI_MODE_DESC *mode) DECLSPEC_HIDDEN;
94 void wined3d_display_mode_from_dxgi1(struct wined3d_display_mode *wined3d_mode,
95 const DXGI_MODE_DESC1 *mode) DECLSPEC_HIDDEN;
96 DXGI_USAGE dxgi_usage_from_wined3d_bind_flags(unsigned int wined3d_bind_flags) DECLSPEC_HIDDEN;
97 unsigned int wined3d_bind_flags_from_dxgi_usage(DXGI_USAGE usage) DECLSPEC_HIDDEN;
98 unsigned int dxgi_swapchain_flags_from_wined3d(unsigned int wined3d_flags) DECLSPEC_HIDDEN;
99 HRESULT dxgi_get_output_from_window(IWineDXGIFactory *factory, HWND window, IDXGIOutput **dxgi_output)
100 DECLSPEC_HIDDEN;
101 HRESULT wined3d_swapchain_desc_from_dxgi(struct wined3d_swapchain_desc *wined3d_desc,
102 IDXGIOutput *dxgi_containing_output, HWND window, const DXGI_SWAP_CHAIN_DESC1 *dxgi_desc,
103 const DXGI_SWAP_CHAIN_FULLSCREEN_DESC *dxgi_fullscreen_desc) DECLSPEC_HIDDEN;
105 HRESULT dxgi_get_private_data(struct wined3d_private_store *store,
106 REFGUID guid, UINT *data_size, void *data) DECLSPEC_HIDDEN;
107 HRESULT dxgi_set_private_data(struct wined3d_private_store *store,
108 REFGUID guid, UINT data_size, const void *data) DECLSPEC_HIDDEN;
109 HRESULT dxgi_set_private_data_interface(struct wined3d_private_store *store,
110 REFGUID guid, const IUnknown *object) DECLSPEC_HIDDEN;
112 /* IDXGIFactory */
113 struct dxgi_factory
115 IWineDXGIFactory IWineDXGIFactory_iface;
116 LONG refcount;
117 struct wined3d_private_store private_store;
118 struct wined3d *wined3d;
119 BOOL extended;
120 HWND device_window;
123 HRESULT dxgi_factory_create(REFIID riid, void **factory, BOOL extended) DECLSPEC_HIDDEN;
124 HWND dxgi_factory_get_device_window(struct dxgi_factory *factory) DECLSPEC_HIDDEN;
125 struct dxgi_factory *unsafe_impl_from_IDXGIFactory(IDXGIFactory *iface) DECLSPEC_HIDDEN;
127 /* IDXGIDevice */
128 struct dxgi_device
130 IWineDXGIDevice IWineDXGIDevice_iface;
131 IWineDXGISwapChainFactory IWineDXGISwapChainFactory_iface;
132 IUnknown *child_layer;
133 LONG refcount;
134 struct wined3d_private_store private_store;
135 struct wined3d_device *wined3d_device;
136 struct wined3d_swapchain *implicit_swapchain;
137 IWineDXGIAdapter *adapter;
140 HRESULT dxgi_device_init(struct dxgi_device *device, struct dxgi_device_layer *layer,
141 IDXGIFactory *factory, IDXGIAdapter *adapter,
142 const D3D_FEATURE_LEVEL *feature_levels, unsigned int level_count) DECLSPEC_HIDDEN;
144 /* IDXGIOutput */
145 struct dxgi_output
147 IDXGIOutput6 IDXGIOutput6_iface;
148 LONG refcount;
149 struct wined3d_output *wined3d_output;
150 struct wined3d_private_store private_store;
151 struct dxgi_adapter *adapter;
154 HRESULT dxgi_output_create(struct dxgi_adapter *adapter, unsigned int output_idx,
155 struct dxgi_output **output) DECLSPEC_HIDDEN;
156 struct dxgi_output *unsafe_impl_from_IDXGIOutput(IDXGIOutput *iface) DECLSPEC_HIDDEN;
158 /* IDXGIAdapter */
159 struct dxgi_adapter
161 IWineDXGIAdapter IWineDXGIAdapter_iface;
162 LONG refcount;
163 struct wined3d_adapter *wined3d_adapter;
164 struct wined3d_private_store private_store;
165 UINT ordinal;
166 struct dxgi_factory *factory;
169 HRESULT dxgi_adapter_create(struct dxgi_factory *factory, UINT ordinal,
170 struct dxgi_adapter **adapter) DECLSPEC_HIDDEN;
171 struct dxgi_adapter *unsafe_impl_from_IDXGIAdapter(IDXGIAdapter *iface) DECLSPEC_HIDDEN;
173 /* IDXGISwapChain */
174 struct d3d11_swapchain
176 IDXGISwapChain1 IDXGISwapChain1_iface;
177 LONG refcount;
178 struct wined3d_private_store private_store;
179 struct wined3d_swapchain *wined3d_swapchain;
180 struct wined3d_swapchain_state_parent state_parent;
181 IWineDXGIDevice *device;
182 IWineDXGIFactory *factory;
184 IDXGIOutput *target;
185 LONG present_count;
188 HRESULT d3d11_swapchain_init(struct d3d11_swapchain *swapchain, struct dxgi_device *device,
189 struct wined3d_swapchain_desc *desc) DECLSPEC_HIDDEN;
191 HRESULT d3d12_swapchain_create(IWineDXGIFactory *factory, ID3D12CommandQueue *queue, HWND window,
192 const DXGI_SWAP_CHAIN_DESC1 *swapchain_desc, const DXGI_SWAP_CHAIN_FULLSCREEN_DESC *fullscreen_desc,
193 IDXGISwapChain1 **swapchain) DECLSPEC_HIDDEN;
195 BOOL dxgi_validate_swapchain_desc(const DXGI_SWAP_CHAIN_DESC1 *desc) DECLSPEC_HIDDEN;
197 /* IDXGISurface */
198 struct dxgi_surface
200 IDXGISurface1 IDXGISurface1_iface;
201 IUnknown IUnknown_iface;
202 IUnknown *outer_unknown;
203 LONG refcount;
204 struct wined3d_private_store private_store;
205 IDXGIDevice *device;
206 struct wined3d_texture *wined3d_texture;
207 HDC dc;
210 HRESULT dxgi_surface_init(struct dxgi_surface *surface, IDXGIDevice *device,
211 IUnknown *outer, struct wined3d_texture *wined3d_texture) DECLSPEC_HIDDEN;
213 #endif /* __WINE_DXGI_PRIVATE_H */