Tidy up vertex shaders and bring the current code inline with the rest
[wine/testsucceed.git] / dlls / wined3d / wined3d_private.h
blob69eeac5af8fa6504eb1c07e73923b18c1f44ea2e
1 /*
2 * Direct3D wine internal private include file
4 * Copyright 2002-2003 The wine-d3d team
5 * Copyright 2002-2003 Raphael Junqueira
6 * Copyright 2004 Jason Edmeades
7 * Copyright 2005 Oliver Stieber
9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public
11 * License as published by the Free Software Foundation; either
12 * version 2.1 of the License, or (at your option) any later version.
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Lesser General Public License for more details.
19 * You should have received a copy of the GNU Lesser General Public
20 * License along with this library; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24 #ifndef __WINE_WINED3D_PRIVATE_H
25 #define __WINE_WINED3D_PRIVATE_H
27 #include <stdarg.h>
28 #include <math.h>
29 #define NONAMELESSUNION
30 #define NONAMELESSSTRUCT
31 #define COBJMACROS
32 #include "windef.h"
33 #include "winbase.h"
34 #include "winreg.h"
35 #include "wingdi.h"
36 #include "winuser.h"
37 #include "wine/debug.h"
38 #include "wine/unicode.h"
40 #include "d3d9.h"
41 #include "d3d9types.h"
42 #include "wine/wined3d_interface.h"
43 #include "wine/wined3d_gl.h"
45 /* Device caps */
46 #define MAX_PALETTES 256
47 #define MAX_STREAMS 16
48 #define MAX_TEXTURES 8
49 #define MAX_SAMPLERS 16
50 #define MAX_ACTIVE_LIGHTS 8
51 #define MAX_CLIPPLANES D3DMAXUSERCLIPPLANES
52 #define MAX_LEVELS 256
54 /* Used for CreateStateBlock */
55 #define NUM_SAVEDPIXELSTATES_R 35
56 #define NUM_SAVEDPIXELSTATES_T 18
57 #define NUM_SAVEDPIXELSTATES_S 12
58 #define NUM_SAVEDVERTEXSTATES_R 31
59 #define NUM_SAVEDVERTEXSTATES_T 2
60 #define NUM_SAVEDVERTEXSTATES_S 1
62 extern const DWORD SavedPixelStates_R[NUM_SAVEDPIXELSTATES_R];
63 extern const DWORD SavedPixelStates_T[NUM_SAVEDPIXELSTATES_T];
64 extern const DWORD SavedPixelStates_S[NUM_SAVEDPIXELSTATES_S];
65 extern const DWORD SavedVertexStates_R[NUM_SAVEDVERTEXSTATES_R];
66 extern const DWORD SavedVertexStates_T[NUM_SAVEDVERTEXSTATES_T];
67 extern const DWORD SavedVertexStates_S[NUM_SAVEDVERTEXSTATES_S];
69 typedef enum _WINELOOKUP {
70 WINELOOKUP_WARPPARAM = 0,
71 WINELOOKUP_MAGFILTER = 1,
72 MAX_LOOKUPS = 2
73 } WINELOOKUP;
75 extern int minLookup[MAX_LOOKUPS];
76 extern int maxLookup[MAX_LOOKUPS];
77 extern DWORD *stateLookup[MAX_LOOKUPS];
79 extern DWORD minMipLookup[D3DTEXF_ANISOTROPIC + 1][D3DTEXF_LINEAR + 1];
81 #if 0
82 /* NOTE: Make sure these are in the correct numerical order. (see /include/d3d9types.h typedef enum _D3DDECLTYPE) */
83 UINT static const glTypeLookup[D3DDECLTYPE_UNUSED][5] = {
84 {D3DDECLTYPE_FLOAT1, 1, GL_FLOAT , GL_FALSE ,sizeof(float)},
85 {D3DDECLTYPE_FLOAT2, 2, GL_FLOAT , GL_FALSE ,sizeof(float)},
86 {D3DDECLTYPE_FLOAT3, 3, GL_FLOAT , GL_FALSE ,sizeof(float)},
87 {D3DDECLTYPE_FLOAT4, 4, GL_FLOAT , GL_FALSE ,sizeof(float)},
88 {D3DDECLTYPE_D3DCOLOR, 4, GL_UNSIGNED_BYTE , GL_TRUE ,sizeof(BYTE)},
89 {D3DDECLTYPE_UBYTE4, 4, GL_UNSIGNED_BYTE , GL_FALSE ,sizeof(BYTE)},
90 {D3DDECLTYPE_SHORT2, 2, GL_SHORT , GL_FALSE ,sizeof(short int)},
91 {D3DDECLTYPE_SHORT4, 4, GL_SHORT , GL_FALSE ,sizeof(short int)},
92 {D3DDECLTYPE_UBYTE4N, 4, GL_UNSIGNED_BYTE , GL_FALSE ,sizeof(BYTE)},
93 {D3DDECLTYPE_SHORT2N, 2, GL_SHORT , GL_FALSE ,sizeof(short int)},
94 {D3DDECLTYPE_SHORT4N, 4, GL_SHORT , GL_FALSE ,sizeof(short int)},
95 {D3DDECLTYPE_USHORT2N, 2, GL_UNSIGNED_SHORT , GL_FALSE ,sizeof(short int)},
96 {D3DDECLTYPE_USHORT4N, 4, GL_UNSIGNED_SHORT , GL_FALSE ,sizeof(short int)},
97 {D3DDECLTYPE_UDEC3, 3, GL_UNSIGNED_SHORT , GL_FALSE ,sizeof(short int)},
98 {D3DDECLTYPE_DEC3N, 3, GL_SHORT , GL_FALSE ,sizeof(short int)},
99 {D3DDECLTYPE_FLOAT16_2, 2, GL_FLOAT , GL_FALSE ,sizeof(short int)},
100 {D3DDECLTYPE_FLOAT16_4, 4, GL_FLOAT , GL_FALSE ,sizeof(short int)}};
102 #define WINED3D_ATR_TYPE(_attribute) glTypeLookup[sd->u.s._attribute.dwType][0]
103 #define WINED3D_ATR_SIZE(_attribute) glTypeLookup[sd->u.s._attribute.dwType][1]
104 #define WINED3D_ATR_GLTYPE(_attribute) glTypeLookup[sd->u.s._attribute.dwType][2]
105 #define WINED3D_ATR_GLSOMETHING(_attribute) glTypeLookup[sd->u.s._attribute.dwType][3]
106 #define WINED3D_ATR_TYPESIZE(_attribute) glTypeLookup[sd->u.s._attribute.dwType][4]
107 #endif
110 * Settings
112 #define VS_NONE 0
113 #define VS_HW 1
114 #define VS_SW 2
116 #define PS_NONE 0
117 #define PS_HW 1
119 #define VBO_NONE 0
120 #define VBO_HW 1
122 typedef struct wined3d_settings_s {
123 /* vertex and pixel shader modes */
124 int vs_mode;
125 int ps_mode;
126 int vbo_mode;
127 } wined3d_settings_t;
129 extern wined3d_settings_t wined3d_settings;
131 /* X11 locking */
133 extern void (*wine_tsx11_lock_ptr)(void);
134 extern void (*wine_tsx11_unlock_ptr)(void);
136 /* As GLX relies on X, this is needed */
137 extern int num_lock;
139 #if 0
140 #define ENTER_GL() ++num_lock; if (num_lock > 1) FIXME("Recursive use of GL lock to: %d\n", num_lock); wine_tsx11_lock_ptr()
141 #define LEAVE_GL() if (num_lock != 1) FIXME("Recursive use of GL lock: %d\n", num_lock); --num_lock; wine_tsx11_unlock_ptr()
142 #else
143 #define ENTER_GL() wine_tsx11_lock_ptr()
144 #define LEAVE_GL() wine_tsx11_unlock_ptr()
145 #endif
147 /*****************************************************************************
148 * Defines
151 /* GL related defines */
152 /* ------------------ */
153 #define GL_SUPPORT(ExtName) (GLINFO_LOCATION.supported[ExtName] != 0)
154 #define GL_LIMITS(ExtName) (GLINFO_LOCATION.max_##ExtName)
155 #define GL_EXTCALL(FuncName) (GLINFO_LOCATION.FuncName)
157 #define D3DCOLOR_R(dw) (((float) (((dw) >> 16) & 0xFF)) / 255.0f)
158 #define D3DCOLOR_G(dw) (((float) (((dw) >> 8) & 0xFF)) / 255.0f)
159 #define D3DCOLOR_B(dw) (((float) (((dw) >> 0) & 0xFF)) / 255.0f)
160 #define D3DCOLOR_A(dw) (((float) (((dw) >> 24) & 0xFF)) / 255.0f)
162 #define D3DCOLORTOGLFLOAT4(dw, vec) \
163 (vec)[0] = D3DCOLOR_R(dw); \
164 (vec)[1] = D3DCOLOR_G(dw); \
165 (vec)[2] = D3DCOLOR_B(dw); \
166 (vec)[3] = D3DCOLOR_A(dw);
168 /* Note: The following is purely to keep the source code as clear from #ifdefs as possible */
169 #if defined(GL_VERSION_1_3)
170 #define GLACTIVETEXTURE(textureNo) \
171 glActiveTexture(GL_TEXTURE0 + textureNo); \
172 checkGLcall("glActiveTexture");
173 #define GLCLIENTACTIVETEXTURE(textureNo) \
174 glClientActiveTexture(GL_TEXTURE0 + textureNo);
175 #define GLMULTITEXCOORD1F(a,b) \
176 glMultiTexCoord1f(GL_TEXTURE0 + a, b);
177 #define GLMULTITEXCOORD2F(a,b,c) \
178 glMultiTexCoord2f(GL_TEXTURE0 + a, b, c);
179 #define GLMULTITEXCOORD3F(a,b,c,d) \
180 glMultiTexCoord3f(GL_TEXTURE0 + a, b, c, d);
181 #define GLMULTITEXCOORD4F(a,b,c,d,e) \
182 glMultiTexCoord4f(GL_TEXTURE0 + a, b, c, d, e);
183 #define GLTEXTURECUBEMAP GL_TEXTURE_CUBE_MAP
184 #else
185 #define GLACTIVETEXTURE(textureNo) \
186 glActiveTextureARB(GL_TEXTURE0_ARB + textureNo); \
187 checkGLcall("glActiveTextureARB");
188 #define GLCLIENTACTIVETEXTURE(textureNo) \
189 glClientActiveTextureARB(GL_TEXTURE0_ARB + textureNo);
190 #define GLMULTITEXCOORD1F(a,b) \
191 glMultiTexCoord1fARB(GL_TEXTURE0_ARB + a, b);
192 #define GLMULTITEXCOORD2F(a,b,c) \
193 glMultiTexCoord2fARB(GL_TEXTURE0_ARB + a, b, c);
194 #define GLMULTITEXCOORD3F(a,b,c,d) \
195 glMultiTexCoord3fARB(GL_TEXTURE0_ARB + a, b, c, d);
196 #define GLMULTITEXCOORD4F(a,b,c,d,e) \
197 glMultiTexCoord4fARB(GL_TEXTURE0_ARB + a, b, c, d, e);
198 #define GLTEXTURECUBEMAP GL_TEXTURE_CUBE_MAP_ARB
199 #endif
201 /* DirectX Device Limits */
202 /* --------------------- */
203 #define MAX_LEVELS 256 /* Maximum number of mipmap levels. Guessed at 256 */
205 #define MAX_STREAMS 16 /* Maximum possible streams - used for fixed size arrays
206 See MaxStreams in MSDN under GetDeviceCaps */
207 /* Maximum number of constants provided to the shaders */
208 #define HIGHEST_TRANSFORMSTATE 512
209 /* Highest value in D3DTRANSFORMSTATETYPE */
210 #define MAX_CLIPPLANES D3DMAXUSERCLIPPLANES
212 #define MAX_PALETTES 256
214 /* Checking of API calls */
215 /* --------------------- */
216 #define checkGLcall(A) \
218 GLint err = glGetError(); \
219 if (err != GL_NO_ERROR) { \
220 FIXME(">>>>>>>>>>>>>>>>> %x from %s @ %s / %d\n", err, A, __FILE__, __LINE__); \
221 } else { \
222 TRACE("%s call ok %s / %d\n", A, __FILE__, __LINE__); \
226 /* Trace routines / diagnostics */
227 /* ---------------------------- */
229 /* Dump out a matrix and copy it */
230 #define conv_mat(mat,gl_mat) \
231 do { \
232 TRACE("%f %f %f %f\n", (mat)->u.s._11, (mat)->u.s._12, (mat)->u.s._13, (mat)->u.s._14); \
233 TRACE("%f %f %f %f\n", (mat)->u.s._21, (mat)->u.s._22, (mat)->u.s._23, (mat)->u.s._24); \
234 TRACE("%f %f %f %f\n", (mat)->u.s._31, (mat)->u.s._32, (mat)->u.s._33, (mat)->u.s._34); \
235 TRACE("%f %f %f %f\n", (mat)->u.s._41, (mat)->u.s._42, (mat)->u.s._43, (mat)->u.s._44); \
236 memcpy(gl_mat, (mat), 16 * sizeof(float)); \
237 } while (0)
239 /* Macro to dump out the current state of the light chain */
240 #define DUMP_LIGHT_CHAIN() \
242 PLIGHTINFOEL *el = This->stateBlock->lights;\
243 while (el) { \
244 TRACE("Light %p (glIndex %ld, d3dIndex %ld, enabled %d)\n", el, el->glIndex, el->OriginalIndex, el->lightEnabled);\
245 el = el->next; \
249 /* Trace vector and strided data information */
250 #define TRACE_VECTOR(name) TRACE( #name "=(%f, %f, %f, %f)\n", name.x, name.y, name.z, name.w);
251 #define TRACE_STRIDED(sd,name) TRACE( #name "=(data:%p, stride:%ld, type:%ld)\n", sd->u.s.name.lpData, sd->u.s.name.dwStride, sd->u.s.name.dwType);
253 /* Defines used for optimizations */
255 /* Only reapply what is necessary */
256 #define REAPPLY_ALPHAOP 0x0001
257 #define REAPPLY_ALL 0xFFFF
259 /* Advance declaration of structures to satisfy compiler */
260 typedef struct IWineD3DStateBlockImpl IWineD3DStateBlockImpl;
261 typedef struct IWineD3DSurfaceImpl IWineD3DSurfaceImpl;
263 /* Tracking */
265 /* TODO: Move some of this to the device */
266 long globalChangeGlRam(long glram);
268 /* Memory and object tracking */
270 /*Structure for holding information on all direct3d objects
271 useful for making sure tracking is ok and when release is called on a device!
272 and probably quite handy for debugging and dumping states out
274 typedef struct WineD3DGlobalStatistics {
275 int glsurfaceram; /* The aproximate amount of glTexture memory allocated for textures */
276 } WineD3DGlobalStatistics;
278 extern WineD3DGlobalStatistics* wineD3DGlobalStatistics;
280 /* Global variables */
281 extern const float identity[16];
283 /*****************************************************************************
284 * Compilable extra diagnostics
287 /* Trace information per-vertex: (extremely high amount of trace) */
288 #if 0 /* NOTE: Must be 0 in cvs */
289 # define VTRACE(A) TRACE A
290 #else
291 # define VTRACE(A)
292 #endif
294 /* Checking of per-vertex related GL calls */
295 #define vcheckGLcall(A) \
297 GLint err = glGetError(); \
298 if (err != GL_NO_ERROR) { \
299 FIXME(">>>>>>>>>>>>>>>>> %x from %s @ %s / %d\n", err, A, __FILE__, __LINE__); \
300 } else { \
301 VTRACE(("%s call ok %s / %d\n", A, __FILE__, __LINE__)); \
305 /* TODO: Confirm each of these works when wined3d move completed */
306 #if 0 /* NOTE: Must be 0 in cvs */
307 /* To avoid having to get gigabytes of trace, the following can be compiled in, and at the start
308 of each frame, a check is made for the existence of C:\D3DTRACE, and if if exists d3d trace
309 is enabled, and if it doesn't exists it is disabled. */
310 # define FRAME_DEBUGGING
311 /* Adding in the SINGLE_FRAME_DEBUGGING gives a trace of just what makes up a single frame, before
312 the file is deleted */
313 # if 1 /* NOTE: Must be 1 in cvs, as this is mostly more useful than a trace from program start */
314 # define SINGLE_FRAME_DEBUGGING
315 # endif
316 /* The following, when enabled, lets you see the makeup of the frame, by drawprimitive calls.
317 It can only be enabled when FRAME_DEBUGGING is also enabled
318 The contents of the back buffer are written into /tmp/backbuffer_* after each primitive
319 array is drawn. */
320 # if 0 /* NOTE: Must be 0 in cvs, as this give a lot of ppm files when compiled in */
321 # define SHOW_FRAME_MAKEUP 1
322 # endif
323 /* The following, when enabled, lets you see the makeup of the all the textures used during each
324 of the drawprimitive calls. It can only be enabled when SHOW_FRAME_MAKEUP is also enabled.
325 The contents of the textures assigned to each stage are written into
326 /tmp/texture_*_<Stage>.ppm after each primitive array is drawn. */
327 # if 0 /* NOTE: Must be 0 in cvs, as this give a lot of ppm files when compiled in */
328 # define SHOW_TEXTURE_MAKEUP 0
329 # endif
330 extern BOOL isOn;
331 extern BOOL isDumpingFrames;
332 extern LONG primCounter;
333 #endif
335 /*****************************************************************************
336 * Prototypes
339 /* Routine common to the draw primitive and draw indexed primitive routines */
340 void drawPrimitive(IWineD3DDevice *iface,
341 int PrimitiveType,
342 long NumPrimitives,
344 /* for Indexed: */
345 long StartVertexIndex,
346 long StartIdx,
347 short idxBytes,
348 const void *idxData,
349 int minIndex);
351 /*****************************************************************************
352 * Structures required to draw primitives
355 typedef struct Direct3DStridedData {
356 BYTE *lpData; /* Pointer to start of data */
357 DWORD dwStride; /* Stride between occurances of this data */
358 DWORD dwType; /* Type (as in D3DVSDT_TYPE) */
359 } Direct3DStridedData;
361 typedef struct Direct3DVertexStridedData {
362 union {
363 struct {
364 Direct3DStridedData position;
365 Direct3DStridedData blendWeights;
366 Direct3DStridedData blendMatrixIndices;
367 Direct3DStridedData normal;
368 Direct3DStridedData pSize;
369 Direct3DStridedData diffuse;
370 Direct3DStridedData specular;
371 Direct3DStridedData texCoords[MAX_TEXTURES];
372 Direct3DStridedData position2; /* tween data */
373 Direct3DStridedData normal2; /* tween data */
374 Direct3DStridedData tangent;
375 Direct3DStridedData binormal;
376 Direct3DStridedData tessFactor;
377 Direct3DStridedData fog;
378 Direct3DStridedData depth;
379 Direct3DStridedData sample;
380 } s;
381 Direct3DStridedData input[16]; /* Indexed by constants in D3DVSDE_REGISTER */
382 } u;
383 } Direct3DVertexStridedData;
385 /*****************************************************************************
386 * Internal representation of a light
388 typedef struct PLIGHTINFOEL PLIGHTINFOEL;
389 struct PLIGHTINFOEL {
390 WINED3DLIGHT OriginalParms; /* Note D3D8LIGHT == D3D9LIGHT */
391 DWORD OriginalIndex;
392 LONG glIndex;
393 BOOL lightEnabled;
394 BOOL changed;
395 BOOL enabledChanged;
397 /* Converted parms to speed up swapping lights */
398 float lightPosn[4];
399 float lightDirn[4];
400 float exponent;
401 float cutoff;
403 PLIGHTINFOEL *next;
404 PLIGHTINFOEL *prev;
407 /*****************************************************************************
408 * IWineD3D implementation structure
410 typedef struct IWineD3DImpl
412 /* IUnknown fields */
413 const IWineD3DVtbl *lpVtbl;
414 LONG ref; /* Note: Ref counting not required */
416 /* WineD3D Information */
417 IUnknown *parent;
418 UINT dxVersion;
420 /* GL Information */
421 BOOL isGLInfoValid;
422 WineD3D_GL_Info gl_info;
423 } IWineD3DImpl;
425 extern const IWineD3DVtbl IWineD3D_Vtbl;
427 typedef struct SwapChainList {
428 IWineD3DSwapChain *swapchain;
429 struct SwapChainList *next;
430 } SwapChainList;
432 /** Hacked out start of a context manager!! **/
433 typedef struct glContext {
434 int Width;
435 int Height;
436 int usedcount;
437 GLXContext context;
439 Drawable drawable;
440 IWineD3DSurface *pSurface;
441 #if 0 /* TODO: someway to represent the state of the context */
442 IWineD3DStateBlock *pStateBlock;
443 #endif
444 /* a few other things like format */
445 } glContext;
447 /* TODO: setup some flags in the regestry to enable, disable pbuffer support
448 (since it will break quite a few things until contexts are managed properly!) */
449 extern BOOL pbuffer_support;
450 /* allocate one pbuffer per surface */
451 extern BOOL pbuffer_per_surface;
453 /* Maximum number of contexts/pbuffers to keep in cache,
454 set to 100 because ATI's drivers don't support deleting pBuffers properly
455 this needs to be migrated to a list and some option availalbe for controle the cache size.
457 #define CONTEXT_CACHE 100
459 typedef struct ResourceList {
460 IWineD3DResource *resource;
461 struct ResourceList *next;
462 } ResourceList;
464 /*****************************************************************************
465 * IWineD3DDevice implementation structure
467 typedef struct IWineD3DDeviceImpl
469 /* IUnknown fields */
470 const IWineD3DDeviceVtbl *lpVtbl;
471 LONG ref; /* Note: Ref counting not required */
473 /* WineD3D Information */
474 IUnknown *parent;
475 IWineD3D *wineD3D;
477 /* X and GL Information */
478 GLint maxConcurrentLights;
480 /* Optimization */
481 BOOL modelview_valid;
482 BOOL proj_valid;
483 BOOL view_ident; /* true iff view matrix is identity */
484 BOOL last_was_rhw; /* true iff last draw_primitive was in xyzrhw mode */
485 GLenum tracking_parm; /* Which source is tracking current colour */
486 LONG tracking_color; /* used iff GL_COLOR_MATERIAL was enabled */
487 #define DISABLED_TRACKING 0 /* Disabled */
488 #define IS_TRACKING 1 /* tracking_parm is tracking diffuse color */
489 #define NEEDS_TRACKING 2 /* Tracking needs to be enabled when needed */
490 #define NEEDS_DISABLE 3 /* Tracking needs to be disabled when needed*/
491 UINT srcBlend;
492 UINT dstBlend;
493 UINT alphafunc;
494 UINT stencilfunc;
495 BOOL texture_shader_active; /* TODO: Confirm use is correct */
497 /* State block related */
498 BOOL isRecordingState;
499 IWineD3DStateBlockImpl *stateBlock;
500 IWineD3DStateBlockImpl *updateStateBlock;
502 /* Internal use fields */
503 D3DDEVICE_CREATION_PARAMETERS createParms;
504 UINT adapterNo;
505 D3DDEVTYPE devType;
507 SwapChainList *swapchains;
509 ResourceList *resources; /* a linked list to track resources created by the device */
511 /* Render Target Support */
512 IWineD3DSurface *depthStencilBuffer;
514 IWineD3DSurface *renderTarget;
515 IWineD3DSurface *stencilBufferTarget;
517 /* palettes texture management */
518 PALETTEENTRY palettes[MAX_PALETTES][256];
519 UINT currentPalette;
521 /* For rendering to a texture using glCopyTexImage */
522 BOOL renderUpsideDown;
524 /* Cursor management */
525 BOOL bCursorVisible;
526 UINT xHotSpot;
527 UINT yHotSpot;
528 UINT xScreenSpace;
529 UINT yScreenSpace;
531 /* Textures for when no other textures are mapped */
532 UINT dummyTextureName[MAX_TEXTURES];
534 /* Debug stream management */
535 BOOL debug;
537 /* Screen buffer resources */
538 glContext contextCache[CONTEXT_CACHE];
540 /* A flag to check if endscene has been called before changing the render tartet */
541 BOOL sceneEnded;
542 } IWineD3DDeviceImpl;
544 extern const IWineD3DDeviceVtbl IWineD3DDevice_Vtbl;
546 /* Support for IWineD3DResource ::Set/Get/FreePrivateData. I don't think
547 * anybody uses it for much so a good implementation is optional. */
548 typedef struct PrivateData
550 struct PrivateData* next;
552 GUID tag;
553 DWORD flags; /* DDSPD_* */
554 DWORD uniqueness_value;
556 union
558 LPVOID data;
559 LPUNKNOWN object;
560 } ptr;
562 DWORD size;
563 } PrivateData;
565 /*****************************************************************************
566 * IWineD3DResource implementation structure
568 typedef struct IWineD3DResourceClass
570 /* IUnknown fields */
571 LONG ref; /* Note: Ref counting not required */
573 /* WineD3DResource Information */
574 IUnknown *parent;
575 D3DRESOURCETYPE resourceType;
576 IWineD3DDeviceImpl *wineD3DDevice;
577 D3DPOOL pool;
578 UINT size;
579 DWORD usage;
580 WINED3DFORMAT format;
581 BYTE *allocatedMemory;
582 PrivateData *privateData;
584 } IWineD3DResourceClass;
586 typedef struct IWineD3DResourceImpl
588 /* IUnknown & WineD3DResource Information */
589 const IWineD3DResourceVtbl *lpVtbl;
590 IWineD3DResourceClass resource;
591 } IWineD3DResourceImpl;
594 /*****************************************************************************
595 * IWineD3DVertexBuffer implementation structure (extends IWineD3DResourceImpl)
597 typedef struct IWineD3DVertexBufferImpl
599 /* IUnknown & WineD3DResource Information */
600 const IWineD3DVertexBufferVtbl *lpVtbl;
601 IWineD3DResourceClass resource;
603 /* WineD3DVertexBuffer specifics */
604 DWORD fvf;
606 } IWineD3DVertexBufferImpl;
608 extern const IWineD3DVertexBufferVtbl IWineD3DVertexBuffer_Vtbl;
611 /*****************************************************************************
612 * IWineD3DIndexBuffer implementation structure (extends IWineD3DResourceImpl)
614 typedef struct IWineD3DIndexBufferImpl
616 /* IUnknown & WineD3DResource Information */
617 const IWineD3DIndexBufferVtbl *lpVtbl;
618 IWineD3DResourceClass resource;
620 /* WineD3DVertexBuffer specifics */
621 } IWineD3DIndexBufferImpl;
623 extern const IWineD3DIndexBufferVtbl IWineD3DIndexBuffer_Vtbl;
625 /*****************************************************************************
626 * IWineD3DBaseTexture D3D- > openGL state map lookups
628 #define WINED3DFUNC_NOTSUPPORTED -2
629 #define WINED3DFUNC_UNIMPLEMENTED -1
631 typedef enum winetexturestates {
632 WINED3DTEXSTA_ADDRESSU = 0,
633 WINED3DTEXSTA_ADDRESSV = 1,
634 WINED3DTEXSTA_ADDRESSW = 2,
635 WINED3DTEXSTA_BORDERCOLOR = 3,
636 WINED3DTEXSTA_MAGFILTER = 4,
637 WINED3DTEXSTA_MINFILTER = 5,
638 WINED3DTEXSTA_MIPFILTER = 6,
639 WINED3DTEXSTA_MAXMIPLEVEL = 7,
640 WINED3DTEXSTA_MAXANISOTROPY = 8,
641 WINED3DTEXSTA_SRGBTEXTURE = 9,
642 WINED3DTEXSTA_ELEMENTINDEX = 10,
643 WINED3DTEXSTA_DMAPOFFSET = 11,
644 WINED3DTEXSTA_TSSADDRESSW = 12,
645 MAX_WINETEXTURESTATES = 13,
646 } winetexturestates;
648 typedef struct Wined3dTextureStateMap {
649 CONST int state;
650 int function;
651 } Wined3dTextureStateMap;
653 /*****************************************************************************
654 * IWineD3DBaseTexture implementation structure (extends IWineD3DResourceImpl)
656 typedef struct IWineD3DBaseTextureClass
658 UINT levels;
659 BOOL dirty;
660 D3DFORMAT format;
661 DWORD usage;
662 UINT textureName;
663 UINT LOD;
664 D3DTEXTUREFILTERTYPE filterType;
665 DWORD states[MAX_WINETEXTURESTATES];
667 } IWineD3DBaseTextureClass;
669 typedef struct IWineD3DBaseTextureImpl
671 /* IUnknown & WineD3DResource Information */
672 const IWineD3DBaseTextureVtbl *lpVtbl;
673 IWineD3DResourceClass resource;
674 IWineD3DBaseTextureClass baseTexture;
676 } IWineD3DBaseTextureImpl;
678 /*****************************************************************************
679 * IWineD3DTexture implementation structure (extends IWineD3DBaseTextureImpl)
681 typedef struct IWineD3DTextureImpl
683 /* IUnknown & WineD3DResource/WineD3DBaseTexture Information */
684 const IWineD3DTextureVtbl *lpVtbl;
685 IWineD3DResourceClass resource;
686 IWineD3DBaseTextureClass baseTexture;
688 /* IWineD3DTexture */
689 IWineD3DSurface *surfaces[MAX_LEVELS];
691 UINT width;
692 UINT height;
693 float pow2scalingFactorX;
694 float pow2scalingFactorY;
696 } IWineD3DTextureImpl;
698 extern const IWineD3DTextureVtbl IWineD3DTexture_Vtbl;
700 /*****************************************************************************
701 * IWineD3DCubeTexture implementation structure (extends IWineD3DBaseTextureImpl)
703 typedef struct IWineD3DCubeTextureImpl
705 /* IUnknown & WineD3DResource/WineD3DBaseTexture Information */
706 const IWineD3DCubeTextureVtbl *lpVtbl;
707 IWineD3DResourceClass resource;
708 IWineD3DBaseTextureClass baseTexture;
710 /* IWineD3DCubeTexture */
711 IWineD3DSurface *surfaces[6][MAX_LEVELS];
713 UINT edgeLength;
714 float pow2scalingFactor;
716 } IWineD3DCubeTextureImpl;
718 extern const IWineD3DCubeTextureVtbl IWineD3DCubeTexture_Vtbl;
720 /*****************************************************************************
721 * IWineD3DVolume implementation structure (extends IUnknown)
723 typedef struct IWineD3DVolumeImpl
725 /* IUnknown & WineD3DResource fields */
726 const IWineD3DVolumeVtbl *lpVtbl;
727 IWineD3DResourceClass resource;
729 /* WineD3DVolume Information */
730 D3DVOLUME_DESC currentDesc;
731 IUnknown *container;
732 UINT bytesPerPixel;
734 BOOL lockable;
735 BOOL locked;
736 D3DBOX lockedBox;
737 D3DBOX dirtyBox;
738 BOOL dirty;
741 } IWineD3DVolumeImpl;
743 extern const IWineD3DVolumeVtbl IWineD3DVolume_Vtbl;
745 /*****************************************************************************
746 * IWineD3DVolumeTexture implementation structure (extends IWineD3DBaseTextureImpl)
748 typedef struct IWineD3DVolumeTextureImpl
750 /* IUnknown & WineD3DResource/WineD3DBaseTexture Information */
751 const IWineD3DVolumeTextureVtbl *lpVtbl;
752 IWineD3DResourceClass resource;
753 IWineD3DBaseTextureClass baseTexture;
755 /* IWineD3DVolumeTexture */
756 IWineD3DVolume *volumes[MAX_LEVELS];
758 UINT width;
759 UINT height;
760 UINT depth;
761 } IWineD3DVolumeTextureImpl;
763 extern const IWineD3DVolumeTextureVtbl IWineD3DVolumeTexture_Vtbl;
765 typedef struct _WINED3DSURFACET_DESC
767 D3DMULTISAMPLE_TYPE MultiSampleType;
768 DWORD MultiSampleQuality;
769 UINT Width;
770 UINT Height;
771 } WINED3DSURFACET_DESC;
773 /*****************************************************************************
774 * IWineD3DSurface implementation structure
776 struct IWineD3DSurfaceImpl
778 /* IUnknown & IWineD3DResource Information */
779 const IWineD3DSurfaceVtbl *lpVtbl;
780 IWineD3DResourceClass resource;
782 /* IWineD3DSurface fields */
783 IUnknown *container;
784 WINED3DSURFACET_DESC currentDesc;
786 UINT textureName;
787 UINT bytesPerPixel;
789 /* TODO: move this off into a management class(maybe!) */
790 BOOL nonpow2;
792 UINT pow2Width;
793 UINT pow2Height;
794 UINT pow2Size;
796 #if 0
797 /* precalculated x and y scalings for texture coords */
798 float pow2scalingFactorX; /* = (Width / pow2Width ) */
799 float pow2scalingFactorY; /* = (Height / pow2Height) */
800 #endif
802 BOOL lockable;
803 BOOL discard;
804 BOOL locked;
805 BOOL activeLock;
807 RECT lockedRect;
808 RECT dirtyRect;
809 BOOL Dirty;
811 BOOL inTexture;
812 BOOL inPBuffer;
814 glDescriptor glDescription;
817 extern const IWineD3DSurfaceVtbl IWineD3DSurface_Vtbl;
819 /*****************************************************************************
820 * IWineD3DVertexDeclaration implementation structure
822 typedef struct IWineD3DVertexDeclarationImpl {
823 /* IUnknown Information */
824 const IWineD3DVertexDeclarationVtbl *lpVtbl;
825 LONG ref; /* Note: Ref counting not required */
827 IUnknown *parent;
828 /** precomputed fvf if simple declaration */
829 IWineD3DDeviceImpl *wineD3DDevice;
830 DWORD fvf[MAX_STREAMS];
831 DWORD allFVF;
833 /** dx8 compatible Declaration fields */
834 DWORD* pDeclaration8;
835 DWORD declaration8Length;
837 /** dx9+ */
838 D3DVERTEXELEMENT9* pDeclaration9;
839 UINT declaration9NumElements;
840 } IWineD3DVertexDeclarationImpl;
842 extern const IWineD3DVertexDeclarationVtbl IWineD3DVertexDeclaration_Vtbl;
844 /*****************************************************************************
845 * IWineD3DStateBlock implementation structure
848 /* Internal state Block for Begin/End/Capture/Create/Apply info */
849 /* Note: Very long winded but gl Lists are not flexible enough */
850 /* to resolve everything we need, so doing it manually for now */
851 typedef struct SAVEDSTATES {
852 BOOL indices;
853 BOOL material;
854 BOOL fvf;
855 BOOL streamSource[MAX_STREAMS];
856 BOOL streamFreq[MAX_STREAMS];
857 BOOL textures[MAX_TEXTURES];
858 BOOL transform[HIGHEST_TRANSFORMSTATE + 1];
859 BOOL viewport;
860 BOOL renderState[WINEHIGHEST_RENDER_STATE + 1];
861 #if 0
862 BOOL textureState[MAX_TEXTURES][WINED3D_HIGHEST_TEXTURE_STATE + 1];
863 BOOL samplerState[MAX_SAMPLERS][WINED3D_HIGHEST_SAMPLER_STATE + 1];
864 #endif
865 BOOL clipplane[MAX_CLIPPLANES];
866 BOOL vertexDecl;
867 BOOL pixelShader;
868 BOOL vertexShader;
869 } SAVEDSTATES;
871 struct IWineD3DStateBlockImpl
873 /* IUnknown fields */
874 const IWineD3DStateBlockVtbl *lpVtbl;
875 LONG ref; /* Note: Ref counting not required */
877 /* IWineD3DStateBlock information */
878 IUnknown *parent;
879 IWineD3DDeviceImpl *wineD3DDevice;
880 WINED3DSTATEBLOCKTYPE blockType;
882 /* Array indicating whether things have been set or changed */
883 SAVEDSTATES changed;
884 SAVEDSTATES set;
886 /* Drawing - Vertex Shader or FVF related */
887 DWORD fvf;
888 /* Vertex Shader Declaration */
889 IWineD3DVertexDeclaration* vertexDecl;
891 void *vertexShader; /* @TODO: Replace void * with IWineD3DVertexShader * */
893 BOOL softwareVertexProcessing;
895 /* Stream Source */
896 BOOL streamIsUP;
897 UINT streamStride[MAX_STREAMS];
898 UINT streamOffset[MAX_STREAMS];
899 IWineD3DVertexBuffer *streamSource[MAX_STREAMS];
900 UINT streamFreq[MAX_STREAMS];
901 UINT streamFlags[MAX_STREAMS]; /*0 | D3DSTREAMSOURCE_INSTANCEDATA | D3DSTREAMSOURCE_INDEXEDDATA */
903 /* Indices */
904 IWineD3DIndexBuffer* pIndexData;
905 UINT baseVertexIndex; /* Note: only used for d3d8 */
907 /* Transform */
908 D3DMATRIX transforms[HIGHEST_TRANSFORMSTATE + 1];
910 /* Lights */
911 PLIGHTINFOEL *lights; /* NOTE: active GL lights must be front of the chain */
913 /* Clipping */
914 double clipplane[MAX_CLIPPLANES][4];
915 WINED3DCLIPSTATUS clip_status;
917 /* ViewPort */
918 WINED3DVIEWPORT viewport;
920 /* Material */
921 WINED3DMATERIAL material;
923 /* Pixel Shader */
924 void *pixelShader; /* TODO: Replace void * with IWineD3DPixelShader * */
926 /* Indexed Vertex Blending */
927 D3DVERTEXBLENDFLAGS vertex_blend;
928 FLOAT tween_factor;
930 /* RenderState */
931 DWORD renderState[WINEHIGHEST_RENDER_STATE + 1];
933 /* Texture */
934 IWineD3DBaseTexture *textures[MAX_TEXTURES];
935 int textureDimensions[MAX_SAMPLERS];
937 /* Texture State Stage */
938 DWORD textureState[MAX_TEXTURES][WINED3D_HIGHEST_TEXTURE_STATE + 1];
939 /* Sampler States */
940 DWORD samplerState[MAX_SAMPLERS][WINED3D_HIGHEST_SAMPLER_STATE + 1];
944 extern const IWineD3DStateBlockVtbl IWineD3DStateBlock_Vtbl;
946 /*****************************************************************************
947 * IWineD3DQueryImpl implementation structure (extends IUnknown)
949 typedef struct IWineD3DQueryImpl
951 const IWineD3DQueryVtbl *lpVtbl;
952 LONG ref; /* Note: Ref counting not required */
954 IUnknown *parent;
955 /*TODO: replace with iface usage */
956 #if 0
957 IWineD3DDevice *wineD3DDevice;
958 #else
959 IWineD3DDeviceImpl *wineD3DDevice;
960 #endif
961 /* IWineD3DQuery fields */
963 D3DQUERYTYPE type;
964 void *extendedData;
967 } IWineD3DQueryImpl;
969 extern const IWineD3DQueryVtbl IWineD3DQuery_Vtbl;
971 /*****************************************************************************
972 * IWineD3DSwapChainImpl implementation structure (extends IUnknown)
975 typedef struct IWineD3DSwapChainImpl
977 /*IUnknown part*/
978 IWineD3DSwapChainVtbl *lpVtbl;
979 LONG ref; /* Note: Ref counting not required */
981 IUnknown *parent;
982 IWineD3DDeviceImpl *wineD3DDevice;
984 /* IWineD3DSwapChain fields */
985 IWineD3DSurface *backBuffer;
986 IWineD3DSurface *frontBuffer;
987 BOOL wantsDepthStencilBuffer;
988 D3DPRESENT_PARAMETERS presentParms;
990 /* TODO: move everything upto drawable off into a context manager
991 and store the 'data' in the contextManagerData interface.
992 IUnknown *contextManagerData;
995 HWND win_handle;
996 Window win;
997 Display *display;
999 GLXContext glCtx;
1000 XVisualInfo *visInfo;
1001 GLXContext render_ctx;
1002 /* This has been left in device for now, but needs moving off into a rendertarget management class and separated out from swapchains and devices. */
1003 Drawable drawable;
1004 } IWineD3DSwapChainImpl;
1006 extern IWineD3DSwapChainVtbl IWineD3DSwapChain_Vtbl;
1008 /*****************************************************************************
1009 * Utility function prototypes
1012 /* Trace routines */
1013 const char* debug_d3dformat(WINED3DFORMAT fmt);
1014 const char* debug_d3ddevicetype(D3DDEVTYPE devtype);
1015 const char* debug_d3dresourcetype(D3DRESOURCETYPE res);
1016 const char* debug_d3dusage(DWORD usage);
1017 const char* debug_d3dprimitivetype(D3DPRIMITIVETYPE PrimitiveType);
1018 const char* debug_d3drenderstate(DWORD state);
1019 const char* debug_d3dtexturestate(DWORD state);
1020 const char* debug_d3dpool(D3DPOOL pool);
1022 /* Routines for GL <-> D3D values */
1023 GLenum StencilOp(DWORD op);
1024 void set_tex_op(IWineD3DDevice *iface, BOOL isAlpha, int Stage, D3DTEXTUREOP op, DWORD arg1, DWORD arg2, DWORD arg3);
1025 void set_texture_matrix(const float *smat, DWORD flags, BOOL calculatedCoords);
1026 void GetSrcAndOpFromValue(DWORD iValue, BOOL isAlphaArg, GLenum* source, GLenum* operand);
1028 SHORT D3DFmtGetBpp(IWineD3DDeviceImpl* This, D3DFORMAT fmt);
1029 GLenum D3DFmt2GLFmt(IWineD3DDeviceImpl* This, D3DFORMAT fmt);
1030 GLenum D3DFmt2GLType(IWineD3DDeviceImpl *This, D3DFORMAT fmt);
1031 GLint D3DFmt2GLIntFmt(IWineD3DDeviceImpl* This, D3DFORMAT fmt);
1033 int D3DFmtMakeGlCfg(D3DFORMAT BackBufferFormat, D3DFORMAT StencilBufferFormat, int *attribs, int* nAttribs, BOOL alternate);
1036 /*****************************************************************************
1037 * To enable calling of inherited functions, requires prototypes
1039 * Note: Only require classes which are subclassed, ie resource, basetexture,
1041 /*** IUnknown methods ***/
1042 extern HRESULT WINAPI IWineD3DResourceImpl_QueryInterface(IWineD3DResource *iface, REFIID riid, void** ppvObject);
1043 extern ULONG WINAPI IWineD3DResourceImpl_AddRef(IWineD3DResource *iface);
1044 extern ULONG WINAPI IWineD3DResourceImpl_Release(IWineD3DResource *iface);
1045 /*** IWineD3DResource methods ***/
1046 extern HRESULT WINAPI IWineD3DResourceImpl_GetParent(IWineD3DResource *iface, IUnknown **pParent);
1047 extern HRESULT WINAPI IWineD3DResourceImpl_GetDevice(IWineD3DResource *iface, IWineD3DDevice ** ppDevice);
1048 extern HRESULT WINAPI IWineD3DResourceImpl_SetPrivateData(IWineD3DResource *iface, REFGUID refguid, CONST void * pData, DWORD SizeOfData, DWORD Flags);
1049 extern HRESULT WINAPI IWineD3DResourceImpl_GetPrivateData(IWineD3DResource *iface, REFGUID refguid, void * pData, DWORD * pSizeOfData);
1050 extern HRESULT WINAPI IWineD3DResourceImpl_FreePrivateData(IWineD3DResource *iface, REFGUID refguid);
1051 extern DWORD WINAPI IWineD3DResourceImpl_SetPriority(IWineD3DResource *iface, DWORD PriorityNew);
1052 extern DWORD WINAPI IWineD3DResourceImpl_GetPriority(IWineD3DResource *iface);
1053 extern void WINAPI IWineD3DResourceImpl_PreLoad(IWineD3DResource *iface);
1054 extern D3DRESOURCETYPE WINAPI IWineD3DResourceImpl_GetType(IWineD3DResource *iface);
1055 /*** class static members ***/
1056 void IWineD3DResourceImpl_CleanUp(IWineD3DResource *iface);
1058 /*** IUnknown methods ***/
1059 extern HRESULT WINAPI IWineD3DBaseTextureImpl_QueryInterface(IWineD3DBaseTexture *iface, REFIID riid, void** ppvObject);
1060 extern ULONG WINAPI IWineD3DBaseTextureImpl_AddRef(IWineD3DBaseTexture *iface);
1061 extern ULONG WINAPI IWineD3DBaseTextureImpl_Release(IWineD3DBaseTexture *iface);
1062 /*** IWineD3DResource methods ***/
1063 extern HRESULT WINAPI IWineD3DBaseTextureImpl_GetParent(IWineD3DBaseTexture *iface, IUnknown **pParent);
1064 extern HRESULT WINAPI IWineD3DBaseTextureImpl_GetDevice(IWineD3DBaseTexture *iface, IWineD3DDevice ** ppDevice);
1065 extern HRESULT WINAPI IWineD3DBaseTextureImpl_SetPrivateData(IWineD3DBaseTexture *iface, REFGUID refguid, CONST void * pData, DWORD SizeOfData, DWORD Flags);
1066 extern HRESULT WINAPI IWineD3DBaseTextureImpl_GetPrivateData(IWineD3DBaseTexture *iface, REFGUID refguid, void * pData, DWORD * pSizeOfData);
1067 extern HRESULT WINAPI IWineD3DBaseTextureImpl_FreePrivateData(IWineD3DBaseTexture *iface, REFGUID refguid);
1068 extern DWORD WINAPI IWineD3DBaseTextureImpl_SetPriority(IWineD3DBaseTexture *iface, DWORD PriorityNew);
1069 extern DWORD WINAPI IWineD3DBaseTextureImpl_GetPriority(IWineD3DBaseTexture *iface);
1070 extern void WINAPI IWineD3DBaseTextureImpl_PreLoad(IWineD3DBaseTexture *iface);
1071 extern D3DRESOURCETYPE WINAPI IWineD3DBaseTextureImpl_GetType(IWineD3DBaseTexture *iface);
1072 /*** IWineD3DBaseTexture methods ***/
1073 extern DWORD WINAPI IWineD3DBaseTextureImpl_SetLOD(IWineD3DBaseTexture *iface, DWORD LODNew);
1074 extern DWORD WINAPI IWineD3DBaseTextureImpl_GetLOD(IWineD3DBaseTexture *iface);
1075 extern DWORD WINAPI IWineD3DBaseTextureImpl_GetLevelCount(IWineD3DBaseTexture *iface);
1076 extern HRESULT WINAPI IWineD3DBaseTextureImpl_SetAutoGenFilterType(IWineD3DBaseTexture *iface, D3DTEXTUREFILTERTYPE FilterType);
1077 extern D3DTEXTUREFILTERTYPE WINAPI IWineD3DBaseTextureImpl_GetAutoGenFilterType(IWineD3DBaseTexture *iface);
1078 extern void WINAPI IWineD3DBaseTextureImpl_GenerateMipSubLevels(IWineD3DBaseTexture *iface);
1079 extern BOOL WINAPI IWineD3DBaseTextureImpl_SetDirty(IWineD3DBaseTexture *iface, BOOL);
1080 extern BOOL WINAPI IWineD3DBaseTextureImpl_GetDirty(IWineD3DBaseTexture *iface);
1082 extern BYTE* WINAPI IWineD3DVertexBufferImpl_GetMemory(IWineD3DVertexBuffer* iface, DWORD iOffset);
1083 extern HRESULT WINAPI IWineD3DVertexBufferImpl_ReleaseMemory(IWineD3DVertexBuffer* iface);
1084 extern HRESULT WINAPI IWineD3DBaseTextureImpl_BindTexture(IWineD3DBaseTexture *iface);
1085 extern HRESULT WINAPI IWineD3DBaseTextureImpl_UnBindTexture(IWineD3DBaseTexture *iface);
1086 extern void WINAPI IWineD3DBaseTextureImpl_ApplyStateChanges(IWineD3DBaseTexture *iface, const DWORD textureStates[WINED3D_HIGHEST_TEXTURE_STATE + 1], const DWORD samplerStates[WINED3D_HIGHEST_SAMPLER_STATE + 1]);
1087 /*** class static members ***/
1088 void IWineD3DBaseTextureImpl_CleanUp(IWineD3DBaseTexture *iface);
1090 /*****************************************************************************
1091 * IDirect3DVertexShader implementation structure
1093 typedef struct IWineD3DVertexShaderImpl {
1094 /* IUnknown parts*/
1095 const IWineD3DVertexShaderVtbl *lpVtbl;
1096 LONG ref; /* Note: Ref counting not required */
1098 IUnknown *parent;
1099 IWineD3DDeviceImpl *wineD3DDevice;
1101 /* IWineD3DVertexShaderImpl*/
1102 CONST DWORD *function;
1103 UINT functionLength;
1105 DWORD usage;
1106 DWORD version;
1107 /* run time datas... */
1108 VSHADERDATA* data;
1109 #if 0 /* needs reworking */
1110 DWORD usage;
1111 DWORD version;
1112 /* run time datas */
1113 VSHADERDATA* data;
1114 VSHADERINPUTDATA input;
1115 VSHADEROUTPUTDATA output;
1116 #endif
1117 } IWineD3DVertexShaderImpl;
1118 extern const IWineD3DVertexShaderVtbl IWineD3DVertexShader_Vtbl;
1120 /*****************************************************************************
1121 * IDirect3DPixelShader implementation structure
1123 typedef struct IWineD3DPixelShaderImpl {
1124 /* IUnknown parts*/
1125 const IWineD3DPixelShaderVtbl *lpVtbl;
1126 LONG ref; /* Note: Ref counting not required */
1128 IUnknown *parent;
1129 IWineD3DDeviceImpl *wineD3DDevice;
1132 /* IWineD3DPixelShaderImpl */
1133 CONST DWORD *function;
1134 UINT functionLength;
1136 #if 0 /* needs reworking */
1137 /* run time datas */
1138 PSHADERDATA* data;
1139 PSHADERINPUTDATA input;
1140 PSHADEROUTPUTDATA output;
1141 #endif
1142 } IWineD3DPixelShaderImpl;
1144 extern const IWineD3DPixelShaderVtbl IWineD3DPixelShader_Vtbl;
1145 #endif