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"
39 #include "wine/wined3d.h"
40 #include "wine/winedxgi.h"
42 enum dxgi_frame_latency
44 DXGI_FRAME_LATENCY_MAX
= 16,
48 enum dxgi_device_layer_id
50 DXGI_DEVICE_LAYER_DEBUG1
= 0x8,
51 DXGI_DEVICE_LAYER_THREAD_SAFE
= 0x10,
52 DXGI_DEVICE_LAYER_DEBUG2
= 0x20,
53 DXGI_DEVICE_LAYER_SWITCH_TO_REF
= 0x30,
54 DXGI_DEVICE_LAYER_D3D10_DEVICE
= 0xffffffff,
57 struct layer_get_size_args
63 IDXGIAdapter
*adapter
;
67 WORD version_revision
;
70 struct dxgi_device_layer
72 enum dxgi_device_layer_id id
;
73 HRESULT (WINAPI
*init
)(enum dxgi_device_layer_id id
, DWORD
*count
, DWORD
*values
);
74 UINT (WINAPI
*get_size
)(enum dxgi_device_layer_id id
, struct layer_get_size_args
*args
, DWORD unknown0
);
75 HRESULT (WINAPI
*create
)(enum dxgi_device_layer_id id
, void **layer_base
, DWORD unknown0
,
76 void *device_object
, REFIID riid
, void **device_layer
);
79 /* TRACE helper functions */
80 const char *debug_dxgi_format(DXGI_FORMAT format
);
81 const char *debug_dxgi_mode(const DXGI_MODE_DESC
*desc
);
82 const char *debug_dxgi_mode1(const DXGI_MODE_DESC1
*desc
);
83 void dump_feature_levels(const D3D_FEATURE_LEVEL
*feature_levels
, unsigned int level_count
);
85 DXGI_FORMAT
dxgi_format_from_wined3dformat(enum wined3d_format_id format
);
86 enum wined3d_format_id
wined3dformat_from_dxgi_format(DXGI_FORMAT format
);
87 void dxgi_sample_desc_from_wined3d(DXGI_SAMPLE_DESC
*desc
,
88 enum wined3d_multisample_type wined3d_type
, unsigned int wined3d_quality
);
89 void wined3d_sample_desc_from_dxgi(enum wined3d_multisample_type
*wined3d_type
,
90 unsigned int *wined3d_quality
, const DXGI_SAMPLE_DESC
*dxgi_desc
);
91 void wined3d_display_mode_from_dxgi(struct wined3d_display_mode
*wined3d_mode
,
92 const DXGI_MODE_DESC
*mode
);
93 void wined3d_display_mode_from_dxgi1(struct wined3d_display_mode
*wined3d_mode
,
94 const DXGI_MODE_DESC1
*mode
);
95 DXGI_USAGE
dxgi_usage_from_wined3d_bind_flags(unsigned int wined3d_bind_flags
);
96 unsigned int wined3d_bind_flags_from_dxgi_usage(DXGI_USAGE usage
);
97 unsigned int dxgi_swapchain_flags_from_wined3d(unsigned int wined3d_flags
);
98 HRESULT
dxgi_get_output_from_window(IWineDXGIFactory
*factory
, HWND window
, IDXGIOutput
**dxgi_output
)
100 HRESULT
wined3d_swapchain_desc_from_dxgi(struct wined3d_swapchain_desc
*wined3d_desc
,
101 IDXGIOutput
*dxgi_containing_output
, HWND window
, const DXGI_SWAP_CHAIN_DESC1
*dxgi_desc
,
102 const DXGI_SWAP_CHAIN_FULLSCREEN_DESC
*dxgi_fullscreen_desc
);
104 HRESULT
dxgi_get_private_data(struct wined3d_private_store
*store
,
105 REFGUID guid
, UINT
*data_size
, void *data
);
106 HRESULT
dxgi_set_private_data(struct wined3d_private_store
*store
,
107 REFGUID guid
, UINT data_size
, const void *data
);
108 HRESULT
dxgi_set_private_data_interface(struct wined3d_private_store
*store
,
109 REFGUID guid
, const IUnknown
*object
);
114 IWineDXGIFactory IWineDXGIFactory_iface
;
116 struct wined3d_private_store private_store
;
117 struct wined3d
*wined3d
;
122 HRESULT
dxgi_factory_create(REFIID riid
, void **factory
, BOOL extended
);
123 HWND
dxgi_factory_get_device_window(struct dxgi_factory
*factory
);
124 struct dxgi_factory
*unsafe_impl_from_IDXGIFactory(IDXGIFactory
*iface
);
129 IWineDXGIDevice IWineDXGIDevice_iface
;
130 IWineDXGISwapChainFactory IWineDXGISwapChainFactory_iface
;
131 IUnknown
*child_layer
;
133 struct wined3d_private_store private_store
;
134 struct wined3d_device
*wined3d_device
;
135 struct wined3d_swapchain
*implicit_swapchain
;
136 IWineDXGIAdapter
*adapter
;
139 HRESULT
dxgi_device_init(struct dxgi_device
*device
, struct dxgi_device_layer
*layer
,
140 IDXGIFactory
*factory
, IDXGIAdapter
*adapter
,
141 const D3D_FEATURE_LEVEL
*feature_levels
, unsigned int level_count
);
146 IDXGIOutput6 IDXGIOutput6_iface
;
148 struct wined3d_output
*wined3d_output
;
149 struct wined3d_private_store private_store
;
150 struct dxgi_adapter
*adapter
;
153 HRESULT
dxgi_output_create(struct dxgi_adapter
*adapter
, unsigned int output_idx
,
154 struct dxgi_output
**output
);
155 struct dxgi_output
*unsafe_impl_from_IDXGIOutput(IDXGIOutput
*iface
);
160 IWineDXGIAdapter IWineDXGIAdapter_iface
;
162 struct wined3d_adapter
*wined3d_adapter
;
163 struct wined3d_private_store private_store
;
165 struct dxgi_factory
*factory
;
168 HRESULT
dxgi_adapter_create(struct dxgi_factory
*factory
, UINT ordinal
,
169 struct dxgi_adapter
**adapter
);
170 struct dxgi_adapter
*unsafe_impl_from_IDXGIAdapter(IDXGIAdapter
*iface
);
173 struct d3d11_swapchain
175 IDXGISwapChain4 IDXGISwapChain4_iface
;
177 struct wined3d_private_store private_store
;
178 struct wined3d_swapchain
*wined3d_swapchain
;
179 struct wined3d_swapchain_state_parent state_parent
;
180 IWineDXGIDevice
*device
;
181 IWineDXGIFactory
*factory
;
185 LONG in_set_fullscreen_state
;
188 HRESULT
d3d11_swapchain_init(struct d3d11_swapchain
*swapchain
, struct dxgi_device
*device
,
189 struct wined3d_swapchain_desc
*desc
);
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
);
195 BOOL
dxgi_validate_swapchain_desc(const DXGI_SWAP_CHAIN_DESC1
*desc
);
197 /* IDXGISurface/IDXGIResource */
200 IDXGISurface1 IDXGISurface1_iface
;
201 IDXGIResource IDXGIResource_iface
;
202 IUnknown IUnknown_iface
;
203 IUnknown
*outer_unknown
;
205 struct wined3d_private_store private_store
;
207 struct wined3d_resource
*wined3d_resource
;
211 HRESULT
dxgi_resource_init(struct dxgi_resource
*resource
, IDXGIDevice
*device
,
212 IUnknown
*outer
, BOOL needs_surface
, struct wined3d_resource
*wined3d_resource
);
214 #endif /* __WINE_DXGI_PRIVATE_H */