From dcddfbc14004c7cd94a003b311650e7ce9f89210 Mon Sep 17 00:00:00 2001 From: Raphael Junqueira Date: Fri, 27 Jun 2003 22:20:44 +0000 Subject: [PATCH] - currently always use sloaw path as fast path have some problems - fix APIENTRY mismatched value used by gl func pointers (in d3dcore_gl.h) --- dlls/d3d8/d3d8_main.c | 1 + dlls/d3d8/d3d8_private.h | 36 ++++++++------------------------ dlls/d3d8/d3dcore_gl.h | 44 ++++++++++++++++++++++++++++++++-------- dlls/d3d8/drawprim.c | 2 +- 4 files changed, 46 insertions(+), 37 deletions(-) diff --git a/dlls/d3d8/d3d8_main.c b/dlls/d3d8/d3d8_main.c index 6803c07020b..704cf063ffb 100644 --- a/dlls/d3d8/d3d8_main.c +++ b/dlls/d3d8/d3d8_main.c @@ -29,6 +29,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3d); +int num_lock = 0; void (*wine_tsx11_lock_ptr)(void) = NULL; void (*wine_tsx11_unlock_ptr)(void) = NULL; diff --git a/dlls/d3d8/d3d8_private.h b/dlls/d3d8/d3d8_private.h index 65bd4c810f0..d70d265b0cc 100644 --- a/dlls/d3d8/d3d8_private.h +++ b/dlls/d3d8/d3d8_private.h @@ -18,8 +18,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef __WINE_D3DX8_PRIVATE_H -#define __WINE_D3DX8_PRIVATE_H +#ifndef __WINE_D3D8_PRIVATE_H +#define __WINE_D3D8_PRIVATE_H #ifndef __WINE_CONFIG_H # error You must include config.h to use this header @@ -49,8 +49,14 @@ extern void (*wine_tsx11_lock_ptr)(void); extern void (*wine_tsx11_unlock_ptr)(void); /* As GLX relies on X, this is needed */ +extern int num_lock; +#if 0 +#define ENTER_GL() ++num_lock; TRACE("inc lock to: %d\n", num_lock); wine_tsx11_lock_ptr() +#define LEAVE_GL() if (num_lock > 2) TRACE("fucking locks: %d\n", num_lock); --num_lock; wine_tsx11_unlock_ptr() +#else #define ENTER_GL() wine_tsx11_lock_ptr() #define LEAVE_GL() wine_tsx11_unlock_ptr() +#endif #include "d3d8.h" @@ -185,31 +191,6 @@ typedef struct PSHADEROUTPUTDATA8 { #include "d3dcore_gl.h" -#define USE_GL_FUNC(type, pfn) type pfn; -typedef struct _GL_Info { - /** - * CAPS Constants - */ - UINT max_lights; - UINT max_textures; - UINT max_clipplanes; - - GL_PSVersion ps_arb_version; - GL_PSVersion ps_nv_version; - - GL_VSVersion vs_arb_version; - GL_VSVersion vs_nv_version; - GL_VSVersion vs_ati_version; - - BOOL supported[30]; - - /** OpenGL EXT and ARB functions ptr */ - GL_EXT_FUNCS_GEN; - /** OpenGL GLX functions ptr */ - GLX_EXT_FUNCS_GEN; - /**/ -} GL_Info; -#undef USE_GL_FUNC #define GL_LIMITS(ExtName) (This->direct3d8->gl_info.max_##ExtName) #define GL_SUPPORT(ExtName) (TRUE == This->direct3d8->gl_info.supported[ExtName]) @@ -252,7 +233,6 @@ typedef struct _GL_Info { * Predeclare the interface implementation structures */ extern ICOM_VTABLE(IDirect3D8) Direct3D8_Vtbl; -extern ICOM_VTABLE(IDirect3D8) mesa_d3d8vt; /***************************************************************************** * IDirect3D implementation structure diff --git a/dlls/d3d8/d3dcore_gl.h b/dlls/d3d8/d3dcore_gl.h index 042b750dd28..22b610b62a7 100644 --- a/dlls/d3d8/d3dcore_gl.h +++ b/dlls/d3d8/d3dcore_gl.h @@ -33,8 +33,10 @@ #endif #undef XMD_H +#undef APIENTRY +#define APIENTRY -/******* +/********************************** * OpenGL Extensions (EXT and ARB) * defines and functions pointer */ @@ -143,14 +145,14 @@ typedef void (APIENTRY * PGLFNGLPOINTPARAMETERFVEXTPROC) (GLenum pname, const GL #endif -/******* +/********************************* * OpenGL GLX Extensions * defines and functions pointer */ -/******* +/********************************* * OpenGL GLX Official Version * defines and functions pointer */ @@ -176,7 +178,7 @@ typedef void (APIENTRY * PGLXFNGLXSELECTEVENTPROC) (Display *dpy, GLXDr typedef void (APIENTRY * PGLXFNGLXGETSELECTEDEVENTPROC) (Display *dpy, GLXDrawable draw, unsigned long *event_mask); -/******* +/******************************************** * OpenGL Supported Extensions (ARB and EXT) */ @@ -280,11 +282,10 @@ void drawPrimitive(LPDIRECT3DDEVICE8 iface, const void *idxData, int minIndex); -/* Structures required to draw primitives */ - - - +/***************************************** + * Structures required to draw primitives + */ typedef struct Direct3DStridedData { BYTE *lpData; /* Pointer to start of data */ @@ -308,4 +309,31 @@ typedef struct Direct3DVertexStridedData { } DUMMYUNIONNAME; } Direct3DVertexStridedData; +#define USE_GL_FUNC(type, pfn) type pfn; +typedef struct _GL_Info { + /** + * CAPS Constants + */ + UINT max_lights; + UINT max_textures; + UINT max_clipplanes; + + GL_PSVersion ps_arb_version; + GL_PSVersion ps_nv_version; + + GL_VSVersion vs_arb_version; + GL_VSVersion vs_nv_version; + GL_VSVersion vs_ati_version; + + BOOL supported[30]; + + /** OpenGL EXT and ARB functions ptr */ + GL_EXT_FUNCS_GEN; + /** OpenGL GLX functions ptr */ + GLX_EXT_FUNCS_GEN; + /**/ +} GL_Info; +#undef USE_GL_FUNC + + #endif /* __WINE_D3DCORE_GL_H */ diff --git a/dlls/d3d8/drawprim.c b/dlls/d3d8/drawprim.c index 96f26edc58f..155a276008f 100644 --- a/dlls/d3d8/drawprim.c +++ b/dlls/d3d8/drawprim.c @@ -1295,7 +1295,7 @@ void drawPrimitive(LPDIRECT3DDEVICE8 iface, drawStridedSoftwareVS(iface, &dataLocations, PrimitiveType, NumPrimitives, idxData, idxSize, minIndex, StartIdx); - } else if (/*TRUE ||*/ + } else if (TRUE || (dataLocations.u.s.pSize.lpData != NULL) || (dataLocations.u.s.diffuse.lpData != NULL) || (dataLocations.u.s.blendWeights.lpData != NULL)) {