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"
37 #include "wine/wined3d.h"
38 #include "wine/winedxgi.h"
40 enum dxgi_frame_latency
42 DXGI_FRAME_LATENCY_DEFAULT
= 3,
43 DXGI_FRAME_LATENCY_MAX
= 16,
47 enum dxgi_device_layer_id
49 DXGI_DEVICE_LAYER_DEBUG1
= 0x8,
50 DXGI_DEVICE_LAYER_THREAD_SAFE
= 0x10,
51 DXGI_DEVICE_LAYER_DEBUG2
= 0x20,
52 DXGI_DEVICE_LAYER_SWITCH_TO_REF
= 0x30,
53 DXGI_DEVICE_LAYER_D3D10_DEVICE
= 0xffffffff,
56 struct layer_get_size_args
62 IDXGIAdapter
*adapter
;
66 WORD version_revision
;
69 struct dxgi_device_layer
71 enum dxgi_device_layer_id id
;
72 HRESULT (WINAPI
*init
)(enum dxgi_device_layer_id id
, DWORD
*count
, DWORD
*values
);
73 UINT (WINAPI
*get_size
)(enum dxgi_device_layer_id id
, struct layer_get_size_args
*args
, DWORD unknown0
);
74 HRESULT (WINAPI
*create
)(enum dxgi_device_layer_id id
, void **layer_base
, DWORD unknown0
,
75 void *device_object
, REFIID riid
, void **device_layer
);
76 void (WINAPI
*set_feature_level
)(enum dxgi_device_layer_id id
, void *device
,
77 D3D_FEATURE_LEVEL feature_level
);
80 /* TRACE helper functions */
81 const char *debug_dxgi_format(DXGI_FORMAT format
) DECLSPEC_HIDDEN
;
82 void dump_feature_levels(const D3D_FEATURE_LEVEL
*feature_levels
, unsigned int level_count
) DECLSPEC_HIDDEN
;
84 DXGI_FORMAT
dxgi_format_from_wined3dformat(enum wined3d_format_id format
) DECLSPEC_HIDDEN
;
85 enum wined3d_format_id
wined3dformat_from_dxgi_format(DXGI_FORMAT format
) DECLSPEC_HIDDEN
;
86 void dxgi_sample_desc_from_wined3d(DXGI_SAMPLE_DESC
*desc
,
87 enum wined3d_multisample_type wined3d_type
, unsigned int wined3d_quality
) DECLSPEC_HIDDEN
;
88 void wined3d_sample_desc_from_dxgi(enum wined3d_multisample_type
*wined3d_type
,
89 unsigned int *wined3d_quality
, const DXGI_SAMPLE_DESC
*dxgi_desc
) DECLSPEC_HIDDEN
;
90 HRESULT
dxgi_get_private_data(struct wined3d_private_store
*store
,
91 REFGUID guid
, UINT
*data_size
, void *data
) DECLSPEC_HIDDEN
;
92 HRESULT
dxgi_set_private_data(struct wined3d_private_store
*store
,
93 REFGUID guid
, UINT data_size
, const void *data
) DECLSPEC_HIDDEN
;
94 HRESULT
dxgi_set_private_data_interface(struct wined3d_private_store
*store
,
95 REFGUID guid
, const IUnknown
*object
) DECLSPEC_HIDDEN
;
100 IDXGIFactory1 IDXGIFactory1_iface
;
102 struct wined3d_private_store private_store
;
103 struct wined3d
*wined3d
;
108 HRESULT
dxgi_factory_create(REFIID riid
, void **factory
, BOOL extended
) DECLSPEC_HIDDEN
;
109 HWND
dxgi_factory_get_device_window(struct dxgi_factory
*factory
) DECLSPEC_HIDDEN
;
110 struct dxgi_factory
*unsafe_impl_from_IDXGIFactory1(IDXGIFactory1
*iface
) DECLSPEC_HIDDEN
;
115 IWineDXGIDevice IWineDXGIDevice_iface
;
116 IUnknown
*child_layer
;
118 struct wined3d_private_store private_store
;
119 struct wined3d_device
*wined3d_device
;
120 IDXGIAdapter1
*adapter
;
123 HRESULT
dxgi_device_init(struct dxgi_device
*device
, struct dxgi_device_layer
*layer
,
124 IDXGIFactory
*factory
, IDXGIAdapter
*adapter
,
125 const D3D_FEATURE_LEVEL
*feature_levels
, unsigned int level_count
) DECLSPEC_HIDDEN
;
130 IDXGIOutput IDXGIOutput_iface
;
132 struct wined3d_private_store private_store
;
133 struct dxgi_adapter
*adapter
;
136 HRESULT
dxgi_output_create(struct dxgi_adapter
*adapter
, struct dxgi_output
**output
) DECLSPEC_HIDDEN
;
141 IDXGIAdapter1 IDXGIAdapter1_iface
;
143 struct wined3d_private_store private_store
;
145 struct dxgi_factory
*factory
;
148 HRESULT
dxgi_adapter_create(struct dxgi_factory
*factory
, UINT ordinal
,
149 struct dxgi_adapter
**adapter
) DECLSPEC_HIDDEN
;
150 struct dxgi_adapter
*unsafe_impl_from_IDXGIAdapter1(IDXGIAdapter1
*iface
) DECLSPEC_HIDDEN
;
153 struct dxgi_swapchain
155 IDXGISwapChain IDXGISwapChain_iface
;
157 struct wined3d_private_store private_store
;
158 struct wined3d_swapchain
*wined3d_swapchain
;
159 IWineDXGIDevice
*device
;
160 IDXGIFactory
*factory
;
163 HRESULT
dxgi_swapchain_init(struct dxgi_swapchain
*swapchain
, struct dxgi_device
*device
,
164 struct wined3d_swapchain_desc
*desc
, BOOL implicit
) DECLSPEC_HIDDEN
;
169 IDXGISurface1 IDXGISurface1_iface
;
170 IUnknown IUnknown_iface
;
171 IUnknown
*outer_unknown
;
173 struct wined3d_private_store private_store
;
175 struct wined3d_resource
*wined3d_resource
;
178 HRESULT
dxgi_surface_init(struct dxgi_surface
*surface
, IDXGIDevice
*device
,
179 IUnknown
*outer
, struct wined3d_resource
*wined3d_resource
) DECLSPEC_HIDDEN
;
181 D3D_FEATURE_LEVEL
dxgi_check_feature_level_support(struct dxgi_factory
*factory
, struct dxgi_adapter
*adapter
,
182 const D3D_FEATURE_LEVEL
*feature_levels
, unsigned int level_count
) DECLSPEC_HIDDEN
;
184 #endif /* __WINE_DXGI_PRIVATE_H */