1 | /*
|
---|
2 | * Direct3D 9 private include file
|
---|
3 | *
|
---|
4 | * Copyright 2002-2003 Jason Edmeades
|
---|
5 | * Copyright 2002-2003 Raphael Junqueira
|
---|
6 | * Copyright 2005 Oliver Stieber
|
---|
7 | *
|
---|
8 | * This library is free software; you can redistribute it and/or
|
---|
9 | * modify it under the terms of the GNU Lesser General Public
|
---|
10 | * License as published by the Free Software Foundation; either
|
---|
11 | * version 2.1 of the License, or (at your option) any later version.
|
---|
12 | *
|
---|
13 | * This library is distributed in the hope that it will be useful,
|
---|
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
---|
16 | * Lesser General Public License for more details.
|
---|
17 | *
|
---|
18 | * You should have received a copy of the GNU Lesser General Public
|
---|
19 | * License along with this library; if not, write to the Free Software
|
---|
20 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
---|
21 | */
|
---|
22 |
|
---|
23 | /*
|
---|
24 | * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
|
---|
25 | * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
|
---|
26 | * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
|
---|
27 | * a choice of LGPL license versions is made available with the language indicating
|
---|
28 | * that LGPLv2 or any later version may be used, or where a choice of which version
|
---|
29 | * of the LGPL is applied is otherwise unspecified.
|
---|
30 | */
|
---|
31 |
|
---|
32 | #ifndef __WINE_D3D9_PRIVATE_H
|
---|
33 | #define __WINE_D3D9_PRIVATE_H
|
---|
34 |
|
---|
35 | #include <stdarg.h>
|
---|
36 |
|
---|
37 | #define NONAMELESSUNION
|
---|
38 | #define NONAMELESSSTRUCT
|
---|
39 | #define COBJMACROS
|
---|
40 | #include "windef.h"
|
---|
41 | #include "winbase.h"
|
---|
42 | #include "wingdi.h"
|
---|
43 | #include "winuser.h"
|
---|
44 | #include "wine/debug.h"
|
---|
45 | #include "wine/unicode.h"
|
---|
46 |
|
---|
47 | #include "d3d9.h"
|
---|
48 | #include "wine/wined3d.h"
|
---|
49 |
|
---|
50 |
|
---|
51 | /* ===========================================================================
|
---|
52 | Internal use
|
---|
53 | =========================================================================== */
|
---|
54 | extern HRESULT vdecl_convert_fvf(DWORD FVF, D3DVERTEXELEMENT9 **ppVertexElements) DECLSPEC_HIDDEN;
|
---|
55 | D3DFORMAT d3dformat_from_wined3dformat(WINED3DFORMAT format) DECLSPEC_HIDDEN;
|
---|
56 | WINED3DFORMAT wined3dformat_from_d3dformat(D3DFORMAT format) DECLSPEC_HIDDEN;
|
---|
57 |
|
---|
58 | /* ===========================================================================
|
---|
59 | Macros
|
---|
60 | =========================================================================== */
|
---|
61 | /* Not nice, but it lets wined3d support different versions of directx */
|
---|
62 | #define WINECAPSTOD3D9CAPS(_pD3D9Caps, _pWineCaps) \
|
---|
63 | _pD3D9Caps->DeviceType = (D3DDEVTYPE) _pWineCaps->DeviceType; \
|
---|
64 | _pD3D9Caps->AdapterOrdinal = _pWineCaps->AdapterOrdinal; \
|
---|
65 | _pD3D9Caps->Caps = _pWineCaps->Caps; \
|
---|
66 | _pD3D9Caps->Caps2 = _pWineCaps->Caps2; \
|
---|
67 | _pD3D9Caps->Caps3 = _pWineCaps->Caps3; \
|
---|
68 | _pD3D9Caps->PresentationIntervals = _pWineCaps->PresentationIntervals; \
|
---|
69 | _pD3D9Caps->CursorCaps = _pWineCaps->CursorCaps; \
|
---|
70 | _pD3D9Caps->DevCaps = _pWineCaps->DevCaps; \
|
---|
71 | _pD3D9Caps->PrimitiveMiscCaps = _pWineCaps->PrimitiveMiscCaps; \
|
---|
72 | _pD3D9Caps->RasterCaps = _pWineCaps->RasterCaps; \
|
---|
73 | _pD3D9Caps->ZCmpCaps = _pWineCaps->ZCmpCaps; \
|
---|
74 | _pD3D9Caps->SrcBlendCaps = _pWineCaps->SrcBlendCaps; \
|
---|
75 | _pD3D9Caps->DestBlendCaps = _pWineCaps->DestBlendCaps; \
|
---|
76 | _pD3D9Caps->AlphaCmpCaps = _pWineCaps->AlphaCmpCaps; \
|
---|
77 | _pD3D9Caps->ShadeCaps = _pWineCaps->ShadeCaps; \
|
---|
78 | _pD3D9Caps->TextureCaps = _pWineCaps->TextureCaps; \
|
---|
79 | _pD3D9Caps->TextureFilterCaps = _pWineCaps->TextureFilterCaps; \
|
---|
80 | _pD3D9Caps->CubeTextureFilterCaps = _pWineCaps->CubeTextureFilterCaps; \
|
---|
81 | _pD3D9Caps->VolumeTextureFilterCaps = _pWineCaps->VolumeTextureFilterCaps; \
|
---|
82 | _pD3D9Caps->TextureAddressCaps = _pWineCaps->TextureAddressCaps; \
|
---|
83 | _pD3D9Caps->VolumeTextureAddressCaps = _pWineCaps->VolumeTextureAddressCaps; \
|
---|
84 | _pD3D9Caps->LineCaps = _pWineCaps->LineCaps; \
|
---|
85 | _pD3D9Caps->MaxTextureWidth = _pWineCaps->MaxTextureWidth; \
|
---|
86 | _pD3D9Caps->MaxTextureHeight = _pWineCaps->MaxTextureHeight; \
|
---|
87 | _pD3D9Caps->MaxVolumeExtent = _pWineCaps->MaxVolumeExtent; \
|
---|
88 | _pD3D9Caps->MaxTextureRepeat = _pWineCaps->MaxTextureRepeat; \
|
---|
89 | _pD3D9Caps->MaxTextureAspectRatio = _pWineCaps->MaxTextureAspectRatio; \
|
---|
90 | _pD3D9Caps->MaxAnisotropy = _pWineCaps->MaxAnisotropy; \
|
---|
91 | _pD3D9Caps->MaxVertexW = _pWineCaps->MaxVertexW; \
|
---|
92 | _pD3D9Caps->GuardBandLeft = _pWineCaps->GuardBandLeft; \
|
---|
93 | _pD3D9Caps->GuardBandTop = _pWineCaps->GuardBandTop; \
|
---|
94 | _pD3D9Caps->GuardBandRight = _pWineCaps->GuardBandRight; \
|
---|
95 | _pD3D9Caps->GuardBandBottom = _pWineCaps->GuardBandBottom; \
|
---|
96 | _pD3D9Caps->ExtentsAdjust = _pWineCaps->ExtentsAdjust; \
|
---|
97 | _pD3D9Caps->StencilCaps = _pWineCaps->StencilCaps; \
|
---|
98 | _pD3D9Caps->FVFCaps = _pWineCaps->FVFCaps; \
|
---|
99 | _pD3D9Caps->TextureOpCaps = _pWineCaps->TextureOpCaps; \
|
---|
100 | _pD3D9Caps->MaxTextureBlendStages = _pWineCaps->MaxTextureBlendStages; \
|
---|
101 | _pD3D9Caps->MaxSimultaneousTextures = _pWineCaps->MaxSimultaneousTextures; \
|
---|
102 | _pD3D9Caps->VertexProcessingCaps = _pWineCaps->VertexProcessingCaps; \
|
---|
103 | _pD3D9Caps->MaxActiveLights = _pWineCaps->MaxActiveLights; \
|
---|
104 | _pD3D9Caps->MaxUserClipPlanes = _pWineCaps->MaxUserClipPlanes; \
|
---|
105 | _pD3D9Caps->MaxVertexBlendMatrices = _pWineCaps->MaxVertexBlendMatrices; \
|
---|
106 | _pD3D9Caps->MaxVertexBlendMatrixIndex = _pWineCaps->MaxVertexBlendMatrixIndex; \
|
---|
107 | _pD3D9Caps->MaxPointSize = _pWineCaps->MaxPointSize; \
|
---|
108 | _pD3D9Caps->MaxPrimitiveCount = _pWineCaps->MaxPrimitiveCount; \
|
---|
109 | _pD3D9Caps->MaxVertexIndex = _pWineCaps->MaxVertexIndex; \
|
---|
110 | _pD3D9Caps->MaxStreams = _pWineCaps->MaxStreams; \
|
---|
111 | _pD3D9Caps->MaxStreamStride = _pWineCaps->MaxStreamStride; \
|
---|
112 | _pD3D9Caps->VertexShaderVersion = _pWineCaps->VertexShaderVersion; \
|
---|
113 | _pD3D9Caps->MaxVertexShaderConst = _pWineCaps->MaxVertexShaderConst; \
|
---|
114 | _pD3D9Caps->PixelShaderVersion = _pWineCaps->PixelShaderVersion; \
|
---|
115 | _pD3D9Caps->PixelShader1xMaxValue = _pWineCaps->PixelShader1xMaxValue; \
|
---|
116 | _pD3D9Caps->DevCaps2 = _pWineCaps->DevCaps2; \
|
---|
117 | _pD3D9Caps->MaxNpatchTessellationLevel = _pWineCaps->MaxNpatchTessellationLevel; \
|
---|
118 | _pD3D9Caps->MasterAdapterOrdinal = _pWineCaps->MasterAdapterOrdinal; \
|
---|
119 | _pD3D9Caps->AdapterOrdinalInGroup = _pWineCaps->AdapterOrdinalInGroup; \
|
---|
120 | _pD3D9Caps->NumberOfAdaptersInGroup = _pWineCaps->NumberOfAdaptersInGroup; \
|
---|
121 | _pD3D9Caps->DeclTypes = _pWineCaps->DeclTypes; \
|
---|
122 | _pD3D9Caps->NumSimultaneousRTs = _pWineCaps->NumSimultaneousRTs; \
|
---|
123 | _pD3D9Caps->StretchRectFilterCaps = _pWineCaps->StretchRectFilterCaps; \
|
---|
124 | _pD3D9Caps->VS20Caps.Caps = _pWineCaps->VS20Caps.Caps; \
|
---|
125 | _pD3D9Caps->VS20Caps.DynamicFlowControlDepth = _pWineCaps->VS20Caps.DynamicFlowControlDepth; \
|
---|
126 | _pD3D9Caps->VS20Caps.NumTemps = _pWineCaps->VS20Caps.NumTemps; \
|
---|
127 | _pD3D9Caps->VS20Caps.NumTemps = _pWineCaps->VS20Caps.NumTemps; \
|
---|
128 | _pD3D9Caps->VS20Caps.StaticFlowControlDepth = _pWineCaps->VS20Caps.StaticFlowControlDepth; \
|
---|
129 | _pD3D9Caps->PS20Caps.Caps = _pWineCaps->PS20Caps.Caps; \
|
---|
130 | _pD3D9Caps->PS20Caps.DynamicFlowControlDepth = _pWineCaps->PS20Caps.DynamicFlowControlDepth; \
|
---|
131 | _pD3D9Caps->PS20Caps.NumTemps = _pWineCaps->PS20Caps.NumTemps; \
|
---|
132 | _pD3D9Caps->PS20Caps.StaticFlowControlDepth = _pWineCaps->PS20Caps.StaticFlowControlDepth; \
|
---|
133 | _pD3D9Caps->PS20Caps.NumInstructionSlots = _pWineCaps->PS20Caps.NumInstructionSlots; \
|
---|
134 | _pD3D9Caps->VertexTextureFilterCaps = _pWineCaps->VertexTextureFilterCaps; \
|
---|
135 | _pD3D9Caps->MaxVShaderInstructionsExecuted = _pWineCaps->MaxVShaderInstructionsExecuted; \
|
---|
136 | _pD3D9Caps->MaxPShaderInstructionsExecuted = _pWineCaps->MaxPShaderInstructionsExecuted; \
|
---|
137 | _pD3D9Caps->MaxVertexShader30InstructionSlots = _pWineCaps->MaxVertexShader30InstructionSlots; \
|
---|
138 | _pD3D9Caps->MaxPixelShader30InstructionSlots = _pWineCaps->MaxPixelShader30InstructionSlots;
|
---|
139 |
|
---|
140 | /* ===========================================================================
|
---|
141 | D3D9 interfaces
|
---|
142 | =========================================================================== */
|
---|
143 |
|
---|
144 | /* ---------- */
|
---|
145 | /* IDirect3D9 */
|
---|
146 | /* ---------- */
|
---|
147 |
|
---|
148 | /*****************************************************************************
|
---|
149 | * Predeclare the interface implementation structures
|
---|
150 | */
|
---|
151 | extern const IDirect3D9ExVtbl Direct3D9_Vtbl DECLSPEC_HIDDEN;
|
---|
152 |
|
---|
153 | /*****************************************************************************
|
---|
154 | * IDirect3D implementation structure
|
---|
155 | */
|
---|
156 | typedef struct IDirect3D9Impl
|
---|
157 | {
|
---|
158 | /* IUnknown fields */
|
---|
159 | const IDirect3D9ExVtbl *lpVtbl;
|
---|
160 | LONG ref;
|
---|
161 |
|
---|
162 | /* The WineD3D device */
|
---|
163 | IWineD3D *WineD3D;
|
---|
164 |
|
---|
165 | /* Created via Direct3DCreate9Ex? Can QI extended interfaces */
|
---|
166 | BOOL extended;
|
---|
167 | } IDirect3D9Impl;
|
---|
168 |
|
---|
169 | void filter_caps(D3DCAPS9* pCaps) DECLSPEC_HIDDEN;
|
---|
170 |
|
---|
171 | /*****************************************************************************
|
---|
172 | * IDirect3DDevice9 implementation structure
|
---|
173 | */
|
---|
174 | typedef struct IDirect3DDevice9Impl
|
---|
175 | {
|
---|
176 | /* IUnknown fields */
|
---|
177 | const IDirect3DDevice9ExVtbl *lpVtbl;
|
---|
178 | const IWineD3DDeviceParentVtbl *device_parent_vtbl;
|
---|
179 | LONG ref;
|
---|
180 |
|
---|
181 | /* IDirect3DDevice9 fields */
|
---|
182 | IWineD3DDevice *WineD3DDevice;
|
---|
183 |
|
---|
184 | /* Avoids recursion with nested ReleaseRef to 0 */
|
---|
185 | BOOL inDestruction;
|
---|
186 |
|
---|
187 | IDirect3DVertexDeclaration9 **convertedDecls;
|
---|
188 | unsigned int numConvertedDecls, declArraySize;
|
---|
189 |
|
---|
190 | BOOL notreset;
|
---|
191 | } IDirect3DDevice9Impl;
|
---|
192 |
|
---|
193 | HRESULT device_init(IDirect3DDevice9Impl *device, IWineD3D *wined3d, UINT adapter, D3DDEVTYPE device_type,
|
---|
194 | HWND focus_window, DWORD flags
|
---|
195 | #ifdef VBOX_WITH_WDDM
|
---|
196 | , VBOXWINEEX_D3DPRESENT_PARAMETERS *parameters
|
---|
197 | #else
|
---|
198 | , D3DPRESENT_PARAMETERS *parameters
|
---|
199 | #endif
|
---|
200 | ) DECLSPEC_HIDDEN;
|
---|
201 |
|
---|
202 | /* IDirect3DDevice9: */
|
---|
203 | extern HRESULT WINAPI IDirect3DDevice9Impl_GetSwapChain(IDirect3DDevice9Ex *iface,
|
---|
204 | UINT iSwapChain, IDirect3DSwapChain9 **pSwapChain) DECLSPEC_HIDDEN;
|
---|
205 | extern UINT WINAPI IDirect3DDevice9Impl_GetNumberOfSwapChains(IDirect3DDevice9Ex *iface) DECLSPEC_HIDDEN;
|
---|
206 | extern HRESULT WINAPI IDirect3DDevice9Impl_SetVertexDeclaration(IDirect3DDevice9Ex *iface,
|
---|
207 | IDirect3DVertexDeclaration9 *pDecl) DECLSPEC_HIDDEN;
|
---|
208 | extern HRESULT WINAPI IDirect3DDevice9Impl_GetVertexDeclaration(IDirect3DDevice9Ex *iface,
|
---|
209 | IDirect3DVertexDeclaration9 **ppDecl) DECLSPEC_HIDDEN;
|
---|
210 | extern HRESULT WINAPI IDirect3DDevice9Impl_SetVertexShader(IDirect3DDevice9Ex *iface,
|
---|
211 | IDirect3DVertexShader9 *pShader) DECLSPEC_HIDDEN;
|
---|
212 | extern HRESULT WINAPI IDirect3DDevice9Impl_GetVertexShader(IDirect3DDevice9Ex *iface,
|
---|
213 | IDirect3DVertexShader9 **ppShader) DECLSPEC_HIDDEN;
|
---|
214 | extern HRESULT WINAPI IDirect3DDevice9Impl_SetVertexShaderConstantF(IDirect3DDevice9Ex *iface,
|
---|
215 | UINT StartRegister, const float *pConstantData, UINT Vector4fCount) DECLSPEC_HIDDEN;
|
---|
216 | extern HRESULT WINAPI IDirect3DDevice9Impl_GetVertexShaderConstantF(IDirect3DDevice9Ex *iface,
|
---|
217 | UINT StartRegister, float *pConstantData, UINT Vector4fCount) DECLSPEC_HIDDEN;
|
---|
218 | extern HRESULT WINAPI IDirect3DDevice9Impl_SetVertexShaderConstantI(IDirect3DDevice9Ex *iface,
|
---|
219 | UINT StartRegister, const int *pConstantData, UINT Vector4iCount) DECLSPEC_HIDDEN;
|
---|
220 | extern HRESULT WINAPI IDirect3DDevice9Impl_GetVertexShaderConstantI(IDirect3DDevice9Ex *iface,
|
---|
221 | UINT StartRegister, int *pConstantData, UINT Vector4iCount) DECLSPEC_HIDDEN;
|
---|
222 | extern HRESULT WINAPI IDirect3DDevice9Impl_SetVertexShaderConstantB(IDirect3DDevice9Ex *iface,
|
---|
223 | UINT StartRegister, const BOOL *pConstantData, UINT BoolCount) DECLSPEC_HIDDEN;
|
---|
224 | extern HRESULT WINAPI IDirect3DDevice9Impl_GetVertexShaderConstantB(IDirect3DDevice9Ex *iface,
|
---|
225 | UINT StartRegister, BOOL *pConstantData, UINT BoolCount) DECLSPEC_HIDDEN;
|
---|
226 | extern HRESULT WINAPI IDirect3DDevice9Impl_SetPixelShader(IDirect3DDevice9Ex *iface,
|
---|
227 | IDirect3DPixelShader9 *pShader) DECLSPEC_HIDDEN;
|
---|
228 | extern HRESULT WINAPI IDirect3DDevice9Impl_GetPixelShader(IDirect3DDevice9Ex *iface,
|
---|
229 | IDirect3DPixelShader9 **ppShader) DECLSPEC_HIDDEN;
|
---|
230 | extern HRESULT WINAPI IDirect3DDevice9Impl_SetPixelShaderConstantF(IDirect3DDevice9Ex *iface,
|
---|
231 | UINT StartRegister, const float *pConstantData, UINT Vector4fCount) DECLSPEC_HIDDEN;
|
---|
232 | extern HRESULT WINAPI IDirect3DDevice9Impl_GetPixelShaderConstantF(IDirect3DDevice9Ex *iface,
|
---|
233 | UINT StartRegister, float *pConstantData, UINT Vector4fCount) DECLSPEC_HIDDEN;
|
---|
234 | extern HRESULT WINAPI IDirect3DDevice9Impl_SetPixelShaderConstantI(IDirect3DDevice9Ex *iface,
|
---|
235 | UINT StartRegister, const int *pConstantData, UINT Vector4iCount) DECLSPEC_HIDDEN;
|
---|
236 | extern HRESULT WINAPI IDirect3DDevice9Impl_GetPixelShaderConstantI(IDirect3DDevice9Ex *iface,
|
---|
237 | UINT StartRegister, int *pConstantData, UINT Vector4iCount) DECLSPEC_HIDDEN;
|
---|
238 | extern HRESULT WINAPI IDirect3DDevice9Impl_SetPixelShaderConstantB(IDirect3DDevice9Ex *iface,
|
---|
239 | UINT StartRegister, const BOOL *pConstantData, UINT BoolCount) DECLSPEC_HIDDEN;
|
---|
240 | extern HRESULT WINAPI IDirect3DDevice9Impl_GetPixelShaderConstantB(IDirect3DDevice9Ex *iface,
|
---|
241 | UINT StartRegister, BOOL *pConstantData, UINT BoolCount) DECLSPEC_HIDDEN;
|
---|
242 |
|
---|
243 | /* ---------------- */
|
---|
244 | /* IDirect3DVolume9 */
|
---|
245 | /* ---------------- */
|
---|
246 |
|
---|
247 | /*****************************************************************************
|
---|
248 | * IDirect3DVolume9 implementation structure
|
---|
249 | */
|
---|
250 | typedef struct IDirect3DVolume9Impl
|
---|
251 | {
|
---|
252 | /* IUnknown fields */
|
---|
253 | const IDirect3DVolume9Vtbl *lpVtbl;
|
---|
254 | LONG ref;
|
---|
255 |
|
---|
256 | /* IDirect3DVolume9 fields */
|
---|
257 | IWineD3DVolume *wineD3DVolume;
|
---|
258 |
|
---|
259 | /* The volume container */
|
---|
260 | IUnknown *container;
|
---|
261 |
|
---|
262 | /* If set forward refcounting to this object */
|
---|
263 | IUnknown *forwardReference;
|
---|
264 | } IDirect3DVolume9Impl;
|
---|
265 |
|
---|
266 | HRESULT volume_init(IDirect3DVolume9Impl *volume, IDirect3DDevice9Impl *device, UINT width, UINT height,
|
---|
267 | UINT depth, DWORD usage, WINED3DFORMAT format, WINED3DPOOL pool
|
---|
268 | #ifdef VBOX_WITH_WDDM
|
---|
269 | , HANDLE *shared_handle
|
---|
270 | , void *pvClientMem
|
---|
271 | #endif
|
---|
272 | ) DECLSPEC_HIDDEN;
|
---|
273 |
|
---|
274 | /* ------------------- */
|
---|
275 | /* IDirect3DSwapChain9 */
|
---|
276 | /* ------------------- */
|
---|
277 |
|
---|
278 | /*****************************************************************************
|
---|
279 | * IDirect3DSwapChain9 implementation structure
|
---|
280 | */
|
---|
281 | typedef struct IDirect3DSwapChain9Impl
|
---|
282 | {
|
---|
283 | /* IUnknown fields */
|
---|
284 | const IDirect3DSwapChain9Vtbl *lpVtbl;
|
---|
285 | LONG ref;
|
---|
286 |
|
---|
287 | /* IDirect3DSwapChain9 fields */
|
---|
288 | IWineD3DSwapChain *wineD3DSwapChain;
|
---|
289 |
|
---|
290 | /* Parent reference */
|
---|
291 | LPDIRECT3DDEVICE9EX parentDevice;
|
---|
292 |
|
---|
293 | /* Flags an implicit swap chain */
|
---|
294 | BOOL isImplicit;
|
---|
295 | } IDirect3DSwapChain9Impl;
|
---|
296 |
|
---|
297 | HRESULT swapchain_init(IDirect3DSwapChain9Impl *swapchain, IDirect3DDevice9Impl *device,
|
---|
298 | D3DPRESENT_PARAMETERS *present_parameters) DECLSPEC_HIDDEN;
|
---|
299 |
|
---|
300 | /* ----------------- */
|
---|
301 | /* IDirect3DSurface9 */
|
---|
302 | /* ----------------- */
|
---|
303 |
|
---|
304 | /*****************************************************************************
|
---|
305 | * IDirect3DSurface9 implementation structure
|
---|
306 | */
|
---|
307 | typedef struct IDirect3DSurface9Impl
|
---|
308 | {
|
---|
309 | /* IUnknown fields */
|
---|
310 | const IDirect3DSurface9Vtbl *lpVtbl;
|
---|
311 | LONG ref;
|
---|
312 |
|
---|
313 | /* IDirect3DResource9 fields */
|
---|
314 | IWineD3DSurface *wineD3DSurface;
|
---|
315 |
|
---|
316 | /* Parent reference */
|
---|
317 | LPDIRECT3DDEVICE9EX parentDevice;
|
---|
318 |
|
---|
319 | /* The surface container */
|
---|
320 | IUnknown *container;
|
---|
321 |
|
---|
322 | /* If set forward refcounting to this object */
|
---|
323 | IUnknown *forwardReference;
|
---|
324 |
|
---|
325 | BOOL getdc_supported;
|
---|
326 | } IDirect3DSurface9Impl;
|
---|
327 |
|
---|
328 | HRESULT surface_init(IDirect3DSurface9Impl *surface, IDirect3DDevice9Impl *device,
|
---|
329 | UINT width, UINT height, D3DFORMAT format, BOOL lockable, BOOL discard, UINT level,
|
---|
330 | DWORD usage, D3DPOOL pool, D3DMULTISAMPLE_TYPE multisample_type, DWORD multisample_quality
|
---|
331 | #ifdef VBOX_WITH_WDDM
|
---|
332 | , HANDLE *shared_handle
|
---|
333 | , void *pvClientMem
|
---|
334 | #endif
|
---|
335 | ) DECLSPEC_HIDDEN;
|
---|
336 |
|
---|
337 | /* ---------------------- */
|
---|
338 | /* IDirect3DVertexBuffer9 */
|
---|
339 | /* ---------------------- */
|
---|
340 |
|
---|
341 | /*****************************************************************************
|
---|
342 | * IDirect3DVertexBuffer9 implementation structure
|
---|
343 | */
|
---|
344 | typedef struct IDirect3DVertexBuffer9Impl
|
---|
345 | {
|
---|
346 | /* IUnknown fields */
|
---|
347 | const IDirect3DVertexBuffer9Vtbl *lpVtbl;
|
---|
348 | LONG ref;
|
---|
349 |
|
---|
350 | /* IDirect3DResource9 fields */
|
---|
351 | IWineD3DBuffer *wineD3DVertexBuffer;
|
---|
352 |
|
---|
353 | /* Parent reference */
|
---|
354 | LPDIRECT3DDEVICE9EX parentDevice;
|
---|
355 |
|
---|
356 | DWORD fvf;
|
---|
357 | } IDirect3DVertexBuffer9Impl;
|
---|
358 |
|
---|
359 | HRESULT vertexbuffer_init(IDirect3DVertexBuffer9Impl *buffer, IDirect3DDevice9Impl *device,
|
---|
360 | UINT size, UINT usage, DWORD fvf, D3DPOOL pool) DECLSPEC_HIDDEN;
|
---|
361 |
|
---|
362 | /* --------------------- */
|
---|
363 | /* IDirect3DIndexBuffer9 */
|
---|
364 | /* --------------------- */
|
---|
365 |
|
---|
366 | /*****************************************************************************
|
---|
367 | * IDirect3DIndexBuffer9 implementation structure
|
---|
368 | */
|
---|
369 | typedef struct IDirect3DIndexBuffer9Impl
|
---|
370 | {
|
---|
371 | /* IUnknown fields */
|
---|
372 | const IDirect3DIndexBuffer9Vtbl *lpVtbl;
|
---|
373 | LONG ref;
|
---|
374 |
|
---|
375 | /* IDirect3DResource9 fields */
|
---|
376 | IWineD3DBuffer *wineD3DIndexBuffer;
|
---|
377 |
|
---|
378 | /* Parent reference */
|
---|
379 | LPDIRECT3DDEVICE9EX parentDevice;
|
---|
380 | WINED3DFORMAT format;
|
---|
381 | } IDirect3DIndexBuffer9Impl;
|
---|
382 |
|
---|
383 | HRESULT indexbuffer_init(IDirect3DIndexBuffer9Impl *buffer, IDirect3DDevice9Impl *device,
|
---|
384 | UINT size, DWORD usage, D3DFORMAT format, D3DPOOL pool) DECLSPEC_HIDDEN;
|
---|
385 |
|
---|
386 | /* --------------------- */
|
---|
387 | /* IDirect3DBaseTexture9 */
|
---|
388 | /* --------------------- */
|
---|
389 |
|
---|
390 | /*****************************************************************************
|
---|
391 | * IDirect3DBaseTexture9 implementation structure
|
---|
392 | */
|
---|
393 | typedef struct IDirect3DBaseTexture9Impl
|
---|
394 | {
|
---|
395 | /* IUnknown fields */
|
---|
396 | const IDirect3DBaseTexture9Vtbl *lpVtbl;
|
---|
397 | LONG ref;
|
---|
398 |
|
---|
399 | /* IDirect3DResource9 fields */
|
---|
400 | IWineD3DBaseTexture *wineD3DBaseTexture;
|
---|
401 | } IDirect3DBaseTexture9Impl;
|
---|
402 |
|
---|
403 | /* --------------------- */
|
---|
404 | /* IDirect3DCubeTexture9 */
|
---|
405 | /* --------------------- */
|
---|
406 |
|
---|
407 | /*****************************************************************************
|
---|
408 | * IDirect3DCubeTexture9 implementation structure
|
---|
409 | */
|
---|
410 | typedef struct IDirect3DCubeTexture9Impl
|
---|
411 | {
|
---|
412 | /* IUnknown fields */
|
---|
413 | const IDirect3DCubeTexture9Vtbl *lpVtbl;
|
---|
414 | LONG ref;
|
---|
415 |
|
---|
416 | /* IDirect3DResource9 fields */
|
---|
417 | IWineD3DCubeTexture *wineD3DCubeTexture;
|
---|
418 |
|
---|
419 | /* Parent reference */
|
---|
420 | LPDIRECT3DDEVICE9EX parentDevice;
|
---|
421 | } IDirect3DCubeTexture9Impl;
|
---|
422 |
|
---|
423 | HRESULT cubetexture_init(IDirect3DCubeTexture9Impl *texture, IDirect3DDevice9Impl *device,
|
---|
424 | UINT edge_length, UINT levels, DWORD usage, D3DFORMAT format, D3DPOOL pool
|
---|
425 | #ifdef VBOX_WITH_WDDM
|
---|
426 | , HANDLE *shared_handle
|
---|
427 | , void **pavClientMem
|
---|
428 | #endif
|
---|
429 | ) DECLSPEC_HIDDEN;
|
---|
430 |
|
---|
431 | /* ----------------- */
|
---|
432 | /* IDirect3DTexture9 */
|
---|
433 | /* ----------------- */
|
---|
434 |
|
---|
435 | /*****************************************************************************
|
---|
436 | * IDirect3DTexture9 implementation structure
|
---|
437 | */
|
---|
438 | typedef struct IDirect3DTexture9Impl
|
---|
439 | {
|
---|
440 | /* IUnknown fields */
|
---|
441 | const IDirect3DTexture9Vtbl *lpVtbl;
|
---|
442 | LONG ref;
|
---|
443 |
|
---|
444 | /* IDirect3DResource9 fields */
|
---|
445 | IWineD3DTexture *wineD3DTexture;
|
---|
446 |
|
---|
447 | /* Parent reference */
|
---|
448 | LPDIRECT3DDEVICE9EX parentDevice;
|
---|
449 | } IDirect3DTexture9Impl;
|
---|
450 |
|
---|
451 | HRESULT texture_init(IDirect3DTexture9Impl *texture, IDirect3DDevice9Impl *device,
|
---|
452 | UINT width, UINT height, UINT levels, DWORD usage, D3DFORMAT format, D3DPOOL pool
|
---|
453 | #ifdef VBOX_WITH_WDDM
|
---|
454 | , HANDLE *shared_handle
|
---|
455 | , void **pavClientMem
|
---|
456 | #endif
|
---|
457 | ) DECLSPEC_HIDDEN;
|
---|
458 |
|
---|
459 | /* ----------------------- */
|
---|
460 | /* IDirect3DVolumeTexture9 */
|
---|
461 | /* ----------------------- */
|
---|
462 |
|
---|
463 | /*****************************************************************************
|
---|
464 | * IDirect3DVolumeTexture9 implementation structure
|
---|
465 | */
|
---|
466 | typedef struct IDirect3DVolumeTexture9Impl
|
---|
467 | {
|
---|
468 | /* IUnknown fields */
|
---|
469 | const IDirect3DVolumeTexture9Vtbl *lpVtbl;
|
---|
470 | LONG ref;
|
---|
471 |
|
---|
472 | /* IDirect3DResource9 fields */
|
---|
473 | IWineD3DVolumeTexture *wineD3DVolumeTexture;
|
---|
474 |
|
---|
475 | /* Parent reference */
|
---|
476 | LPDIRECT3DDEVICE9EX parentDevice;
|
---|
477 | } IDirect3DVolumeTexture9Impl;
|
---|
478 |
|
---|
479 | HRESULT volumetexture_init(IDirect3DVolumeTexture9Impl *texture, IDirect3DDevice9Impl *device,
|
---|
480 | UINT width, UINT height, UINT depth, UINT levels, DWORD usage, D3DFORMAT format, D3DPOOL pool
|
---|
481 | #ifdef VBOX_WITH_WDDM
|
---|
482 | , HANDLE *shared_handle
|
---|
483 | , void **pavClientMem
|
---|
484 | #endif
|
---|
485 | ) DECLSPEC_HIDDEN;
|
---|
486 |
|
---|
487 | /* ----------------------- */
|
---|
488 | /* IDirect3DStateBlock9 */
|
---|
489 | /* ----------------------- */
|
---|
490 |
|
---|
491 | /*****************************************************************************
|
---|
492 | * IDirect3DStateBlock9 implementation structure
|
---|
493 | */
|
---|
494 | typedef struct IDirect3DStateBlock9Impl {
|
---|
495 | /* IUnknown fields */
|
---|
496 | const IDirect3DStateBlock9Vtbl *lpVtbl;
|
---|
497 | LONG ref;
|
---|
498 |
|
---|
499 | /* IDirect3DStateBlock9 fields */
|
---|
500 | IWineD3DStateBlock *wineD3DStateBlock;
|
---|
501 |
|
---|
502 | /* Parent reference */
|
---|
503 | LPDIRECT3DDEVICE9EX parentDevice;
|
---|
504 | } IDirect3DStateBlock9Impl;
|
---|
505 |
|
---|
506 | HRESULT stateblock_init(IDirect3DStateBlock9Impl *stateblock, IDirect3DDevice9Impl *device,
|
---|
507 | D3DSTATEBLOCKTYPE type, IWineD3DStateBlock *wined3d_stateblock) DECLSPEC_HIDDEN;
|
---|
508 |
|
---|
509 | /* --------------------------- */
|
---|
510 | /* IDirect3DVertexDeclaration9 */
|
---|
511 | /* --------------------------- */
|
---|
512 |
|
---|
513 | /*****************************************************************************
|
---|
514 | * IDirect3DVertexDeclaration implementation structure
|
---|
515 | */
|
---|
516 | typedef struct IDirect3DVertexDeclaration9Impl {
|
---|
517 | /* IUnknown fields */
|
---|
518 | const IDirect3DVertexDeclaration9Vtbl *lpVtbl;
|
---|
519 | LONG ref;
|
---|
520 |
|
---|
521 | D3DVERTEXELEMENT9 *elements;
|
---|
522 | UINT element_count;
|
---|
523 |
|
---|
524 | /* IDirect3DVertexDeclaration9 fields */
|
---|
525 | IWineD3DVertexDeclaration *wineD3DVertexDeclaration;
|
---|
526 | DWORD convFVF;
|
---|
527 |
|
---|
528 | /* Parent reference */
|
---|
529 | LPDIRECT3DDEVICE9EX parentDevice;
|
---|
530 | } IDirect3DVertexDeclaration9Impl;
|
---|
531 |
|
---|
532 | void IDirect3DVertexDeclaration9Impl_Destroy(LPDIRECT3DVERTEXDECLARATION9 iface) DECLSPEC_HIDDEN;
|
---|
533 | HRESULT vertexdeclaration_init(IDirect3DVertexDeclaration9Impl *declaration,
|
---|
534 | IDirect3DDevice9Impl *device, const D3DVERTEXELEMENT9 *elements) DECLSPEC_HIDDEN;
|
---|
535 |
|
---|
536 | /* ---------------------- */
|
---|
537 | /* IDirect3DVertexShader9 */
|
---|
538 | /* ---------------------- */
|
---|
539 |
|
---|
540 | /*****************************************************************************
|
---|
541 | * IDirect3DVertexShader implementation structure
|
---|
542 | */
|
---|
543 | typedef struct IDirect3DVertexShader9Impl {
|
---|
544 | /* IUnknown fields */
|
---|
545 | const IDirect3DVertexShader9Vtbl *lpVtbl;
|
---|
546 | LONG ref;
|
---|
547 |
|
---|
548 | /* IDirect3DVertexShader9 fields */
|
---|
549 | IWineD3DVertexShader *wineD3DVertexShader;
|
---|
550 |
|
---|
551 | /* Parent reference */
|
---|
552 | LPDIRECT3DDEVICE9EX parentDevice;
|
---|
553 | } IDirect3DVertexShader9Impl;
|
---|
554 |
|
---|
555 | HRESULT vertexshader_init(IDirect3DVertexShader9Impl *shader,
|
---|
556 | IDirect3DDevice9Impl *device, const DWORD *byte_code) DECLSPEC_HIDDEN;
|
---|
557 |
|
---|
558 | #define D3D9_MAX_VERTEX_SHADER_CONSTANTF 256
|
---|
559 | #define D3D9_MAX_SIMULTANEOUS_RENDERTARGETS 4
|
---|
560 |
|
---|
561 | /* --------------------- */
|
---|
562 | /* IDirect3DPixelShader9 */
|
---|
563 | /* --------------------- */
|
---|
564 |
|
---|
565 | /*****************************************************************************
|
---|
566 | * IDirect3DPixelShader implementation structure
|
---|
567 | */
|
---|
568 | typedef struct IDirect3DPixelShader9Impl {
|
---|
569 | /* IUnknown fields */
|
---|
570 | const IDirect3DPixelShader9Vtbl *lpVtbl;
|
---|
571 | LONG ref;
|
---|
572 |
|
---|
573 | /* IDirect3DPixelShader9 fields */
|
---|
574 | IWineD3DPixelShader *wineD3DPixelShader;
|
---|
575 |
|
---|
576 | /* Parent reference */
|
---|
577 | LPDIRECT3DDEVICE9EX parentDevice;
|
---|
578 | } IDirect3DPixelShader9Impl;
|
---|
579 |
|
---|
580 | HRESULT pixelshader_init(IDirect3DPixelShader9Impl *shader,
|
---|
581 | IDirect3DDevice9Impl *device, const DWORD *byte_code) DECLSPEC_HIDDEN;
|
---|
582 |
|
---|
583 | /* --------------- */
|
---|
584 | /* IDirect3DQuery9 */
|
---|
585 | /* --------------- */
|
---|
586 |
|
---|
587 | /*****************************************************************************
|
---|
588 | * IDirect3DPixelShader implementation structure
|
---|
589 | */
|
---|
590 | typedef struct IDirect3DQuery9Impl {
|
---|
591 | /* IUnknown fields */
|
---|
592 | const IDirect3DQuery9Vtbl *lpVtbl;
|
---|
593 | LONG ref;
|
---|
594 |
|
---|
595 | /* IDirect3DQuery9 fields */
|
---|
596 | IWineD3DQuery *wineD3DQuery;
|
---|
597 |
|
---|
598 | /* Parent reference */
|
---|
599 | LPDIRECT3DDEVICE9EX parentDevice;
|
---|
600 | } IDirect3DQuery9Impl;
|
---|
601 |
|
---|
602 | HRESULT query_init(IDirect3DQuery9Impl *query, IDirect3DDevice9Impl *device,
|
---|
603 | D3DQUERYTYPE type) DECLSPEC_HIDDEN;
|
---|
604 |
|
---|
605 | #endif /* __WINE_D3D9_PRIVATE_H */
|
---|