d3d8: Handle volume refcount forwarding in d3d8.
[wine] / dlls / d3d8 / d3d8_private.h
1 /*
2  * Direct3D 8 private include file
3  *
4  * Copyright 2002-2004 Jason Edmeades
5  * Copyright 2003-2004 Raphael Junqueira
6  * Copyright 2004 Christian Costa
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 #ifndef __WINE_D3D8_PRIVATE_H
24 #define __WINE_D3D8_PRIVATE_H
25
26 #include <stdarg.h>
27
28 #define NONAMELESSUNION
29 #define NONAMELESSSTRUCT
30 #define COBJMACROS
31 #include "windef.h"
32 #include "winbase.h"
33 #include "wingdi.h"
34 #include "wine/debug.h"
35 #include "d3d8.h"
36 #include "ddraw.h"
37 #include "wine/wined3d_interface.h"
38
39 /* Device caps */
40 #define INITIAL_SHADER_HANDLE_TABLE_SIZE        64
41
42 /* CreateVertexShader can return > 0xFFFF */
43 #define VS_HIGHESTFIXEDFXF 0xF0000000
44
45 /* ===========================================================================
46     Macros
47    =========================================================================== */
48 /* Not nice, but it lets wined3d support different versions of directx */
49 #define D3D8CAPSTOWINECAPS(_pD3D8Caps, _pWineCaps) \
50     _pWineCaps->DeviceType                        = (WINED3DDEVTYPE *) &_pD3D8Caps->DeviceType; \
51     _pWineCaps->AdapterOrdinal                    = &_pD3D8Caps->AdapterOrdinal; \
52     _pWineCaps->Caps                              = &_pD3D8Caps->Caps; \
53     _pWineCaps->Caps2                             = &_pD3D8Caps->Caps2; \
54     _pWineCaps->Caps3                             = &_pD3D8Caps->Caps3; \
55     _pWineCaps->PresentationIntervals             = &_pD3D8Caps->PresentationIntervals; \
56     _pWineCaps->CursorCaps                        = &_pD3D8Caps->CursorCaps; \
57     _pWineCaps->DevCaps                           = &_pD3D8Caps->DevCaps; \
58     _pWineCaps->PrimitiveMiscCaps                 = &_pD3D8Caps->PrimitiveMiscCaps; \
59     _pWineCaps->RasterCaps                        = &_pD3D8Caps->RasterCaps; \
60     _pWineCaps->ZCmpCaps                          = &_pD3D8Caps->ZCmpCaps; \
61     _pWineCaps->SrcBlendCaps                      = &_pD3D8Caps->SrcBlendCaps; \
62     _pWineCaps->DestBlendCaps                     = &_pD3D8Caps->DestBlendCaps; \
63     _pWineCaps->AlphaCmpCaps                      = &_pD3D8Caps->AlphaCmpCaps; \
64     _pWineCaps->ShadeCaps                         = &_pD3D8Caps->ShadeCaps; \
65     _pWineCaps->TextureCaps                       = &_pD3D8Caps->TextureCaps; \
66     _pWineCaps->TextureFilterCaps                 = &_pD3D8Caps->TextureFilterCaps; \
67     _pWineCaps->CubeTextureFilterCaps             = &_pD3D8Caps->CubeTextureFilterCaps; \
68     _pWineCaps->VolumeTextureFilterCaps           = &_pD3D8Caps->VolumeTextureFilterCaps; \
69     _pWineCaps->TextureAddressCaps                = &_pD3D8Caps->TextureAddressCaps; \
70     _pWineCaps->VolumeTextureAddressCaps          = &_pD3D8Caps->VolumeTextureAddressCaps; \
71     _pWineCaps->LineCaps                          = &_pD3D8Caps->LineCaps; \
72     _pWineCaps->MaxTextureWidth                   = &_pD3D8Caps->MaxTextureWidth; \
73     _pWineCaps->MaxTextureHeight                  = &_pD3D8Caps->MaxTextureHeight; \
74     _pWineCaps->MaxVolumeExtent                   = &_pD3D8Caps->MaxVolumeExtent; \
75     _pWineCaps->MaxTextureRepeat                  = &_pD3D8Caps->MaxTextureRepeat; \
76     _pWineCaps->MaxTextureAspectRatio             = &_pD3D8Caps->MaxTextureAspectRatio; \
77     _pWineCaps->MaxAnisotropy                     = &_pD3D8Caps->MaxAnisotropy; \
78     _pWineCaps->MaxVertexW                        = &_pD3D8Caps->MaxVertexW; \
79     _pWineCaps->GuardBandLeft                     = &_pD3D8Caps->GuardBandLeft; \
80     _pWineCaps->GuardBandTop                      = &_pD3D8Caps->GuardBandTop; \
81     _pWineCaps->GuardBandRight                    = &_pD3D8Caps->GuardBandRight; \
82     _pWineCaps->GuardBandBottom                   = &_pD3D8Caps->GuardBandBottom; \
83     _pWineCaps->ExtentsAdjust                     = &_pD3D8Caps->ExtentsAdjust; \
84     _pWineCaps->StencilCaps                       = &_pD3D8Caps->StencilCaps; \
85     _pWineCaps->FVFCaps                           = &_pD3D8Caps->FVFCaps; \
86     _pWineCaps->TextureOpCaps                     = &_pD3D8Caps->TextureOpCaps; \
87     _pWineCaps->MaxTextureBlendStages             = &_pD3D8Caps->MaxTextureBlendStages; \
88     _pWineCaps->MaxSimultaneousTextures           = &_pD3D8Caps->MaxSimultaneousTextures; \
89     _pWineCaps->VertexProcessingCaps              = &_pD3D8Caps->VertexProcessingCaps; \
90     _pWineCaps->MaxActiveLights                   = &_pD3D8Caps->MaxActiveLights; \
91     _pWineCaps->MaxUserClipPlanes                 = &_pD3D8Caps->MaxUserClipPlanes; \
92     _pWineCaps->MaxVertexBlendMatrices            = &_pD3D8Caps->MaxVertexBlendMatrices; \
93     _pWineCaps->MaxVertexBlendMatrixIndex         = &_pD3D8Caps->MaxVertexBlendMatrixIndex; \
94     _pWineCaps->MaxPointSize                      = &_pD3D8Caps->MaxPointSize; \
95     _pWineCaps->MaxPrimitiveCount                 = &_pD3D8Caps->MaxPrimitiveCount; \
96     _pWineCaps->MaxVertexIndex                    = &_pD3D8Caps->MaxVertexIndex; \
97     _pWineCaps->MaxStreams                        = &_pD3D8Caps->MaxStreams; \
98     _pWineCaps->MaxStreamStride                   = &_pD3D8Caps->MaxStreamStride; \
99     _pWineCaps->VertexShaderVersion               = &_pD3D8Caps->VertexShaderVersion; \
100     _pWineCaps->MaxVertexShaderConst              = &_pD3D8Caps->MaxVertexShaderConst; \
101     _pWineCaps->PixelShaderVersion                = &_pD3D8Caps->PixelShaderVersion; \
102     _pWineCaps->PixelShader1xMaxValue             = &_pD3D8Caps->MaxPixelShaderValue;
103
104 /* Direct3D8 Interfaces: */
105 typedef struct IDirect3DBaseTexture8Impl IDirect3DBaseTexture8Impl;
106 typedef struct IDirect3DVolumeTexture8Impl IDirect3DVolumeTexture8Impl;
107 typedef struct IDirect3D8Impl IDirect3D8Impl;
108 typedef struct IDirect3DDevice8Impl IDirect3DDevice8Impl;
109 typedef struct IDirect3DTexture8Impl IDirect3DTexture8Impl;
110 typedef struct IDirect3DCubeTexture8Impl IDirect3DCubeTexture8Impl;
111 typedef struct IDirect3DIndexBuffer8Impl IDirect3DIndexBuffer8Impl;
112 typedef struct IDirect3DSurface8Impl IDirect3DSurface8Impl;
113 typedef struct IDirect3DSwapChain8Impl IDirect3DSwapChain8Impl;
114 typedef struct IDirect3DResource8Impl IDirect3DResource8Impl;
115 typedef struct IDirect3DVolume8Impl IDirect3DVolume8Impl;
116 typedef struct IDirect3DVertexBuffer8Impl IDirect3DVertexBuffer8Impl;
117
118 /** Private Interfaces: */
119 typedef struct IDirect3DStateBlockImpl IDirect3DStateBlockImpl;
120 typedef struct IDirect3DVertexShaderImpl IDirect3DVertexShaderImpl;
121 typedef struct IDirect3DPixelShaderImpl IDirect3DPixelShaderImpl;
122 typedef struct IDirect3DVertexShaderDeclarationImpl IDirect3DVertexShaderDeclarationImpl;
123
124 /* Advance declaration of structures to satisfy compiler */
125 typedef struct IDirect3DVertexShader8Impl IDirect3DVertexShader8Impl;
126
127 /* ===========================================================================
128     The interfactes themselves
129    =========================================================================== */
130
131 /* ---------- */
132 /* IDirect3D8 */
133 /* ---------- */
134
135 /*****************************************************************************
136  * Predeclare the interface implementation structures
137  */
138 extern const IDirect3D8Vtbl Direct3D8_Vtbl;
139
140 /*****************************************************************************
141  * IDirect3D implementation structure
142  */
143 struct IDirect3D8Impl
144 {
145     /* IUnknown fields */
146     const IDirect3D8Vtbl   *lpVtbl;
147     LONG                    ref;
148
149     /* The WineD3D device */
150     IWineD3D               *WineD3D;
151 };
152
153 /* ---------------- */
154 /* IDirect3DDevice8 */
155 /* ---------------- */
156
157 /*****************************************************************************
158  * Predeclare the interface implementation structures
159  */
160 extern const IDirect3DDevice8Vtbl Direct3DDevice8_Vtbl;
161
162 /*****************************************************************************
163  * IDirect3DDevice8 implementation structure
164  */
165
166 typedef void * shader_handle;
167
168 struct IDirect3DDevice8Impl
169 {
170     /* IUnknown fields */
171     const IDirect3DDevice8Vtbl   *lpVtbl;
172     LONG                         ref;
173 /* But what about baseVertexIndex in state blocks? hmm... it may be a better idea to pass this to wined3d */
174     IWineD3DDevice               *WineD3DDevice;
175     DWORD                         shader_handle_table_size;
176     DWORD                         allocated_shader_handles;
177     shader_handle                *shader_handles;
178     shader_handle                *free_shader_handles;
179
180 /* FIXME: Move *baseVertexIndex somewhere sensible like wined3d */
181     UINT                          baseVertexIndex;
182 };
183
184 /* ---------------- */
185 /* IDirect3DVolume8 */
186 /* ---------------- */
187
188 /*****************************************************************************
189  * IDirect3DVolume8 implementation structure
190  */
191 struct IDirect3DVolume8Impl
192 {
193     /* IUnknown fields */
194     const IDirect3DVolume8Vtbl *lpVtbl;
195     LONG                        ref;
196
197     /* IDirect3DVolume8 fields */
198     IWineD3DVolume             *wineD3DVolume;
199
200     /* If set forward refcounting to this object */
201     IUnknown                    *forwardReference;
202 };
203
204 /* ------------------- */
205 /* IDirect3DSwapChain8 */
206 /* ------------------- */
207
208 /*****************************************************************************
209  * Predeclare the interface implementation structures
210  */
211 extern const IDirect3DSwapChain8Vtbl Direct3DSwapChain8_Vtbl;
212
213 /*****************************************************************************
214  * IDirect3DSwapChain8 implementation structure
215  */
216 struct IDirect3DSwapChain8Impl
217 {
218     /* IUnknown fields */
219     const IDirect3DSwapChain8Vtbl *lpVtbl;
220     LONG                           ref;
221
222     /* IDirect3DSwapChain8 fields */
223     IWineD3DSwapChain             *wineD3DSwapChain;
224
225     /* Parent reference */
226     LPDIRECT3DDEVICE8              parentDevice;
227 };
228
229 /* ----------------- */
230 /* IDirect3DSurface8 */
231 /* ----------------- */
232
233 /*****************************************************************************
234  * Predeclare the interface implementation structures
235  */
236 extern const IDirect3DSurface8Vtbl Direct3DSurface8_Vtbl;
237
238 /*****************************************************************************
239  * IDirect3DSurface8 implementation structure
240  */
241 struct IDirect3DSurface8Impl
242 {
243     /* IUnknown fields */
244     const IDirect3DSurface8Vtbl *lpVtbl;
245     LONG                         ref;
246
247     /* IDirect3DSurface8 fields */
248     IWineD3DSurface             *wineD3DSurface;
249
250     /* Parent reference */
251     LPDIRECT3DDEVICE8                  parentDevice;
252
253     /* If set forward refcounting to this object */
254     IUnknown                    *forwardReference;
255 };
256
257 /* ------------------ */
258 /* IDirect3DResource8 */
259 /* ------------------ */
260
261 /*****************************************************************************
262  * Predeclare the interface implementation structures
263  */
264 extern const IDirect3DResource8Vtbl Direct3DResource8_Vtbl;
265
266 /*****************************************************************************
267  * IDirect3DResource8 implementation structure
268  */
269 struct IDirect3DResource8Impl
270 {
271     /* IUnknown fields */
272     const IDirect3DResource8Vtbl *lpVtbl;
273     LONG                          ref;
274
275     /* IDirect3DResource8 fields */
276     IWineD3DResource             *wineD3DResource;
277 };
278 extern HRESULT WINAPI IDirect3DResource8Impl_GetDevice(LPDIRECT3DRESOURCE8 iface, IDirect3DDevice8** ppDevice);
279
280 /* ---------------------- */
281 /* IDirect3DVertexBuffer8 */
282 /* ---------------------- */
283
284 /*****************************************************************************
285  * Predeclare the interface implementation structures
286  */
287 extern const IDirect3DVertexBuffer8Vtbl Direct3DVertexBuffer8_Vtbl;
288
289 /*****************************************************************************
290  * IDirect3DVertexBuffer8 implementation structure
291  */
292 struct IDirect3DVertexBuffer8Impl
293 {
294     /* IUnknown fields */
295     const IDirect3DVertexBuffer8Vtbl *lpVtbl;
296     LONG                              ref;
297
298     /* IDirect3DResource8 fields */
299     IWineD3DVertexBuffer             *wineD3DVertexBuffer;
300
301     /* Parent reference */
302     LPDIRECT3DDEVICE8                 parentDevice;
303 };
304
305 /* --------------------- */
306 /* IDirect3DIndexBuffer8 */
307 /* --------------------- */
308
309 /*****************************************************************************
310  * Predeclare the interface implementation structures
311  */
312 extern const IDirect3DIndexBuffer8Vtbl Direct3DIndexBuffer8_Vtbl;
313
314 /*****************************************************************************
315  * IDirect3DIndexBuffer8 implementation structure
316  */
317 struct IDirect3DIndexBuffer8Impl
318 {
319     /* IUnknown fields */
320     const IDirect3DIndexBuffer8Vtbl *lpVtbl;
321     LONG                             ref;
322
323     /* IDirect3DResource8 fields */
324     IWineD3DIndexBuffer             *wineD3DIndexBuffer;
325
326     /* Parent reference */
327     LPDIRECT3DDEVICE8                parentDevice;
328 };
329
330 /* --------------------- */
331 /* IDirect3DBaseTexture8 */
332 /* --------------------- */
333
334 /*****************************************************************************
335  * IDirect3DBaseTexture8 implementation structure
336  */
337 struct IDirect3DBaseTexture8Impl
338 {
339     /* IUnknown fields */
340     const IDirect3DBaseTexture8Vtbl *lpVtbl;
341     LONG                   ref;
342
343     /* IDirect3DResource8 fields */
344     IWineD3DBaseTexture             *wineD3DBaseTexture;
345 };
346
347 /* --------------------- */
348 /* IDirect3DCubeTexture8 */
349 /* --------------------- */
350
351 /*****************************************************************************
352  * Predeclare the interface implementation structures
353  */
354 extern const IDirect3DCubeTexture8Vtbl Direct3DCubeTexture8_Vtbl;
355
356 /*****************************************************************************
357  * IDirect3DCubeTexture8 implementation structure
358  */
359 struct IDirect3DCubeTexture8Impl
360 {
361     /* IUnknown fields */
362     const IDirect3DCubeTexture8Vtbl *lpVtbl;
363     LONG                   ref;
364
365     /* IDirect3DResource8 fields */
366     IWineD3DCubeTexture             *wineD3DCubeTexture;
367
368     /* Parent reference */
369     LPDIRECT3DDEVICE8                parentDevice;
370 };
371
372 /* ----------------- */
373 /* IDirect3DTexture8 */
374 /* ----------------- */
375
376 /*****************************************************************************
377  * Predeclare the interface implementation structures
378  */
379 extern const IDirect3DTexture8Vtbl Direct3DTexture8_Vtbl;
380
381 /*****************************************************************************
382  * IDirect3DTexture8 implementation structure
383  */
384 struct IDirect3DTexture8Impl
385 {
386     /* IUnknown fields */
387     const IDirect3DTexture8Vtbl *lpVtbl;
388     LONG                   ref;
389
390     /* IDirect3DResourc8 fields */
391     IWineD3DTexture             *wineD3DTexture;
392
393     /* Parent reference */
394     LPDIRECT3DDEVICE8            parentDevice;
395 };
396
397 /* ----------------------- */
398 /* IDirect3DVolumeTexture8 */
399 /* ----------------------- */
400
401 /*****************************************************************************
402  * Predeclare the interface implementation structures
403  */
404 extern const IDirect3DVolumeTexture8Vtbl Direct3DVolumeTexture8_Vtbl;
405
406 /*****************************************************************************
407  * IDirect3DVolumeTexture8 implementation structure
408  */
409 struct IDirect3DVolumeTexture8Impl
410 {
411     /* IUnknown fields */
412     const IDirect3DVolumeTexture8Vtbl *lpVtbl;
413     LONG                   ref;
414
415     /* IDirect3DResource8 fields */
416     IWineD3DVolumeTexture             *wineD3DVolumeTexture;
417
418     /* Parent reference */
419     LPDIRECT3DDEVICE8                  parentDevice;
420 };
421
422 /* ----------------------- */
423 /* IDirect3DStateBlockImpl */
424 /* ----------------------- */
425
426 /* TODO: Generate a valid GUIDs */
427 /* {83B073CE-6F30-11d9-C687-00046142C14F} */
428 DEFINE_GUID(IID_IDirect3DStateBlock8, 
429 0x83b073ce, 0x6f30, 0x11d9, 0xc6, 0x87, 0x0, 0x4, 0x61, 0x42, 0xc1, 0x4f);
430
431 DEFINE_GUID(IID_IDirect3DVertexShader8,
432 0xefc5557e, 0x6265, 0x4613, 0x8a, 0x94, 0x43, 0x85, 0x78, 0x89, 0xeb, 0x36);
433
434 DEFINE_GUID(IID_IDirect3DPixelShader8,
435 0x6d3bdbdc, 0x5b02, 0x4415, 0xb8, 0x52, 0xce, 0x5e, 0x8b, 0xcc, 0xb2, 0x89);
436
437
438 /*****************************************************************************
439  * IDirect3DStateBlock8 interface
440  */
441 #define INTERFACE IDirect3DStateBlock8
442 DECLARE_INTERFACE_(IDirect3DStateBlock8, IUnknown)
443 {
444     /*** IUnknown methods ***/
445     STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
446     STDMETHOD_(ULONG,AddRef)(THIS) PURE;
447     STDMETHOD_(ULONG,Release)(THIS) PURE;
448     /*** IDirect3DStateBlock9 methods ***/
449     STDMETHOD(GetDevice)(THIS_ struct IDirect3DDevice8** ppDevice) PURE;
450     STDMETHOD(Capture)(THIS) PURE;
451     STDMETHOD(Apply)(THIS) PURE;
452 };
453 #undef INTERFACE
454
455 /*** IUnknown methods ***/
456 #define IDirect3DStateBlock8_QueryInterface(p,a,b)  (p)->lpVtbl->QueryInterface(p,a,b)
457 #define IDirect3DStateBlock8_AddRef(p)              (p)->lpVtbl->AddRef(p)
458 #define IDirect3DStateBlock8_Release(p)             (p)->lpVtbl->Release(p)
459 /*** IDirect3DStateBlock9 methods ***/
460 #define IDirect3DStateBlock8_GetDevice(p,a)         (p)->lpVtbl->GetDevice(p,a)
461 #define IDirect3DStateBlock8_Capture(p)             (p)->lpVtbl->Capture(p)
462 #define IDirect3DStateBlock8_Apply(p)               (p)->lpVtbl->Apply(p)
463
464 /*****************************************************************************
465  * Predeclare the interface implementation structures
466  */
467 extern const IDirect3DStateBlock8Vtbl Direct3DStateBlock8_Vtbl;
468
469 /*****************************************************************************
470  * IDirect3DStateBlock implementation structure
471  */
472 typedef struct  IDirect3DStateBlock8Impl {
473     /* IUnknown fields */
474     const IDirect3DStateBlock8Vtbl *lpVtbl;
475     LONG                   ref;
476
477     /* IDirect3DResource8 fields */
478     IWineD3DStateBlock             *wineD3DStateBlock;
479 } IDirect3DStateBlock8Impl;
480
481 /*****************************************************************************
482  * IDirect3DVertexShader9 interface
483  */
484 #define INTERFACE IDirect3DVertexShader8
485 DECLARE_INTERFACE_(IDirect3DVertexShader8, IUnknown)
486 {
487     /*** IUnknown methods ***/
488     STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
489     STDMETHOD_(ULONG,AddRef)(THIS) PURE;
490     STDMETHOD_(ULONG,Release)(THIS) PURE;
491     /*** IDirect3DVertexShader9 methods ***/
492     STDMETHOD(GetDevice)(THIS_ struct IDirect3DDevice8** ppDevice) PURE;
493     STDMETHOD(GetFunction)(THIS_ void*, UINT* pSizeOfData) PURE;
494 };
495 #undef INTERFACE
496
497 /*** IUnknown methods ***/
498 #define IDirect3DVertexShader8_QueryInterface(p,a,b)  (p)->lpVtbl->QueryInterface(p,a,b)
499 #define IDirect3DVertexShader8_AddRef(p)              (p)->lpVtbl->AddRef(p)
500 #define IDirect3DVertexShader8_Release(p)             (p)->lpVtbl->Release(p)
501 /*** IDirect3DVertexShader8 methods ***/
502 #define IDirect3DVertexShader8_GetDevice(p,a)         (p)->lpVtbl->GetDevice(p,a)
503 #define IDirect3DVertexShader8_GetFunction(p,a,b)     (p)->lpVtbl->GetFunction(p,a,b)
504
505 /* ------------------------- */
506 /* IDirect3DVertexShader8Impl */
507 /* ------------------------- */
508
509 /*****************************************************************************
510  * IDirect3DPixelShader9 interface
511  */
512 #define INTERFACE IDirect3DPixelShader8
513 DECLARE_INTERFACE_(IDirect3DPixelShader8,IUnknown)
514 {
515     /*** IUnknown methods ***/
516     STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
517     STDMETHOD_(ULONG,AddRef)(THIS) PURE;
518     STDMETHOD_(ULONG,Release)(THIS) PURE;
519     /*** IDirect3DPixelShader8 methods ***/
520     STDMETHOD(GetDevice)(THIS_ struct IDirect3DDevice8** ppDevice) PURE;
521     STDMETHOD(GetFunction)(THIS_ void*, UINT* pSizeOfData) PURE;
522 };
523 #undef INTERFACE
524
525 /*** IUnknown methods ***/
526 #define IDirect3DPixelShader8_QueryInterface(p,a,b)  (p)->lpVtbl->QueryInterface(p,a,b)
527 #define IDirect3DPixelShader8_AddRef(p)              (p)->lpVtbl->AddRef(p)
528 #define IDirect3DPixelShader8_Release(p)             (p)->lpVtbl->Release(p)
529 /*** IDirect3DPixelShader8 methods ***/
530 #define IDirect3DPixelShader8_GetDevice(p,a)         (p)->lpVtbl->GetDevice(p,a)
531 #define IDirect3DPixelShader8_GetFunction(p,a,b)     (p)->lpVtbl->GetFunction(p,a,b)
532
533
534 /*****************************************************************************
535  * Predeclare the interface implementation structures
536  */
537 extern const IDirect3DVertexShader8Vtbl Direct3DVertexShader8_Vtbl;
538
539 /*****************************************************************************
540  * IDirect3DVertexShader implementation structure
541  */
542
543 struct IDirect3DVertexShader8Impl {
544   const IDirect3DVertexShader8Vtbl *lpVtbl;
545   LONG ref;
546
547   shader_handle                    *handle;
548   IWineD3DVertexShader             *wineD3DVertexShader;
549 };
550
551
552 /* ------------------------ */
553 /* IDirect3DPixelShaderImpl */
554 /* ------------------------ */
555
556
557 /*****************************************************************************
558  * Predeclare the interface implementation structures
559  */
560 extern const IDirect3DPixelShader8Vtbl Direct3DPixelShader8_Vtbl;
561
562 /*****************************************************************************
563  * IDirect3DPixelShader implementation structure
564  */
565 typedef struct IDirect3DPixelShader8Impl {
566     const IDirect3DPixelShader8Vtbl *lpVtbl;
567     LONG                             ref;
568
569     shader_handle                   *handle;
570     /* The device, to be replaced by an IDirect3DDeviceImpl */
571     IWineD3DPixelShader             *wineD3DPixelShader;
572 } IDirect3DPixelShader8Impl;
573
574 /**
575  * Internals functions
576  *
577  * to see how not defined it here
578  */
579
580 /* Callbacks */
581 extern HRESULT WINAPI D3D8CB_CreateSurface(IUnknown *device, IUnknown *pSuperior, UINT Width, UINT Height,
582                                          WINED3DFORMAT Format, DWORD Usage, WINED3DPOOL Pool, UINT Level,
583                                          IWineD3DSurface** ppSurface, HANDLE* pSharedHandle);
584
585 extern HRESULT WINAPI D3D8CB_CreateVolume(IUnknown  *pDevice, IUnknown *pSuperior, UINT Width, UINT Height, UINT Depth,
586                                           WINED3DFORMAT  Format, WINED3DPOOL Pool, DWORD Usage,
587                                           IWineD3DVolume **ppVolume,
588                                           HANDLE   * pSharedHandle);
589
590 extern HRESULT WINAPI D3D8CB_CreateDepthStencilSurface(IUnknown *device, IUnknown *pSuperior, UINT Width, UINT Height,
591                                          WINED3DFORMAT Format, WINED3DMULTISAMPLE_TYPE MultiSample,
592                                          DWORD MultisampleQuality, BOOL Discard,
593                                          IWineD3DSurface** ppSurface, HANDLE* pSharedHandle);
594
595 extern HRESULT WINAPI D3D8CB_CreateRenderTarget(IUnknown *device, IUnknown *pSuperior, UINT Width, UINT Height,
596                                          WINED3DFORMAT Format, WINED3DMULTISAMPLE_TYPE MultiSample,
597                                          DWORD MultisampleQuality, BOOL Lockable,
598                                          IWineD3DSurface** ppSurface, HANDLE* pSharedHandle);
599
600 extern ULONG WINAPI D3D8CB_DestroyDepthStencilSurface (IWineD3DSurface *pSurface);
601
602 extern ULONG WINAPI D3D8CB_DestroySurface(IWineD3DSurface *pSurface);
603
604 extern ULONG WINAPI D3D8CB_DestroyVolume(IWineD3DVolume *pVolume);
605
606 #endif /* __WINE_D3DX8_PRIVATE_H */