diff -ur --exclude=CVS ./configs/default /storage/dri/Mesa/configs/default --- ./configs/default 2004-07-31 18:28:27.000000000 +1000 +++ /storage/dri/Mesa/configs/default 2004-06-10 12:32:53.000000000 +1000 @@ -45,8 +45,7 @@ # Optional assembly language optimization files for libGL ASM_SOURCES = -# GLw widget sources (Append "GLwMDrawA.c" here and add -lXm to GLW_LIB_DEPS in -# order to build the Motif widget too) +# GLw widget sources (Append "GLwMDrawA.c" to build the Motif widget too) GLW_SOURCES = GLwDrawA.c @@ -64,5 +63,5 @@ OSMESA_LIB_DEPS = -L$(LIB_DIR) -lGL GLU_LIB_DEPS = -L$(LIB_DIR) -lGL -lm GLUT_LIB_DEPS = -L$(LIB_DIR) -lGLU -lGL -lX11 -lXmu -lXt -lXi -lm -GLW_LIB_DEPS = -L$(LIB_DIR) -lGL -lXt -lX11 +GLW_LIB_DEPS = -L$(LIB_DIR) -lGL -lXt -lXm -lX11 APP_LIB_DEPS = -L$(LIB_DIR) -lglut -lGLU -lGL -lm diff -ur --exclude=CVS ./configs/linux /storage/dri/Mesa/configs/linux --- ./configs/linux 2004-07-31 18:28:27.000000000 +1000 +++ /storage/dri/Mesa/configs/linux 2004-03-27 02:16:35.000000000 +1100 @@ -18,5 +18,5 @@ OSMESA_LIB_DEPS = -L$(LIB_DIR) -lGL GLU_LIB_DEPS = -L$(LIB_DIR) -lGL -lm GLUT_LIB_DEPS = -L$(LIB_DIR) -lGLU -lGL -L/usr/X11R6/lib -lX11 -lXmu -lXt -lXi -lm -GLW_LIB_DEPS = -L$(LIB_DIR) -lGL -L/usr/X11R6/lib -lXt -lX11 +GLW_LIB_DEPS = -L$(LIB_DIR) -lGL -L/usr/X11R6/lib -lXt -lXm -lX11 APP_LIB_DEPS = -L$(LIB_DIR) -lglut -lGLU -lGL -lm diff -ur --exclude=CVS ./configs/linux-debug /storage/dri/Mesa/configs/linux-debug --- ./configs/linux-debug 2004-07-31 18:28:27.000000000 +1000 +++ /storage/dri/Mesa/configs/linux-debug 2004-03-27 02:37:26.000000000 +1100 @@ -18,5 +18,5 @@ OSMESA_LIB_DEPS = -L$(LIB_DIR) -lGL GLU_LIB_DEPS = -L$(LIB_DIR) -lGL -lm GLUT_LIB_DEPS = -L$(LIB_DIR) -lGLU -lGL -L/usr/X11R6/lib -lX11 -lXmu -lXt -lXi -lm -GLW_LIB_DEPS = -L$(LIB_DIR) -lGL -lXt -L/usr/X11R6/lib -lX11 +GLW_LIB_DEPS = -L$(LIB_DIR) -lGL -lXt -L/usr/X11R6/lib -lXm -lX11 APP_LIB_DEPS = -L$(LIB_DIR) -lglut -lGLU -lGL -lm diff -ur --exclude=CVS ./configs/linux-dri /storage/dri/Mesa/configs/linux-dri --- ./configs/linux-dri 2004-07-31 18:28:27.000000000 +1000 +++ /storage/dri/Mesa/configs/linux-dri 2004-06-15 22:19:12.000000000 +1000 @@ -21,7 +21,7 @@ GL_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lm -lpthread -lexpat -ldl GLUT_LIB_DEPS = -L$(LIB_DIR) -lGLU -lGL -L/usr/X11R6/lib -lX11 -lXmu -lXt -lXi -lm -GLW_LIB_DEPS = -L$(LIB_DIR) -lGL -L/usr/X11R6/lib -lXt -lX11 +GLW_LIB_DEPS = -L$(LIB_DIR) -lGL -L/usr/X11R6/lib -lXt -lXm -lX11 # Directories diff -ur --exclude=CVS ./configs/linux-dri-x86 /storage/dri/Mesa/configs/linux-dri-x86 --- ./configs/linux-dri-x86 2004-07-31 18:28:27.000000000 +1000 +++ /storage/dri/Mesa/configs/linux-dri-x86 2004-06-15 22:19:12.000000000 +1000 @@ -19,7 +19,7 @@ GL_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lm -lpthread -lexpat -ldl GLUT_LIB_DEPS = -L$(LIB_DIR) -lGLU -lGL -L/usr/X11R6/lib -lX11 -lXmu -lXt -lXi -lm -GLW_LIB_DEPS = -L$(LIB_DIR) -lGL -L/usr/X11R6/lib -lXt -lX11 +GLW_LIB_DEPS = -L$(LIB_DIR) -lGL -L/usr/X11R6/lib -lXt -lXm -lX11 # Directories diff -ur --exclude=CVS ./configs/linux-dri-x86-64 /storage/dri/Mesa/configs/linux-dri-x86-64 --- ./configs/linux-dri-x86-64 2004-07-31 18:28:27.000000000 +1000 +++ /storage/dri/Mesa/configs/linux-dri-x86-64 2004-06-15 22:19:12.000000000 +1000 @@ -20,7 +20,7 @@ # Library/program dependencies GL_LIB_DEPS = -L/usr/X11R6/lib64 -lX11 -lXext -lm -lpthread -lexpat -ldl GLUT_LIB_DEPS = -L$(LIB_DIR) -lGLU -lGL -L/usr/X11R6/lib64 -lX11 -lXmu -lXt -lXi -lm -GLW_LIB_DEPS = -L$(LIB_DIR) -lGL -L/usr/X11R6/lib64 -lXt -lX11 +GLW_LIB_DEPS = -L$(LIB_DIR) -lGL -L/usr/X11R6/lib64 -lXt -lXm -lX11 # Directories SRC_DIRS = mesa glu glut/glx glw diff -ur --exclude=CVS ./configs/linux-glide /storage/dri/Mesa/configs/linux-glide --- ./configs/linux-glide 2004-07-31 18:28:27.000000000 +1000 +++ /storage/dri/Mesa/configs/linux-glide 2004-04-07 16:37:51.000000000 +1000 @@ -18,5 +18,5 @@ OSMESA_LIB_DEPS = -L$(LIB_DIR) -lGL GLU_LIB_DEPS = -L$(LIB_DIR) -lGL -lm GLUT_LIB_DEPS = -L$(LIB_DIR) -lGLU -lGL -L/usr/X11R6/lib -lX11 -lXmu -lXt -lXi -lm -GLW_LIB_DEPS = -L$(LIB_DIR) -lGL -L/usr/X11R6/lib -lXt -lX11 +GLW_LIB_DEPS = -L$(LIB_DIR) -lGL -L/usr/X11R6/lib -lXt -lXm -lX11 APP_LIB_DEPS = -L$(LIB_DIR) -lglut -lGLU -lGL -L/usr/local/glide/lib -lglide3x -lm diff -ur --exclude=CVS ./configs/linux-solo /storage/dri/Mesa/configs/linux-solo --- ./configs/linux-solo 2004-07-31 18:28:27.000000000 +1000 +++ /storage/dri/Mesa/configs/linux-solo 2004-07-08 20:43:00.000000000 +1000 @@ -8,7 +8,7 @@ CC = gcc CXX = g++ -CCOMMON = -DDRI_NEW_INTERFACE_ONLY -D_POSIX_SOURCE -D_SVID_SOURCE -D_BSD_SOURCE -D_POSIX_C_SOURCE=199309L -D_GNU_SOURCE +CCOMMON = -DDRI_NEW_INTERFACE_ONLY -D_POSIX_SOURCE -D_SVID_SOURCE -D_BSD_SOURCE -D_POSIX_C_SOURCE=199309L CFLAGS = $(CCOMMON) -Wmissing-prototypes -g -std=c99 -Wundef -fPIC -ffast-math diff -ur --exclude=CVS ./configs/linux-tcc /storage/dri/Mesa/configs/linux-tcc --- ./configs/linux-tcc 2004-07-31 18:28:27.000000000 +1000 +++ /storage/dri/Mesa/configs/linux-tcc 2004-04-15 07:35:47.000000000 +1000 @@ -21,5 +21,5 @@ OSMESA_LIB_DEPS = -L$(LIB_DIR) -lGL GLU_LIB_DEPS = -L$(LIB_DIR) -lGL -lm GLUT_LIB_DEPS = -L$(LIB_DIR) -lGLU -lGL -L/usr/X11R6/lib -lX11 -lXmu -lXt -lXi -lm -GLW_LIB_DEPS = -L$(LIB_DIR) -lGL -lXt -L/usr/X11R6/lib -lX11 +GLW_LIB_DEPS = -L$(LIB_DIR) -lGL -lXt -L/usr/X11R6/lib -lXm -lX11 APP_LIB_DEPS = -L$(LIB_DIR) -lglut -lGLU -lGL -lm diff -ur --exclude=CVS ./configs/linux-x86 /storage/dri/Mesa/configs/linux-x86 --- ./configs/linux-x86 2004-07-31 18:28:27.000000000 +1000 +++ /storage/dri/Mesa/configs/linux-x86 2004-06-27 19:01:54.000000000 +1000 @@ -22,5 +22,5 @@ OSMESA_LIB_DEPS = -L$(LIB_DIR) -lGL GLU_LIB_DEPS = -L$(LIB_DIR) -lGL -lm GLUT_LIB_DEPS = -L$(LIB_DIR) -lGLU -lGL -L/usr/X11R6/lib -lX11 -lXmu -lXt -lXi -lm -GLW_LIB_DEPS = -L$(LIB_DIR) -lGL -L/usr/X11R6/lib -lXt -lX11 +GLW_LIB_DEPS = -L$(LIB_DIR) -lGL -L/usr/X11R6/lib -lXt -lXm -lX11 APP_LIB_DEPS = -L$(LIB_DIR) -lglut -lGLU -lGL -lm diff -ur --exclude=CVS ./configs/linux-x86-64 /storage/dri/Mesa/configs/linux-x86-64 --- ./configs/linux-x86-64 2004-07-31 18:28:27.000000000 +1000 +++ /storage/dri/Mesa/configs/linux-x86-64 2004-04-30 18:29:04.000000000 +1000 @@ -26,5 +26,5 @@ OSMESA_LIB_DEPS = -L$(LIB_DIR) -lGL GLU_LIB_DEPS = -L$(LIB_DIR) -lGL -lm GLUT_LIB_DEPS = -L$(LIB_DIR) -lGLU -lGL -L/usr/X11R6/lib64 -lX11 -lXmu -lXt -lXi -lm -GLW_LIB_DEPS = -L$(LIB_DIR) -lGL -L/usr/X11R6/lib64 -lXt -lX11 +GLW_LIB_DEPS = -L$(LIB_DIR) -lGL -L/usr/X11R6/lib64 -lXt -lXm -lX11 APP_LIB_DEPS = -L$(LIB_DIR) -lglut -lGLU -lGL -lm diff -ur --exclude=CVS ./configs/linux-x86-glide /storage/dri/Mesa/configs/linux-x86-glide --- ./configs/linux-x86-glide 2004-07-31 18:28:27.000000000 +1000 +++ /storage/dri/Mesa/configs/linux-x86-glide 2004-06-27 19:01:54.000000000 +1000 @@ -22,5 +22,5 @@ OSMESA_LIB_DEPS = -L$(LIB_DIR) -lGL GLU_LIB_DEPS = -L$(LIB_DIR) -lGL -lm GLUT_LIB_DEPS = -L$(LIB_DIR) -lGLU -lGL -L/usr/X11R6/lib -lX11 -lXmu -lXt -lXi -lm -GLW_LIB_DEPS = -L$(LIB_DIR) -lGL -L/usr/X11R6/lib -lXt -lX11 +GLW_LIB_DEPS = -L$(LIB_DIR) -lGL -L/usr/X11R6/lib -lXt -lXm -lX11 APP_LIB_DEPS = -L$(LIB_DIR) -lglut -lGLU -lGL -L/usr/local/glide/lib -lglide3x -lm diff -ur --exclude=CVS ./docs/README.DJ /storage/dri/Mesa/docs/README.DJ --- ./docs/README.DJ 2004-07-31 18:28:27.000000000 +1000 +++ /storage/dri/Mesa/docs/README.DJ 2004-04-07 16:37:51.000000000 +1000 @@ -255,13 +255,12 @@ + added DMesaGetProcAddress and glutGetProcAddress * reorganized fxMesa wrapper to handle multiple contexts ! fixed a horrible bug in VGA initialization routine - ! fixed partial clears Contact: ~~~~~~~~ -Name: Daniel Borca +Name: Borca Daniel E-mail: dborca@users.sourceforge.net WWW: http://www.geocities.com/dborca/ diff -ur --exclude=CVS ./include/GL/glxext.h /storage/dri/Mesa/include/GL/glxext.h --- ./include/GL/glxext.h 2004-04-24 04:42:23.000000000 +1000 +++ /storage/dri/Mesa/include/GL/glxext.h 2002-03-23 12:47:27.000000000 +1100 @@ -33,8 +33,6 @@ ** not been independently verified as being compliant with the OpenGL(R) ** version 1.2.1 Specification. */ -/* $XFree86: xc/extras/Mesa/include/GL/glxext.h,v 1.5tsi Exp $ */ -/* $XdotOrg: xc/extras/Mesa/include/GL/glxext.h,v 1.2 2004/04/23 18:42:23 eich Exp $ */ #if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__) #define WIN32_LEAN_AND_MEAN 1 @@ -262,9 +260,6 @@ #ifndef GLX_MESA_release_buffers #endif -#ifndef GLX_MESA_agp_offset -#endif - #ifndef GLX_MESA_set_3dfx_mode #define GLX_3DFX_WINDOW_MODE_MESA 0x1 #define GLX_3DFX_FULLSCREEN_MODE_MESA 0x2 @@ -317,15 +312,6 @@ } GLXBufferClobberEventSGIX; #endif -#if defined(__UNIXOS2__) || defined(__SOL64__) -typedef long int int32_t; -typedef long long int int64_t; -#endif - -#if defined(SCO) || defined(__USLC__) -#include -#endif - #ifndef GLX_VERSION_1_3 #define GLX_VERSION_1_3 1 #ifdef GLX_GLXEXT_PROTOTYPES @@ -582,24 +568,6 @@ typedef Bool ( * PFNGLXSET3DFXMODEMESAPROC) (int mode); #endif -#ifndef GLX_MESA_agp_offset -#define GLX_MESA_agp_offset 1 -#ifdef GLX_GLXEXT_PROTOTYPES -extern GLuint glXGetAGPOffsetMESA (const GLvoid *); -#endif /* GLX_GLXEXT_PROTOTYPES */ -typedef GLuint ( * PFNGLXGETAGPOFFSETMESAPROC) (const GLvoid *); -#endif - -#ifndef GLX_MESA_swap_control -#define GLX_MESA_swap_control 1 -#ifdef GLX_GLXEXT_PROTOTYPES -extern GLint glXSwapIntervalMESA(unsigned interval); -extern GLint glXGetSwapIntervalMESA( void ); -#endif /* GLX_GLXEXT_PROTOTYPES */ -typedef GLint ( * PFNGLXSWAPINTERVALMESAPROC) (unsigned interval); -typedef GLint ( * PFNGLXGETSWAPINTERVALMESAPROC) ( void ); -#endif - #ifndef GLX_SGIX_visual_select_group #define GLX_SGIX_visual_select_group 1 #endif @@ -608,6 +576,11 @@ #define GLX_OML_swap_method 1 #endif +#if defined(__STDC_VERSION__) +#if __STDC_VERSION__ >= 199901L +/* Include ISO C99 integer types for OML_sync_control; need a better test */ +#include + #ifndef GLX_OML_sync_control #define GLX_OML_sync_control 1 #ifdef GLX_GLXEXT_PROTOTYPES @@ -624,19 +597,8 @@ typedef Bool ( * PFNGLXWAITFORSBCOMLPROC) (Display *dpy, GLXDrawable drawable, int64_t target_sbc, int64_t *ust, int64_t *msc, int64_t *sbc); #endif -#ifndef GLX_MESA_swap_frame_usage -#define GLX_MESA_swap_frame_usage 1 -#ifdef GLX_GLXEXT_PROTOTYPES -extern GLint glXBeginFrameTrackingMESA(Display *dpy, GLXDrawable drawable); -extern GLint glXEndFrameTrackingMESA(Display *dpy, GLXDrawable drawable); -extern GLint glXGetFrameUsageMESA(Display *dpy, GLXDrawable drawable, GLfloat *usage); -extern GLint glXQueryFrameTrackingMESA(Display *dpy, GLXDrawable drawable, int64_t *sbc, int64_t *missedFrames, GLfloat *lastMissedUsage); -#endif /* GLX_GLXEXT_PROTOTYPES */ -typedef GLint ( * PFNGLXBEGINFRAMETRACKINGMESAPROC) (Display *dpy, GLXDrawable drawable); -typedef GLint ( * PFNGLXENDFRAMETRACKINGMESAPROC) (Display *dpy, GLXDrawable drawable); -typedef GLint ( * PFNGLXGETFRAMEUSAGEMESAPROC) (Display *dpy, GLXDrawable drawable, GLfloat *usage); -typedef GLint ( * PFNGLXQUERYFRAMETRACKINGMESAPROC) (Display *dpy, GLXDrawable drawable, int64_t *sbc, int64_t *missedFrames, GLfloat *lastMissedUsage); -#endif +#endif /* C99 version test */ +#endif /* STDC test */ #ifdef __cplusplus } diff -ur --exclude=CVS ./include/GL/internal/glcore.h /storage/dri/Mesa/include/GL/internal/glcore.h --- ./include/GL/internal/glcore.h 2004-06-21 23:35:05.000000000 +1000 +++ /storage/dri/Mesa/include/GL/internal/glcore.h 2004-06-08 21:07:45.000000000 +1000 @@ -49,7 +49,6 @@ #define GL_CORE_SGI 1 #define GL_CORE_MESA 2 #define GL_CORE_APPLE 4 -#define GL_CORE_WINDOWS 8 typedef struct __GLcontextRec __GLcontext; typedef struct __GLinterfaceRec __GLinterface; Binary files ./progs/images/girl.rgb and /storage/dri/Mesa/progs/images/girl.rgb differ diff -ur --exclude=CVS ./src/glx/mini/miniglx.c /storage/dri/Mesa/src/glx/mini/miniglx.c --- ./src/glx/mini/miniglx.c 2004-07-31 18:28:33.000000000 +1000 +++ /storage/dri/Mesa/src/glx/mini/miniglx.c 2004-08-12 12:10:37.000000000 +1000 @@ -505,13 +505,13 @@ else if (dpy->VarInfo.xres == 800 && dpy->VarInfo.yres == 600) { /* timing values taken from /etc/fb.modes (800x600 @ 75Hz) */ - dpy->VarInfo.pixclock = 20203; - dpy->VarInfo.left_margin = 160; - dpy->VarInfo.right_margin = 16; - dpy->VarInfo.upper_margin = 21; + dpy->VarInfo.pixclock = 27778; + dpy->VarInfo.left_margin = 128; + dpy->VarInfo.right_margin = 24; + dpy->VarInfo.upper_margin = 22; dpy->VarInfo.lower_margin = 1; - dpy->VarInfo.hsync_len = 80; - dpy->VarInfo.vsync_len = 3; + dpy->VarInfo.hsync_len = 72; + dpy->VarInfo.vsync_len = 2; } else if (dpy->VarInfo.xres == 768 && dpy->VarInfo.yres == 1024) { @@ -1452,7 +1452,7 @@ win->curBottom = win->frontBottom; } - dpy->driScreen.createNewDrawable(dpy, dpy->driver_modes, (int) win, + dpy->driScreen.createNewDrawable(dpy, visual->mode, (int) win, &win->driDrawable, GLX_WINDOW_BIT, empty_attribute_list); if (!win->driDrawable.private) { @@ -1806,6 +1806,7 @@ (void) stereoFlag; for ( mode = dpy->driver_modes ; mode != NULL ; mode = mode->next ) { if (mode->rgbMode == rgbFlag && + mode->doubleBufferMode == dbFlag && mode->redBits >= redBits && mode->greenBits >= greenBits && mode->blueBits >= blueBits && diff -ur --exclude=CVS ./src/mesa/drivers/dri/common/xmlconfig.c /storage/dri/Mesa/src/mesa/drivers/dri/common/xmlconfig.c --- ./src/mesa/drivers/dri/common/xmlconfig.c 2004-07-31 18:28:33.000000000 +1000 +++ /storage/dri/Mesa/src/mesa/drivers/dri/common/xmlconfig.c 2004-08-12 12:10:38.000000000 +1000 @@ -77,7 +77,7 @@ # define GET_PROGRAM_NAME() __getProgramName() # else # define GET_PROGRAM_NAME() "" -# warning "Per application configuration won't with your OS version work." +# warning "Per application configuration won't work with your OS version." # endif #endif @@ -647,13 +647,17 @@ struct OptInfoData *data = &userData; GLuint realNoptions; - /* determine hash table size and allocate memory */ + /* determine hash table size and allocate memory: + * 3/2 of the number of options, rounded up, so there remains always + * at least one free entry. This is needed for detecting undefined + * options in configuration files without getting a hash table overflow. + * Round this up to a power of two. */ + GLuint minSize = (nConfigOptions*3 + 1) / 2; GLuint size, log2size; - for (size = 1, log2size = 0; size < nConfigOptions*3/2; - size <<= 1, ++log2size); + for (size = 1, log2size = 0; size < minSize; size <<= 1, ++log2size); info->tableSize = log2size; info->info = CALLOC (size * sizeof (driOptionInfo)); - info->values = CALLOC (size * sizeof (driOptionInfo)); + info->values = CALLOC (size * sizeof (driOptionValue)); if (info->info == NULL || info->values == NULL) { fprintf (stderr, "%s: %d: out of memory.\n", __FILE__, __LINE__); abort(); diff -ur --exclude=CVS ./src/mesa/drivers/dri/i915/intel_context.h /storage/dri/Mesa/src/mesa/drivers/dri/i915/intel_context.h --- ./src/mesa/drivers/dri/i915/intel_context.h 2004-07-31 18:28:33.000000000 +1000 +++ /storage/dri/Mesa/src/mesa/drivers/dri/i915/intel_context.h 2004-06-27 19:01:55.000000000 +1000 @@ -352,7 +352,6 @@ * From linux kernel i386 header files, copes with odd sizes better * than COPY_DWORDS would: */ -#ifdef __i386__ static __inline__ void * __memcpy(void * to, const void * from, size_t n) { int d0, d1, d2; @@ -370,9 +369,6 @@ : "memory"); return (to); } -#else -#define __memcpy(a,b,c) memcpy(a,b,c) -#endif diff -ur --exclude=CVS ./src/mesa/drivers/dri/i915/intel_tris.c /storage/dri/Mesa/src/mesa/drivers/dri/i915/intel_tris.c --- ./src/mesa/drivers/dri/i915/intel_tris.c 2004-07-31 18:28:34.000000000 +1000 +++ /storage/dri/Mesa/src/mesa/drivers/dri/i915/intel_tris.c 2004-07-08 20:43:01.000000000 +1000 @@ -50,7 +50,7 @@ * Emit primitives as inline vertices * ***********************************************************************/ -#ifdef __i386__ +#if 1 #define COPY_DWORDS( j, vb, vertsize, v ) \ do { \ int __tmp; \ diff -ur --exclude=CVS ./src/mesa/drivers/dri/r200/r200_pixel.c /storage/dri/Mesa/src/mesa/drivers/dri/r200/r200_pixel.c --- ./src/mesa/drivers/dri/r200/r200_pixel.c 2004-06-16 19:18:16.000000000 +1000 +++ /storage/dri/Mesa/src/mesa/drivers/dri/r200/r200_pixel.c 2004-07-31 18:13:24.000000000 +1000 @@ -152,9 +152,10 @@ GLvoid *pixels ) { r200ContextPtr rmesa = R200_CONTEXT(ctx); - GLint size; GLint pitch = pack->RowLength ? pack->RowLength : width; GLint blit_format; + GLuint cpp = rmesa->r200Screen->cpp; + GLint size = width * height * cpp; if (R200_DEBUG & DEBUG_PIXEL) fprintf(stderr, "%s\n", __FUNCTION__); diff -ur --exclude=CVS ./src/mesa/drivers/dri/r200/r200_sanity.c /storage/dri/Mesa/src/mesa/drivers/dri/r200/r200_sanity.c --- ./src/mesa/drivers/dri/r200/r200_sanity.c 2004-07-31 18:28:34.000000000 +1000 +++ /storage/dri/Mesa/src/mesa/drivers/dri/r200/r200_sanity.c 2004-08-12 12:10:38.000000000 +1000 @@ -817,7 +817,7 @@ fprintf(stderr, "emit scalars2, start %d stride %d nr %d (end %d)\n", start, stride, sz, start + stride * sz); - if (start + stride * sz > 257) { + if (start + stride * sz > 258) { fprintf(stderr, "emit scalars OVERFLOW %d/%d/%d\n", start, stride, sz); return -1; } diff -ur --exclude=CVS ./src/mesa/drivers/dri/radeon/radeon_vtxfmt.c /storage/dri/Mesa/src/mesa/drivers/dri/radeon/radeon_vtxfmt.c --- ./src/mesa/drivers/dri/radeon/radeon_vtxfmt.c 2004-06-16 19:18:19.000000000 +1000 +++ /storage/dri/Mesa/src/mesa/drivers/dri/radeon/radeon_vtxfmt.c 2004-08-12 12:10:38.000000000 +1000 @@ -387,7 +387,7 @@ assert(rmesa->dma.flush == 0); rmesa->vb.fell_back = GL_TRUE; rmesa->vb.installed = GL_FALSE; - glBegin( prim ); + GL_CALL(Begin)( prim ); if (rmesa->vb.installed_color_3f_sz == 4) alpha = ctx->Current.Attrib[VERT_ATTRIB_COLOR0][3]; @@ -397,21 +397,21 @@ for (i = 0 ; i < nrverts; i++) { GLuint offset = 3; if (ind & RADEON_CP_VC_FRMT_N0) { - glNormal3fv( &tmp[i][offset] ); + GL_CALL(Normal3fv)( &tmp[i][offset] ); offset += 3; } if (ind & RADEON_CP_VC_FRMT_PKCOLOR) { radeon_color_t *col = (radeon_color_t *)&tmp[i][offset]; - glColor4ub( col->red, col->green, col->blue, col->alpha ); + GL_CALL(Color4ub)( col->red, col->green, col->blue, col->alpha ); offset++; } else if (ind & RADEON_CP_VC_FRMT_FPALPHA) { - glColor4fv( &tmp[i][offset] ); + GL_CALL(Color4fv)( &tmp[i][offset] ); offset+=4; } else if (ind & RADEON_CP_VC_FRMT_FPCOLOR) { - glColor3fv( &tmp[i][offset] ); + GL_CALL(Color3fv)( &tmp[i][offset] ); offset+=3; } @@ -422,44 +422,44 @@ } if (ind & RADEON_CP_VC_FRMT_ST0) { - glTexCoord2fv( &tmp[i][offset] ); + GL_CALL(TexCoord2fv)( &tmp[i][offset] ); offset += 2; } if (ind & RADEON_CP_VC_FRMT_ST1) { - glMultiTexCoord2fvARB( GL_TEXTURE1_ARB, &tmp[i][offset] ); + GL_CALL(MultiTexCoord2fvARB)( GL_TEXTURE1_ARB, &tmp[i][offset] ); offset += 2; } - glVertex3fv( &tmp[i][0] ); + GL_CALL(Vertex3fv)( &tmp[i][0] ); } /* Replay current vertex */ if (ind & RADEON_CP_VC_FRMT_N0) - glNormal3fv( rmesa->vb.normalptr ); + GL_CALL(Normal3fv)( rmesa->vb.normalptr ); if (ind & RADEON_CP_VC_FRMT_PKCOLOR) - glColor4ub( rmesa->vb.colorptr->red, rmesa->vb.colorptr->green, rmesa->vb.colorptr->blue, rmesa->vb.colorptr->alpha ); + GL_CALL(Color4ub)( rmesa->vb.colorptr->red, rmesa->vb.colorptr->green, rmesa->vb.colorptr->blue, rmesa->vb.colorptr->alpha ); else if (ind & RADEON_CP_VC_FRMT_FPALPHA) - glColor4fv( rmesa->vb.floatcolorptr ); + GL_CALL(Color4fv)( rmesa->vb.floatcolorptr ); else if (ind & RADEON_CP_VC_FRMT_FPCOLOR) { if (rmesa->vb.installed_color_3f_sz == 4 && alpha != 1.0) - glColor4f( rmesa->vb.floatcolorptr[0], - rmesa->vb.floatcolorptr[1], - rmesa->vb.floatcolorptr[2], - alpha ); + GL_CALL(Color4f)( rmesa->vb.floatcolorptr[0], + rmesa->vb.floatcolorptr[1], + rmesa->vb.floatcolorptr[2], + alpha ); else - glColor3fv( rmesa->vb.floatcolorptr ); + GL_CALL(Color3fv)( rmesa->vb.floatcolorptr ); } if (ind & RADEON_CP_VC_FRMT_PKSPEC) GL_CALL(SecondaryColor3ubEXT)( rmesa->vb.specptr->red, rmesa->vb.specptr->green, rmesa->vb.specptr->blue ); if (ind & RADEON_CP_VC_FRMT_ST0) - glTexCoord2fv( rmesa->vb.texcoordptr[0] ); + GL_CALL(TexCoord2fv)( rmesa->vb.texcoordptr[0] ); if (ind & RADEON_CP_VC_FRMT_ST1) - glMultiTexCoord2fvARB( GL_TEXTURE1_ARB, rmesa->vb.texcoordptr[1] ); + GL_CALL(MultiTexCoord2fvARB)( GL_TEXTURE1_ARB, rmesa->vb.texcoordptr[1] ); } @@ -758,7 +758,7 @@ if (rmesa->vb.prim[0] != GL_POLYGON+1) { VFMT_FALLBACK( __FUNCTION__ ); - glMaterialfv( face, pname, params ); + GL_CALL(Materialfv)( face, pname, params ); return; } _mesa_noop_Materialfv( face, pname, params ); @@ -797,7 +797,7 @@ radeonVtxfmtValidate( ctx ); if (!rmesa->vb.installed) { - glBegin( mode ); + GL_CALL(Begin)( mode ); return; } diff -ur --exclude=CVS ./src/mesa/drivers/dri/tdfx/tdfx_context.c /storage/dri/Mesa/src/mesa/drivers/dri/tdfx/tdfx_context.c --- ./src/mesa/drivers/dri/tdfx/tdfx_context.c 2004-07-31 18:28:34.000000000 +1000 +++ /storage/dri/Mesa/src/mesa/drivers/dri/tdfx/tdfx_context.c 2004-08-12 12:10:38.000000000 +1000 @@ -97,7 +97,9 @@ _mesa_enable_extension( ctx, "GL_EXT_blend_subtract" ); _mesa_enable_extension( ctx, "GL_EXT_blend_equation_separate" ); } else { +#if 0 /*[dBorca] cannot handle 565. badbad! revise*/ _mesa_enable_extension( ctx, "GL_SGIS_generate_mipmap" ); +#endif } if (fxMesa->haveHwStencil) { diff -ur --exclude=CVS ./src/mesa/drivers/dri/tdfx/tdfx_render.c /storage/dri/Mesa/src/mesa/drivers/dri/tdfx/tdfx_render.c --- ./src/mesa/drivers/dri/tdfx/tdfx_render.c 2004-07-31 18:28:34.000000000 +1000 +++ /storage/dri/Mesa/src/mesa/drivers/dri/tdfx/tdfx_render.c 2004-08-12 12:10:38.000000000 +1000 @@ -725,7 +725,7 @@ fxMesa->Glide.grColorMask( fxMesa->Color.ColorMask[RCOMP] || fxMesa->Color.ColorMask[GCOMP] || fxMesa->Color.ColorMask[BCOMP], - fxMesa->Color.ColorMask[ACOMP] ); + /*fxMesa->Color.ColorMask[ACOMP]*/GL_FALSE/*[dBorca] no-no*/ ); } fxMesa->dirty &= ~TDFX_UPLOAD_COLOR_MASK; } diff -ur --exclude=CVS ./src/mesa/drivers/glide/fxdd.c /storage/dri/Mesa/src/mesa/drivers/glide/fxdd.c --- ./src/mesa/drivers/glide/fxdd.c 2004-07-31 18:28:34.000000000 +1000 +++ /storage/dri/Mesa/src/mesa/drivers/glide/fxdd.c 2004-08-12 12:10:38.000000000 +1000 @@ -462,22 +462,19 @@ struct gl_pixelstore_attrib scissoredUnpack; /* check if there's any raster operations enabled which we can't handle */ - if ((swrast->_RasterMask & (ALPHATEST_BIT | + if (swrast->_RasterMask & (ALPHATEST_BIT | /*BLEND_BIT |*/ /* blending ok, through pixpipe */ DEPTH_BIT | /* could be done with RGB:DEPTH */ FOG_BIT | /* could be done with RGB:DEPTH */ LOGIC_OP_BIT | /*CLIP_BIT |*/ /* clipping ok, below */ STENCIL_BIT | - /*MASKING_BIT |*/ /* masking ok, test follows */ + MASKING_BIT | ALPHABUF_BIT | /* nope! see 565 span kludge */ MULTI_DRAW_BIT | OCCLUSION_BIT | /* nope! at least not yet */ TEXTURE_BIT | - FRAGPROG_BIT)) - || - ((swrast->_RasterMask & MASKING_BIT) /*&& (ctx->Visual.greenBits != 8)*/ && (ctx->Visual.greenBits != 5)) - ) { + FRAGPROG_BIT)) { _swrast_Bitmap(ctx, px, py, width, height, unpack, bitmap); return; } @@ -485,6 +482,7 @@ /* make sure the pixelpipe is configured correctly */ fxSetupFXUnits(ctx); + /* FIXME! _RasterMask & CLIP_BIT gets set if we're out of Viewport, also! */ if (ctx->Scissor.Enabled) { /* This is a bit tricky, but by carefully adjusting the px, py, * width, height, skipPixels and skipRows values we can do @@ -544,14 +542,14 @@ if (!grLfbLock(GR_LFB_WRITE_ONLY, fxMesa->currentFB, mode, - GR_ORIGIN_UPPER_LEFT, FXTRUE, &info)) { - _swrast_Bitmap(ctx, px, py, width, height, unpack, bitmap); + GR_ORIGIN_LOWER_LEFT, FXTRUE, &info)) { + _swrast_Bitmap(ctx, px, py, width, height, finalUnpack, bitmap); return; } { const GLint winX = 0; - const GLint winY = fxMesa->height - 1; + const GLint winY = 0; /* The dest stride depends on the hardware and whether we're drawing * to the front or back buffer. This compile-time test seems to do * the job for now. @@ -561,7 +559,7 @@ GLint row; /* compute dest address of bottom-left pixel in bitmap */ GLushort *dst = (GLushort *) info.lfbPtr - + (winY - py) * dstStride + (winX + px); + + (winY + py) * dstStride + (winX + px); for (row = 0; row < height; row++) { const GLubyte *src = @@ -607,7 +605,7 @@ if (mask != 128) src++; } - dst -= dstStride; + dst += dstStride; } } @@ -649,6 +647,7 @@ /* make sure the pixelpipe is configured correctly */ fxSetupFXUnits(ctx); + /* FIXME! _RasterMask & CLIP_BIT gets set if we're out of Viewport, also! */ if (ctx->Scissor.Enabled) { /* This is a bit tricky, but by carefully adjusting the px, py, * width, height, skipPixels and skipRows values we can do @@ -702,14 +701,14 @@ if (!grLfbLock(GR_LFB_WRITE_ONLY, fxMesa->currentFB, GR_LFBWRITEMODE_8888, - GR_ORIGIN_UPPER_LEFT, FXTRUE, &info)) { - _swrast_Bitmap(ctx, px, py, width, height, unpack, bitmap); + GR_ORIGIN_LOWER_LEFT, FXTRUE, &info)) { + _swrast_Bitmap(ctx, px, py, width, height, finalUnpack, bitmap); return; } { const GLint winX = 0; - const GLint winY = fxMesa->height - 1; + const GLint winY = 0; /* The dest stride depends on the hardware and whether we're drawing * to the front or back buffer. This compile-time test seems to do * the job for now. @@ -719,7 +718,7 @@ GLint row; /* compute dest address of bottom-left pixel in bitmap */ GLuint *dst = (GLuint *) info.lfbPtr - + (winY - py) * dstStride + (winX + px); + + (winY + py) * dstStride + (winX + px); for (row = 0; row < height; row++) { const GLubyte *src = @@ -765,7 +764,7 @@ if (mask != 128) src++; } - dst -= dstStride; + dst += dstStride; } } @@ -1094,11 +1093,280 @@ } -/* [dBorca] Hack alert: - * not finished!!! - * revise fallback tests and fix scissor; implement new formats - * also write its siblings: 565 and 1555 - */ +void +fxDDDrawPixels555 (GLcontext * ctx, GLint x, GLint y, + GLsizei width, GLsizei height, + GLenum format, GLenum type, + const struct gl_pixelstore_attrib *unpack, + const GLvoid * pixels) +{ + fxMesaContext fxMesa = FX_CONTEXT(ctx); + SWcontext *swrast = SWRAST_CONTEXT(ctx); + GrLfbInfo_t info; + const struct gl_pixelstore_attrib *finalUnpack; + struct gl_pixelstore_attrib scissoredUnpack; + + if (ctx->Pixel.ZoomX != 1.0F || + ctx->Pixel.ZoomY != 1.0F || + (ctx->_ImageTransferState & (IMAGE_SCALE_BIAS_BIT| + IMAGE_MAP_COLOR_BIT)) || + (swrast->_RasterMask & (ALPHATEST_BIT | + /*BLEND_BIT |*/ /* blending ok, through pixpipe */ + DEPTH_BIT | /* could be done with RGB:DEPTH */ + FOG_BIT | /* could be done with RGB:DEPTH */ + LOGIC_OP_BIT | + /*CLIP_BIT |*/ /* clipping ok, below */ + STENCIL_BIT | + MASKING_BIT | + ALPHABUF_BIT | + MULTI_DRAW_BIT | + OCCLUSION_BIT | /* nope! at least not yet */ + TEXTURE_BIT | + FRAGPROG_BIT)) || + fxMesa->fallback) + { + _swrast_DrawPixels( ctx, x, y, width, height, format, type, + unpack, pixels ); + return; + } + + /* make sure the pixelpipe is configured correctly */ + fxSetupFXUnits(ctx); + + /* FIXME! _RasterMask & CLIP_BIT gets set if we're out of Viewport, also! */ + if (ctx->Scissor.Enabled) { + /* This is a bit tricky, but by carefully adjusting the px, py, + * width, height, skipPixels and skipRows values we can do + * scissoring without special code in the rendering loop. + */ + + /* we'll construct a new pixelstore struct */ + finalUnpack = &scissoredUnpack; + scissoredUnpack = *unpack; + if (scissoredUnpack.RowLength == 0) + scissoredUnpack.RowLength = width; + + /* clip left */ + if (x < ctx->Scissor.X) { + scissoredUnpack.SkipPixels += (ctx->Scissor.X - x); + width -= (ctx->Scissor.X - x); + x = ctx->Scissor.X; + } + /* clip right */ + if (x + width >= ctx->Scissor.X + ctx->Scissor.Width) { + width -= (x + width - (ctx->Scissor.X + ctx->Scissor.Width)); + } + /* clip bottom */ + if (y < ctx->Scissor.Y) { + scissoredUnpack.SkipRows += (ctx->Scissor.Y - y); + height -= (ctx->Scissor.Y - y); + y = ctx->Scissor.Y; + } + /* clip top */ + if (y + height >= ctx->Scissor.Y + ctx->Scissor.Height) { + height -= (y + height - (ctx->Scissor.Y + ctx->Scissor.Height)); + } + + if (width <= 0 || height <= 0) + return; + } + else { + finalUnpack = unpack; + } + + info.size = sizeof(info); + if (!grLfbLock(GR_LFB_WRITE_ONLY, + fxMesa->currentFB, + GR_LFBWRITEMODE_1555, + GR_ORIGIN_LOWER_LEFT, FXTRUE, &info)) { + _swrast_DrawPixels(ctx, x, y, width, height, format, type, finalUnpack, pixels); + return; + } + + { + const GLint winX = 0; + const GLint winY = 0; + + const GLint dstStride = info.strideInBytes / 2; /* stride in GLushorts */ + GLushort *dst = (GLushort *) info.lfbPtr + (winY + y) * dstStride + (winX + x); + + if (format == GL_RGBA && type == GL_UNSIGNED_BYTE) { + GLint row; + for (row = 0; row < height; row++) { + GLubyte *src = (GLubyte *) _mesa_image_address(finalUnpack, pixels, + width, height, format, + type, 0, row, 0); + GLint col; + for (col = 0; col < width; col++) { + dst[col] = TDFXPACKCOLOR1555(src[2], src[1], src[0], src[3]); + src += 4; + } + dst += dstStride; + } + } + else if (format == GL_RGB && type == GL_UNSIGNED_BYTE) { + GLint row; + for (row = 0; row < height; row++) { + GLubyte *src = (GLubyte *) _mesa_image_address(finalUnpack, pixels, + width, height, format, + type, 0, row, 0); + GLint col; + for (col = 0; col < width; col++) { + dst[col] = TDFXPACKCOLOR1555(src[2], src[1], src[0], 255); + src += 3; + } + dst += dstStride; + } + } + else { + grLfbUnlock(GR_LFB_WRITE_ONLY, fxMesa->currentFB); + _swrast_DrawPixels(ctx, x, y, width, height, format, type, finalUnpack, pixels); + return; + } + + } + + grLfbUnlock(GR_LFB_WRITE_ONLY, fxMesa->currentFB); +} + + +void +fxDDDrawPixels565 (GLcontext * ctx, GLint x, GLint y, + GLsizei width, GLsizei height, + GLenum format, GLenum type, + const struct gl_pixelstore_attrib *unpack, + const GLvoid * pixels) +{ + fxMesaContext fxMesa = FX_CONTEXT(ctx); + SWcontext *swrast = SWRAST_CONTEXT(ctx); + GrLfbInfo_t info; + const struct gl_pixelstore_attrib *finalUnpack; + struct gl_pixelstore_attrib scissoredUnpack; + + if (ctx->Pixel.ZoomX != 1.0F || + ctx->Pixel.ZoomY != 1.0F || + (ctx->_ImageTransferState & (IMAGE_SCALE_BIAS_BIT| + IMAGE_MAP_COLOR_BIT)) || + (swrast->_RasterMask & (ALPHATEST_BIT | + /*BLEND_BIT |*/ /* blending ok, through pixpipe */ + DEPTH_BIT | /* could be done with RGB:DEPTH */ + FOG_BIT | /* could be done with RGB:DEPTH */ + LOGIC_OP_BIT | + /*CLIP_BIT |*/ /* clipping ok, below */ + STENCIL_BIT | + MASKING_BIT | + ALPHABUF_BIT | + MULTI_DRAW_BIT | + OCCLUSION_BIT | /* nope! at least not yet */ + TEXTURE_BIT | + FRAGPROG_BIT)) || + fxMesa->fallback) + { + _swrast_DrawPixels( ctx, x, y, width, height, format, type, + unpack, pixels ); + return; + } + + /* make sure the pixelpipe is configured correctly */ + fxSetupFXUnits(ctx); + + /* FIXME! _RasterMask & CLIP_BIT gets set if we're out of Viewport, also! */ + if (ctx->Scissor.Enabled) { + /* This is a bit tricky, but by carefully adjusting the px, py, + * width, height, skipPixels and skipRows values we can do + * scissoring without special code in the rendering loop. + */ + + /* we'll construct a new pixelstore struct */ + finalUnpack = &scissoredUnpack; + scissoredUnpack = *unpack; + if (scissoredUnpack.RowLength == 0) + scissoredUnpack.RowLength = width; + + /* clip left */ + if (x < ctx->Scissor.X) { + scissoredUnpack.SkipPixels += (ctx->Scissor.X - x); + width -= (ctx->Scissor.X - x); + x = ctx->Scissor.X; + } + /* clip right */ + if (x + width >= ctx->Scissor.X + ctx->Scissor.Width) { + width -= (x + width - (ctx->Scissor.X + ctx->Scissor.Width)); + } + /* clip bottom */ + if (y < ctx->Scissor.Y) { + scissoredUnpack.SkipRows += (ctx->Scissor.Y - y); + height -= (ctx->Scissor.Y - y); + y = ctx->Scissor.Y; + } + /* clip top */ + if (y + height >= ctx->Scissor.Y + ctx->Scissor.Height) { + height -= (y + height - (ctx->Scissor.Y + ctx->Scissor.Height)); + } + + if (width <= 0 || height <= 0) + return; + } + else { + finalUnpack = unpack; + } + + info.size = sizeof(info); + if (!grLfbLock(GR_LFB_WRITE_ONLY, + fxMesa->currentFB, + GR_LFBWRITEMODE_565, + GR_ORIGIN_LOWER_LEFT, FXTRUE, &info)) { + _swrast_DrawPixels(ctx, x, y, width, height, format, type, finalUnpack, pixels); + return; + } + + { + const GLint winX = 0; + const GLint winY = 0; + + const GLint dstStride = info.strideInBytes / 2; /* stride in GLushorts */ + GLushort *dst = (GLushort *) info.lfbPtr + (winY + y) * dstStride + (winX + x); + + if (format == GL_RGBA && type == GL_UNSIGNED_BYTE) { + GLint row; + for (row = 0; row < height; row++) { + GLubyte *src = (GLubyte *) _mesa_image_address(finalUnpack, pixels, + width, height, format, + type, 0, row, 0); + GLint col; + for (col = 0; col < width; col++) { + dst[col] = TDFXPACKCOLOR565(src[2], src[1], src[0]); + src += 4; + } + dst += dstStride; + } + } + else if (format == GL_RGB && type == GL_UNSIGNED_BYTE) { + GLint row; + for (row = 0; row < height; row++) { + GLubyte *src = (GLubyte *) _mesa_image_address(finalUnpack, pixels, + width, height, format, + type, 0, row, 0); + GLint col; + for (col = 0; col < width; col++) { + dst[col] = TDFXPACKCOLOR565(src[2], src[1], src[0]); + src += 3; + } + dst += dstStride; + } + } + else { + grLfbUnlock(GR_LFB_WRITE_ONLY, fxMesa->currentFB); + _swrast_DrawPixels(ctx, x, y, width, height, format, type, finalUnpack, pixels); + return; + } + + } + + grLfbUnlock(GR_LFB_WRITE_ONLY, fxMesa->currentFB); +} + + void fxDDDrawPixels8888 (GLcontext * ctx, GLint x, GLint y, GLsizei width, GLsizei height, @@ -1107,24 +1375,28 @@ const GLvoid * pixels) { fxMesaContext fxMesa = FX_CONTEXT(ctx); + SWcontext *swrast = SWRAST_CONTEXT(ctx); GrLfbInfo_t info; + const struct gl_pixelstore_attrib *finalUnpack; + struct gl_pixelstore_attrib scissoredUnpack; if (ctx->Pixel.ZoomX != 1.0F || ctx->Pixel.ZoomY != 1.0F || (ctx->_ImageTransferState & (IMAGE_SCALE_BIAS_BIT| IMAGE_MAP_COLOR_BIT)) || - /*ctx->Color.AlphaEnabled ||*/ - ctx->Depth.Test || - ctx->Fog.Enabled || - ctx->Scissor.Enabled || - ctx->Stencil.Enabled || - /*!ctx->Color.ColorMask[0] || - !ctx->Color.ColorMask[1] || - !ctx->Color.ColorMask[2] || - !ctx->Color.ColorMask[3] ||*/ - ctx->Color.ColorLogicOpEnabled || - ctx->Texture._EnabledUnits || - ctx->Depth.OcclusionTest || + (swrast->_RasterMask & (/*ALPHATEST_BIT |*/ + /*BLEND_BIT |*/ /* blending ok, through pixpipe */ + DEPTH_BIT | /* could be done with RGB:DEPTH */ + FOG_BIT | /* could be done with RGB:DEPTH */ + LOGIC_OP_BIT | + /*CLIP_BIT |*/ /* clipping ok, below */ + STENCIL_BIT | + /*MASKING_BIT |*/ /* masking ok, we're in 32bpp */ + /*ALPHABUF_BIT |*//* alpha ok, we're in 32bpp */ + MULTI_DRAW_BIT | + OCCLUSION_BIT | /* nope! at least not yet */ + TEXTURE_BIT | + FRAGPROG_BIT)) || fxMesa->fallback) { _swrast_DrawPixels( ctx, x, y, width, height, format, type, @@ -1132,64 +1404,101 @@ return; } - /* lock early to make sure cliprects are right */ - BEGIN_BOARD_LOCK(); - /* make sure the pixelpipe is configured correctly */ fxSetupFXUnits(ctx); - /* look for clipmasks, giveup if region obscured */ -#if 0 - if (ctx->Color.DrawBuffer == GL_FRONT) { - if (!inClipRects_Region(fxMesa, scrX, scrY, width, height)) { - END_BOARD_LOCK(fxMesa); - _swrast_DrawPixels(ctx, x, y, width, height, format, type, unpack, pixels); - return; + /* FIXME! _RasterMask & CLIP_BIT gets set if we're out of Viewport, also! */ + if (ctx->Scissor.Enabled) { + /* This is a bit tricky, but by carefully adjusting the px, py, + * width, height, skipPixels and skipRows values we can do + * scissoring without special code in the rendering loop. + */ + + /* we'll construct a new pixelstore struct */ + finalUnpack = &scissoredUnpack; + scissoredUnpack = *unpack; + if (scissoredUnpack.RowLength == 0) + scissoredUnpack.RowLength = width; + + /* clip left */ + if (x < ctx->Scissor.X) { + scissoredUnpack.SkipPixels += (ctx->Scissor.X - x); + width -= (ctx->Scissor.X - x); + x = ctx->Scissor.X; + } + /* clip right */ + if (x + width >= ctx->Scissor.X + ctx->Scissor.Width) { + width -= (x + width - (ctx->Scissor.X + ctx->Scissor.Width)); } + /* clip bottom */ + if (y < ctx->Scissor.Y) { + scissoredUnpack.SkipRows += (ctx->Scissor.Y - y); + height -= (ctx->Scissor.Y - y); + y = ctx->Scissor.Y; + } + /* clip top */ + if (y + height >= ctx->Scissor.Y + ctx->Scissor.Height) { + height -= (y + height - (ctx->Scissor.Y + ctx->Scissor.Height)); + } + + if (width <= 0 || height <= 0) + return; + } + else { + finalUnpack = unpack; } -#endif info.size = sizeof(info); if (!grLfbLock(GR_LFB_WRITE_ONLY, fxMesa->currentFB, GR_LFBWRITEMODE_8888, - GR_ORIGIN_UPPER_LEFT, FXTRUE, &info)) { - _swrast_DrawPixels(ctx, x, y, width, height, format, type, unpack, pixels); + GR_ORIGIN_LOWER_LEFT, FXTRUE, &info)) { + _swrast_DrawPixels(ctx, x, y, width, height, format, type, finalUnpack, pixels); return; } { const GLint winX = 0; - const GLint winY = fxMesa->height - 1; + const GLint winY = 0; const GLint dstStride = info.strideInBytes / 4; /* stride in GLuints */ - GLuint *dst = (GLuint *) info.lfbPtr + (winY - y) * dstStride + (winX + x); - const GLubyte *src = (GLubyte *)_mesa_image_address(unpack, pixels, - width, height, format, - type, 0, 0, 0); - const GLint srcStride = _mesa_image_row_stride(unpack, width, format, type); + GLuint *dst = (GLuint *) info.lfbPtr + (winY + y) * dstStride + (winX + x); if (format == GL_RGBA && type == GL_UNSIGNED_BYTE) { /* directly memcpy 8A8R8G8B pixels to screen */ const GLint widthInBytes = width * 4; GLint row; for (row = 0; row < height; row++) { + GLubyte *src = (GLubyte *) _mesa_image_address(finalUnpack, pixels, + width, height, format, + type, 0, row, 0); MEMCPY(dst, src, widthInBytes); - dst -= dstStride; - src += srcStride; + dst += dstStride; + } + } + else if (format == GL_RGB && type == GL_UNSIGNED_BYTE) { + GLint row; + for (row = 0; row < height; row++) { + GLubyte *src = (GLubyte *) _mesa_image_address(finalUnpack, pixels, + width, height, format, + type, 0, row, 0); + GLint col; + for (col = 0; col < width; col++) { + dst[col] = TDFXPACKCOLOR8888(src[2], src[1], src[0], 255); + src += 3; + } + dst += dstStride; } } else { grLfbUnlock(GR_LFB_WRITE_ONLY, fxMesa->currentFB); - END_BOARD_LOCK(); - _swrast_DrawPixels(ctx, x, y, width, height, format, type, unpack, pixels); + _swrast_DrawPixels(ctx, x, y, width, height, format, type, finalUnpack, pixels); return; } } grLfbUnlock(GR_LFB_WRITE_ONLY, fxMesa->currentFB); - END_BOARD_LOCK(); } @@ -1329,17 +1638,8 @@ return 0; } - /* [dBorca] Hack alert: - * Unlike the rest of the Voodoo family, the Rush - * doesn't support ZBUFFER with WBUFFER-like depth functions! - * I guess we could use WBUFFER, which is better, but we can't - * because the depth span functions would need to translate - * depth values to 4.12 floating point... - */ if (fxMesa->haveZBuffer) { - grDepthBufferMode((fxMesa->type == GR_SSTTYPE_SST96) - ? GR_DEPTHBUFFER_WBUFFER - : GR_DEPTHBUFFER_ZBUFFER); + grDepthBufferMode(GR_DEPTHBUFFER_ZBUFFER); } if (!fxMesa->bgrOrder) { @@ -1730,19 +2030,21 @@ ctx->Driver.DrawBuffer = fxDDSetDrawBuffer; ctx->Driver.GetBufferSize = fxDDBufferSize; switch (fxMesa->colDepth) { - case 15: - ctx->Driver.ReadPixels = fxDDReadPixels555; - ctx->Driver.Bitmap = fxDDDrawBitmap2; - break; - case 16: - ctx->Driver.ReadPixels = fxDDReadPixels565; - ctx->Driver.Bitmap = fxDDDrawBitmap2; - break; - case 32: - ctx->Driver.DrawPixels = fxDDDrawPixels8888; - ctx->Driver.ReadPixels = fxDDReadPixels8888; - ctx->Driver.Bitmap = fxDDDrawBitmap4; - break; + case 15: + ctx->Driver.DrawPixels = fxDDDrawPixels555; + ctx->Driver.ReadPixels = fxDDReadPixels555; + ctx->Driver.Bitmap = fxDDDrawBitmap2; + break; + case 16: + ctx->Driver.DrawPixels = fxDDDrawPixels565; + ctx->Driver.ReadPixels = fxDDReadPixels565; + ctx->Driver.Bitmap = fxDDDrawBitmap2; + break; + case 32: + ctx->Driver.DrawPixels = fxDDDrawPixels8888; + ctx->Driver.ReadPixels = fxDDReadPixels8888; + ctx->Driver.Bitmap = fxDDDrawBitmap4; + break; } ctx->Driver.Finish = fxDDFinish; ctx->Driver.Flush = NULL; diff -ur --exclude=CVS ./src/mesa/drivers/glide/fxvbtmp.h /storage/dri/Mesa/src/mesa/drivers/glide/fxvbtmp.h --- ./src/mesa/drivers/glide/fxvbtmp.h 2004-07-31 18:28:34.000000000 +1000 +++ /storage/dri/Mesa/src/mesa/drivers/glide/fxvbtmp.h 2004-08-12 12:10:38.000000000 +1000 @@ -319,16 +319,16 @@ setup_tab[IND].check_tex_sizes = TAG(check_tex_sizes); setup_tab[IND].interp = TAG(interp); + setup_tab[IND].vertex_format = 0; if (IND & SETUP_PTEX) { - setup_tab[IND].vertex_format = (GR_STWHINT_W_DIFF_TMU0 | - GR_STWHINT_W_DIFF_TMU1); - } - else { - setup_tab[IND].vertex_format = 0; + setup_tab[IND].vertex_format |= GR_STWHINT_W_DIFF_TMU0; } #if (IND & SETUP_TMU1) - setup_tab[IND].vertex_format |= GR_STWHINT_ST_DIFF_TMU1; + setup_tab[IND].vertex_format |= GR_STWHINT_ST_DIFF_TMU1; + if (IND & SETUP_PTEX) { + setup_tab[IND].vertex_format |= GR_STWHINT_W_DIFF_TMU1; + } #endif #endif diff -ur --exclude=CVS ./src/mesa/drivers/x11/fakeglx.c /storage/dri/Mesa/src/mesa/drivers/x11/fakeglx.c --- ./src/mesa/drivers/x11/fakeglx.c 2004-06-16 19:19:00.000000000 +1000 +++ /storage/dri/Mesa/src/mesa/drivers/x11/fakeglx.c 2004-08-12 12:10:38.000000000 +1000 @@ -282,6 +282,10 @@ else comparePointers = GL_FALSE; + /* Force the visual to have an alpha channel */ + if (rgbFlag && _mesa_getenv("MESA_GLX_FORCE_ALPHA")) + alphaFlag = GL_TRUE; + /* First check if a matching visual is already in the list */ for (i=0; idepth > 8) rgb_flag = GL_TRUE; - depth_size = DEFAULT_SOFTWARE_DEPTH_BITS; + depth_size = default_depth_bits(); stencil_size = STENCIL_BITS; /* XXX accum??? */ } @@ -1178,8 +1202,9 @@ depth_size = 31; /* 32 causes int overflow problems */ else if (depth_size > 16) depth_size = 24; - else if (depth_size > 0) - depth_size = DEFAULT_SOFTWARE_DEPTH_BITS; /*16*/ + else if (depth_size > 0) { + depth_size = default_depth_bits(); + } /* we only support one size of stencil and accum buffers. */ if (stencil_size > 0) diff -ur --exclude=CVS ./src/mesa/main/imports.h /storage/dri/Mesa/src/mesa/main/imports.h --- ./src/mesa/main/imports.h 2004-06-30 01:05:37.000000000 +1000 +++ /storage/dri/Mesa/src/mesa/main/imports.h 2004-04-30 18:29:04.000000000 +1000 @@ -224,7 +224,7 @@ ***/ #if defined(__i386__) || defined(__386__) || defined(__sparc__) || \ defined(__s390x__) || defined(__powerpc__) || \ - defined(__AMD64__) || defined(__amd64__) || \ + defined(__AMD64__) || \ defined(ia64) || defined(__ia64__) || \ (defined(__alpha__) && (defined(__IEEE_FLOAT) || !defined(VMS))) #define USE_IEEE diff -ur --exclude=CVS ./src/mesa/math/m_debug_clip.c /storage/dri/Mesa/src/mesa/math/m_debug_clip.c --- ./src/mesa/math/m_debug_clip.c 2004-06-16 19:19:22.000000000 +1000 +++ /storage/dri/Mesa/src/mesa/math/m_debug_clip.c 2004-08-12 12:10:38.000000000 +1000 @@ -1,9 +1,8 @@ - /* * Mesa 3-D graphics library - * Version: 5.0 + * Version: 6.1 * - * Copyright (C) 1999-2001 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2005 Brian Paul All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -194,9 +193,10 @@ * Cliptest tests */ -static GLfloat s[TEST_COUNT][4] ALIGN16; -static GLfloat d[TEST_COUNT][4] ALIGN16; -static GLfloat r[TEST_COUNT][4] ALIGN16; +ALIGN16(static GLfloat, s[TEST_COUNT][4]); +ALIGN16(static GLfloat, d[TEST_COUNT][4]); +ALIGN16(static GLfloat, r[TEST_COUNT][4]); + static int test_cliptest_function( clip_func func, int np, int psize, long *cycles ) diff -ur --exclude=CVS ./src/mesa/math/m_debug_util.h /storage/dri/Mesa/src/mesa/math/m_debug_util.h --- ./src/mesa/math/m_debug_util.h 2004-07-31 18:28:36.000000000 +1000 +++ /storage/dri/Mesa/src/mesa/math/m_debug_util.h 2004-08-12 12:10:38.000000000 +1000 @@ -1,9 +1,8 @@ - /* * Mesa 3-D graphics library - * Version: 3.5 + * Version: 6.1 * - * Copyright (C) 1999-2001 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2004 Brian Paul All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -265,11 +264,11 @@ /* Ensure our arrays are correctly aligned. */ #if defined(__GNUC__) -# define ALIGN16 type array __attribute__ ((aligned (16))) +# define ALIGN16(type, array) type array __attribute__ ((aligned (16))) #elif defined(__MSC__) -# define ALIGN16 type array __declspec(align(16)) /* GH: Does this work? */ +# define ALIGN16(type, array) type array __declspec(align(16)) /* GH: Does this work? */ #elif defined(__WATCOMC__) -# define ALIGN16 /* Watcom does not support this */ +# define ALIGN16(type, array) /* Watcom does not support this */ #elif defined(__xlC__) # define ALIGN16(type, array) type __align (16) array #else diff -ur --exclude=CVS ./src/mesa/math/m_debug_xform.c /storage/dri/Mesa/src/mesa/math/m_debug_xform.c --- ./src/mesa/math/m_debug_xform.c 2004-06-16 19:19:22.000000000 +1000 +++ /storage/dri/Mesa/src/mesa/math/m_debug_xform.c 2004-08-12 12:10:38.000000000 +1000 @@ -1,9 +1,8 @@ - /* * Mesa 3-D graphics library - * Version: 3.5 + * Version: 6.1 * - * Copyright (C) 1999-2001 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2004 Brian Paul All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -162,9 +161,9 @@ m[3] = 11.0; m[7] = 23.0; m[11] = 91.0; m[15] = 9.0; } -static GLfloat s[TEST_COUNT][4] ALIGN16; -static GLfloat d[TEST_COUNT][4] ALIGN16; -static GLfloat r[TEST_COUNT][4] ALIGN16; +ALIGN16(static GLfloat, s[TEST_COUNT][4]); +ALIGN16(static GLfloat, d[TEST_COUNT][4]); +ALIGN16(static GLfloat, r[TEST_COUNT][4]); static int test_transform_function( transform_func func, int psize, int mtype, long *cycles ) diff -ur --exclude=CVS ./src/mesa/swrast/s_drawpix.c /storage/dri/Mesa/src/mesa/swrast/s_drawpix.c --- ./src/mesa/swrast/s_drawpix.c 2004-06-16 19:19:27.000000000 +1000 +++ /storage/dri/Mesa/src/mesa/swrast/s_drawpix.c 2004-08-12 12:10:39.000000000 +1000 @@ -93,10 +93,11 @@ static GLboolean fast_draw_pixels(GLcontext *ctx, GLint x, GLint y, GLsizei width, GLsizei height, - GLenum format, GLenum type, const GLvoid *pixels) + GLenum format, GLenum type, + const struct gl_pixelstore_attrib *unpack, + const GLvoid *pixels) { SWcontext *swrast = SWRAST_CONTEXT(ctx); - const struct gl_pixelstore_attrib *unpack = &ctx->Unpack; struct sw_span span; INIT_SPAN(span, GL_BITMAP, 0, 0, SPAN_RGBA); @@ -495,7 +496,9 @@ static void draw_index_pixels( GLcontext *ctx, GLint x, GLint y, GLsizei width, GLsizei height, - GLenum type, const GLvoid *pixels ) + GLenum type, + const struct gl_pixelstore_attrib *unpack, + const GLvoid *pixels ) { const GLboolean zoom = ctx->Pixel.ZoomX!=1.0 || ctx->Pixel.ZoomY!=1.0; GLint row, skipPixels; @@ -519,12 +522,12 @@ ? MAX_WIDTH : (width - skipPixels); ASSERT(spanEnd <= MAX_WIDTH); for (row = 0; row < height; row++, span.y++) { - const GLvoid *source = _mesa_image_address(&ctx->Unpack, pixels, + const GLvoid *source = _mesa_image_address(unpack, pixels, width, height, GL_COLOR_INDEX, type, 0, row, skipPixels); _mesa_unpack_index_span(ctx, span.end, GL_UNSIGNED_INT, - span.array->index, type, source, &ctx->Unpack, + span.array->index, type, source, unpack, ctx->_ImageTransferState); /* These may get changed during writing/clipping */ @@ -549,7 +552,9 @@ static void draw_stencil_pixels( GLcontext *ctx, GLint x, GLint y, GLsizei width, GLsizei height, - GLenum type, const GLvoid *pixels ) + GLenum type, + const struct gl_pixelstore_attrib *unpack, + const GLvoid *pixels ) { const GLboolean zoom = ctx->Pixel.ZoomX!=1.0 || ctx->Pixel.ZoomY!=1.0; const GLint desty = y; @@ -584,12 +589,12 @@ GLstencil values[MAX_WIDTH]; GLenum destType = (sizeof(GLstencil) == sizeof(GLubyte)) ? GL_UNSIGNED_BYTE : GL_UNSIGNED_SHORT; - const GLvoid *source = _mesa_image_address(&ctx->Unpack, pixels, + const GLvoid *source = _mesa_image_address(unpack, pixels, width, height, GL_COLOR_INDEX, type, 0, row, skipPixels); _mesa_unpack_index_span(ctx, spanWidth, destType, values, - type, source, &ctx->Unpack, + type, source, unpack, ctx->_ImageTransferState); if (ctx->_ImageTransferState & IMAGE_SHIFT_OFFSET_BIT) { _mesa_shift_and_offset_stencil(ctx, spanWidth, values); @@ -618,7 +623,9 @@ static void draw_depth_pixels( GLcontext *ctx, GLint x, GLint y, GLsizei width, GLsizei height, - GLenum type, const GLvoid *pixels ) + GLenum type, + const struct gl_pixelstore_attrib *unpack, + const GLvoid *pixels ) { const GLboolean bias_or_scale = ctx->Pixel.DepthBias!=0.0 || ctx->Pixel.DepthScale!=1.0; const GLboolean zoom = ctx->Pixel.ZoomX != 1.0 || ctx->Pixel.ZoomY != 1.0; @@ -658,7 +665,7 @@ span.end = width; for (row = 0; row < height; row++, span.y++) { const GLushort *zSrc = (const GLushort *) - _mesa_image_address(&ctx->Unpack, pixels, width, height, + _mesa_image_address(unpack, pixels, width, height, GL_DEPTH_COMPONENT, type, 0, row, 0); GLint i; for (i = 0; i < width; i++) @@ -680,7 +687,7 @@ span.end = width; for (row = 0; row < height; row++, span.y++) { const GLuint *zSrc = (const GLuint *) - _mesa_image_address(&ctx->Unpack, pixels, width, height, + _mesa_image_address(unpack, pixels, width, height, GL_DEPTH_COMPONENT, type, 0, row, 0); if (shift == 0) { MEMCPY(span.array->z, zSrc, width * sizeof(GLdepth)); @@ -706,7 +713,7 @@ ASSERT(span.end <= MAX_WIDTH); for (row = 0; row < height; row++, spanY++) { GLfloat floatSpan[MAX_WIDTH]; - const GLvoid *zSrc = _mesa_image_address(&ctx->Unpack, + const GLvoid *zSrc = _mesa_image_address(unpack, pixels, width, height, GL_DEPTH_COMPONENT, type, 0, row, skipPixels); @@ -719,7 +726,7 @@ span.end = spanEnd; _mesa_unpack_depth_span(ctx, span.end, floatSpan, type, - zSrc, &ctx->Unpack); + zSrc, unpack); /* clamp depth values to [0,1] and convert from floats to ints */ { const GLfloat zScale = ctx->DepthMaxF; @@ -751,10 +758,11 @@ static void draw_rgba_pixels( GLcontext *ctx, GLint x, GLint y, GLsizei width, GLsizei height, - GLenum format, GLenum type, const GLvoid *pixels ) + GLenum format, GLenum type, + const struct gl_pixelstore_attrib *unpack, + const GLvoid *pixels ) { SWcontext *swrast = SWRAST_CONTEXT(ctx); - const struct gl_pixelstore_attrib *unpack = &ctx->Unpack; const GLboolean zoom = ctx->Pixel.ZoomX!=1.0 || ctx->Pixel.ZoomY!=1.0; const GLint desty = y; GLboolean quickDraw; @@ -770,7 +778,7 @@ } /* Try an optimized glDrawPixels first */ - if (fast_draw_pixels(ctx, x, y, width, height, format, type, pixels)) + if (fast_draw_pixels(ctx, x, y, width, height, format, type, unpack, pixels)) return; if (ctx->Depth.Test) @@ -919,7 +927,6 @@ const GLvoid *pixels ) { SWcontext *swrast = SWRAST_CONTEXT(ctx); - (void) unpack; if (swrast->NewState) _swrast_validate_derived( ctx ); @@ -933,16 +940,16 @@ switch (format) { case GL_STENCIL_INDEX: - draw_stencil_pixels( ctx, x, y, width, height, type, pixels ); + draw_stencil_pixels( ctx, x, y, width, height, type, unpack, pixels ); break; case GL_DEPTH_COMPONENT: - draw_depth_pixels( ctx, x, y, width, height, type, pixels ); + draw_depth_pixels( ctx, x, y, width, height, type, unpack, pixels ); break; case GL_COLOR_INDEX: if (ctx->Visual.rgbMode) - draw_rgba_pixels(ctx, x,y, width, height, format, type, pixels); + draw_rgba_pixels(ctx, x,y, width, height, format, type, unpack, pixels); else - draw_index_pixels(ctx, x, y, width, height, type, pixels); + draw_index_pixels(ctx, x, y, width, height, type, unpack, pixels); break; case GL_RED: case GL_GREEN: @@ -955,7 +962,7 @@ case GL_RGBA: case GL_BGRA: case GL_ABGR_EXT: - draw_rgba_pixels(ctx, x, y, width, height, format, type, pixels); + draw_rgba_pixels(ctx, x, y, width, height, format, type, unpack, pixels); break; default: _mesa_error( ctx, GL_INVALID_ENUM, "glDrawPixels(format)" ); @@ -980,7 +987,6 @@ const struct gl_pixelstore_attrib *unpack ) { SWcontext *swrast = SWRAST_CONTEXT(ctx); - (void) unpack; if (swrast->NewState) _swrast_validate_derived( ctx ); @@ -990,9 +996,9 @@ switch (colorFormat) { case GL_COLOR_INDEX: if (ctx->Visual.rgbMode) - draw_rgba_pixels(ctx, x,y, width, height, colorFormat, colorType, colors); + draw_rgba_pixels(ctx, x,y, width, height, colorFormat, colorType, unpack, colors); else - draw_index_pixels(ctx, x, y, width, height, colorType, colors); + draw_index_pixels(ctx, x, y, width, height, colorType, unpack, colors); break; case GL_RED: case GL_GREEN: @@ -1005,7 +1011,7 @@ case GL_RGBA: case GL_BGRA: case GL_ABGR_EXT: - draw_rgba_pixels(ctx, x, y, width, height, colorFormat, colorType, colors); + draw_rgba_pixels(ctx, x, y, width, height, colorFormat, colorType, unpack, colors); break; default: _mesa_error( ctx, GL_INVALID_ENUM, diff -ur --exclude=CVS ./src/mesa/swrast/s_nvfragprog.c /storage/dri/Mesa/src/mesa/swrast/s_nvfragprog.c --- ./src/mesa/swrast/s_nvfragprog.c 2004-07-31 18:28:36.000000000 +1000 +++ /storage/dri/Mesa/src/mesa/swrast/s_nvfragprog.c 2004-08-12 12:10:39.000000000 +1000 @@ -714,6 +714,10 @@ result[0] = result[1] = result[2] = result[3] = a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3]; store_vector4( inst, machine, result ); +#if DEBUG_FRAG + printf("DP4 %g = (%g, %g %g %g) . (%g, %g %g %g)\n", + result[0], a[0], a[1], a[2], a[3], b[0], b[1], b[2], b[3]); +#endif } break; case FP_OPCODE_DPH: @@ -850,6 +854,12 @@ result[2] = MAX2(a[2], b[2]); result[3] = MAX2(a[3], b[3]); store_vector4( inst, machine, result ); +#if DEBUG_FRAG + printf("MAX (%g %g %g %g) = (%g %g %g %g), (%g %g %g %g)\n", + result[0], result[1], result[2], result[3], + a[0], a[1], a[2], a[3], + b[0], b[1], b[2], b[3]); +#endif } break; case FP_OPCODE_MIN: @@ -869,6 +879,10 @@ GLfloat result[4]; fetch_vector4( ctx, &inst->SrcReg[0], machine, program, result ); store_vector4( inst, machine, result ); +#if DEBUG_FRAG + printf("MOV (%g %g %g %g)\n", + result[0], result[1], result[2], result[3]); +#endif } break; case FP_OPCODE_MUL: diff -ur --exclude=CVS ./src/mesa/tnl/t_vb_vertex.c /storage/dri/Mesa/src/mesa/tnl/t_vb_vertex.c --- ./src/mesa/tnl/t_vb_vertex.c 2004-06-16 19:19:32.000000000 +1000 +++ /storage/dri/Mesa/src/mesa/tnl/t_vb_vertex.c 2004-08-12 12:10:39.000000000 +1000 @@ -148,6 +148,18 @@ VB->EyePtr = TransformRaw( &store->eye, ctx->ModelviewMatrixStack.Top, VB->ObjPtr); +#if 0 + /* examine some eye coordinates */ + { + GLuint i; + GLfloat *v = VB->EyePtr->start; + for (i = 0; i < 4; i++) { + _mesa_printf("eye[%d] = %g, %g, %g, %g\n", + i, v[0], v[1], v[2], v[3]); + v += 4; + } + } +#endif } VB->ClipPtr = TransformRaw( &store->clip, @@ -161,12 +173,27 @@ /* impossible */ case 2: _mesa_vector4f_clean_elem( VB->ClipPtr, VB->Count, 2 ); + /* fall-through */ case 3: _mesa_vector4f_clean_elem( VB->ClipPtr, VB->Count, 3 ); + /* fall-through */ case 4: break; } +#if 0 + /* examine some clip coordinates */ + { + GLuint i; + GLfloat *v = VB->ClipPtr->start; + for (i = 0; i < 4; i++) { + _mesa_printf("clip[%d] = %g, %g, %g, %g\n", + i, v[0], v[1], v[2], v[3]); + v += 4; + } + } +#endif + /* Cliptest and perspective divide. Clip functions must clear * the clipmask. */ diff -ur --exclude=CVS ./src/mesa/tnl/t_vertex_c.c /storage/dri/Mesa/src/mesa/tnl/t_vertex_c.c --- ./src/mesa/tnl/t_vertex_c.c 2004-07-27 11:54:48.000000000 +1000 +++ /storage/dri/Mesa/src/mesa/tnl/t_vertex_c.c 2004-07-08 20:43:02.000000000 +1000 @@ -230,16 +230,7 @@ static tnl_emit_func print_store_func( struct tnl_clipspace_codegen *p ) { -/* C99 provides __func__, older gcc versions called it __FUNCTION__ */ -#if __STDC_VERSION__ < 199901L -# if __GNUC__ >= 2 -# define __func__ __FUNCTION__ -# else -# define __func__ "" -# endif -#endif - - fprintf(stderr, "%s: emitted:\n%s\n", __func__, p->buf); + fprintf(stderr, "%s: emitted:\n%s\n", __FUNCTION__, p->buf); return 0; }