summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2003-08-19 15:52:51 +0000
committerBrian Paul <brian.paul@tungstengraphics.com>2003-08-19 15:52:51 +0000
commit9ec58c2c5bbf90428a0e8e1c4f4af3805c602cd3 (patch)
tree0519440b1cfa2b839ee1995b3e09d62dc05dd9d1
parent3dc8cc4ebc63624dd521923271e63c2ac5a8aaae (diff)
DOS and glide driver updates from Daniel Borca
-rw-r--r--Makefile.DJ10
-rw-r--r--Makefile.mgw4
-rw-r--r--docs/README.DJ26
-rw-r--r--include/GL/dmesa.h6
-rw-r--r--include/GL/fxmesa.h4
-rw-r--r--include/GL/glut.h2
-rw-r--r--progs/samples/Makefile.DJ15
-rw-r--r--src/glu/mesa/Makefile.DJ10
-rw-r--r--src/glu/sgi/Makefile.DJ10
-rw-r--r--src/glut/dos/Makefile.DJ10
-rw-r--r--src/glut/dos/glutint.h24
-rw-r--r--src/glut/dos/init.c73
-rw-r--r--src/glut/dos/state.c6
-rw-r--r--src/glut/dos/window.c69
-rw-r--r--src/glut/glx/glut_bitmap.c2
-rw-r--r--src/glut/glx/glut_bwidth.c4
-rw-r--r--src/glut/glx/glut_stroke.c2
-rw-r--r--src/glut/glx/glut_swidth.c4
-rw-r--r--src/mesa/Makefile.DJ32
-rw-r--r--src/mesa/drivers/dos/dmesa.c32
-rw-r--r--src/mesa/drivers/glide/fxapi.c248
-rw-r--r--src/mesa/drivers/glide/fxdd.c169
-rw-r--r--src/mesa/drivers/glide/fxddspan.c75
-rw-r--r--src/mesa/drivers/glide/fxddtex.c205
-rw-r--r--src/mesa/drivers/glide/fxdrv.h19
-rw-r--r--src/mesa/drivers/glide/fxglidew.c278
-rw-r--r--src/mesa/drivers/glide/fxglidew.h780
-rw-r--r--src/mesa/drivers/glide/fxopengl.def934
-rw-r--r--src/mesa/drivers/glide/fxsetup.c196
-rw-r--r--src/mesa/drivers/glide/fxtexman.c66
-rw-r--r--src/mesa/drivers/glide/fxwgl.c416
31 files changed, 1559 insertions, 2172 deletions
diff --git a/Makefile.DJ b/Makefile.DJ
index 78207d9ed14..f7c8277fe5f 100644
--- a/Makefile.DJ
+++ b/Makefile.DJ
@@ -23,7 +23,7 @@
# DOS/DJGPP makefile v1.4 for Mesa
#
# Copyright (C) 2002 - Borca Daniel
-# Email : dborca@yahoo.com
+# Email : dborca@users.sourceforge.net
# Web : http://www.geocities.com/dborca
@@ -32,12 +32,12 @@
#
# Environment variables:
# CPU optimize for the given processor.
-# default = k6
+# default = pentium
# GLU=[mesa|sgi] specify GLU directory; can be `sgi' (requires GNU/C++)
# or `mesa'.
# default = mesa
-# GLIDE path to Glide3 SDK include files; used with FX.
-# default = $(TOP)/include/glide3
+# GLIDE path to Glide3 SDK; used with FX.
+# default = $(TOP)/glide3
# FX=1 build for 3dfx Glide3. Note that this disables
# compilation of most DMesa code and requires fxMesa.
# As a consequence, you'll need the DJGPP Glide3
@@ -70,7 +70,7 @@
.PHONY : all libgl libglu libglut clean realclean
-CPU ?= k6
+CPU ?= pentium
GLU ?= mesa
diff --git a/Makefile.mgw b/Makefile.mgw
index 8a95b2582f6..77d6c97f75b 100644
--- a/Makefile.mgw
+++ b/Makefile.mgw
@@ -32,7 +32,7 @@
#
# Environment variables:
# CPU optimize for the given processor.
-# default = k6
+# default = pentium
# GLIDE path to Glide3 SDK; used with FX.
# default = $(TOP)/glide3
# FX=1 build for 3dfx Glide3. Note that this disables
@@ -62,7 +62,7 @@
.PHONY : all libgl clean realclean
-CPU ?= k6
+CPU ?= pentium
CFLAGS = -Wall -W -pedantic
CFLAGS += -O2 -ffast-math -mcpu=$(CPU)
diff --git a/docs/README.DJ b/docs/README.DJ
index 26fd9d05396..0ca479163ff 100644
--- a/docs/README.DJ
+++ b/docs/README.DJ
@@ -31,12 +31,12 @@ Available options:
Environment variables:
CPU optimize for the given processor.
- default = k6
+ default = pentium
GLU=[mesa|sgi] specify GLU directory; can be `sgi' (requires GNU/C++)
or `mesa'.
default = mesa
- GLIDE path to Glide3 SDK include files; used with FX.
- default = $(TOP)/include/glide3
+ GLIDE path to Glide3 SDK; used with FX.
+ default = $(TOP)/glide3
FX=1 build for 3dfx Glide3. Note that this disables
compilation of most DMesa code and requires fxMesa.
As a consequence, you'll need the DJGPP Glide3
@@ -70,7 +70,7 @@ Tested on:
CPU: AMD Athlon XP 1800+
Mainboard: EP-8KTA3 w/ 128 MB SDRAM
Video card: Voodoo5 5500 AGP w/ 64 MB SDRAM
- DJGPP: djdev 2.04 + gcc v3.2.2 + make v3.79.1
+ DJGPP: djdev 2.04 + gcc v3.2.2 + make v3.80
OS: DOS and Win98SE
@@ -119,12 +119,6 @@ FAQ:
lazy programmer and I found that the easiest way to keep buffer handling
at peak performance ;-).
- Q) My demo doesn't display text. I know I used the GLUT font routines!
- A) Then you probably use GLUT as a DXE. Well, there is no direct access to
- variables due to the way DXE works. Read the documentation. The author of
- GLUT took this into account for _WIN32 DLL's only; I don't want to modify
- his headers. The only workaround is to link GLUT the old way :-(
-
Q) The GLUT is incomplete.
A) See below.
@@ -173,9 +167,12 @@ position far to the right (or way down); then you can move them back to any
position right before the main loop.
The following environment variables can customize GLUT behaviour:
+ GLUT_FPS - print frames/second statistics to stderr
DMESA_GLUT_REFRESH - set vertical screen refresh rate (VESA3)
DMESA_GLUT_BPP - set default bits per pixel (VGA needs 8)
- GLUT_FPS - print frames/second statistics to stderr
+ DMESA_GLUT_DEPTH - set default depth bits
+ DMESA_GLUT_STENCIL - set default stencil bits
+ DMESA_GLUT_ACCUM - set default accum bits
@@ -212,8 +209,11 @@ v1.3 (mar-2003)
* revamped GLUT
* switched to DXE3
-v1.4 (jun-2003)
+v1.4 (aug-2003)
+ + enabled fonts with DXE
+ + truly added multi-window support in GLUT
* accomodated makefiles with the new sourcetree
+ * hacked and slashed the 3dfx driver (w/ help from Hiroshi Morii)
@@ -221,5 +221,5 @@ Contact:
~~~~~~~~
Name: Borca Daniel
-E-mail: dborca@yahoo.com
+E-mail: dborca@users.sourceforge.net
WWW: http://www.geocities.com/dborca/
diff --git a/include/GL/dmesa.h b/include/GL/dmesa.h
index bb7d9b0cc96..7510fdb9f4e 100644
--- a/include/GL/dmesa.h
+++ b/include/GL/dmesa.h
@@ -23,10 +23,10 @@
*/
/*
- * DOS/DJGPP device driver v1.3 for Mesa
+ * DOS/DJGPP device driver v1.4 for Mesa
*
* Copyright (C) 2002 - Borca Daniel
- * Email : dborca@yahoo.com
+ * Email : dborca@users.sourceforge.net
* Web : http://www.geocities.com/dborca
*/
@@ -90,7 +90,7 @@ void DMesaDestroyContext (DMesaContext c);
/*
* Return a handle to the current context.
*/
-DMesaContext DMesaGetCurrentContext (void);
+void *DMesaGetCurrentContext (void);
diff --git a/include/GL/fxmesa.h b/include/GL/fxmesa.h
index 7697c720073..42f6ed8d72c 100644
--- a/include/GL/fxmesa.h
+++ b/include/GL/fxmesa.h
@@ -76,7 +76,7 @@ GLAPI GLboolean GLAPIENTRY fxMesaSelectCurrentBoard(int n);
GLAPI void GLAPIENTRY fxMesaMakeCurrent(fxMesaContext ctx);
-GLAPI fxMesaContext GLAPIENTRY fxMesaGetCurrentContext(void);
+GLAPI void * GLAPIENTRY fxMesaGetCurrentContext(void);
GLAPI void GLAPIENTRY fxMesaSwapBuffers(void);
@@ -88,6 +88,8 @@ GLAPI int GLAPIENTRY fxQueryHardware(void);
GLAPI void GLAPIENTRY fxCloseHardware(void);
+GLAPI void GLAPIENTRY fxGetScreenGeometry (GLint *w, GLint *h);
+
#if defined (__BEOS__)
#pragma export off
diff --git a/include/GL/glut.h b/include/GL/glut.h
index 87fd6cee6c9..27d937f7ce8 100644
--- a/include/GL/glut.h
+++ b/include/GL/glut.h
@@ -350,7 +350,7 @@ WGLAPI int GLAPIENTRY SetPixelFormat(HDC,int,const PIXELFORMATDESCRIPTOR *);
#define GLUT_NORMAL 0
#define GLUT_OVERLAY 1
-#if defined(_WIN32)
+#if defined(_WIN32) || defined (GLUT_IMPORT_LIB)
/* Stroke font constants (use these in GLUT program). */
#define GLUT_STROKE_ROMAN ((void*)0)
#define GLUT_STROKE_MONO_ROMAN ((void*)1)
diff --git a/progs/samples/Makefile.DJ b/progs/samples/Makefile.DJ
index 13b1c7221b4..f8b0ccda48d 100644
--- a/progs/samples/Makefile.DJ
+++ b/progs/samples/Makefile.DJ
@@ -23,7 +23,7 @@
# DOS/DJGPP samples makefile v1.4 for Mesa
#
# Copyright (C) 2002 - Borca Daniel
-# Email : dborca@yahoo.com
+# Email : dborca@users.sourceforge.net
# Web : http://www.geocities.com/dborca
@@ -32,9 +32,9 @@
#
# Environment variables:
# CPU optimize for the given processor.
-# default = k6
-# GLIDE path to Glide3 SDK library files; used with FX.
-# default = $(TOP)/lib/glide3
+# default = pentium
+# GLIDE path to Glide3 SDK; used with FX.
+# default = $(TOP)/glide3
# FX=1 build for 3dfx Glide3. Note that this disables
# compilation of most DMesa code and requires fxMesa.
# As a consequence, you'll need the DJGPP Glide3
@@ -53,13 +53,14 @@
.SUFFIXES : .c .o .exe
TOP = ../..
-CPU ?= k6
-GLIDE ?= $(TOP)/lib/glide3
+CPU ?= pentium
+GLIDE ?= $(TOP)/glide3
CC = gcc
CFLAGS = -Wall -W -pedantic
CFLAGS += -O2 -ffast-math -mcpu=$(CPU)
CFLAGS += -I$(TOP)/include -I../util
+CFLAGS += -DGLUT_IMPORT_LIB
LD = gxx
LDFLAGS = -s -L$(TOP)/lib
@@ -69,7 +70,7 @@ LDLIBS += -liglut -liglu -ligl
else
LDLIBS = -lglut -lglu -lgl
ifeq ($(FX),1)
-LDFLAGS += -L$(GLIDE)
+LDFLAGS += -L$(GLIDE)/lib
LDLIBS += -lglid3
endif
endif
diff --git a/src/glu/mesa/Makefile.DJ b/src/glu/mesa/Makefile.DJ
index 1e61080b49b..4d383cda315 100644
--- a/src/glu/mesa/Makefile.DJ
+++ b/src/glu/mesa/Makefile.DJ
@@ -23,7 +23,7 @@
# DOS/DJGPP glu makefile v1.4 for Mesa
#
# Copyright (C) 2002 - Borca Daniel
-# Email : dborca@yahoo.com
+# Email : dborca@users.sourceforge.net
# Web : http://www.geocities.com/dborca
@@ -48,7 +48,7 @@ GLU_LIB = libglu.a
GLU_DXE = glu.dxe
GLU_IMP = libiglu.a
-export LD_LIBRARY_PATH := $(LD_LIBRARY_PATH);$(LIBDIR)
+export LD_LIBRARY_PATH := $(LD_LIBRARY_PATH);$(LIBDIR);$(GLIDE)/lib
CC = gcc
CFLAGS += -I$(TOP)/include
@@ -87,16 +87,14 @@ OBJECTS = $(SOURCES:.c=.o)
all: $(LIBDIR)/$(GLU_LIB) $(LIBDIR)/$(GLU_DXE) $(LIBDIR)/$(GLU_IMP)
$(LIBDIR)/$(GLU_LIB): $(OBJECTS)
- $(AR) $(ARFLAGS) $(LIBDIR)/$(GLU_LIB) $(OBJECTS)
+ $(AR) $(ARFLAGS) $@ $^
$(LIBDIR)/$(GLU_DXE) $(LIBDIR)/$(GLU_IMP): $(OBJECTS)
ifeq ($(HAVEDXE3),)
$(warning Missing DXE3 package... Skipping $(GLU_DXE))
else
- -dxe3gen -o $(LIBDIR)/$(GLU_DXE) -Y $(LIBDIR)/$(GLU_IMP) -D "MesaGLU DJGPP" -E _glu -P gl.dxe -U $(OBJECTS)
+ -dxe3gen -o $(LIBDIR)/$(GLU_DXE) -Y $(LIBDIR)/$(GLU_IMP) -D "MesaGLU DJGPP" -E _glu -P gl.dxe -U $^
endif
clean:
-$(call UNLINK,*.o)
-
--include depend
diff --git a/src/glu/sgi/Makefile.DJ b/src/glu/sgi/Makefile.DJ
index 0facbc7ee92..b3bad70181c 100644
--- a/src/glu/sgi/Makefile.DJ
+++ b/src/glu/sgi/Makefile.DJ
@@ -23,7 +23,7 @@
# DOS/DJGPP glu makefile v1.4 for Mesa
#
# Copyright (C) 2002 - Borca Daniel
-# Email : dborca@yahoo.com
+# Email : dborca@users.sourceforge.net
# Web : http://www.geocities.com/dborca
@@ -48,7 +48,7 @@ GLU_LIB = libglu.a
GLU_DXE = glu.dxe
GLU_IMP = libiglu.a
-export LD_LIBRARY_PATH := $(LD_LIBRARY_PATH);$(LIBDIR)
+export LD_LIBRARY_PATH := $(LD_LIBRARY_PATH);$(LIBDIR);$(GLIDE)/lib
CC = gcc
CFLAGS += -DNDEBUG -DLIBRARYBUILD -I$(TOP)/include -Iinclude
@@ -171,13 +171,13 @@ OBJECTS = $(addsuffix .o,$(basename $(SOURCES)))
all: $(LIBDIR)/$(GLU_LIB) $(LIBDIR)/$(GLU_DXE) $(LIBDIR)/$(GLU_IMP)
$(LIBDIR)/$(GLU_LIB): $(OBJECTS)
- $(AR) $(ARFLAGS) $(LIBDIR)/$(GLU_LIB) $(OBJECTS)
+ $(AR) $(ARFLAGS) $@ $^
$(LIBDIR)/$(GLU_DXE) $(LIBDIR)/$(GLU_IMP): $(OBJECTS)
ifeq ($(HAVEDXE3),)
$(warning Missing DXE3 package... Skipping $(GLU_DXE))
else
- -dxe3gen -o $(LIBDIR)/$(GLU_DXE) -Y $(LIBDIR)/$(GLU_IMP) -D "MesaGLU/SGI DJGPP" -E _glu -P gl.dxe -U $(OBJECTS)
+ -dxe3gen -o $(LIBDIR)/$(GLU_DXE) -Y $(LIBDIR)/$(GLU_IMP) -D "MesaGLU/SGI DJGPP" -E _glu -P gl.dxe -U $^
endif
clean:
@@ -186,5 +186,3 @@ clean:
-$(call UNLINK,libnurbs/interface/*.o)
-$(call UNLINK,libnurbs/internals/*.o)
-$(call UNLINK,libnurbs/nurbtess/*.o)
-
--include depend
diff --git a/src/glut/dos/Makefile.DJ b/src/glut/dos/Makefile.DJ
index c870d23d444..4586a0ba699 100644
--- a/src/glut/dos/Makefile.DJ
+++ b/src/glut/dos/Makefile.DJ
@@ -23,7 +23,7 @@
# DOS/DJGPP glut makefile v1.4 for Mesa
#
# Copyright (C) 2002 - Borca Daniel
-# Email : dborca@yahoo.com
+# Email : dborca@users.sourceforge.net
# Web : http://www.geocities.com/dborca
@@ -53,10 +53,11 @@ GLUT_LIB = libglut.a
GLUT_DXE = glut.dxe
GLUT_IMP = libiglut.a
-export LD_LIBRARY_PATH := $(LD_LIBRARY_PATH);$(LIBDIR)
+export LD_LIBRARY_PATH := $(LD_LIBRARY_PATH);$(LIBDIR);$(GLIDE)/lib
CC = gcc
CFLAGS += -I- -I$(TOP)/include -I. -I$(MKGLUT) -IPC_HW
+CFLAGS += -DGLUT_IMPORT_LIB
AR = ar
ARFLAGS = rus
@@ -78,6 +79,7 @@ CORE_SOURCES = \
mouse.c \
overlay.c \
state.c \
+ util.c \
window.c
PC_HW_SOURCES = \
@@ -119,13 +121,13 @@ OBJECTS = $(addsuffix .o,$(basename $(SOURCES)))
all: $(LIBDIR)/$(GLUT_LIB) $(LIBDIR)/$(GLUT_DXE) $(LIBDIR)/$(GLUT_IMP)
$(LIBDIR)/$(GLUT_LIB): $(OBJECTS)
- $(AR) $(ARFLAGS) $(LIBDIR)/$(GLUT_LIB) $(OBJECTS)
+ $(AR) $(ARFLAGS) $@ $^
$(LIBDIR)/$(GLUT_DXE) $(LIBDIR)/$(GLUT_IMP): $(OBJECTS)
ifeq ($(HAVEDXE3),)
$(warning Missing DXE3 package... Skipping $(GLUT_DXE))
else
- -dxe3gen -o $(LIBDIR)/$(GLUT_DXE) -Y $(LIBDIR)/$(GLUT_IMP) -D "MesaGLUT DJGPP" -E _glut -P gl.dxe -P glu.dxe -U $(OBJECTS)
+ -dxe3gen -o $(LIBDIR)/$(GLUT_DXE) -Y $(LIBDIR)/$(GLUT_IMP) -D "MesaGLUT DJGPP" -E _glut -P gl.dxe -P glu.dxe -U $^
endif
clean:
diff --git a/src/glut/dos/glutint.h b/src/glut/dos/glutint.h
index e8dffb581be..013b307e941 100644
--- a/src/glut/dos/glutint.h
+++ b/src/glut/dos/glutint.h
@@ -19,10 +19,10 @@
*/
/*
- * DOS/DJGPP glut driver v1.3 for Mesa
+ * DOS/DJGPP glut driver v1.4 for Mesa
*
* Copyright (C) 2002 - Borca Daniel
- * Email : dborca@yahoo.com
+ * Email : dborca@users.sourceforge.net
* Web : http://www.geocities.com/dborca
*/
@@ -64,9 +64,11 @@ typedef void (GLUTCALLBACK *GLUTjoystickCB) (unsigned int, int, int, int);
typedef struct GLUTwindow {
int num; /* window id */
+ DMesaContext context;
DMesaBuffer buffer;
int show_mouse;
+ GLboolean redisplay;
/* GLUT settable or visible window state. */
int xpos;
@@ -100,9 +102,10 @@ typedef struct GLUTwindow {
extern GLUTidleCB g_idle_func;
extern GLUTmenuStatusCB g_menu_status_func;
-extern GLboolean g_redisplay;
-
extern GLuint g_bpp; /* HW: bits per pixel */
+extern GLuint g_depth; /* HW: depth bits */
+extern GLuint g_stencil; /* HW: stencil bits */
+extern GLuint g_accum; /* HW: accum bits */
extern GLuint g_refresh; /* HW: vertical refresh rate */
extern GLuint g_screen_w, g_screen_h; /* HW: physical screen size */
extern GLint g_driver_caps;
@@ -117,6 +120,7 @@ extern int g_mouse; /* non-zero if mouse installed */
extern int g_mouse_x, g_mouse_y; /* mouse coords, relative to current win */
extern GLUTwindow *g_curwin; /* current window */
+extern GLUTwindow *g_windows[];
extern char *__glutProgramName; /* program name */
@@ -127,6 +131,10 @@ extern char * __glutStrdup(const char *string);
extern void __glutWarning(char *format,...);
extern void __glutFatalError(char *format,...);
extern void __glutFatalUsage(char *format,...);
+/* Private routines from util.c */
+#ifdef GLUT_IMPORT_LIB
+extern void *__glutFont(void *font);
+#endif
@@ -137,14 +145,6 @@ extern void __glutFatalUsage(char *format,...);
#define MAX_WINDOWS 2
-#define DEFAULT_WIDTH 300
-#define DEFAULT_HEIGHT 300
-#define DEFAULT_BPP 16
-
-#define DEPTH_SIZE 16
-#define STENCIL_SIZE 8
-#define ACCUM_SIZE 16
-
#define RESERVED_COLORS 0
#endif /* __glutint_h__ */
diff --git a/src/glut/dos/init.c b/src/glut/dos/init.c
index 5d09561dac3..22bab9f8afc 100644
--- a/src/glut/dos/init.c
+++ b/src/glut/dos/init.c
@@ -19,10 +19,10 @@
*/
/*
- * DOS/DJGPP glut driver v1.3 for Mesa
+ * DOS/DJGPP glut driver v1.4 for Mesa
*
* Copyright (C) 2002 - Borca Daniel
- * Email : dborca@yahoo.com
+ * Email : dborca@users.sourceforge.net
* Web : http://www.geocities.com/dborca
*/
@@ -31,11 +31,20 @@
#include "glutint.h"
+#define DEFAULT_WIDTH 300
+#define DEFAULT_HEIGHT 300
+#define DEFAULT_BPP 16
+
+#define DEPTH_SIZE 16
+#define STENCIL_SIZE 8
+#define ACCUM_SIZE 16
-GLboolean g_redisplay = GL_FALSE;
GLuint g_bpp = DEFAULT_BPP;
+GLuint g_depth = DEPTH_SIZE;
+GLuint g_stencil = STENCIL_SIZE;
+GLuint g_accum = ACCUM_SIZE;
GLuint g_refresh = 0;
GLuint g_screen_w, g_screen_h;
GLint g_driver_caps;
@@ -58,6 +67,15 @@ void APIENTRY glutInit (int *argc, char **argv)
if ((env = getenv("DMESA_GLUT_BPP")) != NULL) {
g_bpp = atoi(env);
}
+ if ((env = getenv("DMESA_GLUT_DEPTH")) != NULL) {
+ g_depth = atoi(env);
+ }
+ if ((env = getenv("DMESA_GLUT_STENCIL")) != NULL) {
+ g_stencil = atoi(env);
+ }
+ if ((env = getenv("DMESA_GLUT_ACCUM")) != NULL) {
+ g_accum = atoi(env);
+ }
if ((env = getenv("DMESA_GLUT_REFRESH")) != NULL) {
g_refresh = atoi(env);
}
@@ -109,6 +127,7 @@ void APIENTRY glutInitWindowSize (int width, int height)
void APIENTRY glutMainLoop (void)
{
+ int i;
GLboolean idle;
static int old_mouse_x = 0;
static int old_mouse_y = 0;
@@ -125,29 +144,43 @@ void APIENTRY glutMainLoop (void)
pc_install_keyb();
__glutInitMouse();
- glutPostRedisplay();
- if (g_curwin->reshape) {
- g_curwin->reshape(g_curwin->width, g_curwin->height);
- }
- if (g_curwin->visibility) {
- g_curwin->visibility(GLUT_VISIBLE);
+ for (i = 0; i < MAX_WINDOWS; i++) {
+ if (g_windows[i] != NULL) {
+ GLUTwindow *w = g_windows[i];
+ glutSetWindow(w->num);
+ glutPostRedisplay();
+ if (w->reshape) {
+ w->reshape(w->width, w->height);
+ }
+ if (w->visibility) {
+ w->visibility(GLUT_VISIBLE);
+ }
+ }
}
while (GL_TRUE) {
idle = GL_TRUE;
- if (g_redisplay && g_curwin->display) {
- idle = GL_FALSE;
- g_redisplay = GL_FALSE;
-
- if (g_curwin->show_mouse && !(g_display_mode & GLUT_DOUBLE)) {
- /* XXX scare mouse */
- g_curwin->display();
- /* XXX unscare mouse */
- } else {
- g_curwin->display();
- }
+ for (i = 0; i < MAX_WINDOWS; i++) {
+ if (g_windows[i] != NULL) {
+ GLUTwindow *w = g_windows[i];
+ if (w->redisplay && w->display) {
+ idle = GL_FALSE;
+ w->redisplay = GL_FALSE;
+
+ if (DMesaMakeCurrent(w->context, w->buffer)) {
+ if (w->show_mouse && !(g_display_mode & GLUT_DOUBLE)) {
+ /* XXX scare mouse */
+ w->display();
+ /* XXX unscare mouse */
+ } else {
+ w->display();
+ }
+ }
+ }
+ }
}
+ DMesaMakeCurrent(g_curwin->context, g_curwin->buffer);
if (g_mouse) {
int mouse_x;
diff --git a/src/glut/dos/state.c b/src/glut/dos/state.c
index 245d2ef621c..e9d854cd4e1 100644
--- a/src/glut/dos/state.c
+++ b/src/glut/dos/state.c
@@ -19,7 +19,7 @@
*/
/*
- * DOS/DJGPP glut driver v1.3 for Mesa
+ * DOS/DJGPP glut driver v1.4 for Mesa
*
* Copyright (C) 2002 - Borca Daniel
* Email : dborca@yahoo.com
@@ -60,9 +60,9 @@ int APIENTRY glutGet (GLenum type)
case GLUT_WINDOW_HEIGHT:
return g_curwin->height;
case GLUT_WINDOW_STENCIL_SIZE:
- return STENCIL_SIZE;
+ return g_stencil;
case GLUT_WINDOW_DEPTH_SIZE:
- return DEPTH_SIZE;
+ return g_depth;
case GLUT_WINDOW_RGBA:
return !(g_display_mode & GLUT_INDEX);
case GLUT_WINDOW_COLORMAP_SIZE:
diff --git a/src/glut/dos/window.c b/src/glut/dos/window.c
index cfc2f965c04..06e8ea9ead1 100644
--- a/src/glut/dos/window.c
+++ b/src/glut/dos/window.c
@@ -19,10 +19,10 @@
*/
/*
- * DOS/DJGPP glut driver v1.3 for Mesa
+ * DOS/DJGPP glut driver v1.4 for Mesa
*
* Copyright (C) 2002 - Borca Daniel
- * Email : dborca@yahoo.com
+ * Email : dborca@users.sourceforge.net
* Web : http://www.geocities.com/dborca
*/
@@ -38,8 +38,7 @@ GLUTwindow *g_curwin;
static GLuint swaptime, swapcount;
static DMesaVisual visual = NULL;
-static DMesaContext context = NULL;
-static GLUTwindow *windows[MAX_WINDOWS];
+GLUTwindow *g_windows[MAX_WINDOWS];
@@ -50,7 +49,6 @@ static void clean (void)
for (i=1; i<=MAX_WINDOWS; i++) {
glutDestroyWindow(i);
}
- if (context) DMesaDestroyContext(context);
if (visual) DMesaDestroyVisual(visual);
pc_close_stdout();
@@ -64,53 +62,72 @@ int APIENTRY glutCreateWindow (const char *title)
int i;
int m8width = (g_init_w + 7) & ~7;
+ /* We set the Visual once. This will be our desktop (graphic mode).
+ * We should do this in the `glutInit' code, but we don't have any idea
+ * about its geometry. Supposedly, when we are about to create one
+ * window, we have a slight idea about resolution.
+ */
if (!visual) {
if ((visual=DMesaCreateVisual(g_init_x + m8width, g_init_y + g_init_h, g_bpp, g_refresh,
g_display_mode & GLUT_DOUBLE,
!(g_display_mode & GLUT_INDEX),
g_display_mode & GLUT_ALPHA,
- g_display_mode & GLUT_DEPTH ?DEPTH_SIZE :0,
- g_display_mode & GLUT_STENCIL?STENCIL_SIZE:0,
- g_display_mode & GLUT_ACCUM ?ACCUM_SIZE :0))==NULL) {
- return 0;
- }
-
- if ((context=DMesaCreateContext(visual, NULL))==NULL) {
- DMesaDestroyVisual(visual);
+ g_display_mode & GLUT_DEPTH ? g_depth :0,
+ g_display_mode & GLUT_STENCIL ? g_stencil:0,
+ g_display_mode & GLUT_ACCUM ? g_accum :0))==NULL) {
return 0;
}
+ /* Also hook stdio/stderr once */
pc_open_stdout();
pc_open_stderr();
pc_atexit(clean);
}
+ /* Search for an empty slot.
+ * Each window has its own rendering Context and its own Buffer.
+ */
for (i=0; i<MAX_WINDOWS; i++) {
- if (windows[i] == NULL) {
+ if (g_windows[i] == NULL) {
+ DMesaContext c;
DMesaBuffer b;
GLUTwindow *w;
- if ((w=(GLUTwindow *)calloc(1, sizeof(GLUTwindow))) == NULL) {
+ if ((w = (GLUTwindow *)calloc(1, sizeof(GLUTwindow))) == NULL) {
+ return 0;
+ }
+
+ /* Allocate the rendering Context. */
+ if ((c = DMesaCreateContext(visual, NULL)) == NULL) {
+ free(w);
return 0;
}
- if ((b=DMesaCreateBuffer(visual, g_init_x, g_init_y, m8width, g_init_h))==NULL) {
+ /* Allocate the Buffer (displayable area).
+ * We have to specify buffer size and position (inside the desktop).
+ */
+ if ((b = DMesaCreateBuffer(visual, g_init_x, g_init_y, m8width, g_init_h)) == NULL) {
+ DMesaDestroyContext(c);
free(w);
return 0;
}
- if (!DMesaMakeCurrent(context, b)) {
+
+ /* Bind Buffer to Context and make the Context the current one. */
+ if (!DMesaMakeCurrent(c, b)) {
DMesaDestroyBuffer(b);
+ DMesaDestroyContext(c);
free(w);
return 0;
}
- g_curwin = windows[i] = w;
+ g_curwin = g_windows[i] = w;
w->num = ++i;
w->xpos = g_init_x;
w->ypos = g_init_y;
w->width = m8width;
w->height = g_init_h;
+ w->context = c;
w->buffer = b;
return i;
@@ -131,10 +148,13 @@ int APIENTRY glutCreateSubWindow (int win, int x, int y, int width, int height)
void APIENTRY glutDestroyWindow (int win)
{
- if (windows[--win]) {
- DMesaDestroyBuffer(windows[win]->buffer);
- free(windows[win]);
- windows[win] = NULL;
+ if (g_windows[--win]) {
+ GLUTwindow *w = g_windows[win];
+ DMesaMakeCurrent(NULL, NULL);
+ DMesaDestroyBuffer(w->buffer);
+ DMesaDestroyContext(w->context);
+ free(w);
+ g_windows[win] = NULL;
}
}
@@ -142,7 +162,7 @@ void APIENTRY glutDestroyWindow (int win)
void APIENTRY glutPostRedisplay (void)
{
- g_redisplay = GL_TRUE;
+ g_curwin->redisplay = GL_TRUE;
}
@@ -183,7 +203,8 @@ int APIENTRY glutGetWindow (void)
void APIENTRY glutSetWindow (int win)
{
- g_curwin = windows[win - 1];
+ g_curwin = g_windows[win - 1];
+ DMesaMakeCurrent(g_curwin->context, g_curwin->buffer);
}
diff --git a/src/glut/glx/glut_bitmap.c b/src/glut/glx/glut_bitmap.c
index f471167810e..8fec7f11710 100644
--- a/src/glut/glx/glut_bitmap.c
+++ b/src/glut/glx/glut_bitmap.c
@@ -16,7 +16,7 @@ glutBitmapCharacter(GLUTbitmapFont font, int c)
GLint swapbytes, lsbfirst, rowlength;
GLint skiprows, skippixels, alignment;
-#if defined(_WIN32)
+#if defined(_WIN32) || defined(GLUT_IMPORT_LIB)
fontinfo = (BitmapFontPtr) __glutFont(font);
#else
fontinfo = (BitmapFontPtr) font;
diff --git a/src/glut/glx/glut_bwidth.c b/src/glut/glx/glut_bwidth.c
index 34776f8b0f3..f9cdb184da7 100644
--- a/src/glut/glx/glut_bwidth.c
+++ b/src/glut/glx/glut_bwidth.c
@@ -15,7 +15,7 @@ glutBitmapWidth(GLUTbitmapFont font, int c)
BitmapFontPtr fontinfo;
const BitmapCharRec *ch;
-#ifdef _WIN32
+#if defined(_WIN32) || defined(GLUT_IMPORT_LIB)
fontinfo = (BitmapFontPtr) __glutFont(font);
#else
fontinfo = (BitmapFontPtr) font;
@@ -37,7 +37,7 @@ glutBitmapLength(GLUTbitmapFont font, const unsigned char *string)
BitmapFontPtr fontinfo;
const BitmapCharRec *ch;
-#ifdef _WIN32
+#if defined(_WIN32) || defined(GLUT_IMPORT_LIB)
fontinfo = (BitmapFontPtr) __glutFont(font);
#else
fontinfo = (BitmapFontPtr) font;
diff --git a/src/glut/glx/glut_stroke.c b/src/glut/glx/glut_stroke.c
index a7af66201fe..7569012ec4e 100644
--- a/src/glut/glx/glut_stroke.c
+++ b/src/glut/glx/glut_stroke.c
@@ -18,7 +18,7 @@ glutStrokeCharacter(GLUTstrokeFont font, int c)
int i, j;
-#if defined(_WIN32)
+#if defined(_WIN32) || defined(GLUT_IMPORT_LIB)
fontinfo = (StrokeFontPtr) __glutFont(font);
#else
fontinfo = (StrokeFontPtr) font;
diff --git a/src/glut/glx/glut_swidth.c b/src/glut/glx/glut_swidth.c
index d999b4d38c4..4717bbff5b1 100644
--- a/src/glut/glx/glut_swidth.c
+++ b/src/glut/glx/glut_swidth.c
@@ -15,7 +15,7 @@ glutStrokeWidth(GLUTstrokeFont font, int c)
StrokeFontPtr fontinfo;
const StrokeCharRec *ch;
-#if defined(_WIN32)
+#if defined(_WIN32) || defined(GLUT_IMPORT_LIB)
fontinfo = (StrokeFontPtr) __glutFont(font);
#else
fontinfo = (StrokeFontPtr) font;
@@ -37,7 +37,7 @@ glutStrokeLength(GLUTstrokeFont font, const unsigned char *string)
StrokeFontPtr fontinfo;
const StrokeCharRec *ch;
-#if defined(_WIN32)
+#if defined(_WIN32) || defined(GLUT_IMPORT_LIB)
fontinfo = (StrokeFontPtr) __glutFont(font);
#else
fontinfo = (StrokeFontPtr) font;
diff --git a/src/mesa/Makefile.DJ b/src/mesa/Makefile.DJ
index ad9cd5b37b0..2d9c2d94efd 100644
--- a/src/mesa/Makefile.DJ
+++ b/src/mesa/Makefile.DJ
@@ -23,7 +23,7 @@
# DOS/DJGPP core makefile v1.4 for Mesa
#
# Copyright (C) 2002 - Borca Daniel
-# Email : dborca@yahoo.com
+# Email : dborca@users.sourceforge.net
# Web : http://www.geocities.com/dborca
@@ -33,8 +33,8 @@
# Environment variables:
# CFLAGS
#
-# GLIDE path to Glide3 SDK include files; used with FX.
-# default = $(TOP)/include/glide3
+# GLIDE path to Glide3 SDK; used with FX.
+# default = $(TOP)/glide3
# FX=1 build for 3dfx Glide3. Note that this disables
# compilation of most DMesa code and requires fxMesa.
# As a consequence, you'll need the DJGPP Glide3
@@ -65,19 +65,19 @@
.INTERMEDIATE: x86/gen_matypes.exe
TOP = ../..
-GLIDE ?= $(TOP)/include/glide3
+GLIDE ?= $(TOP)/glide3
LIBDIR = $(TOP)/lib
GL_LIB = libgl.a
GL_DXE = gl.dxe
GL_IMP = libigl.a
-export LD_LIBRARY_PATH := $(LD_LIBRARY_PATH);$(LIBDIR)
+export LD_LIBRARY_PATH := $(LD_LIBRARY_PATH);$(LIBDIR);$(GLIDE)/lib
CC = gcc
CFLAGS += -I$(TOP)/include -I. -Imain -Iglapi
ifeq ($(FX),1)
CFLAGS += -D__DOS__ -DH3
-CFLAGS += -I$(GLIDE) -DFX -DFX_GLIDE3 -DFXMESA_USE_ARGB
+CFLAGS += -I$(GLIDE)/include -DFX
LIBNAME = "MesaGL/FX DJGPP"
else
ifeq ($(MATROX),1)
@@ -260,12 +260,12 @@ K3D_SOURCES = \
x86/3dnow_normal.S
CORE_SOURCES = \
- $(MAIN_SOURCES) \
- $(GLAPI_SOURCES) \
- $(MATH_SOURCES) \
- $(ARRAY_CACHE_SOURCES) \
- $(SWRAST_SOURCES) \
- $(SWRAST_SETUP_SOURCES) \
+ $(MAIN_SOURCES) \
+ $(GLAPI_SOURCES) \
+ $(MATH_SOURCES) \
+ $(ARRAY_CACHE_SOURCES) \
+ $(SWRAST_SOURCES) \
+ $(SWRAST_SETUP_SOURCES) \
$(TNL_SOURCES)
ifeq ($(HAVE_MMX),1)
@@ -336,16 +336,16 @@ X86_OBJECTS = $(addsuffix .o,$(basename $(X86_SOURCES)))
all: $(LIBDIR)/$(GL_LIB) $(LIBDIR)/$(GL_DXE) $(LIBDIR)/$(GL_IMP)
$(LIBDIR)/$(GL_LIB): $(OBJECTS)
- $(AR) $(ARFLAGS) $(LIBDIR)/$(GL_LIB) $(OBJECTS)
+ $(AR) $(ARFLAGS) $@ $^
$(LIBDIR)/$(GL_DXE) $(LIBDIR)/$(GL_IMP): $(OBJECTS)
ifeq ($(HAVEDXE3),)
$(warning Missing DXE3 package... Skipping $(GL_DXE))
else
ifeq ($(FX),1)
- -dxe3gen -o $(LIBDIR)/$(GL_DXE) -Y $(LIBDIR)/$(GL_IMP) -D $(LIBNAME) -E _gl -E _DMesa -P glid3.dxe -U $(OBJECTS)
+ -dxe3gen -o $(LIBDIR)/$(GL_DXE) -Y $(LIBDIR)/$(GL_IMP) -D $(LIBNAME) -E _gl -E _DMesa -P glid3.dxe -U $^
else
- -dxe3gen -o $(LIBDIR)/$(GL_DXE) -Y $(LIBDIR)/$(GL_IMP) -D $(LIBNAME) -E _gl -E _DMesa -U $(OBJECTS)
+ -dxe3gen -o $(LIBDIR)/$(GL_DXE) -Y $(LIBDIR)/$(GL_IMP) -D $(LIBNAME) -E _gl -E _DMesa -U $^
endif
endif
@@ -369,5 +369,3 @@ clean:
-$(call UNLINK,drivers/dos/*.o)
-$(call UNLINK,drivers/dos/mga/*.o)
-$(call UNLINK,drivers/glide/*.o)
-
--include depend
diff --git a/src/mesa/drivers/dos/dmesa.c b/src/mesa/drivers/dos/dmesa.c
index 92381307c28..7918fe9e9df 100644
--- a/src/mesa/drivers/dos/dmesa.c
+++ b/src/mesa/drivers/dos/dmesa.c
@@ -26,14 +26,14 @@
* DOS/DJGPP device driver v1.4 for Mesa
*
* Copyright (c) 2003 - Borca Daniel
- * Email : dborca@yahoo.com
+ * Email : dborca@users.sourceforge.net
* Web : http://www.geocities.com/dborca
*/
-#ifndef FX
#include "glheader.h"
#include "context.h"
+#ifndef FX
#include "extensions.h"
#include "macros.h"
#include "matrix.h"
@@ -58,7 +58,7 @@
#include "mga/mga.h"
#endif /* MATROX */
#else /* FX */
-#include "../glide/fxdrv.h"
+#include "GL/fxmesa.h"
#endif /* FX */
#include "GL/dmesa.h"
@@ -1142,7 +1142,7 @@ static const GLubyte* get_string (GLcontext *ctx, GLenum name)
#ifdef MATROX
" (MGA)"
#endif
- "\0port (c) Borca Daniel mar-2003";
+ "\0port (c) Borca Daniel aug-2003";
default:
return NULL;
}
@@ -1474,7 +1474,7 @@ void DMesaDestroyVisual (DMesaVisual v)
#endif
#else
- fxMesaDestroyContext((fxMesaContext)v);
+ fxMesaDestroyContext((tdfxContextPtr)v);
#endif
}
@@ -1536,7 +1536,7 @@ DMesaContext DMesaCreateContext (DMesaVisual visual,
_mesa_enable_sw_extensions((GLcontext *)c);
_mesa_enable_1_3_extensions((GLcontext *)c);
_mesa_enable_1_4_extensions((GLcontext *)c);
- _mesa_enable_1_5_extensions((GLcontext *)c);
+ _mesa_enable_1_5_extensions((GLcontext *)c);
/* you probably have to do a bunch of other initializations here. */
c->visual = visual;
@@ -1645,7 +1645,7 @@ GLboolean DMesaMakeCurrent (DMesaContext c, DMesaBuffer b)
}
#else
- fxMesaMakeCurrent((fxMesaContext)c);
+ fxMesaMakeCurrent((tdfxContextPtr)c);
#endif
return GL_TRUE;
@@ -1682,13 +1682,13 @@ void DMesaSetCI (int ndx, GLfloat red, GLfloat green, GLfloat blue)
-DMesaContext DMesaGetCurrentContext (void)
+void *DMesaGetCurrentContext (void)
{
#ifndef FX
GET_CURRENT_CONTEXT(ctx);
- return (DMesaContext)ctx;
+ return ctx;
#else
- return (DMesaContext)fxMesaGetCurrentContext();
+ return fxMesaGetCurrentContext();
#endif
}
@@ -1696,14 +1696,7 @@ DMesaContext DMesaGetCurrentContext (void)
int DMesaGetIntegerv (GLenum pname, GLint *params)
{
-#ifndef FX
- GET_CURRENT_CONTEXT(ctx);
- const DMesaContext c = (DMesaContext)ctx;
-#else
- const fxMesaContext c = fxMesaGetCurrentContext();
-#endif
-
- if (c == NULL) {
+ if (DMesaGetCurrentContext() == NULL) {
return -1;
}
@@ -1716,8 +1709,7 @@ int DMesaGetIntegerv (GLenum pname, GLint *params)
mga_get(MGA_GET_SCREEN_SIZE, params);
#endif
#else
- params[0] = c->screen_width;
- params[1] = c->screen_height;
+ fxGetScreenGeometry(&params[0], &params[1]);
#endif
break;
case DMESA_GET_DRIVER_CAPS:
diff --git a/src/mesa/drivers/glide/fxapi.c b/src/mesa/drivers/glide/fxapi.c
index bb87565296b..451c3a8ce2a 100644
--- a/src/mesa/drivers/glide/fxapi.c
+++ b/src/mesa/drivers/glide/fxapi.c
@@ -1,4 +1,4 @@
-/* $Id: fxapi.c,v 1.36 2003/07/17 14:50:12 brianp Exp $ */
+/* $Id: fxapi.c,v 1.37 2003/08/19 15:52:53 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -29,6 +29,8 @@
* Brian Paul
* Daryll Strauss
* Keith Whitwell
+ * Daniel Borca
+ * Hiroshi Morii
*/
@@ -103,10 +105,29 @@ fxMesaSelectCurrentBoard(int n)
}
-fxMesaContext GLAPIENTRY
-fxMesaGetCurrentContext(void)
+void * GLAPIENTRY fxMesaGetCurrentContext (void)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ return ctx;
+}
+
+
+void GLAPIENTRY fxGetScreenGeometry (GLint *w, GLint *h)
{
- return fxMesaCurrentCtx;
+ GLint width = 0;
+ GLint height = 0;
+
+ if (fxMesaCurrentCtx != NULL) {
+ width = fxMesaCurrentCtx->screen_width;
+ height = fxMesaCurrentCtx->screen_height;
+ }
+
+ if (w != NULL) {
+ *w = width;
+ }
+ if (h != NULL) {
+ *h = height;
+ }
}
@@ -133,11 +154,7 @@ gl3DfxSetPaletteEXT(GLuint * pal)
if (fxMesa) {
fxMesa->haveGlobalPaletteTexture = 1;
- FX_grTexDownloadTable(GR_TMU0, GR_TEXTABLE_PALETTE,
- (GuTexPalette *) pal);
- if (fxMesa->haveTwoTMUs)
- FX_grTexDownloadTable(GR_TMU1, GR_TEXTABLE_PALETTE,
- (GuTexPalette *) pal);
+ grTexDownloadTable(GR_TEXTABLE_PALETTE, (GuTexPalette *) pal);
}
}
@@ -169,16 +186,8 @@ fxBestResolution(int width, int height, int aux)
fxQueryHardware();
- if (glbHWConfig.SSTs[glbCurrentBoard].type == GR_SSTTYPE_VOODOO) {
- fbmem = glbHWConfig.SSTs[glbCurrentBoard].sstBoard.VoodooConfig.fbRam;
-
- if (glbHWConfig.SSTs[glbCurrentBoard].sstBoard.VoodooConfig.sliDetect)
- fbmem *= 2;
- }
- else if (glbHWConfig.SSTs[glbCurrentBoard].type == GR_SSTTYPE_SST96)
- fbmem = glbHWConfig.SSTs[glbCurrentBoard].sstBoard.SST96Config.fbRam;
- else
- fbmem = 2;
+ fbmem = glbHWConfig.SSTs[glbCurrentBoard].VoodooConfig.fbRam
+ * glbHWConfig.SSTs[glbCurrentBoard].VoodooConfig.numChips;
/* A work around for BZFlag */
@@ -187,13 +196,14 @@ fxBestResolution(int width, int height, int aux)
height = 480;
}
- for (i = 0; i < NUM_RESOLUTIONS; i++)
+ for (i = 0; i < NUM_RESOLUTIONS; i++) {
if (resolutions[i][4 - aux] <= fbmem) {
- if ((width <= resolutions[i][0]) && (height <= resolutions[i][1]))
+ if ((width <= resolutions[i][0]) && (height <= resolutions[i][1])) {
return resolutions[i][2];
-
+ }
lastvalidres = resolutions[i][2];
}
+ }
return lastvalidres;
}
@@ -282,7 +292,6 @@ fxMesaCreateContext(GLuint win,
/*FX_GrContext_t glideContext = 0; */
char *errorstr;
GLboolean useBGR;
- char *system = NULL;
GLuint pixFmt, colDepth = 16;
GLint redBits, greenBits, blueBits, alphaBits;
@@ -306,15 +315,15 @@ fxMesaCreateContext(GLuint win,
case FXMESA_ALPHA_SIZE:
i++;
alphaBuffer = attribList[i] > 0;
- if (alphaBuffer)
+ if (alphaBuffer) {
aux = 1;
+ }
break;
case FXMESA_DEPTH_SIZE:
i++;
depthSize = attribList[i];
if (depthSize) {
aux = 1;
- depthSize = 16;
}
break;
case FXMESA_STENCIL_SIZE:
@@ -337,26 +346,26 @@ fxMesaCreateContext(GLuint win,
break;
default:
if (MESA_VERBOSE & VERBOSE_DRIVER) {
- fprintf(stderr, "fxmesa: fxMesaCreateContext() End (defualt)\n");
+ fprintf(stderr, "fxmesa: bad FXMESA_* switch\n");
}
return NULL;
}
i++;
}
+ if (depthSize) {
+ depthSize = (colDepth == 32) ? 24 : 16;
+ }
+
/* A workaround for Linux GLQuake */
if (depthSize && alphaBuffer)
alphaBuffer = 0;
if ((type = fxQueryHardware()) < 0) {
- fprintf(stderr,
- "fx Driver: ERROR no Voodoo1/2 Graphics or Voodoo Rush !\n");
+ fprintf(stderr, "fxmesa: ERROR no Voodoo hardware!\n");
return NULL;
}
- if (type == GR_SSTTYPE_VOODOO)
- win = 0;
-
grSstSelect(glbCurrentBoard);
fxMesa = (fxMesaContext) calloc(1, sizeof(struct tfxMesaContext));
@@ -365,23 +374,14 @@ fxMesaCreateContext(GLuint win,
goto errorhandler;
}
- if (glbHWConfig.SSTs[glbCurrentBoard].type == GR_SSTTYPE_VOODOO)
- fxMesa->haveTwoTMUs =
- (glbHWConfig.SSTs[glbCurrentBoard].sstBoard.VoodooConfig.nTexelfx >
- 1);
- else if (glbHWConfig.SSTs[glbCurrentBoard].type == GR_SSTTYPE_SST96)
- fxMesa->haveTwoTMUs =
- (glbHWConfig.SSTs[glbCurrentBoard].sstBoard.SST96Config.nTexelfx >
- 1);
- else
- fxMesa->haveTwoTMUs = GL_FALSE;
-
+ fxMesa->haveTwoTMUs = (glbHWConfig.SSTs[glbCurrentBoard].VoodooConfig.nTexelfx > 1);
fxMesa->haveDoubleBuffer = doubleBuffer;
fxMesa->haveAlphaBuffer = alphaBuffer;
fxMesa->haveGlobalPaletteTexture = GL_FALSE;
fxMesa->haveZBuffer = depthSize ? 1 : 0;
fxMesa->verbose = verbose;
fxMesa->board = glbCurrentBoard;
+ fxMesa->maxTextureSize = glbHWConfig.SSTs[glbCurrentBoard].VoodooConfig.maxTextureSize; /* [koolsmoky] */
switch (fxMesa->colDepth = colDepth) {
@@ -390,21 +390,21 @@ fxMesaCreateContext(GLuint win,
greenBits = 5;
blueBits = 5;
alphaBits = 1;
- pixFmt = 4; /* GR_PIXFMT_ARGB_1555 */
+ pixFmt = GR_PIXFMT_ARGB_1555;
break;
case 16:
redBits = 5;
greenBits = 6;
blueBits = 5;
alphaBits = 0;
- pixFmt = 3; /* GR_PIXFMT_ARGB_565 */
+ pixFmt = GR_PIXFMT_RGB_565;
break;
case 32:
redBits = 8;
greenBits = 8;
blueBits = 8;
alphaBits = 8;
- pixFmt = 5; /* GR_PIXFMT_ARGB_8888 */
+ pixFmt = GR_PIXFMT_ARGB_8888;
break;
default:
errorstr = "pixelFormat";
@@ -414,11 +414,7 @@ fxMesaCreateContext(GLuint win,
fxMesa->glideContext = FX_grSstWinOpen(&glbHWConfig.SSTs[glbCurrentBoard],
(FxU32)win, res, ref,
-#ifdef FXMESA_USE_ARGB
- GR_COLORFORMAT_ARGB,
-#else
GR_COLORFORMAT_ABGR,
-#endif
pixFmt,
GR_ORIGIN_LOWER_LEFT, 2, aux);
if (!fxMesa->glideContext) {
@@ -428,87 +424,34 @@ fxMesaCreateContext(GLuint win,
/*
* Pixel tables are used during pixel read-back
- * Either initialize them for RGB or BGR order.
+ * Either initialize them for RGB or BGR order;
+ * However, 32bit capable cards have the right order.
+ * As a consequence, 32bit read-back is not swizzled!
* Also determine if we need vertex snapping.
*/
-
- fxMesa->snapVertices = GL_TRUE; /* play it safe */
-
-#ifdef FXMESA_USE_ARGB
- useBGR = GL_FALSE; /* Force RGB pixel order */
- system = "FXMESA_USE_ARGB";
-#else
- if (glbHWConfig.SSTs[glbCurrentBoard].type == GR_SSTTYPE_VOODOO) {
- /* jk991130 - Voodoo 3s don't use BGR. Query the # of TMUs
- * as Voodoo3s have 2 TMUs on board, Banshee has only 1
- * bk000413 - another suggestion from Joseph Kain is using
- * VendorID 0x121a for all 3dfx boards
- * DeviceID VG 1/V2 2/VB 3/V3 5
- * For now we cehck for known BGR devices, and presume
- * everything else to be a V3/RGB.
- */
- GrVoodooConfig_t *voodoo;
- voodoo = &glbHWConfig.SSTs[glbCurrentBoard].sstBoard.VoodooConfig;
-
- if (voodoo->nTexelfx == 1) {
- /* Voodoo1 or Banshee */
- useBGR = GL_TRUE;
- system = "Voodoo1";
- }
- else if (voodoo->nTexelfx == 2 &&
- voodoo->fbiRev == 260 &&
- voodoo->tmuConfig[0].tmuRev == 4 &&
- (voodoo->tmuConfig[0].tmuRam == 2 ||
- voodoo->tmuConfig[0].tmuRam == 4)) {
- /* Voodoo 2 */
- useBGR = GL_TRUE;
- system = "Voodoo2";
- fxMesa->snapVertices = GL_FALSE;
- }
- else if (voodoo->nTexelfx == 2 &&
- voodoo->fbiRev == 2 &&
- voodoo->tmuConfig[0].tmuRev == 1 &&
- voodoo->tmuConfig[0].tmuRam == 4) {
- /* Quantum3D Obsidian 50/100 */
- useBGR = GL_TRUE;
- system = "Quantum3D Obsidian";
- }
- else
- /* Brian
- * (voodoo->nTexelfx == 2 &&
- * voodoo->fbiRev == 0 &&
- * voodoo->tmuConfig[0].tmuRev == 148441048 &&
- * voodoo->tmuConfig[0].tmuRam == 3)
- * Bernd
- * (voodoo->nTexelfx == 2 &&
- * voodoo->fbiRev == 69634 &&
- * voodoo->tmuConfig[0].tmuRev == 69634 &&
- * voodoo->tmuConfig[0].tmuRam == 2 )
- */
- {
- /* Presumed Voodoo3 */
- useBGR = GL_FALSE;
- system = "Voodoo3";
- fxMesa->snapVertices = GL_FALSE;
- }
- if (verbose) {
- fprintf(stderr,
- "Voodoo: Texelfx: %d / FBI Rev.: %d / TMU Rev.: %d / TMU RAM: %d\n",
- voodoo->nTexelfx, voodoo->fbiRev, voodoo->tmuConfig[0].tmuRev,
- voodoo->tmuConfig[0].tmuRam);
- }
- }
- else {
- useBGR = GL_FALSE; /* use RGB pixel order otherwise */
- system = "non-voodoo";
- fxMesa->snapVertices = GL_FALSE;
+ switch (glbHWConfig.SSTs[glbCurrentBoard].type) {
+ case GR_SSTTYPE_VOODOO:
+ case GR_SSTTYPE_Banshee:
+ useBGR = GL_TRUE;
+ fxMesa->snapVertices = GL_TRUE;
+ break;
+ case GR_SSTTYPE_Voodoo2:
+ useBGR = GL_TRUE;
+ fxMesa->snapVertices = GL_FALSE;
+ break;
+ case GR_SSTTYPE_Voodoo3:
+ case GR_SSTTYPE_Voodoo4:
+ case GR_SSTTYPE_Voodoo5:
+ default:
+ useBGR = GL_FALSE;
+ fxMesa->snapVertices = GL_FALSE;
+ break;
}
-#endif /*FXMESA_USE_ARGB */
if (verbose) {
- fprintf(stderr, "Voodoo pixel order: %s (%s)\n",
- useBGR ? "BGR" : "RGB", system);
- fprintf(stderr, "Vertex snapping: %d\n", fxMesa->snapVertices);
+ fprintf(stderr, "Voodoo pixel order = %s, vertex snapping = %d\n",
+ useBGR ? "BGR" : "RGB",
+ fxMesa->snapVertices);
}
fxInitPixelTables(fxMesa, useBGR);
@@ -527,8 +470,8 @@ fxMesaCreateContext(GLuint win,
fxMesa->new_state = ~0;
if (verbose)
- fprintf(stderr, "Voodoo Glide screen size: %dx%d\n",
- (int) FX_grSstScreenWidth(), (int) FX_grSstScreenHeight());
+ fprintf(stderr, "Voodoo screen: %dx%dx%d\n",
+ (int)FX_grSstScreenWidth(), (int)FX_grSstScreenHeight(), colDepth);
fxMesa->glVis = _mesa_create_visual(GL_TRUE, /* RGB mode */
doubleBuffer, GL_FALSE, /* stereo */
@@ -594,7 +537,7 @@ fxMesaCreateContext(GLuint win,
errorhandler:
if (fxMesa) {
if (fxMesa->glideContext)
- FX_grSstWinClose(fxMesa->glideContext);
+ grSstWinClose(fxMesa->glideContext);
fxMesa->glideContext = 0;
if (fxMesa->state)
@@ -611,7 +554,7 @@ fxMesaCreateContext(GLuint win,
}
if (MESA_VERBOSE & VERBOSE_DRIVER) {
- fprintf(stderr, "fxmesa: fxMesaCreateContext() End (%s)\n", errorstr);
+ fprintf(stderr, "fxmesa: ERROR (%s)\n", errorstr);
}
return NULL;
}
@@ -679,7 +622,7 @@ fxMesaDestroyContext(fxMesaContext fxMesa)
_mesa_destroy_framebuffer(fxMesa->glBuffer);
fxCloseHardware();
- FX_grSstWinClose(fxMesa->glideContext);
+ grSstWinClose(fxMesa->glideContext);
free(fxMesa);
@@ -784,7 +727,7 @@ fxMesaSwapBuffers(void)
/*
* Don't allow swap buffer commands to build up!
*/
- while (FX_grGetInteger(FX_PENDING_BUFFERSWAPS) >
+ while (FX_grGetInteger(GR_PENDING_BUFFERSWAPS) >
fxMesaCurrentCtx->maxPendingSwapBuffers)
/* The driver is able to sleep when waiting for the completation
of multiple swapbuffer operations instead of wasting
@@ -817,38 +760,15 @@ fxQueryHardware(void)
if (getenv("MESA_FX_INFO")) {
char buf[80];
-
- FX_grGlideGetVersion(buf);
- fprintf(stderr, "Voodoo Using Glide V%s\n", buf);
- fprintf(stderr, "Voodoo Number of boards: %d\n",
- glbHWConfig.num_sst);
-
- if (glbHWConfig.SSTs[glbCurrentBoard].type == GR_SSTTYPE_VOODOO) {
- GrVoodooConfig_t *voodoo;
- voodoo =
- &glbHWConfig.SSTs[glbCurrentBoard].sstBoard.VoodooConfig;
-
- fprintf(stderr, "Voodoo Framebuffer RAM: %d\n",
- voodoo->sliDetect ? (voodoo->fbRam *
- 2) : voodoo->fbRam);
- fprintf(stderr, "Voodoo Number of TMUs: %d\n",
- voodoo->nTexelfx);
- fprintf(stderr, "Voodoo fbRam: %d\n", voodoo->fbRam);
- fprintf(stderr, "Voodoo fbiRev: %d\n", voodoo->fbiRev);
-
- fprintf(stderr, "Voodoo SLI detected: %d\n",
- voodoo->sliDetect);
- }
- else if (glbHWConfig.SSTs[glbCurrentBoard].type ==
- GR_SSTTYPE_SST96) {
- GrSst96Config_t *sst96;
- sst96 =
- &glbHWConfig.SSTs[glbCurrentBoard].sstBoard.SST96Config;
- fprintf(stderr, "Voodoo Framebuffer RAM: %d\n", sst96->fbRam);
- fprintf(stderr, "Voodoo Number of TMUs: %d\n",
- sst96->nTexelfx);
- }
-
+ GrVoodooConfig_t *voodoo = &glbHWConfig.SSTs[glbCurrentBoard].VoodooConfig;
+
+ strcpy(buf, grGetString(GR_VERSION));
+ fprintf(stderr, "Voodoo Using Glide %s\n", buf);
+ fprintf(stderr, "Voodoo Number of boards: %d\n", glbHWConfig.num_sst);
+ fprintf(stderr, "Voodoo Number of TMUs: %d\n", voodoo->nTexelfx);
+ fprintf(stderr, "Voodoo fbRam: %d\n", voodoo->fbRam);
+ fprintf(stderr, "Voodoo fbiRev: %d\n", voodoo->fbiRev);
+ fprintf(stderr, "Voodoo chips detected: %d\n", voodoo->numChips);
}
}
else {
@@ -858,7 +778,7 @@ fxQueryHardware(void)
glbGlideInitialized = 1;
#if defined(__WIN32__)
- onexit((_onexit_t) cleangraphics);
+ _onexit((_onexit_t) cleangraphics);
#elif defined(__linux__)
/* Only register handler if environment variable is not defined. */
if (!getenv("MESA_FX_NO_SIGNALS")) {
diff --git a/src/mesa/drivers/glide/fxdd.c b/src/mesa/drivers/glide/fxdd.c
index 81d3754e42e..3b58eb0535d 100644
--- a/src/mesa/drivers/glide/fxdd.c
+++ b/src/mesa/drivers/glide/fxdd.c
@@ -2,7 +2,7 @@
* fxDDReadPixels888 does not convert 8A8R8G8B into 5R5G5B
*/
-/* $Id: fxdd.c,v 1.98 2003/07/17 14:50:12 brianp Exp $ */
+/* $Id: fxdd.c,v 1.99 2003/08/19 15:52:53 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -33,6 +33,8 @@
* Brian Paul
* Daryll Strauss
* Keith Whitwell
+ * Daniel Borca
+ * Hiroshi Morii
*/
/* fxdd.c - 3Dfx VooDoo Mesa device driver functions */
@@ -167,7 +169,8 @@ fxDDClear(GLcontext * ctx, GLbitfield mask, GLboolean all,
{
fxMesaContext fxMesa = (fxMesaContext) ctx->DriverCtx;
const GLuint colorMask = *((GLuint *) & ctx->Color.ColorMask);
- const FxU16 clearD = (FxU16) (ctx->Depth.Clear * 0xffff);
+ /* [dBorca] should use an adequate scaler for 16 vs 32bit (GR_ZDEPTH_MIN_MAX) */
+ const FxU32 clearD = (FxU32) (ctx->Depth.Clear * 0x00ffffff);
GLbitfield softwareMask = mask & (DD_STENCIL_BIT | DD_ACCUM_BIT);
/* we can't clear stencil or accum buffers */
@@ -191,11 +194,11 @@ fxDDClear(GLcontext * ctx, GLbitfield mask, GLboolean all,
switch (mask) {
case DD_BACK_LEFT_BIT | DD_DEPTH_BIT:
/* back buffer & depth */
- FX_grDepthMask(FXTRUE);
- FX_grRenderBuffer(GR_BUFFER_BACKBUFFER);
+ grDepthMask(FXTRUE);
+ grRenderBuffer(GR_BUFFER_BACKBUFFER);
FX_grBufferClear(fxMesa->clearC, fxMesa->clearA, clearD);
if (!ctx->Depth.Mask) {
- FX_grDepthMask(FXFALSE);
+ grDepthMask(FXFALSE);
}
break;
case DD_FRONT_LEFT_BIT | DD_DEPTH_BIT:
@@ -204,70 +207,68 @@ fxDDClear(GLcontext * ctx, GLbitfield mask, GLboolean all,
* This is a work-around/
*/
/* clear depth */
- FX_grDepthMask(FXTRUE);
- FX_grRenderBuffer(GR_BUFFER_BACKBUFFER);
- FX_grColorMask(FXFALSE, FXFALSE);
+ grDepthMask(FXTRUE);
+ grRenderBuffer(GR_BUFFER_BACKBUFFER);
+ grColorMask(FXFALSE, FXFALSE);
FX_grBufferClear(fxMesa->clearC, fxMesa->clearA, clearD);
/* clear front */
- FX_grColorMask(FXTRUE, ctx->Color.ColorMask[ACOMP]
- && fxMesa->haveAlphaBuffer);
- FX_grRenderBuffer(GR_BUFFER_FRONTBUFFER);
+ grColorMask(FXTRUE, ctx->Color.ColorMask[ACOMP] && fxMesa->haveAlphaBuffer);
+ grRenderBuffer(GR_BUFFER_FRONTBUFFER);
FX_grBufferClear(fxMesa->clearC, fxMesa->clearA, clearD);
break;
case DD_BACK_LEFT_BIT:
/* back buffer only */
- FX_grDepthMask(FXFALSE);
- FX_grRenderBuffer(GR_BUFFER_BACKBUFFER);
+ grDepthMask(FXFALSE);
+ grRenderBuffer(GR_BUFFER_BACKBUFFER);
FX_grBufferClear(fxMesa->clearC, fxMesa->clearA, clearD);
if (ctx->Depth.Mask) {
- FX_grDepthMask(FXTRUE);
+ grDepthMask(FXTRUE);
}
break;
case DD_FRONT_LEFT_BIT:
/* front buffer only */
- FX_grDepthMask(FXFALSE);
- FX_grRenderBuffer(GR_BUFFER_FRONTBUFFER);
+ grDepthMask(FXFALSE);
+ grRenderBuffer(GR_BUFFER_FRONTBUFFER);
FX_grBufferClear(fxMesa->clearC, fxMesa->clearA, clearD);
if (ctx->Depth.Mask) {
- FX_grDepthMask(FXTRUE);
+ grDepthMask(FXTRUE);
}
break;
case DD_FRONT_LEFT_BIT | DD_BACK_LEFT_BIT:
/* front and back */
- FX_grDepthMask(FXFALSE);
- FX_grRenderBuffer(GR_BUFFER_BACKBUFFER);
+ grDepthMask(FXFALSE);
+ grRenderBuffer(GR_BUFFER_BACKBUFFER);
FX_grBufferClear(fxMesa->clearC, fxMesa->clearA, clearD);
- FX_grRenderBuffer(GR_BUFFER_FRONTBUFFER);
+ grRenderBuffer(GR_BUFFER_FRONTBUFFER);
FX_grBufferClear(fxMesa->clearC, fxMesa->clearA, clearD);
if (ctx->Depth.Mask) {
- FX_grDepthMask(FXTRUE);
+ grDepthMask(FXTRUE);
}
break;
case DD_FRONT_LEFT_BIT | DD_BACK_LEFT_BIT | DD_DEPTH_BIT:
/* clear front */
- FX_grDepthMask(FXFALSE);
- FX_grRenderBuffer(GR_BUFFER_FRONTBUFFER);
+ grDepthMask(FXFALSE);
+ grRenderBuffer(GR_BUFFER_FRONTBUFFER);
FX_grBufferClear(fxMesa->clearC, fxMesa->clearA, clearD);
/* clear back and depth */
- FX_grDepthMask(FXTRUE);
- FX_grRenderBuffer(GR_BUFFER_BACKBUFFER);
+ grDepthMask(FXTRUE);
+ grRenderBuffer(GR_BUFFER_BACKBUFFER);
FX_grBufferClear(fxMesa->clearC, fxMesa->clearA, clearD);
if (!ctx->Depth.Mask) {
- FX_grDepthMask(FXFALSE);
+ grDepthMask(FXFALSE);
}
break;
case DD_DEPTH_BIT:
/* just the depth buffer */
- FX_grRenderBuffer(GR_BUFFER_BACKBUFFER);
- FX_grColorMask(FXFALSE, FXFALSE);
- FX_grDepthMask(FXTRUE);
+ grRenderBuffer(GR_BUFFER_BACKBUFFER);
+ grColorMask(FXFALSE, FXFALSE);
+ grDepthMask(FXTRUE);
FX_grBufferClear(fxMesa->clearC, fxMesa->clearA, clearD);
- FX_grColorMask(FXTRUE, ctx->Color.ColorMask[ACOMP]
- && fxMesa->haveAlphaBuffer);
+ grColorMask(FXTRUE, ctx->Color.ColorMask[ACOMP] && fxMesa->haveAlphaBuffer);
if (ctx->Color._DrawDestMask & FRONT_LEFT_BIT)
- FX_grRenderBuffer(GR_BUFFER_FRONTBUFFER);
+ grRenderBuffer(GR_BUFFER_FRONTBUFFER);
if (!ctx->Depth.Test || !ctx->Depth.Mask)
- FX_grDepthMask(FXFALSE);
+ grDepthMask(FXFALSE);
break;
default:
/* error */
@@ -294,14 +295,14 @@ fxDDSetDrawBuffer(GLcontext * ctx, GLenum mode)
if (mode == GL_FRONT_LEFT) {
fxMesa->currentFB = GR_BUFFER_FRONTBUFFER;
- FX_grRenderBuffer(fxMesa->currentFB);
+ grRenderBuffer(fxMesa->currentFB);
}
else if (mode == GL_BACK_LEFT) {
fxMesa->currentFB = GR_BUFFER_BACKBUFFER;
- FX_grRenderBuffer(fxMesa->currentFB);
+ grRenderBuffer(fxMesa->currentFB);
}
else if (mode == GL_NONE) {
- FX_grColorMask(FXFALSE, FXFALSE);
+ grColorMask(FXFALSE, FXFALSE);
}
else {
/* we'll need a software fallback */
@@ -404,10 +405,10 @@ fxDDDrawBitmap(GLcontext * ctx, GLint px, GLint py,
}
info.size = sizeof(info);
- if (!FX_grLfbLock(GR_LFB_WRITE_ONLY,
- fxMesa->currentFB,
- GR_LFBWRITEMODE_565,
- GR_ORIGIN_UPPER_LEFT, FXFALSE, &info)) {
+ if (!grLfbLock(GR_LFB_WRITE_ONLY,
+ fxMesa->currentFB,
+ GR_LFBWRITEMODE_565,
+ GR_ORIGIN_UPPER_LEFT, FXFALSE, &info)) {
#ifndef FX_SILENT
fprintf(stderr, "fx Driver: error locking the linear frame buffer\n");
#endif
@@ -476,7 +477,7 @@ fxDDDrawBitmap(GLcontext * ctx, GLint px, GLint py,
}
}
- FX_grLfbUnlock(GR_LFB_WRITE_ONLY, fxMesa->currentFB);
+ grLfbUnlock(GR_LFB_WRITE_ONLY, fxMesa->currentFB);
}
@@ -783,7 +784,7 @@ static void fxDDReadPixels888 (GLcontext * ctx,
static void
fxDDFinish(GLcontext * ctx)
{
- FX_grFlush();
+ grFlush();
}
@@ -797,43 +798,23 @@ fxDDFinish(GLcontext * ctx)
static const GLubyte *
fxDDGetString(GLcontext * ctx, GLenum name)
{
- switch (name) {
- case GL_RENDERER:
- {
- static char buf[80];
-
- if (glbHWConfig.SSTs[glbCurrentBoard].type == GR_SSTTYPE_VOODOO) {
- GrVoodooConfig_t *vc =
- &glbHWConfig.SSTs[glbCurrentBoard].sstBoard.VoodooConfig;
-
- sprintf(buf,
- "Mesa Glide v0.30 Voodoo_Graphics %d "
- "CARD/%d FB/%d TM/%d TMU/%s",
- glbCurrentBoard,
- (vc->sliDetect ? (vc->fbRam * 2) : vc->fbRam),
- (vc->tmuConfig[GR_TMU0].tmuRam +
- ((vc->nTexelfx > 1) ? vc->tmuConfig[GR_TMU1].
- tmuRam : 0)), vc->nTexelfx,
- (vc->sliDetect ? "SLI" : "NOSLI"));
- }
- else if (glbHWConfig.SSTs[glbCurrentBoard].type == GR_SSTTYPE_SST96) {
- GrSst96Config_t *sc =
- &glbHWConfig.SSTs[glbCurrentBoard].sstBoard.SST96Config;
-
- sprintf(buf,
- "Glide v0.30 Voodoo_Rush %d "
- "CARD/%d FB/%d TM/%d TMU/NOSLI",
- glbCurrentBoard,
- sc->fbRam, sc->tmuConfig.tmuRam, sc->nTexelfx);
- }
- else {
- strcpy(buf, "Glide v0.30 UNKNOWN");
- }
- return (GLubyte *) buf;
- }
- default:
- return NULL;
- }
+ switch (name) {
+ case GL_RENDERER:
+ {
+ static char buf[80];
+ GrVoodooConfig_t *vc = &glbHWConfig.SSTs[glbCurrentBoard].VoodooConfig;
+ sprintf(buf, "Mesa %s v0.31 %s %dMB FB, %dMB TM, %d TMU, %s",
+ grGetString(GR_RENDERER),
+ grGetString(GR_HARDWARE),
+ vc->fbRam,
+ (vc->tmuConfig[GR_TMU0].tmuRam + ((vc->nTexelfx > 1) ? vc->tmuConfig[GR_TMU1].tmuRam : 0)),
+ (vc->nTexelfx * vc->numChips),
+ (vc->numChips > 1) ? "SLI" : "NOSLI");
+ return (GLubyte *)buf;
+ }
+ default:
+ return NULL;
+ }
}
static const struct gl_pipeline_stage *fx_pipeline[] = {
@@ -909,18 +890,18 @@ fxDDInitFxMesaContext(fxMesaContext fxMesa)
fxMesa->unitsState.depthMask = GL_TRUE;
fxMesa->unitsState.depthTestFunc = GR_CMP_LESS;
- FX_grColorMask(FXTRUE, fxMesa->haveAlphaBuffer ? FXTRUE : FXFALSE);
+ grColorMask(FXTRUE, fxMesa->haveAlphaBuffer ? FXTRUE : FXFALSE);
if (fxMesa->haveDoubleBuffer) {
fxMesa->currentFB = GR_BUFFER_BACKBUFFER;
- FX_grRenderBuffer(GR_BUFFER_BACKBUFFER);
+ grRenderBuffer(GR_BUFFER_BACKBUFFER);
}
else {
fxMesa->currentFB = GR_BUFFER_FRONTBUFFER;
- FX_grRenderBuffer(GR_BUFFER_FRONTBUFFER);
+ grRenderBuffer(GR_BUFFER_FRONTBUFFER);
}
- fxMesa->state = malloc(FX_grGetInteger(FX_GLIDE_STATE_SIZE));
- fxMesa->fogTable = (GrFog_t *) malloc(FX_grGetInteger(FX_FOG_TABLE_ENTRIES) *
+ fxMesa->state = malloc(FX_grGetInteger(GR_GLIDE_STATE_SIZE));
+ fxMesa->fogTable = (GrFog_t *) malloc(FX_grGetInteger(GR_FOG_TABLE_ENTRIES) *
sizeof(GrFog_t));
if (!fxMesa->state || !fxMesa->fogTable) {
@@ -932,14 +913,19 @@ fxDDInitFxMesaContext(fxMesaContext fxMesa)
}
if (fxMesa->haveZBuffer)
- FX_grDepthBufferMode(GR_DEPTHBUFFER_ZBUFFER);
+ grDepthBufferMode(GR_DEPTHBUFFER_ZBUFFER);
-#ifndef FXMESA_USE_ARGB
- FX_grLfbWriteColorFormat(GR_COLORFORMAT_ABGR); /* Not every Glide has this */
-#endif
+ grLfbWriteColorFormat(GR_COLORFORMAT_ABGR);
- fxMesa->textureAlign = FX_grGetInteger(FX_TEXTURE_ALIGN);
- fxMesa->glCtx->Const.MaxTextureLevels = 9;
+ fxMesa->textureAlign = FX_grGetInteger(GR_TEXTURE_ALIGN);
+ /* [koolsmoky] */
+ {
+ int textureSize = ((fxMesa->maxTextureSize > 2048) ? 2048 : fxMesa->maxTextureSize);
+ fxMesa->glCtx->Const.MaxTextureLevels = 0;
+ do {
+ fxMesa->glCtx->Const.MaxTextureLevels++;
+ } while ((textureSize >>= 0x1) & 0x7ff);
+ }
fxMesa->glCtx->Const.MaxTextureUnits = fxMesa->haveTwoTMUs ? 2 : 1;
fxMesa->new_state = _NEW_ALL;
@@ -950,6 +936,7 @@ fxDDInitFxMesaContext(fxMesaContext fxMesa)
_tnl_CreateContext(fxMesa->glCtx);
_swsetup_CreateContext(fxMesa->glCtx);
+ /* Install customized pipeline */
_tnl_destroy_pipeline(fxMesa->glCtx);
_tnl_install_pipeline(fxMesa->glCtx, fx_pipeline);
@@ -970,7 +957,7 @@ fxDDInitFxMesaContext(fxMesaContext fxMesa)
fxDDInitExtensions(fxMesa->glCtx);
- FX_grGlideGetState((GrState *) fxMesa->state);
+ grGlideGetState((GrState *) fxMesa->state);
return 1;
}
diff --git a/src/mesa/drivers/glide/fxddspan.c b/src/mesa/drivers/glide/fxddspan.c
index e106ce291e2..6e847acce4e 100644
--- a/src/mesa/drivers/glide/fxddspan.c
+++ b/src/mesa/drivers/glide/fxddspan.c
@@ -1,9 +1,11 @@
/* Hack alert:
- * Depth32 functions won't compile with Glide2
+ * The performance hit is disastruous for SPAN functions.
+ * Should we use SpanRenderStart / SpanRenderFinish in `swrast.h'
+ * for locking / unlocking the LFB?
* Optimize and check endianess for `read_R8G8B8_pixels'
*/
-/* $Id: fxddspan.c,v 1.23 2003/07/17 14:50:12 brianp Exp $ */
+/* $Id: fxddspan.c,v 1.24 2003/08/19 15:52:53 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -34,6 +36,8 @@
* Brian Paul
* Daryll Strauss
* Keith Whitwell
+ * Daniel Borca
+ * Hiroshi Morii
*/
@@ -60,9 +64,6 @@
#endif
-#if !defined(FXMESA_USE_ARGB)
-
-
#define writeRegionClipped(fxm,dst_buffer,dst_x,dst_y,src_format,src_width,src_height,src_stride,src_data) \
FX_grLfbWriteRegion(dst_buffer,dst_x,dst_y,src_format,src_width,src_height,src_stride,src_data)
@@ -87,42 +88,6 @@
src_data) \
-#else /* !defined(FXMESA_USE_RGBA) */
-
-#define writeRegionClipped(fxm,dst_buffer,dst_x,dst_y,src_format,src_width,src_height,src_stride,src_data) \
- FX_grLfbWriteRegion(dst_buffer,dst_x,dst_y,src_format,src_width,src_height,src_stride,src_data)
-
-
-#define MESACOLOR_TO_ARGB(c) ( \
- ( ((unsigned int)(c[ACOMP]))<<24 ) | \
- ( ((unsigned int)(c[RCOMP]))<<16 ) | \
- ( ((unsigned int)(c[GCOMP]))<<8 ) | \
- ( (unsigned int)(c[BCOMP])) )
-
-inline void
-LFB_WRITE_SPAN_MESA(GrBuffer_t dst_buffer,
- FxU32 dst_x,
- FxU32 dst_y,
- FxU32 src_width, FxI32 src_stride, void *src_data)
-{
- /* Covert to ARGB */
- GLubyte(*rgba)[4] = src_data;
- GLuint argb[MAX_WIDTH];
- int i;
-
- for (i = 0; i < src_width; i++) {
- argb[i] = MESACOLOR_TO_ARGB(rgba[i]);
- }
- writeRegionClipped( /*fxMesa, */ NULL, dst_buffer,
- dst_x,
- dst_y,
- GR_LFB_SRC_FMT_8888,
- src_width, 1, src_stride, (void *) argb);
-}
-
-#endif /* !defined(FXMESA_USE_RGBA) */
-
-
/************************************************************************/
/***** Span functions *****/
/************************************************************************/
@@ -412,7 +377,7 @@ static void read_R8G8B8_span (const GLcontext * ctx,
{
fxMesaContext fxMesa = (fxMesaContext) ctx->DriverCtx;
BEGIN_BOARD_LOCK();
- FX_grLfbReadRegion(fxMesa->currentFB, x, fxMesa->height - 1 - y, n, 1, n * 4, rgba);
+ grLfbReadRegion(fxMesa->currentFB, x, fxMesa->height - 1 - y, n, 1, n * 4, rgba);
END_BOARD_LOCK();
}
@@ -602,6 +567,7 @@ fxDDWriteDepth32Span(GLcontext * ctx,
{
fxMesaContext fxMesa = (fxMesaContext) ctx->DriverCtx;
GLint bottom = fxMesa->height - 1;
+ GLint i;
if (MESA_VERBOSE & VERBOSE_DRIVER) {
fprintf(stderr, "fxmesa: fxDDWriteDepth32Span(...)\n");
@@ -609,17 +575,21 @@ fxDDWriteDepth32Span(GLcontext * ctx,
if (mask) {
- GLint i;
for (i = 0; i < n; i++) {
if (mask[i]) {
+ GLuint d = depth[i] << 8;
writeRegionClipped(fxMesa, GR_BUFFER_AUXBUFFER, x + i, bottom - y,
- GR_LFBWRITEMODE_Z32, 1, 1, 0, (void *) &depth[i]);
+ GR_LFBWRITEMODE_Z32, 1, 1, 0, (void *) &d);
}
}
}
else {
+ GLuint depth32[MAX_WIDTH];
+ for (i = 0; i < n; i++) {
+ depth32[i] = depth[i] << 8;
+ }
writeRegionClipped(fxMesa, GR_BUFFER_AUXBUFFER, x, bottom - y,
- GR_LFBWRITEMODE_Z32, n, 1, 0, (void *) depth);
+ GR_LFBWRITEMODE_Z32, n, 1, 0, (void *) depth32);
}
}
@@ -637,7 +607,7 @@ fxDDReadDepthSpan(GLcontext * ctx,
fprintf(stderr, "fxmesa: fxDDReadDepthSpan(...)\n");
}
- FX_grLfbReadRegion(GR_BUFFER_AUXBUFFER, x, bottom - y, n, 1, 0, depth16);
+ grLfbReadRegion(GR_BUFFER_AUXBUFFER, x, bottom - y, n, 1, 0, depth16);
for (i = 0; i < n; i++) {
depth[i] = depth16[i];
}
@@ -655,7 +625,7 @@ fxDDReadDepth32Span(GLcontext * ctx,
fprintf(stderr, "fxmesa: fxDDReadDepth32Span(...)\n");
}
- FX_grLfbReadRegion(GR_BUFFER_AUXBUFFER, x, bottom - y, n, 1, 0, depth);
+ grLfbReadRegion(GR_BUFFER_AUXBUFFER, x, bottom - y, n, 1, 0, depth);
}
@@ -702,8 +672,9 @@ fxDDWriteDepth32Pixels(GLcontext * ctx,
if (mask[i]) {
int xpos = x[i];
int ypos = bottom - y[i];
+ GLuint d = depth[i] << 8;
writeRegionClipped(fxMesa, GR_BUFFER_AUXBUFFER, xpos, ypos,
- GR_LFBWRITEMODE_Z32, 1, 1, 0, (void *) &depth[i]);
+ GR_LFBWRITEMODE_Z32, 1, 1, 0, (void *) &d);
}
}
}
@@ -725,7 +696,7 @@ fxDDReadDepthPixels(GLcontext * ctx, GLuint n,
int xpos = x[i];
int ypos = bottom - y[i];
GLushort d;
- FX_grLfbReadRegion(GR_BUFFER_AUXBUFFER, xpos, ypos, 1, 1, 0, &d);
+ grLfbReadRegion(GR_BUFFER_AUXBUFFER, xpos, ypos, 1, 1, 0, &d);
depth[i] = d;
}
}
@@ -746,7 +717,7 @@ fxDDReadDepth32Pixels(GLcontext * ctx, GLuint n,
for (i = 0; i < n; i++) {
int xpos = x[i];
int ypos = bottom - y[i];
- FX_grLfbReadRegion(GR_BUFFER_AUXBUFFER, xpos, ypos, 1, 1, 0, &depth[i]);
+ grLfbReadRegion(GR_BUFFER_AUXBUFFER, xpos, ypos, 1, 1, 0, &depth[i]);
}
}
@@ -766,11 +737,11 @@ fxDDSetBuffer(GLcontext * ctx, GLframebuffer * buffer, GLuint bufferBit)
if (bufferBit == FRONT_LEFT_BIT) {
fxMesa->currentFB = GR_BUFFER_FRONTBUFFER;
- FX_grRenderBuffer(fxMesa->currentFB);
+ grRenderBuffer(fxMesa->currentFB);
}
else if (bufferBit == BACK_LEFT_BIT) {
fxMesa->currentFB = GR_BUFFER_BACKBUFFER;
- FX_grRenderBuffer(fxMesa->currentFB);
+ grRenderBuffer(fxMesa->currentFB);
}
}
diff --git a/src/mesa/drivers/glide/fxddtex.c b/src/mesa/drivers/glide/fxddtex.c
index fafdb7c4d68..a2c3aec8a51 100644
--- a/src/mesa/drivers/glide/fxddtex.c
+++ b/src/mesa/drivers/glide/fxddtex.c
@@ -1,4 +1,4 @@
-/* $Id: fxddtex.c,v 1.46 2001/11/06 16:01:19 brianp Exp $ */
+/* $Id: fxddtex.c,v 1.47 2003/08/19 15:52:53 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -29,6 +29,8 @@
* Brian Paul
* Daryll Strauss
* Keith Whitwell
+ * Daniel Borca
+ * Hiroshi Morii
*/
@@ -172,10 +174,10 @@ fxDDTexEnv(GLcontext * ctx, GLenum target, GLenum pname,
/* apply any lod biasing right now */
if (pname == GL_TEXTURE_LOD_BIAS_EXT) {
- FX_grTexLodBiasValue(GR_TMU0, *param);
+ grTexLodBiasValue(GR_TMU0, *param);
if (fxMesa->haveTwoTMUs) {
- FX_grTexLodBiasValue(GR_TMU1, *param);
+ grTexLodBiasValue(GR_TMU1, *param);
}
}
@@ -450,11 +452,7 @@ fxDDTexUseGlbPalette(GLcontext * ctx, GLboolean state)
if (state) {
fxMesa->haveGlobalPaletteTexture = 1;
- FX_grTexDownloadTable(GR_TMU0, GR_TEXTABLE_PALETTE,
- &(fxMesa->glbPalette));
- if (fxMesa->haveTwoTMUs)
- FX_grTexDownloadTable(GR_TMU1, GR_TEXTABLE_PALETTE,
- &(fxMesa->glbPalette));
+ grTexDownloadTable(GR_TEXTABLE_PALETTE, &(fxMesa->glbPalette));
}
else {
fxMesa->haveGlobalPaletteTexture = 0;
@@ -504,8 +502,8 @@ fxTexGetInfo(int w, int h, GrLOD_t * lodlevel, GrAspectRatio_t * ar,
float *sscale, float *tscale,
int *i_sscale, int *i_tscale, int *wscale, int *hscale)
{
-
- static GrLOD_t lod[9] = { GR_LOD_256, GR_LOD_128, GR_LOD_64, GR_LOD_32,
+ /* [koolsmoky] */
+ static GrLOD_t lod[12] = { GR_LOD_2048, GR_LOD_1024, GR_LOD_512, GR_LOD_256, GR_LOD_128, GR_LOD_64, GR_LOD_32,
GR_LOD_16, GR_LOD_8, GR_LOD_4, GR_LOD_2, GR_LOD_1
};
@@ -521,14 +519,14 @@ fxTexGetInfo(int w, int h, GrLOD_t * lodlevel, GrAspectRatio_t * ar,
switch (logw - logh) {
case 0:
aspectratio = GR_ASPECT_1x1;
- l = lod[8 - logw];
+ l = lod[11 - logw];
s = t = 256.0f;
is = it = INT_TRICK(8);
ws = hs = 1;
break;
case 1:
aspectratio = GR_ASPECT_2x1;
- l = lod[8 - logw];
+ l = lod[11 - logw];
s = 256.0f;
t = 128.0f;
is = INT_TRICK(8);
@@ -538,7 +536,7 @@ fxTexGetInfo(int w, int h, GrLOD_t * lodlevel, GrAspectRatio_t * ar,
break;
case 2:
aspectratio = GR_ASPECT_4x1;
- l = lod[8 - logw];
+ l = lod[11 - logw];
s = 256.0f;
t = 64.0f;
is = INT_TRICK(8);
@@ -548,7 +546,7 @@ fxTexGetInfo(int w, int h, GrLOD_t * lodlevel, GrAspectRatio_t * ar,
break;
case 3:
aspectratio = GR_ASPECT_8x1;
- l = lod[8 - logw];
+ l = lod[11 - logw];
s = 256.0f;
t = 32.0f;
is = INT_TRICK(8);
@@ -558,7 +556,7 @@ fxTexGetInfo(int w, int h, GrLOD_t * lodlevel, GrAspectRatio_t * ar,
break;
case 4:
aspectratio = GR_ASPECT_8x1;
- l = lod[8 - logw];
+ l = lod[11 - logw];
s = 256.0f;
t = 32.0f;
is = INT_TRICK(8);
@@ -568,7 +566,7 @@ fxTexGetInfo(int w, int h, GrLOD_t * lodlevel, GrAspectRatio_t * ar,
break;
case 5:
aspectratio = GR_ASPECT_8x1;
- l = lod[8 - logw];
+ l = lod[11 - logw];
s = 256.0f;
t = 32.0f;
is = INT_TRICK(8);
@@ -578,7 +576,7 @@ fxTexGetInfo(int w, int h, GrLOD_t * lodlevel, GrAspectRatio_t * ar,
break;
case 6:
aspectratio = GR_ASPECT_8x1;
- l = lod[8 - logw];
+ l = lod[11 - logw];
s = 256.0f;
t = 32.0f;
is = INT_TRICK(8);
@@ -588,7 +586,7 @@ fxTexGetInfo(int w, int h, GrLOD_t * lodlevel, GrAspectRatio_t * ar,
break;
case 7:
aspectratio = GR_ASPECT_8x1;
- l = lod[8 - logw];
+ l = lod[11 - logw];
s = 256.0f;
t = 32.0f;
is = INT_TRICK(8);
@@ -598,7 +596,7 @@ fxTexGetInfo(int w, int h, GrLOD_t * lodlevel, GrAspectRatio_t * ar,
break;
case 8:
aspectratio = GR_ASPECT_8x1;
- l = lod[8 - logw];
+ l = lod[11 - logw];
s = 256.0f;
t = 32.0f;
is = INT_TRICK(8);
@@ -606,9 +604,39 @@ fxTexGetInfo(int w, int h, GrLOD_t * lodlevel, GrAspectRatio_t * ar,
ws = 1;
hs = 32;
break;
+ case 9:
+ aspectratio = GR_ASPECT_8x1;
+ l = lod[11 - logw];
+ s = 256.0f;
+ t = 32.0f;
+ is = INT_TRICK(8);
+ it = INT_TRICK(5);
+ ws = 1;
+ hs = 64;
+ break;
+ case 10:
+ aspectratio = GR_ASPECT_8x1;
+ l = lod[11 - logw];
+ s = 256.0f;
+ t = 32.0f;
+ is = INT_TRICK(8);
+ it = INT_TRICK(5);
+ ws = 1;
+ hs = 128;
+ break;
+ case 11:
+ aspectratio = GR_ASPECT_8x1;
+ l = lod[11 - logw];
+ s = 256.0f;
+ t = 32.0f;
+ is = INT_TRICK(8);
+ it = INT_TRICK(5);
+ ws = 1;
+ hs = 256;
+ break;
case -1:
aspectratio = GR_ASPECT_1x2;
- l = lod[8 - logh];
+ l = lod[11 - logh];
s = 128.0f;
t = 256.0f;
is = INT_TRICK(7);
@@ -618,7 +646,7 @@ fxTexGetInfo(int w, int h, GrLOD_t * lodlevel, GrAspectRatio_t * ar,
break;
case -2:
aspectratio = GR_ASPECT_1x4;
- l = lod[8 - logh];
+ l = lod[11 - logh];
s = 64.0f;
t = 256.0f;
is = INT_TRICK(6);
@@ -628,7 +656,7 @@ fxTexGetInfo(int w, int h, GrLOD_t * lodlevel, GrAspectRatio_t * ar,
break;
case -3:
aspectratio = GR_ASPECT_1x8;
- l = lod[8 - logh];
+ l = lod[11 - logh];
s = 32.0f;
t = 256.0f;
is = INT_TRICK(5);
@@ -638,7 +666,7 @@ fxTexGetInfo(int w, int h, GrLOD_t * lodlevel, GrAspectRatio_t * ar,
break;
case -4:
aspectratio = GR_ASPECT_1x8;
- l = lod[8 - logh];
+ l = lod[11 - logh];
s = 32.0f;
t = 256.0f;
is = INT_TRICK(5);
@@ -648,7 +676,7 @@ fxTexGetInfo(int w, int h, GrLOD_t * lodlevel, GrAspectRatio_t * ar,
break;
case -5:
aspectratio = GR_ASPECT_1x8;
- l = lod[8 - logh];
+ l = lod[11 - logh];
s = 32.0f;
t = 256.0f;
is = INT_TRICK(5);
@@ -658,7 +686,7 @@ fxTexGetInfo(int w, int h, GrLOD_t * lodlevel, GrAspectRatio_t * ar,
break;
case -6:
aspectratio = GR_ASPECT_1x8;
- l = lod[8 - logh];
+ l = lod[11 - logh];
s = 32.0f;
t = 256.0f;
is = INT_TRICK(5);
@@ -668,7 +696,7 @@ fxTexGetInfo(int w, int h, GrLOD_t * lodlevel, GrAspectRatio_t * ar,
break;
case -7:
aspectratio = GR_ASPECT_1x8;
- l = lod[8 - logh];
+ l = lod[11 - logh];
s = 32.0f;
t = 256.0f;
is = INT_TRICK(5);
@@ -678,7 +706,7 @@ fxTexGetInfo(int w, int h, GrLOD_t * lodlevel, GrAspectRatio_t * ar,
break;
case -8:
aspectratio = GR_ASPECT_1x8;
- l = lod[8 - logh];
+ l = lod[11 - logh];
s = 32.0f;
t = 256.0f;
is = INT_TRICK(5);
@@ -686,6 +714,36 @@ fxTexGetInfo(int w, int h, GrLOD_t * lodlevel, GrAspectRatio_t * ar,
ws = 32;
hs = 1;
break;
+ case -9:
+ aspectratio = GR_ASPECT_1x8;
+ l = lod[11 - logh];
+ s = 32.0f;
+ t = 256.0f;
+ is = INT_TRICK(5);
+ it = INT_TRICK(8);
+ ws = 64;
+ hs = 1;
+ break;
+ case -10:
+ aspectratio = GR_ASPECT_1x8;
+ l = lod[11 - logh];
+ s = 32.0f;
+ t = 256.0f;
+ is = INT_TRICK(5);
+ it = INT_TRICK(8);
+ ws = 128;
+ hs = 1;
+ break;
+ case -11:
+ aspectratio = GR_ASPECT_1x8;
+ l = lod[11 - logh];
+ s = 32.0f;
+ t = 256.0f;
+ is = INT_TRICK(5);
+ it = INT_TRICK(8);
+ ws = 256;
+ hs = 1;
+ break;
default:
return 0;
break;
@@ -724,8 +782,10 @@ fxTexGetInfo(int w, int h, GrLOD_t * lodlevel, GrAspectRatio_t * ar,
* Glide internal texture format and base texture format.
*/
void
-fxTexGetFormat(GLenum glformat, GrTextureFormat_t * tfmt, GLint * ifmt)
+fxTexGetFormat(GLcontext *ctx, GLenum glformat, GrTextureFormat_t * tfmt, GLint * ifmt) /* [koolsmoky] */
{
+ fxMesaContext fxMesa = FX_CONTEXT(ctx);
+
switch (glformat) {
case 1:
case GL_LUMINANCE:
@@ -771,33 +831,61 @@ fxTexGetFormat(GLenum glformat, GrTextureFormat_t * tfmt, GLint * ifmt)
if (ifmt)
(*ifmt) = GL_ALPHA;
break;
- case 3:
- case GL_RGB:
case GL_R3_G3_B2:
case GL_RGB4:
case GL_RGB5:
+ if (tfmt)
+ (*tfmt) = GR_TEXFMT_RGB_565;
+ if (ifmt)
+ (*ifmt) = GL_RGB;
+ break;
+ case 3:
+ case GL_RGB:
case GL_RGB8:
case GL_RGB10:
case GL_RGB12:
case GL_RGB16:
+#if 0 /* [koolsmoky] getting ready for 32bpp textures */
+ if (fxMesa->colDepth == 32) {
+ if (tfmt) (*tfmt) = GR_TEXFMT_ARGB_8888;
+ } else {
+ if (tfmt) (*tfmt) = GR_TEXFMT_RGB_565;
+ }
+ if (ifmt) (*ifmt) = GL_RGB;
+#else
if (tfmt)
(*tfmt) = GR_TEXFMT_RGB_565;
if (ifmt)
(*ifmt) = GL_RGB;
+#endif
break;
- case 4:
- case GL_RGBA:
case GL_RGBA2:
case GL_RGBA4:
+ if (tfmt)
+ (*tfmt) = GR_TEXFMT_ARGB_4444;
+ if (ifmt)
+ (*ifmt) = GL_RGBA;
+ break;
+ case 4:
+ case GL_RGBA:
case GL_RGBA8:
case GL_RGB10_A2:
case GL_RGBA12:
case GL_RGBA16:
+#if 0 /* [koolsmoky] getting ready for 32bpp textures */
+ if (fxMesa->colDepth == 32) {
+ if (tfmt) (*tfmt) = GR_TEXFMT_ARGB_8888;
+ } else {
+ if (tfmt) (*tfmt) = GR_TEXFMT_ARGB_4444;
+ }
+ if (ifmt) (*ifmt) = GL_RGBA;
+#else
if (tfmt)
(*tfmt) = GR_TEXFMT_ARGB_4444;
if (ifmt)
(*ifmt) = GL_RGBA;
- break;
+#endif
+ break;
case GL_RGB5_A1:
if (tfmt)
(*tfmt) = GR_TEXFMT_ARGB_1555;
@@ -1008,6 +1096,27 @@ fetch_r5g5b5a1(const struct gl_texture_image *texImage,
}
+#if 0 /* [koolsmoky] getting ready for 32bpp textures */
+static void
+fetch_a8r8g8b8(const struct gl_texture_image *texImage,
+ GLint i, GLint j, GLint k, GLvoid * texelOut)
+{
+ GLchan *rgba = (GLchan *) texelOut;
+ const tfxMipMapLevel *mml = FX_MIPMAP_DATA(texImage);
+ const GLuint *texel;
+
+ i = i * mml->wScale;
+ j = j * mml->hScale;
+
+ texel = ((GLuint *) texImage->Data) + j * mml->width + i;
+ rgba[RCOMP] = (((*texel) >> 16) & 0xff);
+ rgba[GCOMP] = (((*texel) >> 8) & 0xff);
+ rgba[BCOMP] = (((*texel)) & 0xff);
+ rgba[ACOMP] = (((*texel) >> 24) & 0xff);
+}
+#endif
+
+
static void
PrintTexture(int w, int h, int c, const GLubyte * data)
{
@@ -1029,6 +1138,8 @@ const struct gl_texture_format *
fxDDChooseTextureFormat( GLcontext *ctx, GLint internalFormat,
GLenum srcFormat, GLenum srcType )
{
+ fxMesaContext fxMesa = FX_CONTEXT(ctx);
+
switch (internalFormat) {
case GL_INTENSITY:
case GL_INTENSITY4:
@@ -1066,25 +1177,37 @@ fxDDChooseTextureFormat( GLcontext *ctx, GLint internalFormat,
case GL_LUMINANCE12_ALPHA12:
case GL_LUMINANCE16_ALPHA16:
return &_mesa_texformat_al88;
- case 3:
- case GL_RGB:
case GL_R3_G3_B2:
case GL_RGB4:
case GL_RGB5:
+ return &_mesa_texformat_rgb565;
+ case 3:
+ case GL_RGB:
case GL_RGB8:
case GL_RGB10:
case GL_RGB12:
case GL_RGB16:
+#if 0 /* [koolsmoky] getting ready for 32bpp textures */
+ return (fxMesa->colDepth == 32) ? &_mesa_texformat_argb8888
+ : &_mesa_texformat_rgb565;
+#else
return &_mesa_texformat_rgb565;
- case 4:
- case GL_RGBA:
+#endif
case GL_RGBA2:
case GL_RGBA4:
+ return &_mesa_texformat_argb4444;
+ case 4:
+ case GL_RGBA:
case GL_RGBA8:
case GL_RGB10_A2:
case GL_RGBA12:
case GL_RGBA16:
+#if 0 /* [koolsmoky] getting ready for 32bpp textures */
+ return (fxMesa->colDepth == 32) ? &_mesa_texformat_argb8888
+ : &_mesa_texformat_argb4444;
+#else
return &_mesa_texformat_argb4444;
+#endif
case GL_RGB5_A1:
return &_mesa_texformat_argb1555;
default:
@@ -1114,6 +1237,10 @@ fxGlideFormat(GLint mesaFormat)
return GR_TEXFMT_ARGB_4444;
case MESA_FORMAT_ARGB1555:
return GR_TEXFMT_ARGB_1555;
+#if 0 /* [koolsmoky] getting ready for 32bpp textures */
+ case MESA_FORMAT_ARGB8888:
+ return GR_TEXFMT_ARGB_8888;
+#endif
default:
_mesa_problem(NULL, "Unexpected format in fxGlideFormat");
return 0;
@@ -1141,6 +1268,10 @@ fxFetchFunction(GLint mesaFormat)
return fetch_r4g4b4a4;
case MESA_FORMAT_ARGB1555:
return fetch_r5g5b5a1;
+#if 0 /* [koolsmoky] getting ready for 32bpp textures */
+ case MESA_FORMAT_ARGB8888:
+ return fetch_a8r8g8b8;
+#endif
default:
_mesa_problem(NULL, "Unexpected format in fxGlideFormat");
return NULL;
diff --git a/src/mesa/drivers/glide/fxdrv.h b/src/mesa/drivers/glide/fxdrv.h
index 56d76634fb5..271cd85dfea 100644
--- a/src/mesa/drivers/glide/fxdrv.h
+++ b/src/mesa/drivers/glide/fxdrv.h
@@ -1,4 +1,4 @@
-/* $Id: fxdrv.h,v 1.57 2003/07/17 14:50:12 brianp Exp $ */
+/* $Id: fxdrv.h,v 1.58 2003/08/19 15:52:53 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -29,6 +29,8 @@
* Brian Paul
* Daryll Strauss
* Keith Whitwell
+ * Daniel Borca
+ * Hiroshi Morii
*/
/* fxsetup.c - 3Dfx VooDoo rendering mode setup functions */
@@ -87,14 +89,6 @@ extern float gl_ubyte_to_float_255_color_tab[256];
-#if defined(FXMESA_USE_ARGB)
-#define FXCOLOR4( c ) ( \
- ( ((unsigned int)(c[3]))<<24 ) | \
- ( ((unsigned int)(c[0]))<<16 ) | \
- ( ((unsigned int)(c[1]))<<8 ) | \
- ( (unsigned int)(c[2])) )
-
-#else
#ifdef __i386__
#define FXCOLOR4( c ) (* (int *)c)
#else
@@ -104,7 +98,6 @@ extern float gl_ubyte_to_float_255_color_tab[256];
( ((unsigned int)(c[1]))<<8 ) | \
( (unsigned int)(c[0])) )
#endif
-#endif
@@ -433,7 +426,7 @@ struct tfxMesaContext
GLint swapInterval;
GLint maxPendingSwapBuffers;
- FX_GrContext_t glideContext;
+ GrContext_t glideContext;
int screen_width;
int screen_height;
@@ -444,6 +437,7 @@ struct tfxMesaContext
int clipMaxY;
int colDepth;
+ int maxTextureSize; /* [koolsmoky] */
};
@@ -527,7 +521,8 @@ extern void fxTMReloadSubMipMapLevel(fxMesaContext,
struct gl_texture_object *, GLint, GLint,
GLint);
-extern void fxTexGetFormat(GLenum, GrTextureFormat_t *, GLint *);
+extern void fxTexGetFormat(GLcontext *, GLenum, GrTextureFormat_t *, GLint *); /* [koolsmoky] */
+
extern int fxTexGetInfo(int, int, GrLOD_t *, GrAspectRatio_t *,
float *, float *, int *, int *, int *, int *);
diff --git a/src/mesa/drivers/glide/fxglidew.c b/src/mesa/drivers/glide/fxglidew.c
index 950dfdbc86c..69fbebdec83 100644
--- a/src/mesa/drivers/glide/fxglidew.c
+++ b/src/mesa/drivers/glide/fxglidew.c
@@ -1,4 +1,4 @@
-/* $Id: fxglidew.c,v 1.20 2003/07/17 14:50:12 brianp Exp $ */
+/* $Id: fxglidew.c,v 1.21 2003/08/19 15:52:53 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -29,6 +29,8 @@
* Brian Paul
* Daryll Strauss
* Keith Whitwell
+ * Daniel Borca
+ * Hiroshi Morii
*/
/* fxsetup.c - 3Dfx VooDoo rendering mode setup functions */
@@ -49,111 +51,21 @@
FxI32
FX_grGetInteger_NoLock(FxU32 pname)
{
-#if !defined(FX_GLIDE3)
- switch (pname) {
- case FX_FOG_TABLE_ENTRIES:
- return GR_FOG_TABLE_SIZE;
- case FX_GLIDE_STATE_SIZE:
- return sizeof(GrState);
- case FX_LFB_PIXEL_PIPE:
- return FXFALSE;
- case FX_PENDING_BUFFERSWAPS:
- return grBufferNumPending();
- case FX_TEXTURE_ALIGN:
- /* This is a guess from reading the glide3 docs */
- return 8;
- default:
- if (MESA_VERBOSE & VERBOSE_DRIVER) {
- fprintf(stderr, "Wrong parameter in FX_grGetInteger!\n");
- }
- return -1;
- }
-#else
- FxU32 grname;
- FxI32 result;
-
- switch (pname) {
- case FX_FOG_TABLE_ENTRIES:
- case FX_GLIDE_STATE_SIZE:
- case FX_LFB_PIXEL_PIPE:
- case FX_PENDING_BUFFERSWAPS:
- case FX_TEXTURE_ALIGN:
- grname = pname;
- break;
- default:
- if (MESA_VERBOSE & VERBOSE_DRIVER) {
- fprintf(stderr, "Wrong parameter in FX_grGetInteger!\n");
- }
- return -1;
- }
+ FxI32 result;
- grGet(grname, 4, &result);
- return result;
-#endif
-}
+ if (grGet(pname, 4, &result)) {
+ return result;
+ }
-FxI32
-FX_grGetInteger(FxU32 pname)
-{
- int result;
-
- BEGIN_BOARD_LOCK();
- result = FX_grGetInteger_NoLock(pname);
- END_BOARD_LOCK();
- return result;
-}
-
-
-FxBool
-FX_grLfbLock(GrLock_t type, GrBuffer_t buffer,
- GrLfbWriteMode_t writeMode, GrOriginLocation_t origin,
- FxBool pixelPipeline, GrLfbInfo_t * info)
-{
- FxBool result;
-
- BEGIN_BOARD_LOCK();
- result = grLfbLock(type, buffer, writeMode, origin, pixelPipeline, info);
- END_BOARD_LOCK();
- return result;
-}
-
-FxU32
-FX_grTexTextureMemRequired(FxU32 evenOdd, GrTexInfo * info)
-{
- FxU32 result;
-
- BEGIN_BOARD_LOCK();
- result = grTexTextureMemRequired(evenOdd, info);
- END_BOARD_LOCK();
- return result;
-}
-
-FxU32
-FX_grTexMinAddress(GrChipID_t tmu)
-{
- FxU32 result;
-
- BEGIN_BOARD_LOCK();
- result = grTexMinAddress(tmu);
- END_BOARD_LOCK();
- return result;
-}
-
-extern FxU32
-FX_grTexMaxAddress(GrChipID_t tmu)
-{
- FxU32 result;
-
- BEGIN_BOARD_LOCK();
- result = grTexMaxAddress(tmu);
- END_BOARD_LOCK();
- return result;
+ if (MESA_VERBOSE & VERBOSE_DRIVER) {
+ fprintf(stderr, "Wrong parameter in FX_grGetInteger!\n");
+ }
+ return -1;
}
FxBool
FX_grSstControl(FxU32 code)
{
-#if defined(FX_GLIDE3)
/* The glide 3 sources call for grEnable/grDisable to be called in exchange
* for grSstControl. */
switch (code) {
@@ -166,47 +78,9 @@ FX_grSstControl(FxU32 code)
}
/* Appearently GR_CONTROL_RESIZE can be ignored. */
return 1; /* OK? */
-#else
- FxU32 result;
- BEGIN_BOARD_LOCK();
- result = grSstControl(code);
- END_BOARD_LOCK();
- return result;
-#endif
}
-#if defined(FX_GLIDE3)
-
-void
-FX_grGammaCorrectionValue(float val)
-{
- (void) val;
-/* ToDo */
-}
-
-int
-FX_getFogTableSize(void)
-{
- int result;
- BEGIN_BOARD_LOCK();
- grGet(GR_FOG_TABLE_ENTRIES, sizeof(int), (void *) &result);
- END_BOARD_LOCK();
- return result;
-}
-
-int
-FX_getGrStateSize(void)
-{
- int result;
- BEGIN_BOARD_LOCK();
- grGet(GR_GLIDE_STATE_SIZE, sizeof(int), (void *) &result);
- END_BOARD_LOCK();
-
- return result;
-
-}
-
int
FX_grSstScreenWidth()
{
@@ -232,14 +106,6 @@ FX_grSstScreenHeight()
}
void
-FX_grGlideGetVersion(char *buf)
-{
- BEGIN_BOARD_LOCK();
- strcpy(buf, grGetString(GR_VERSION));
- END_BOARD_LOCK();
-}
-
-void
FX_grSstPerfStats(GrSstPerfStats_t * st)
{
FxI32 n;
@@ -273,14 +139,6 @@ FX_grAADrawPoint(GrVertex * a)
}
void
-FX_grDrawPolygonVertexList(int n, GrVertex * verts)
-{
- BEGIN_CLIP_LOOP();
- grDrawVertexArrayContiguous(GR_POLYGON, n, verts, sizeof(GrVertex));
- END_CLIP_LOOP();
-}
-
-void
FX_setupGrVertexLayout(void)
{
BEGIN_BOARD_LOCK();
@@ -334,14 +192,6 @@ FX_grHints_NoLock(GrHint_t hintType, FxU32 hintMask)
}
}
-void
-FX_grHints(GrHint_t hintType, FxU32 hintMask)
-{
- BEGIN_BOARD_LOCK();
- FX_grHints_NoLock(hintType, hintMask);
- END_BOARD_LOCK();
-}
-
/*
* Glide3 doesn't have the grSstQueryHardware function anymore.
* Instead, we call grGet() and fill in the data structures ourselves.
@@ -360,81 +210,63 @@ FX_grSstQueryHardware(GrHwConfiguration * config)
for (i = 0; i < config->num_sst; i++) {
FxI32 result;
+ const char *extension;
- config->SSTs[i].type = GR_SSTTYPE_VOODOO;
grSstSelect(i);
+ extension = grGetString(GR_HARDWARE);
+ if (strstr(extension, "Voodoo Banshee")) {
+ config->SSTs[i].type = GR_SSTTYPE_Banshee;
+ } else if (strstr(extension, "Voodoo3")) {
+ config->SSTs[i].type = GR_SSTTYPE_Voodoo3;
+ } else if (strstr(extension, "Voodoo4")) {
+ config->SSTs[i].type = GR_SSTTYPE_Voodoo4;
+ } else if (strstr(extension, "Voodoo5")) {
+ config->SSTs[i].type = GR_SSTTYPE_Voodoo5;
+ } else { /* Voodoo1,2,rush */
+ /* ZZZ TO DO */
+ config->SSTs[i].type = GR_SSTTYPE_VOODOO;
+ }
+
grGet(GR_MEMORY_FB, 4, &result);
- config->SSTs[i].sstBoard.VoodooConfig.fbRam = result / (1024 * 1024);
+ config->SSTs[i].VoodooConfig.fbRam = result / (1024 * 1024);
grGet(GR_NUM_TMU, 4, &result);
- config->SSTs[i].sstBoard.VoodooConfig.nTexelfx = result;
+ config->SSTs[i].VoodooConfig.nTexelfx = result;
grGet(GR_REVISION_FB, 4, &result);
- config->SSTs[i].sstBoard.VoodooConfig.fbiRev = result;
+ config->SSTs[i].VoodooConfig.fbiRev = result;
- grGet(GR_NUM_FB, 4, (void *) &numFB);
- if (numFB > 1)
- config->SSTs[i].sstBoard.VoodooConfig.sliDetect = FXTRUE;
- else
- config->SSTs[i].sstBoard.VoodooConfig.sliDetect = FXFALSE;
-
- for (j = 0; j < config->SSTs[i].sstBoard.VoodooConfig.nTexelfx; j++) {
+ for (j = 0; j < config->SSTs[i].VoodooConfig.nTexelfx; j++) {
grGet(GR_MEMORY_TMU, 4, &result);
- config->SSTs[i].sstBoard.VoodooConfig.tmuConfig[j].tmuRam =
- result / (1024 * 1024);
+ config->SSTs[i].VoodooConfig.tmuConfig[j].tmuRam = result / (1024 * 1024);
grGet(GR_REVISION_TMU, 4, &result);
- config->SSTs[i].sstBoard.VoodooConfig.tmuConfig[j].tmuRev = result;
+ config->SSTs[i].VoodooConfig.tmuConfig[j].tmuRev = result;
}
- {
- const char *extension = grGetString(GR_EXTENSION);
- if (strstr(extension, " PIXEXT ")) {
- config->SSTs[i].sstBoard.VoodooConfig.gExt.grSstWinOpen = grGetProcAddress("grSstWinOpenExt");
- }
+ extension = grGetString(GR_EXTENSION);
+ if (strstr(extension, " PIXEXT ")) {
+ config->SSTs[i].VoodooConfig.grSstWinOpenExt = grGetProcAddress("grSstWinOpenExt");
}
- }
- END_BOARD_LOCK();
- return 1;
-}
-
-#else
-
-int
-FX_grSstScreenWidth()
-{
- int i;
- BEGIN_BOARD_LOCK();
- i = grSstScreenWidth();
- END_BOARD_LOCK();
- return i;
-}
-int
-FX_grSstScreenHeight()
-{
- int i;
- BEGIN_BOARD_LOCK();
- i = grSstScreenHeight();
- END_BOARD_LOCK();
- return i;
-}
+ /* [koolsmoky] */
+ grGet(GR_MAX_TEXTURE_SIZE, 4, &result);
+ config->SSTs[i].VoodooConfig.maxTextureSize = result;
-int
-FX_grSstQueryHardware(GrHwConfiguration * c)
-{
- int i;
- BEGIN_BOARD_LOCK();
- i = grSstQueryHardware(c);
+ /* need to get the number of SLI units for napalm */
+ grGet(GR_NUM_FB, 4, (void *) &numFB);
+ config->SSTs[i].VoodooConfig.numChips = numFB;
+ /* this can only be useful for Voodoo2:
+ * sliDetect = ((config->SSTs[i].type == GR_SSTTYPE_Voodoo2) && (numFB > 1));
+ */
+ }
END_BOARD_LOCK();
- return i;
+ return 1;
}
-#endif /* FX_GLIDE3 */
-
/* It appears to me that this function is needed either way. */
-FX_GrContext_t
+GrContext_t
FX_grSstWinOpen(struct SstCard_St *c,
FxU32 hWnd,
GrScreenResolution_t screen_resolution,
@@ -444,15 +276,15 @@ FX_grSstWinOpen(struct SstCard_St *c,
GrOriginLocation_t origin_location,
int nColBuffers, int nAuxBuffers)
{
- FX_GrContext_t i;
+ GrContext_t i;
BEGIN_BOARD_LOCK();
- if ((c->type == GR_SSTTYPE_VOODOO) && c->sstBoard.VoodooConfig.gExt.grSstWinOpen) {
- i = c->sstBoard.VoodooConfig.gExt.grSstWinOpen(hWnd,
- screen_resolution,
- refresh_rate,
- color_format, origin_location,
- pixel_format,
- nColBuffers, nAuxBuffers);
+ if (c->VoodooConfig.grSstWinOpenExt) {
+ i = c->VoodooConfig.grSstWinOpenExt(hWnd,
+ screen_resolution,
+ refresh_rate,
+ color_format, origin_location,
+ pixel_format,
+ nColBuffers, nAuxBuffers);
} else
i = grSstWinOpen(hWnd,
screen_resolution,
diff --git a/src/mesa/drivers/glide/fxglidew.h b/src/mesa/drivers/glide/fxglidew.h
index 1ef3451d92a..a09df0b48cf 100644
--- a/src/mesa/drivers/glide/fxglidew.h
+++ b/src/mesa/drivers/glide/fxglidew.h
@@ -1,4 +1,4 @@
-/* $Id: fxglidew.h,v 1.14 2003/07/17 14:50:12 brianp Exp $ */
+/* $Id: fxglidew.h,v 1.15 2003/08/19 15:52:53 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -29,141 +29,95 @@
* Brian Paul
* Daryll Strauss
* Keith Whitwell
+ * Daniel Borca
+ * Hiroshi Morii
*/
#ifndef __FX_GLIDE_WARPER__
#define __FX_GLIDE_WARPER__
-#include <glide.h>
-/*
- * General context:
- */
-#if !defined(FX_GLIDE3)
-typedef FxU32 FX_GrContext_t; /* Not used in Glide2 */
-typedef FxU32 GrPixelFormat_t;
-#else
+#include <glide.h>
#include <g3ext.h>
-typedef GrContext_t FX_GrContext_t;
-#endif
-/*
- * Glide3 emulation on Glide2:
- */
-#if !defined(FX_GLIDE3)
- /* Constanst for FX_grGetInteger( ) */
-#define FX_FOG_TABLE_ENTRIES 0x0004 /* The number of entries in the hardware fog table. */
-#define FX_GLIDE_STATE_SIZE 0x0006 /* Size of buffer, in bytes, needed to save Glide state. */
-#define FX_LFB_PIXEL_PIPE 0x0009 /* 1 if LFB writes can go through the 3D pixel pipe. */
-#define FX_PENDING_BUFFERSWAPS 0x0014 /* The number of buffer swaps pending. */
-#define FX_TEXTURE_ALIGN 0x0024 /* The required alignment for textures */
-#else
-#define FX_FOG_TABLE_ENTRIES GR_FOG_TABLE_ENTRIES
-#define FX_GLIDE_STATE_SIZE GR_GLIDE_STATE_SIZE
-#define FX_LFB_PIXEL_PIPE GR_LFB_PIXEL_PIPE
-#define FX_PENDING_BUFFERSWAPS GR_PENDING_BUFFERSWAPS
-#define FX_TEXTURE_ALIGN GR_TEXTURE_ALIGN
-#endif
-/*
- * Genral warper functions for Glide2/Glide3:
- */
-extern FxI32 FX_grGetInteger(FxU32 pname);
+
+#define FX_grGetInteger FX_grGetInteger_NoLock
extern FxI32 FX_grGetInteger_NoLock(FxU32 pname);
-/*
- * Glide2 emulation on Glide3:
- */
-#if defined(FX_GLIDE3)
-
-#define GR_ASPECT_1x1 GR_ASPECT_LOG2_1x1
-#define GR_ASPECT_2x1 GR_ASPECT_LOG2_2x1
-#define GR_ASPECT_4x1 GR_ASPECT_LOG2_4x1
-#define GR_ASPECT_8x1 GR_ASPECT_LOG2_8x1
-#define GR_ASPECT_1x2 GR_ASPECT_LOG2_1x2
-#define GR_ASPECT_1x4 GR_ASPECT_LOG2_1x4
-#define GR_ASPECT_1x8 GR_ASPECT_LOG2_1x8
-
-#define GR_LOD_256 GR_LOD_LOG2_256
-#define GR_LOD_128 GR_LOD_LOG2_128
-#define GR_LOD_64 GR_LOD_LOG2_64
-#define GR_LOD_32 GR_LOD_LOG2_32
-#define GR_LOD_16 GR_LOD_LOG2_16
-#define GR_LOD_8 GR_LOD_LOG2_8
-#define GR_LOD_4 GR_LOD_LOG2_4
-#define GR_LOD_2 GR_LOD_LOG2_2
-#define GR_LOD_1 GR_LOD_LOG2_1
-
-#define GR_FOG_WITH_TABLE GR_FOG_WITH_TABLE_ON_Q
+
+
+#define GR_ASPECT_1x1 GR_ASPECT_LOG2_1x1
+#define GR_ASPECT_2x1 GR_ASPECT_LOG2_2x1
+#define GR_ASPECT_4x1 GR_ASPECT_LOG2_4x1
+#define GR_ASPECT_8x1 GR_ASPECT_LOG2_8x1
+#define GR_ASPECT_1x2 GR_ASPECT_LOG2_1x2
+#define GR_ASPECT_1x4 GR_ASPECT_LOG2_1x4
+#define GR_ASPECT_1x8 GR_ASPECT_LOG2_1x8
+
+#define GR_LOD_2048 GR_LOD_LOG2_2048 /* [koolsmoky] big texture support for napalm */
+#define GR_LOD_1024 GR_LOD_LOG2_1024
+#define GR_LOD_512 GR_LOD_LOG2_512
+#define GR_LOD_256 GR_LOD_LOG2_256
+#define GR_LOD_128 GR_LOD_LOG2_128
+#define GR_LOD_64 GR_LOD_LOG2_64
+#define GR_LOD_32 GR_LOD_LOG2_32
+#define GR_LOD_16 GR_LOD_LOG2_16
+#define GR_LOD_8 GR_LOD_LOG2_8
+#define GR_LOD_4 GR_LOD_LOG2_4
+#define GR_LOD_2 GR_LOD_LOG2_2
+#define GR_LOD_1 GR_LOD_LOG2_1
+
+#define GR_FOG_WITH_TABLE GR_FOG_WITH_TABLE_ON_Q
+
+
typedef int GrSstType;
-#define MAX_NUM_SST 4
-
-#define GR_SSTTYPE_VOODOO 0
-#define GR_SSTTYPE_SST96 1
-#define GR_SSTTYPE_AT3D 2
-#define GR_SSTTYPE_Voodoo2 3
-
-typedef struct GrTMUConfig_St
-{
- int tmuRev; /* Rev of Texelfx chip */
- int tmuRam; /* 1, 2, or 4 MB */
-}
-GrTMUConfig_t;
-
-typedef struct GrVoodooConfig_St
-{
- int fbRam; /* 1, 2, or 4 MB */
- int fbiRev; /* Rev of Pixelfx chip */
- int nTexelfx; /* How many texelFX chips are there? */
- FxBool sliDetect; /* Is it a scan-line interleaved board? */
- struct { /* Glide extensions */
- GrProc grSstWinOpen;
- } gExt;
- GrTMUConfig_t tmuConfig[GLIDE_NUM_TMU]; /* Configuration of the Texelfx chips */
-}
-GrVoodooConfig_t;
-
-typedef struct GrSst96Config_St
-{
- int fbRam; /* How much? */
- int nTexelfx;
- GrTMUConfig_t tmuConfig;
-}
-GrSst96Config_t;
-
-typedef GrVoodooConfig_t GrVoodoo2Config_t;
-
-typedef struct GrAT3DConfig_St
-{
- int rev;
-}
-GrAT3DConfig_t;
-
-typedef struct
-{
- int num_sst; /* # of HW units in the system */
- struct SstCard_St
- {
- GrSstType type; /* Which hardware is it? */
- union SstBoard_u
- {
- GrVoodooConfig_t VoodooConfig;
- GrSst96Config_t SST96Config;
- GrAT3DConfig_t AT3DConfig;
- GrVoodoo2Config_t Voodoo2Config;
- }
- sstBoard;
- }
- SSTs[MAX_NUM_SST]; /* configuration for each board */
-}
-GrHwConfiguration;
+#define MAX_NUM_SST 4
+
+enum {
+ GR_SSTTYPE_VOODOO = 0,
+ GR_SSTTYPE_SST96 = 1,
+ GR_SSTTYPE_AT3D = 2,
+ GR_SSTTYPE_Voodoo2 = 3,
+ GR_SSTTYPE_Banshee = 4,
+ GR_SSTTYPE_Voodoo3 = 5,
+ GR_SSTTYPE_Voodoo4 = 6,
+ GR_SSTTYPE_Voodoo5 = 7
+};
+
+typedef struct GrTMUConfig_St {
+ int tmuRev; /* Rev of Texelfx chip */
+ int tmuRam; /* 1, 2, or 4 MB */
+} GrTMUConfig_t;
+
+typedef struct GrVoodooConfig_St {
+ int fbRam; /* 1, 2, or 4 MB */
+ int fbiRev; /* Rev of Pixelfx chip */
+ int nTexelfx; /* How many texelFX chips are there? */
+ GrTMUConfig_t tmuConfig[GLIDE_NUM_TMU]; /* Configuration of the Texelfx chips */
+ int maxTextureSize;
+ int numChips; /* Number of Voodoo chips [koolsmoky] */
+ /* Glide3 extensions */
+ GrProc grSstWinOpenExt;
+} GrVoodooConfig_t;
+
+typedef struct {
+ int num_sst; /* # of HW units in the system */
+ struct SstCard_St {
+ GrSstType type; /* Which hardware is it? */
+ GrVoodooConfig_t VoodooConfig;
+ }
+ SSTs[MAX_NUM_SST]; /* configuration for each board */
+} GrHwConfiguration;
+
+
typedef FxU32 GrHint_t;
-#define GR_HINTTYPE_MIN 0
-#define GR_HINT_STWHINT 0
+#define GR_HINTTYPE_MIN 0
+#define GR_HINT_STWHINT 0
typedef FxU32 GrSTWHint_t;
#define GR_STWHINT_W_DIFF_FBI FXBIT(0)
@@ -174,33 +128,32 @@ typedef FxU32 GrSTWHint_t;
#define GR_STWHINT_W_DIFF_TMU2 FXBIT(5)
#define GR_STWHINT_ST_DIFF_TMU2 FXBIT(6)
-#define GR_CONTROL_ACTIVATE 1
-#define GR_CONTROL_DEACTIVATE 0
+#define GR_CONTROL_ACTIVATE 1
+#define GR_CONTROL_DEACTIVATE 0
+
+
+
+#define GrState void
+
-#define GrState void
/*
** move the vertex layout defintion to application
*/
-typedef struct
-{
- float sow; /* s texture ordinate (s over w) */
- float tow; /* t texture ordinate (t over w) */
- float oow; /* 1/w (used mipmapping - really 0xfff/w) */
-}
-GrTmuVertex;
-
-
-typedef struct
-{
- float x, y, z; /* X, Y, and Z of scrn space -- Z is ignored */
- float r, g, b; /* R, G, B, ([0..255.0]) */
- float ooz; /* 65535/Z (used for Z-buffering) */
- float a; /* Alpha [0..255.0] */
- float oow; /* 1/W (used for W-buffering, texturing) */
- GrTmuVertex tmuvtx[GLIDE_NUM_TMU];
-}
-GrVertex;
+typedef struct {
+ float sow; /* s texture ordinate (s over w) */
+ float tow; /* t texture ordinate (t over w) */
+ float oow; /* 1/w (used mipmapping - really 0xfff/w) */
+} GrTmuVertex;
+
+typedef struct {
+ float x, y, z; /* X, Y, and Z of scrn space -- Z is ignored */
+ float r, g, b; /* R, G, B, ([0..255.0]) */
+ float ooz; /* 65535/Z (used for Z-buffering) */
+ float a; /* Alpha [0..255.0] */
+ float oow; /* 1/W (used for W-buffering, texturing) */
+ GrTmuVertex tmuvtx[GLIDE_NUM_TMU];
+} GrVertex;
#define GR_VERTEX_X_OFFSET 0
#define GR_VERTEX_Y_OFFSET 1
@@ -218,142 +171,52 @@ GrVertex;
#define GR_VERTEX_TOW_TMU1_OFFSET 13
#define GR_VERTEX_OOW_TMU1_OFFSET 14
-#endif
/*
- * Glide2 functions for Glide3
+ * Write region: ToDo possible exploit the PixelPipe parameter.
*/
-#if defined(FX_GLIDE3)
-#define FX_grTexDownloadTable(TMU,type,data) \
- do { \
- BEGIN_BOARD_LOCK(); \
- grTexDownloadTable(type,data); \
- END_BOARD_LOCK(); \
- } while (0);
-#define FX_grTexDownloadTable_NoLock(TMU,type,data) \
- grTexDownloadTable(type, data)
-#else
-#define FX_grTexDownloadTable(TMU,type,data) \
- do { \
- BEGIN_BOARD_LOCK(); \
- grTexDownloadTable(TMU,type,data); \
- END_BOARD_LOCK(); \
- } while (0);
-#define FX_grTexDownloadTable_NoLock grTexDownloadTable
-#endif
+#define FX_grLfbWriteRegion(dst_buffer,dst_x,dst_y,src_format,src_width,src_height,src_stride,src_data) \
+ do { \
+ BEGIN_BOARD_LOCK(); \
+ grLfbWriteRegion(dst_buffer,\
+ dst_x, \
+ dst_y, \
+ src_format,\
+ src_width, \
+ src_height,\
+ FXFALSE, \
+ src_stride,\
+ src_data); \
+ END_BOARD_LOCK(); \
+ } while(0)
-/*
- * Flush
- */
-#if defined(FX_GLIDE3)
-#define FX_grFlush() \
- do { \
- BEGIN_BOARD_LOCK(); \
- grFlush(); \
- END_BOARD_LOCK(); \
- } while (0)
-#else
-#define FX_grFlush() \
- do { \
- BEGIN_BOARD_LOCK(); \
- grSstIdle(); \
- END_BOARD_LOCK(); \
- } while (0)
-#endif
-#define FX_grFinish() \
- do { \
- BEGIN_BOARD_LOCK(); \
- grFinish(); \
- END_BOARD_LOCK(); \
- } while (0)
/*
- * Write region: ToDo possible exploit the PixelPipe parameter.
+ * Draw triangle
*/
-#if defined(FX_GLIDE3)
-#define FX_grLfbWriteRegion(dst_buffer,dst_x,dst_y,src_format,src_width,src_height,src_stride,src_data) \
- do { \
- BEGIN_BOARD_LOCK(); \
- grLfbWriteRegion(dst_buffer,dst_x,dst_y,src_format,src_width,src_height,FXFALSE,src_stride,src_data); \
- END_BOARD_LOCK(); \
- } while(0)
-#else
-#define FX_grLfbWriteRegion(dst_buffer,dst_x,dst_y,src_format,src_width,src_height,src_stride,src_data) \
+#define FX_grDrawTriangle(a,b,c)\
do { \
- BEGIN_BOARD_LOCK(); \
- grLfbWriteRegion(dst_buffer,dst_x,dst_y,src_format,src_width,src_height,src_stride,src_data); \
- END_BOARD_LOCK(); \
+ BEGIN_CLIP_LOOP(); \
+ grDrawTriangle(a,b,c); \
+ END_CLIP_LOOP(); \
} while (0)
-#endif
-/*
- * Read region
- */
-#define FX_grLfbReadRegion(src_buffer,src_x,src_y,src_width,src_height,dst_stride,dst_data) \
- do { \
- BEGIN_BOARD_LOCK(); \
- grLfbReadRegion(src_buffer,src_x,src_y,src_width,src_height,dst_stride,dst_data); \
- END_BOARD_LOCK(); \
- } while (0);
-/*
- * Draw triangle
- */
-#define FX_grDrawTriangle(a,b,c) \
- do { \
- BEGIN_CLIP_LOOP(); \
- grDrawTriangle(a,b,c); \
- END_CLIP_LOOP(); \
- } while (0)
/*
* For Lod/LodLog2 conversion.
*/
-#if defined(FX_GLIDE3)
#define FX_largeLodLog2(info) (info).largeLodLog2
-#else
-#define FX_largeLodLog2(info) (info).largeLod
-#endif
-
-#if defined(FX_GLIDE3)
-#define FX_aspectRatioLog2(info) (info).aspectRatioLog2
-#else
-#define FX_aspectRatioLog2(info) (info).aspectRatio
-#endif
-
-#if defined(FX_GLIDE3)
+#define FX_aspectRatioLog2(info) (info).aspectRatioLog2
#define FX_smallLodLog2(info) (info).smallLodLog2
-#else
-#define FX_smallLodLog2(info) (info).smallLod
-#endif
-
-#if defined(FX_GLIDE3)
#define FX_lodToValue(val) ((int)(GR_LOD_256-val))
-#else
-#define FX_lodToValue(val) ((int)(val))
-#endif
-
-#if defined(FX_GLIDE3)
#define FX_largeLodValue(info) ((int)(GR_LOD_256-(info).largeLodLog2))
-#else
-#define FX_largeLodValue(info) ((int)(info).largeLod)
-#endif
-#define FX_largeLodValue_NoLock FX_largeLodValue
-
-#if defined(FX_GLIDE3)
#define FX_smallLodValue(info) ((int)(GR_LOD_256-(info).smallLodLog2))
-#else
-#define FX_smallLodValue(info) ((int)(info).smallLod)
-#endif
-#define FX_smallLodValue_NoLock FX_smallLodValue
-
-#if defined(FX_GLIDE3)
#define FX_valueToLod(val) ((GrLOD_t)(GR_LOD_256-val))
-#else
-#define FX_valueToLod(val) ((GrLOD_t)(val))
-#endif
+
+
/*
* ScreenWidth/Height stuff.
@@ -364,129 +227,51 @@ extern int FX_grSstScreenHeight(void);
/*
- * Version string.
- */
-#if defined(FX_GLIDE3)
-extern void FX_grGlideGetVersion(char *buf);
-#else
-#define FX_grGlideGetVersion(b) \
- do { \
- BEGIN_BOARD_LOCK(); \
- grGlideGetVersion(b); \
- END_BOARD_LOCK(); \
- } while (0)
-#endif
-/*
- * Performance statistics
+ * Query
*/
-#if defined(FX_GLIDE3)
-extern void FX_grSstPerfStats(GrSstPerfStats_t * st);
-#else
-#define FX_grSstPerfStats(s) \
- do { \
- BEGIN_BOARD_LOCK(); \
- grSstPerfStats(s); \
- END_BOARD_LOCK(); \
- } while (0)
-#endif
+extern void FX_grSstPerfStats(GrSstPerfStats_t *st);
+extern int FX_grSstQueryHardware(GrHwConfiguration *config);
+
-/*
- * Hardware Query
- */
-extern int FX_grSstQueryHardware(GrHwConfiguration * config);
/*
* GrHints
*/
-#if defined(FX_GLIDE3)
+#define FX_grHints FX_grHints_NoLock
extern void FX_grHints_NoLock(GrHint_t hintType, FxU32 hintMask);
-extern void FX_grHints(GrHint_t hintType, FxU32 hintMask);
-#else
-#define FX_grHints(t,m) \
- do { \
- BEGIN_BOARD_LOCK(); \
- grHints(t, m); \
- END_BOARD_LOCK(); \
- } while(0)
-#define FX_grHints_NoLock grHints
-#endif
+
+
+
/*
* Antialiashed line+point drawing.
*/
-#if defined(FX_GLIDE3)
-extern void FX_grAADrawLine(GrVertex * a, GrVertex * b);
-#else
-#define FX_grAADrawLine(a,b) \
- do { \
- BEGIN_CLIP_LOOP(); \
- grAADrawLine(a,b); \
- END_CLIP_LOOP(); \
- } while (0)
-#endif
-
-#if defined(FX_GLIDE3)
-extern void FX_grAADrawPoint(GrVertex * a);
-#else
-#define FX_grAADrawPoint(a) \
- do { \
- BEGIN_CLIP_LOOP(); \
- grAADrawPoint(a); \
- END_CLIP_LOOP(); \
- } while (0)
-#endif
+extern void FX_grAADrawLine(GrVertex *a, GrVertex *b);
+extern void FX_grAADrawPoint(GrVertex *a);
+
+
/*
* Needed for Glide3 only, to set up Glide2 compatible vertex layout.
*/
-#if defined(FX_GLIDE3)
extern void FX_setupGrVertexLayout(void);
-#else
-#define FX_setupGrVertexLayout() do {} while (0)
-#endif
+
+
+
/*
* grSstControl stuff
*/
extern FxBool FX_grSstControl(FxU32 code);
-/*
- * grGammaCorrectionValue
- */
-#if defined(FX_GLIDE3)
-extern void FX_grGammaCorrectionValue(float val);
-#else
-#define FX_grGammaCorrectionValue(v) \
- do { \
- BEGIN_BOARD_LOCK(); \
- grGammaCorrectionValue(v) \
- END_BOARD_LOCK(); \
- } while (0)
-#endif
-
-#if defined(FX_GLIDE3)
-#define FX_grSstWinClose(w) \
- do { \
- BEGIN_BOARD_LOCK(); \
- grSstWinClose(w); \
- END_BOARD_LOCK(); \
- } while (0)
-#else
-#define FX_grSstWinClose(w) \
- do { \
- BEGIN_BOARD_LOCK(); \
- grSstWinClose(); \
- END_BOARD_LOCK(); \
- } while (0)
-#endif
-extern FX_GrContext_t FX_grSstWinOpen(struct SstCard_St *c,
- FxU32 hWnd,
- GrScreenResolution_t screen_resolution,
- GrScreenRefresh_t refresh_rate,
- GrColorFormat_t color_format,
- GrPixelFormat_t pixel_format,
- GrOriginLocation_t origin_location,
- int nColBuffers, int nAuxBuffers);
+extern GrContext_t FX_grSstWinOpen(struct SstCard_St *c,
+ FxU32 hWnd,
+ GrScreenResolution_t screen_resolution,
+ GrScreenRefresh_t refresh_rate,
+ GrColorFormat_t color_format,
+ GrPixelFormat_t pixel_format,
+ GrOriginLocation_t origin_location,
+ int nColBuffers, int nAuxBuffers);
#define FX_grDrawLine(v1, v2) \
@@ -503,30 +288,12 @@ extern FX_GrContext_t FX_grSstWinOpen(struct SstCard_St *c,
END_CLIP_LOOP(); \
} while (0)
-#if defined(FX_GLIDE3)
-extern void FX_grDrawPolygonVertexList(int n, GrVertex * v);
-#else
-#define FX_grDrawPolygonVertexList(n, v) \
- do { \
- BEGIN_CLIP_LOOP(); \
- grDrawPolygonVertexList(n, v); \
- END_CLIP_LOOP(); \
- } while (0)
-#endif
-
-#define FX_grDitherMode(m) \
- do { \
- BEGIN_BOARD_LOCK(); \
- grDitherMode(m); \
- END_BOARD_LOCK(); \
- } while (0)
-
-#define FX_grRenderBuffer(b) \
- do { \
- BEGIN_BOARD_LOCK(); \
- grRenderBuffer(b); \
- END_BOARD_LOCK(); \
- } while (0)
+#define FX_grDrawPolygonVertexList(n, v) \
+ do { \
+ BEGIN_CLIP_LOOP(); \
+ grDrawVertexArrayContiguous(GR_POLYGON, n, v, sizeof(GrVertex)); \
+ END_CLIP_LOOP(); \
+ } while (0)
#define FX_grBufferClear(c, a, d) \
do { \
@@ -535,40 +302,6 @@ extern void FX_grDrawPolygonVertexList(int n, GrVertex * v);
END_CLIP_LOOP(); \
} while (0)
-#define FX_grDepthMask(m) \
- do { \
- BEGIN_BOARD_LOCK(); \
- grDepthMask(m); \
- END_BOARD_LOCK(); \
- } while (0)
-
-#define FX_grColorMask(c, a) \
- do { \
- BEGIN_BOARD_LOCK(); \
- grColorMask(c, a); \
- END_BOARD_LOCK(); \
- } while (0)
-
-extern FxBool FX_grLfbLock(GrLock_t type, GrBuffer_t buffer,
- GrLfbWriteMode_t writeMode,
- GrOriginLocation_t origin, FxBool pixelPipeline,
- GrLfbInfo_t * info);
-
-#define FX_grLfbUnlock(t, b) \
- do { \
- BEGIN_BOARD_LOCK(); \
- grLfbUnlock(t, b); \
- END_BOARD_LOCK(); \
- } while (0)
-
-#define FX_grConstantColorValue(v) \
- do { \
- BEGIN_BOARD_LOCK(); \
- grConstantColorValue(v); \
- END_BOARD_LOCK(); \
- } while (0)
-
-#define FX_grConstantColorValue_NoLock grConstantColorValue
#define FX_grAADrawTriangle(a, b, c, ab, bc, ca) \
do { \
@@ -577,208 +310,7 @@ extern FxBool FX_grLfbLock(GrLock_t type, GrBuffer_t buffer,
END_CLIP_LOOP(); \
} while (0)
-#define FX_grAlphaBlendFunction(rs, rd, as, ad) \
- do { \
- BEGIN_BOARD_LOCK(); \
- grAlphaBlendFunction(rs, rd, as, ad); \
- END_BOARD_LOCK(); \
- } while (0)
-
-#define FX_grAlphaCombine(func, fact, loc, oth, inv) \
- do { \
- BEGIN_BOARD_LOCK(); \
- grAlphaCombine(func, fact, loc, oth, inv); \
- END_BOARD_LOCK(); \
- } while (0)
-
-#define FX_grAlphaCombine_NoLock grAlphaCombine
-
-#define FX_grAlphaTestFunction(f) \
- do { \
- BEGIN_BOARD_LOCK(); \
- grAlphaTestFunction(f); \
- END_BOARD_LOCK(); \
- } while (0)
-
-#define FX_grAlphaTestReferenceValue(v) \
- do { \
- BEGIN_BOARD_LOCK(); \
- grAlphaTestReferenceValue(v); \
- END_BOARD_LOCK(); \
- } while (0)
-
-#define FX_grClipWindow(minx, miny, maxx, maxy) \
- do { \
- BEGIN_BOARD_LOCK(); \
- grClipWindow(minx, miny, maxx, maxy); \
- END_BOARD_LOCK(); \
- } while (0)
-
-#define FX_grClipWindow_NoLock grClipWindow
-
-#define FX_grColorCombine(func, fact, loc, oth, inv) \
- do { \
- BEGIN_BOARD_LOCK(); \
- grColorCombine(func, fact, loc, oth, inv); \
- END_BOARD_LOCK(); \
- } while (0)
-
-#define FX_grColorCombine_NoLock grColorCombine
-
-#define FX_grCullMode(m) \
- do { \
- BEGIN_BOARD_LOCK(); \
- grCullMode(m); \
- END_BOARD_LOCK(); \
- } while (0)
-
-#define FX_grDepthBiasLevel(lev) \
- do { \
- BEGIN_BOARD_LOCK(); \
- grDepthBiasLevel(lev); \
- END_BOARD_LOCK(); \
- } while (0)
-
-#define FX_grDepthBufferFunction(func) \
- do { \
- BEGIN_BOARD_LOCK(); \
- grDepthBufferFunction(func); \
- END_BOARD_LOCK(); \
- } while (0)
-
-#define FX_grFogColorValue(c) \
- do { \
- BEGIN_BOARD_LOCK(); \
- grFogColorValue(c); \
- END_BOARD_LOCK(); \
- } while (0)
-
-#define FX_grFogMode(m) \
- do { \
- BEGIN_BOARD_LOCK(); \
- grFogMode(m); \
- END_BOARD_LOCK(); \
- } while (0)
-
-#define FX_grFogTable(t) \
- do { \
- BEGIN_BOARD_LOCK(); \
- grFogTable(t); \
- END_BOARD_LOCK(); \
- } while (0)
-
-#define FX_grTexClampMode(t, sc, tc) \
- do { \
- BEGIN_BOARD_LOCK(); \
- grTexClampMode(t, sc, tc); \
- END_BOARD_LOCK(); \
- } while (0)
-
-#define FX_grTexClampMode_NoLock grTexClampMode
-
-#define FX_grTexCombine(t, rfunc, rfact, afunc, afact, rinv, ainv) \
- do { \
- BEGIN_BOARD_LOCK(); \
- grTexCombine(t, rfunc, rfact, afunc, afact, rinv, ainv); \
- END_BOARD_LOCK(); \
- } while (0)
-
-#define FX_grTexCombine_NoLock grTexCombine
-#define FX_grTexDownloadMipMapLevel(t, sa, tlod, llod, ar, f, eo, d) \
- do { \
- BEGIN_BOARD_LOCK(); \
- grTexDownloadMipMapLevel(t, sa, tlod, llod, ar, f, eo, d); \
- END_BOARD_LOCK(); \
- } while (0)
-
-#define FX_grTexDownloadMipMapLevel_NoLock grTexDownloadMipMapLevel
-
-#define FX_grTexDownloadMipMapLevelPartial(t, sa, tlod, llod, ar, f, eo, d, s, e); \
- do { \
- BEGIN_BOARD_LOCK(); \
- grTexDownloadMipMapLevelPartial(t, sa, tlod, llod, ar, f, eo, d, s, e); \
- END_BOARD_LOCK(); \
- } while (0)
-
-#define FX_grTexFilterMode(t, minf, magf) \
- do { \
- BEGIN_BOARD_LOCK(); \
- grTexFilterMode(t, minf, magf); \
- END_BOARD_LOCK(); \
- } while (0)
-
-#define FX_grTexFilterMode_NoLock grTexFilterMode
-
-extern FxU32 FX_grTexMinAddress(GrChipID_t tmu);
-extern FxU32 FX_grTexMaxAddress(GrChipID_t tmu);
-
-#define FX_grTexMipMapMode(t, m, lod) \
- do { \
- BEGIN_BOARD_LOCK(); \
- grTexMipMapMode(t, m, lod); \
- END_BOARD_LOCK(); \
- } while (0)
-
-#define FX_grTexMipMapMode_NoLock grTexMipMapMode
-
-#define FX_grTexSource(t, sa, eo, i) \
- do { \
- BEGIN_BOARD_LOCK(); \
- grTexSource(t, sa, eo, i); \
- END_BOARD_LOCK(); \
- } while (0)
-
-#define FX_grTexSource_NoLock grTexSource
-
-extern FxU32 FX_grTexTextureMemRequired(FxU32 evenOdd, GrTexInfo * info);
-#define FX_grTexTextureMemRequired_NoLock grTexTextureMemRequired
-
-#define FX_grGlideGetState(s) \
- do { \
- BEGIN_BOARD_LOCK(); \
- grGlideGetState(s); \
- END_BOARD_LOCK(); \
- } while (0)
-#define FX_grGlideGetState_NoLock(s) grGlideGetState(s);
-
-#define FX_grDRIBufferSwap(i) \
- do { \
- BEGIN_BOARD_LOCK(); \
- grDRIBufferSwap(i); \
- END_BOARD_LOCK(); \
- } while (0)
-
-#define FX_grSstSelect(b) \
- do { \
- BEGIN_BOARD_LOCK(); \
- grSstSelect(b); \
- END_BOARD_LOCK(); \
- } while (0)
-
-#define FX_grSstSelect_NoLock grSstSelect
-
-#define FX_grGlideSetState(s) \
- do { \
- BEGIN_BOARD_LOCK(); \
- grGlideSetState(s); \
- END_BOARD_LOCK(); \
- } while (0)
-#define FX_grGlideSetState_NoLock(s) grGlideSetState(s);
-
-#define FX_grDepthBufferMode(m) \
- do { \
- BEGIN_BOARD_LOCK(); \
- grDepthBufferMode(m); \
- END_BOARD_LOCK(); \
- } while (0)
-
-#define FX_grLfbWriteColorFormat(f) \
- do { \
- BEGIN_BOARD_LOCK(); \
- grLfbWriteColorFormat(f); \
- END_BOARD_LOCK(); \
- } while (0)
#define FX_grDrawVertexArray(m, c, p) \
do { \
@@ -787,26 +319,6 @@ extern FxU32 FX_grTexTextureMemRequired(FxU32 evenOdd, GrTexInfo * info);
END_CLIP_LOOP(); \
} while (0)
-#define FX_grGlideShutdown() \
- do { \
- BEGIN_BOARD_LOCK(); \
- grGlideShutdown(); \
- END_BOARD_LOCK(); \
- } while (0)
-
-#define FX_grTexLodBiasValue_NoLock(t, v) grTexLodBiasValue(t, v)
-
-#define FX_grTexLodBiasValue(t, v) \
- do { \
- BEGIN_BOARD_LOCK(); \
- grTexLodBiasValue(t, v); \
- END_BOARD_LOCK(); \
- } while (0)
-
-#define FX_grGlideInit_NoLock grGlideInit
-#define FX_grSstWinOpen_NoLock grSstWinOpen
-extern int FX_getFogTableSize(void);
-extern int FX_getGrStateSize(void);
#endif /* __FX_GLIDE_WARPER__ */
diff --git a/src/mesa/drivers/glide/fxopengl.def b/src/mesa/drivers/glide/fxopengl.def
index af76f4c1b21..cb321670cec 100644
--- a/src/mesa/drivers/glide/fxopengl.def
+++ b/src/mesa/drivers/glide/fxopengl.def
@@ -1,467 +1,467 @@
-EXPORTS
- glAccum
- glAlphaFunc
- glAreTexturesResident
- glArrayElement
- glBegin
- glBindTexture
- glBitmap
- glBlendFunc
- glCallList
- glCallLists
- glClear
- glClearAccum
- glClearIndex
- glClearColor
- glClearDepth
- glClearStencil
- glClipPlane
- glColor3b
- glColor3d
- glColor3f
- glColor3i
- glColor3s
- glColor3ub
- glColor3ui
- glColor3us
- glColor4b
- glColor4d
- glColor4f
- glColor4i
- glColor4s
- glColor4ub
- glColor4ui
- glColor4us
- glColor3bv
- glColor3dv
- glColor3fv
- glColor3iv
- glColor3sv
- glColor3ubv
- glColor3uiv
- glColor3usv
- glColor4bv
- glColor4dv
- glColor4fv
- glColor4iv
- glColor4sv
- glColor4ubv
- glColor4uiv
- glColor4usv
- glColorMask
- glColorMaterial
- glColorPointer
- glColorTableEXT
- glColorSubTableEXT
- glCopyPixels
- glCopyTexImage1D
- glCopyTexImage2D
- glCopyTexSubImage1D
- glCopyTexSubImage2D
- glCullFace
- glDepthFunc
- glDepthMask
- glDepthRange
- glDeleteLists
- glDeleteTextures
- glDisable
- glDisableClientState
- glDrawArrays
- glDrawBuffer
- glDrawElements
- glDrawPixels
- glEnable
- glEnableClientState
- glEnd
- glEndList
- glEvalCoord1d
- glEvalCoord1f
- glEvalCoord1dv
- glEvalCoord1fv
- glEvalCoord2d
- glEvalCoord2f
- glEvalCoord2dv
- glEvalCoord2fv
- glEvalPoint1
- glEvalPoint2
- glEvalMesh1
- glEdgeFlag
- glEdgeFlagv
- glEdgeFlagPointer
- glEvalMesh2
- glFeedbackBuffer
- glFinish
- glFlush
- glFogf
- glFogi
- glFogfv
- glFogiv
- glFrontFace
- glFrustum
- glGenLists
- glGenTextures
- glGetBooleanv
- glGetClipPlane
- glGetColorTableEXT
- glGetColorTableParameterivEXT
- glGetColorTableParameterfvEXT
- glGetDoublev
- glGetError
- glGetFloatv
- glGetIntegerv
- glGetLightfv
- glGetLightiv
- glGetMapdv
- glGetMapfv
- glGetMapiv
- glGetMaterialfv
- glGetMaterialiv
- glGetPixelMapfv
- glGetPixelMapuiv
- glGetPixelMapusv
- glGetPointerv
- glGetPolygonStipple
- glGetString
- glGetTexEnvfv
- glGetTexEnviv
- glGetTexGeniv
- glGetTexGendv
- glGetTexGenfv
- glGetTexImage
- glGetTexLevelParameterfv
- glGetTexLevelParameteriv
- glGetTexParameterfv
- glGetTexParameteriv
- glHint
- glIndexd
- glIndexf
- glIndexi
- glIndexs
- glIndexub
- glIndexdv
- glIndexfv
- glIndexiv
- glIndexsv
- glIndexubv
- glIndexMask
- glIndexPointer
- glInterleavedArrays
- glInitNames
- glIsList
- glIsTexture
- glLightf
- glLighti
- glLightfv
- glLightiv
- glLightModelf
- glLightModeli
- glLightModelfv
- glLightModeliv
- glLineWidth
- glLineStipple
- glListBase
- glLoadIdentity
- glLoadMatrixd
- glLoadMatrixf
- glLoadName
- glLogicOp
- glMap1d
- glMap1f
- glMap2d
- glMap2f
- glMapGrid1d
- glMapGrid1f
- glMapGrid2d
- glMapGrid2f
- glMaterialf
- glMateriali
- glMaterialfv
- glMaterialiv
- glMatrixMode
- glMultMatrixd
- glMultMatrixf
- glNewList
- glNormal3b
- glNormal3d
- glNormal3f
- glNormal3i
- glNormal3s
- glNormal3bv
- glNormal3dv
- glNormal3fv
- glNormal3iv
- glNormal3sv
- glNormalPointer
- glOrtho
- glPassThrough
- glPixelMapfv
- glPixelMapuiv
- glPixelMapusv
- glPixelStoref
- glPixelStorei
- glPixelTransferf
- glPixelTransferi
- glPixelZoom
- glPointSize
- glPolygonMode
- glPolygonOffset
- glPolygonOffsetEXT
- glPolygonStipple
- glPopAttrib
- glPopClientAttrib
- glPopMatrix
- glPopName
- glPrioritizeTextures
- glPushMatrix
- glRasterPos2d
- glRasterPos2f
- glRasterPos2i
- glRasterPos2s
- glRasterPos3d
- glRasterPos3f
- glRasterPos3i
- glRasterPos3s
- glRasterPos4d
- glRasterPos4f
- glRasterPos4i
- glRasterPos4s
- glRasterPos2dv
- glRasterPos2fv
- glRasterPos2iv
- glRasterPos2sv
- glRasterPos3dv
- glRasterPos3fv
- glRasterPos3iv
- glRasterPos3sv
- glRasterPos4dv
- glRasterPos4fv
- glRasterPos4iv
- glRasterPos4sv
- glReadBuffer
- glReadPixels
- glRectd
- glRectf
- glRecti
- glRects
- glRectdv
- glRectfv
- glRectiv
- glRectsv
- glScissor
- glIsEnabled
- glPushAttrib
- glPushClientAttrib
- glPushName
- glRenderMode
- glRotated
- glRotatef
- glSelectBuffer
- glScaled
- glScalef
- glShadeModel
- glStencilFunc
- glStencilMask
- glStencilOp
- glTexCoord1d
- glTexCoord1f
- glTexCoord1i
- glTexCoord1s
- glTexCoord2d
- glTexCoord2f
- glTexCoord2i
- glTexCoord2s
- glTexCoord3d
- glTexCoord3f
- glTexCoord3i
- glTexCoord3s
- glTexCoord4d
- glTexCoord4f
- glTexCoord4i
- glTexCoord4s
- glTexCoord1dv
- glTexCoord1fv
- glTexCoord1iv
- glTexCoord1sv
- glTexCoord2dv
- glTexCoord2fv
- glTexCoord2iv
- glTexCoord2sv
- glTexCoord3dv
- glTexCoord3fv
- glTexCoord3iv
- glTexCoord3sv
- glTexCoord4dv
- glTexCoord4fv
- glTexCoord4iv
- glTexCoord4sv
- glTexCoordPointer
- glTexGend
- glTexGenf
- glTexGeni
- glTexGendv
- glTexGeniv
- glTexGenfv
- glTexEnvf
- glTexEnvi
- glTexEnvfv
- glTexEnviv
- glTexImage1D
- glTexImage2D
- glTexParameterf
- glTexParameteri
- glTexParameterfv
- glTexParameteriv
- glTexSubImage1D
- glTexSubImage2D
- glTranslated
- glTranslatef
- glVertex2d
- glVertex2f
- glVertex2i
- glVertex2s
- glVertex3d
- glVertex3f
- glVertex3i
- glVertex3s
- glVertex4d
- glVertex4f
- glVertex4i
- glVertex4s
- glVertex2dv
- glVertex2fv
- glVertex2iv
- glVertex2sv
- glVertex3dv
- glVertex3fv
- glVertex3iv
- glVertex3sv
- glVertex4dv
- glVertex4fv
- glVertex4iv
- glVertex4sv
- glVertexPointer
- glViewport
- glBlendEquationEXT
- glBlendColorEXT
- glVertexPointerEXT
- glNormalPointerEXT
- glColorPointerEXT
- glIndexPointerEXT
- glTexCoordPointerEXT
- glEdgeFlagPointerEXT
- glGetPointervEXT
- glArrayElementEXT
- glDrawArraysEXT
- glBindTextureEXT
- glDeleteTexturesEXT
- glGenTexturesEXT
- glPrioritizeTexturesEXT
- glCopyTexSubImage3DEXT
- glTexImage3DEXT
- glTexSubImage3DEXT
- glWindowPos4fMESA
- glWindowPos2iMESA
- glWindowPos2sMESA
- glWindowPos2fMESA
- glWindowPos2dMESA
- glWindowPos2ivMESA
- glWindowPos2svMESA
- glWindowPos2fvMESA
- glWindowPos2dvMESA
- glWindowPos3iMESA
- glWindowPos3sMESA
- glWindowPos3fMESA
- glWindowPos3dMESA
- glWindowPos3ivMESA
- glWindowPos3svMESA
- glWindowPos3fvMESA
- glWindowPos3dvMESA
- glWindowPos4iMESA
- glWindowPos4sMESA
- glWindowPos4dMESA
- glWindowPos4ivMESA
- glWindowPos4svMESA
- glWindowPos4fvMESA
- glWindowPos4dvMESA
- glResizeBuffersMESA
- wglCopyContext
- wglCreateContext
- wglCreateLayerContext
- wglDeleteContext
-;wglDescribeLayerPlane
- wglGetCurrentContext
- wglGetCurrentDC
-;wglGetLayerPaletteEntries
- wglGetProcAddress
- wglMakeCurrent
-;wglRealizeLayerPalette
-;wglSetLayerPaletteEntries
- wglShareLists
- wglSwapLayerBuffers
- wglUseFontBitmapsA
- wglUseFontBitmapsW
- wglUseFontOutlinesA
- wglUseFontOutlinesW
- wglChoosePixelFormat
- ChoosePixelFormat
- wglDescribePixelFormat
- DescribePixelFormat
- wglGetPixelFormat
- GetPixelFormat
- wglSetPixelFormat
- SetPixelFormat
- wglSwapBuffers
- SwapBuffers
- gl3DfxSetPaletteEXT
- glActiveTextureARB
- glClientActiveTextureARB
- glMultiTexCoord1dARB
- glMultiTexCoord1dvARB
- glMultiTexCoord1fARB
- glMultiTexCoord1fvARB
- glMultiTexCoord1iARB
- glMultiTexCoord1ivARB
- glMultiTexCoord1sARB
- glMultiTexCoord1svARB
- glMultiTexCoord2dARB
- glMultiTexCoord2dvARB
- glMultiTexCoord2fARB
- glMultiTexCoord2fvARB
- glMultiTexCoord2iARB
- glMultiTexCoord2ivARB
- glMultiTexCoord2sARB
- glMultiTexCoord2svARB
- glMultiTexCoord3dARB
- glMultiTexCoord3dvARB
- glMultiTexCoord3fARB
- glMultiTexCoord3fvARB
- glMultiTexCoord3iARB
- glMultiTexCoord3ivARB
- glMultiTexCoord3sARB
- glMultiTexCoord3svARB
- glMultiTexCoord4dARB
- glMultiTexCoord4dvARB
- glMultiTexCoord4fARB
- glMultiTexCoord4fvARB
- glMultiTexCoord4iARB
- glMultiTexCoord4ivARB
- glMultiTexCoord4sARB
- glMultiTexCoord4svARB
- fxMesaCreateContext
- fxMesaCreateBestContext
- fxMesaDestroyContext
- fxMesaSelectCurrentBoard
- fxMesaMakeCurrent
- fxMesaGetCurrentContext
- fxMesaSwapBuffers
- fxMesaSetNearFar
- fxMesaUpdateScreenSize
- fxQueryHardware
- fxCloseHardware
- OSMesaCreateContext
- OSMesaDestroyContext
- OSMesaGetCurrentContext
- OSMesaGetDepthBuffer
- OSMesaGetIntegerv
- OSMesaMakeCurrent
- OSMesaPixelStore
+EXPORTS
+ glAccum
+ glAlphaFunc
+ glAreTexturesResident
+ glArrayElement
+ glBegin
+ glBindTexture
+ glBitmap
+ glBlendFunc
+ glCallList
+ glCallLists
+ glClear
+ glClearAccum
+ glClearIndex
+ glClearColor
+ glClearDepth
+ glClearStencil
+ glClipPlane
+ glColor3b
+ glColor3d
+ glColor3f
+ glColor3i
+ glColor3s
+ glColor3ub
+ glColor3ui
+ glColor3us
+ glColor4b
+ glColor4d
+ glColor4f
+ glColor4i
+ glColor4s
+ glColor4ub
+ glColor4ui
+ glColor4us
+ glColor3bv
+ glColor3dv
+ glColor3fv
+ glColor3iv
+ glColor3sv
+ glColor3ubv
+ glColor3uiv
+ glColor3usv
+ glColor4bv
+ glColor4dv
+ glColor4fv
+ glColor4iv
+ glColor4sv
+ glColor4ubv
+ glColor4uiv
+ glColor4usv
+ glColorMask
+ glColorMaterial
+ glColorPointer
+ glColorTableEXT
+ glColorSubTableEXT
+ glCopyPixels
+ glCopyTexImage1D
+ glCopyTexImage2D
+ glCopyTexSubImage1D
+ glCopyTexSubImage2D
+ glCullFace
+ glDepthFunc
+ glDepthMask
+ glDepthRange
+ glDeleteLists
+ glDeleteTextures
+ glDisable
+ glDisableClientState
+ glDrawArrays
+ glDrawBuffer
+ glDrawElements
+ glDrawPixels
+ glEnable
+ glEnableClientState
+ glEnd
+ glEndList
+ glEvalCoord1d
+ glEvalCoord1f
+ glEvalCoord1dv
+ glEvalCoord1fv
+ glEvalCoord2d
+ glEvalCoord2f
+ glEvalCoord2dv
+ glEvalCoord2fv
+ glEvalPoint1
+ glEvalPoint2
+ glEvalMesh1
+ glEdgeFlag
+ glEdgeFlagv
+ glEdgeFlagPointer
+ glEvalMesh2
+ glFeedbackBuffer
+ glFinish
+ glFlush
+ glFogf
+ glFogi
+ glFogfv
+ glFogiv
+ glFrontFace
+ glFrustum
+ glGenLists
+ glGenTextures
+ glGetBooleanv
+ glGetClipPlane
+ glGetColorTableEXT
+ glGetColorTableParameterivEXT
+ glGetColorTableParameterfvEXT
+ glGetDoublev
+ glGetError
+ glGetFloatv
+ glGetIntegerv
+ glGetLightfv
+ glGetLightiv
+ glGetMapdv
+ glGetMapfv
+ glGetMapiv
+ glGetMaterialfv
+ glGetMaterialiv
+ glGetPixelMapfv
+ glGetPixelMapuiv
+ glGetPixelMapusv
+ glGetPointerv
+ glGetPolygonStipple
+ glGetString
+ glGetTexEnvfv
+ glGetTexEnviv
+ glGetTexGeniv
+ glGetTexGendv
+ glGetTexGenfv
+ glGetTexImage
+ glGetTexLevelParameterfv
+ glGetTexLevelParameteriv
+ glGetTexParameterfv
+ glGetTexParameteriv
+ glHint
+ glIndexd
+ glIndexf
+ glIndexi
+ glIndexs
+ glIndexub
+ glIndexdv
+ glIndexfv
+ glIndexiv
+ glIndexsv
+ glIndexubv
+ glIndexMask
+ glIndexPointer
+ glInterleavedArrays
+ glInitNames
+ glIsList
+ glIsTexture
+ glLightf
+ glLighti
+ glLightfv
+ glLightiv
+ glLightModelf
+ glLightModeli
+ glLightModelfv
+ glLightModeliv
+ glLineWidth
+ glLineStipple
+ glListBase
+ glLoadIdentity
+ glLoadMatrixd
+ glLoadMatrixf
+ glLoadName
+ glLogicOp
+ glMap1d
+ glMap1f
+ glMap2d
+ glMap2f
+ glMapGrid1d
+ glMapGrid1f
+ glMapGrid2d
+ glMapGrid2f
+ glMaterialf
+ glMateriali
+ glMaterialfv
+ glMaterialiv
+ glMatrixMode
+ glMultMatrixd
+ glMultMatrixf
+ glNewList
+ glNormal3b
+ glNormal3d
+ glNormal3f
+ glNormal3i
+ glNormal3s
+ glNormal3bv
+ glNormal3dv
+ glNormal3fv
+ glNormal3iv
+ glNormal3sv
+ glNormalPointer
+ glOrtho
+ glPassThrough
+ glPixelMapfv
+ glPixelMapuiv
+ glPixelMapusv
+ glPixelStoref
+ glPixelStorei
+ glPixelTransferf
+ glPixelTransferi
+ glPixelZoom
+ glPointSize
+ glPolygonMode
+ glPolygonOffset
+ glPolygonOffsetEXT
+ glPolygonStipple
+ glPopAttrib
+ glPopClientAttrib
+ glPopMatrix
+ glPopName
+ glPrioritizeTextures
+ glPushMatrix
+ glRasterPos2d
+ glRasterPos2f
+ glRasterPos2i
+ glRasterPos2s
+ glRasterPos3d
+ glRasterPos3f
+ glRasterPos3i
+ glRasterPos3s
+ glRasterPos4d
+ glRasterPos4f
+ glRasterPos4i
+ glRasterPos4s
+ glRasterPos2dv
+ glRasterPos2fv
+ glRasterPos2iv
+ glRasterPos2sv
+ glRasterPos3dv
+ glRasterPos3fv
+ glRasterPos3iv
+ glRasterPos3sv
+ glRasterPos4dv
+ glRasterPos4fv
+ glRasterPos4iv
+ glRasterPos4sv
+ glReadBuffer
+ glReadPixels
+ glRectd
+ glRectf
+ glRecti
+ glRects
+ glRectdv
+ glRectfv
+ glRectiv
+ glRectsv
+ glScissor
+ glIsEnabled
+ glPushAttrib
+ glPushClientAttrib
+ glPushName
+ glRenderMode
+ glRotated
+ glRotatef
+ glSelectBuffer
+ glScaled
+ glScalef
+ glShadeModel
+ glStencilFunc
+ glStencilMask
+ glStencilOp
+ glTexCoord1d
+ glTexCoord1f
+ glTexCoord1i
+ glTexCoord1s
+ glTexCoord2d
+ glTexCoord2f
+ glTexCoord2i
+ glTexCoord2s
+ glTexCoord3d
+ glTexCoord3f
+ glTexCoord3i
+ glTexCoord3s
+ glTexCoord4d
+ glTexCoord4f
+ glTexCoord4i
+ glTexCoord4s
+ glTexCoord1dv
+ glTexCoord1fv
+ glTexCoord1iv
+ glTexCoord1sv
+ glTexCoord2dv
+ glTexCoord2fv
+ glTexCoord2iv
+ glTexCoord2sv
+ glTexCoord3dv
+ glTexCoord3fv
+ glTexCoord3iv
+ glTexCoord3sv
+ glTexCoord4dv
+ glTexCoord4fv
+ glTexCoord4iv
+ glTexCoord4sv
+ glTexCoordPointer
+ glTexGend
+ glTexGenf
+ glTexGeni
+ glTexGendv
+ glTexGeniv
+ glTexGenfv
+ glTexEnvf
+ glTexEnvi
+ glTexEnvfv
+ glTexEnviv
+ glTexImage1D
+ glTexImage2D
+ glTexParameterf
+ glTexParameteri
+ glTexParameterfv
+ glTexParameteriv
+ glTexSubImage1D
+ glTexSubImage2D
+ glTranslated
+ glTranslatef
+ glVertex2d
+ glVertex2f
+ glVertex2i
+ glVertex2s
+ glVertex3d
+ glVertex3f
+ glVertex3i
+ glVertex3s
+ glVertex4d
+ glVertex4f
+ glVertex4i
+ glVertex4s
+ glVertex2dv
+ glVertex2fv
+ glVertex2iv
+ glVertex2sv
+ glVertex3dv
+ glVertex3fv
+ glVertex3iv
+ glVertex3sv
+ glVertex4dv
+ glVertex4fv
+ glVertex4iv
+ glVertex4sv
+ glVertexPointer
+ glViewport
+ glBlendEquationEXT
+ glBlendColorEXT
+ glVertexPointerEXT
+ glNormalPointerEXT
+ glColorPointerEXT
+ glIndexPointerEXT
+ glTexCoordPointerEXT
+ glEdgeFlagPointerEXT
+ glGetPointervEXT
+ glArrayElementEXT
+ glDrawArraysEXT
+ glBindTextureEXT
+ glDeleteTexturesEXT
+ glGenTexturesEXT
+ glPrioritizeTexturesEXT
+ glCopyTexSubImage3DEXT
+ glTexImage3DEXT
+ glTexSubImage3DEXT
+ glWindowPos4fMESA
+ glWindowPos2iMESA
+ glWindowPos2sMESA
+ glWindowPos2fMESA
+ glWindowPos2dMESA
+ glWindowPos2ivMESA
+ glWindowPos2svMESA
+ glWindowPos2fvMESA
+ glWindowPos2dvMESA
+ glWindowPos3iMESA
+ glWindowPos3sMESA
+ glWindowPos3fMESA
+ glWindowPos3dMESA
+ glWindowPos3ivMESA
+ glWindowPos3svMESA
+ glWindowPos3fvMESA
+ glWindowPos3dvMESA
+ glWindowPos4iMESA
+ glWindowPos4sMESA
+ glWindowPos4dMESA
+ glWindowPos4ivMESA
+ glWindowPos4svMESA
+ glWindowPos4fvMESA
+ glWindowPos4dvMESA
+ glResizeBuffersMESA
+ wglCopyContext
+ wglCreateContext
+ wglCreateLayerContext
+ wglDeleteContext
+;wglDescribeLayerPlane
+ wglGetCurrentContext
+ wglGetCurrentDC
+;wglGetLayerPaletteEntries
+ wglGetProcAddress
+ wglMakeCurrent
+;wglRealizeLayerPalette
+;wglSetLayerPaletteEntries
+ wglShareLists
+ wglSwapLayerBuffers
+ wglUseFontBitmapsA
+ wglUseFontBitmapsW
+ wglUseFontOutlinesA
+ wglUseFontOutlinesW
+ wglChoosePixelFormat
+ ChoosePixelFormat
+ wglDescribePixelFormat
+ DescribePixelFormat
+ wglGetPixelFormat
+ GetPixelFormat
+ wglSetPixelFormat
+ SetPixelFormat
+ wglSwapBuffers
+ SwapBuffers
+ gl3DfxSetPaletteEXT
+ glActiveTextureARB
+ glClientActiveTextureARB
+ glMultiTexCoord1dARB
+ glMultiTexCoord1dvARB
+ glMultiTexCoord1fARB
+ glMultiTexCoord1fvARB
+ glMultiTexCoord1iARB
+ glMultiTexCoord1ivARB
+ glMultiTexCoord1sARB
+ glMultiTexCoord1svARB
+ glMultiTexCoord2dARB
+ glMultiTexCoord2dvARB
+ glMultiTexCoord2fARB
+ glMultiTexCoord2fvARB
+ glMultiTexCoord2iARB
+ glMultiTexCoord2ivARB
+ glMultiTexCoord2sARB
+ glMultiTexCoord2svARB
+ glMultiTexCoord3dARB
+ glMultiTexCoord3dvARB
+ glMultiTexCoord3fARB
+ glMultiTexCoord3fvARB
+ glMultiTexCoord3iARB
+ glMultiTexCoord3ivARB
+ glMultiTexCoord3sARB
+ glMultiTexCoord3svARB
+ glMultiTexCoord4dARB
+ glMultiTexCoord4dvARB
+ glMultiTexCoord4fARB
+ glMultiTexCoord4fvARB
+ glMultiTexCoord4iARB
+ glMultiTexCoord4ivARB
+ glMultiTexCoord4sARB
+ glMultiTexCoord4svARB
+ fxMesaCreateContext
+ fxMesaCreateBestContext
+ fxMesaDestroyContext
+ fxMesaSelectCurrentBoard
+ fxMesaMakeCurrent
+ fxMesaGetCurrentContext
+ fxMesaSwapBuffers
+; fxMesaSetNearFar
+ fxMesaUpdateScreenSize
+ fxQueryHardware
+ fxCloseHardware
+; OSMesaCreateContext
+; OSMesaDestroyContext
+; OSMesaGetCurrentContext
+; OSMesaGetDepthBuffer
+; OSMesaGetIntegerv
+; OSMesaMakeCurrent
+; OSMesaPixelStore
diff --git a/src/mesa/drivers/glide/fxsetup.c b/src/mesa/drivers/glide/fxsetup.c
index 48a1ae69267..523bf2b3fdd 100644
--- a/src/mesa/drivers/glide/fxsetup.c
+++ b/src/mesa/drivers/glide/fxsetup.c
@@ -1,4 +1,4 @@
-/* $Id: fxsetup.c,v 1.38 2002/11/04 20:29:04 brianp Exp $ */
+/* $Id: fxsetup.c,v 1.39 2003/08/19 15:52:53 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -29,6 +29,8 @@
* Brian Paul
* Daryll Strauss
* Keith Whitwell
+ * Daniel Borca
+ * Hiroshi Morii
*/
/* fxsetup.c - 3Dfx VooDoo rendering mode setup functions */
@@ -78,8 +80,8 @@ fxTexValidate(GLcontext * ctx, struct gl_texture_object *tObj)
else
FX_smallLodLog2(ti->info) = FX_largeLodLog2(ti->info);
- fxTexGetFormat(tObj->Image[minl]->TexFormat->BaseFormat, &(ti->info.format),
- &(ti->baseLevelInternalFormat));
+ fxTexGetFormat(ctx, tObj->Image[minl]->TexFormat->BaseFormat, &(ti->info.format),
+ &(ti->baseLevelInternalFormat)); /* [koolsmoky] */
switch (tObj->WrapS) {
case GL_CLAMP_TO_EDGE:
@@ -309,7 +311,7 @@ fxSetupSingleTMU_NoLock(fxMesaContext fxMesa, struct gl_texture_object *tObj)
else {
if (fxMesa->haveTwoTMUs) {
if (fxMesa->freeTexMem[FX_TMU0] >
- FX_grTexTextureMemRequired_NoLock(GR_MIPMAPLEVELMASK_BOTH,
+ grTexTextureMemRequired(GR_MIPMAPLEVELMASK_BOTH,
&(ti->info))) {
fxTMMoveInTM_NoLock(fxMesa, tObj, FX_TMU0);
}
@@ -328,22 +330,19 @@ fxSetupSingleTMU_NoLock(fxMesaContext fxMesa, struct gl_texture_object *tObj)
if (MESA_VERBOSE & VERBOSE_DRIVER) {
fprintf(stderr, "fxmesa: uploading texture palette\n");
}
- FX_grTexDownloadTable_NoLock(GR_TMU0, GR_TEXTABLE_PALETTE,
- &(ti->palette));
- FX_grTexDownloadTable_NoLock(GR_TMU1, GR_TEXTABLE_PALETTE,
- &(ti->palette));
+ grTexDownloadTable(GR_TEXTABLE_PALETTE, &(ti->palette));
}
- FX_grTexClampMode_NoLock(GR_TMU0, ti->sClamp, ti->tClamp);
- FX_grTexClampMode_NoLock(GR_TMU1, ti->sClamp, ti->tClamp);
- FX_grTexFilterMode_NoLock(GR_TMU0, ti->minFilt, ti->maxFilt);
- FX_grTexFilterMode_NoLock(GR_TMU1, ti->minFilt, ti->maxFilt);
- FX_grTexMipMapMode_NoLock(GR_TMU0, ti->mmMode, ti->LODblend);
- FX_grTexMipMapMode_NoLock(GR_TMU1, ti->mmMode, ti->LODblend);
+ grTexClampMode(GR_TMU0, ti->sClamp, ti->tClamp);
+ grTexClampMode(GR_TMU1, ti->sClamp, ti->tClamp);
+ grTexFilterMode(GR_TMU0, ti->minFilt, ti->maxFilt);
+ grTexFilterMode(GR_TMU1, ti->minFilt, ti->maxFilt);
+ grTexMipMapMode(GR_TMU0, ti->mmMode, ti->LODblend);
+ grTexMipMapMode(GR_TMU1, ti->mmMode, ti->LODblend);
- FX_grTexSource_NoLock(GR_TMU0, ti->tm[FX_TMU0]->startAddr,
+ grTexSource(GR_TMU0, ti->tm[FX_TMU0]->startAddr,
GR_MIPMAPLEVELMASK_ODD, &(ti->info));
- FX_grTexSource_NoLock(GR_TMU1, ti->tm[FX_TMU1]->startAddr,
+ grTexSource(GR_TMU1, ti->tm[FX_TMU1]->startAddr,
GR_MIPMAPLEVELMASK_EVEN, &(ti->info));
}
else {
@@ -357,8 +356,7 @@ fxSetupSingleTMU_NoLock(fxMesaContext fxMesa, struct gl_texture_object *tObj)
if (MESA_VERBOSE & VERBOSE_DRIVER) {
fprintf(stderr, "fxmesa: uploading texture palette\n");
}
- FX_grTexDownloadTable_NoLock(tmu, GR_TEXTABLE_PALETTE,
- &(ti->palette));
+ grTexDownloadTable(GR_TEXTABLE_PALETTE, &(ti->palette));
}
/* KW: The alternative is to do the download to the other tmu. If
@@ -368,12 +366,11 @@ fxSetupSingleTMU_NoLock(fxMesaContext fxMesa, struct gl_texture_object *tObj)
if (ti->LODblend && (MESA_VERBOSE & VERBOSE_DRIVER))
fprintf(stderr, "fxmesa: not blending texture - only on one tmu\n");
- FX_grTexClampMode_NoLock(tmu, ti->sClamp, ti->tClamp);
- FX_grTexFilterMode_NoLock(tmu, ti->minFilt, ti->maxFilt);
- FX_grTexMipMapMode_NoLock(tmu, ti->mmMode, FXFALSE);
+ grTexClampMode(tmu, ti->sClamp, ti->tClamp);
+ grTexFilterMode(tmu, ti->minFilt, ti->maxFilt);
+ grTexMipMapMode(tmu, ti->mmMode, FXFALSE);
- FX_grTexSource_NoLock(tmu, ti->tm[tmu]->startAddr,
- GR_MIPMAPLEVELMASK_BOTH, &(ti->info));
+ grTexSource(tmu, ti->tm[tmu]->startAddr, GR_MIPMAPLEVELMASK_BOTH, &(ti->info));
}
}
@@ -385,7 +382,7 @@ fxSelectSingleTMUSrc_NoLock(fxMesaContext fxMesa, GLint tmu, FxBool LODblend)
}
if (LODblend) {
- FX_grTexCombine_NoLock(GR_TMU0,
+ grTexCombine(GR_TMU0,
GR_COMBINE_FUNCTION_BLEND,
GR_COMBINE_FACTOR_ONE_MINUS_LOD_FRACTION,
GR_COMBINE_FUNCTION_BLEND,
@@ -393,7 +390,7 @@ fxSelectSingleTMUSrc_NoLock(fxMesaContext fxMesa, GLint tmu, FxBool LODblend)
FXFALSE, FXFALSE);
if (fxMesa->haveTwoTMUs)
- FX_grTexCombine_NoLock(GR_TMU1,
+ grTexCombine(GR_TMU1,
GR_COMBINE_FUNCTION_LOCAL,
GR_COMBINE_FACTOR_NONE,
GR_COMBINE_FUNCTION_LOCAL,
@@ -402,13 +399,13 @@ fxSelectSingleTMUSrc_NoLock(fxMesaContext fxMesa, GLint tmu, FxBool LODblend)
}
else {
if (tmu != FX_TMU1) {
- FX_grTexCombine_NoLock(GR_TMU0,
+ grTexCombine(GR_TMU0,
GR_COMBINE_FUNCTION_LOCAL,
GR_COMBINE_FACTOR_NONE,
GR_COMBINE_FUNCTION_LOCAL,
GR_COMBINE_FACTOR_NONE, FXFALSE, FXFALSE);
if (fxMesa->haveTwoTMUs) {
- FX_grTexCombine_NoLock(GR_TMU1,
+ grTexCombine(GR_TMU1,
GR_COMBINE_FUNCTION_ZERO,
GR_COMBINE_FACTOR_NONE,
GR_COMBINE_FUNCTION_ZERO,
@@ -417,7 +414,7 @@ fxSelectSingleTMUSrc_NoLock(fxMesaContext fxMesa, GLint tmu, FxBool LODblend)
fxMesa->tmuSrc = FX_TMU0;
}
else {
- FX_grTexCombine_NoLock(GR_TMU1,
+ grTexCombine(GR_TMU1,
GR_COMBINE_FUNCTION_LOCAL,
GR_COMBINE_FACTOR_NONE,
GR_COMBINE_FUNCTION_LOCAL,
@@ -425,7 +422,7 @@ fxSelectSingleTMUSrc_NoLock(fxMesaContext fxMesa, GLint tmu, FxBool LODblend)
/* GR_COMBINE_FUNCTION_SCALE_OTHER doesn't work ?!? */
- FX_grTexCombine_NoLock(GR_TMU0,
+ grTexCombine(GR_TMU0,
GR_COMBINE_FUNCTION_BLEND,
GR_COMBINE_FACTOR_ONE,
GR_COMBINE_FUNCTION_BLEND,
@@ -495,25 +492,25 @@ fxSetupTextureSingleTMU_NoLock(GLcontext * ctx, GLuint textureset)
switch (ctx->Texture.Unit[textureset].EnvMode) {
case GL_DECAL:
- FX_grAlphaCombine_NoLock(GR_COMBINE_FUNCTION_LOCAL,
+ grAlphaCombine(GR_COMBINE_FUNCTION_LOCAL,
GR_COMBINE_FACTOR_NONE,
locala, GR_COMBINE_OTHER_NONE, FXFALSE);
- FX_grColorCombine_NoLock(GR_COMBINE_FUNCTION_BLEND,
+ grColorCombine(GR_COMBINE_FUNCTION_BLEND,
GR_COMBINE_FACTOR_TEXTURE_ALPHA,
localc, GR_COMBINE_OTHER_TEXTURE, FXFALSE);
break;
case GL_MODULATE:
- FX_grAlphaCombine_NoLock(GR_COMBINE_FUNCTION_SCALE_OTHER,
+ grAlphaCombine(GR_COMBINE_FUNCTION_SCALE_OTHER,
GR_COMBINE_FACTOR_LOCAL,
locala, GR_COMBINE_OTHER_TEXTURE, FXFALSE);
if (ifmt == GL_ALPHA)
- FX_grColorCombine_NoLock(GR_COMBINE_FUNCTION_LOCAL,
+ grColorCombine(GR_COMBINE_FUNCTION_LOCAL,
GR_COMBINE_FACTOR_NONE,
localc, GR_COMBINE_OTHER_NONE, FXFALSE);
else
- FX_grColorCombine_NoLock(GR_COMBINE_FUNCTION_SCALE_OTHER,
+ grColorCombine(GR_COMBINE_FUNCTION_SCALE_OTHER,
GR_COMBINE_FACTOR_LOCAL,
localc, GR_COMBINE_OTHER_TEXTURE, FXFALSE);
break;
@@ -523,20 +520,20 @@ fxSetupTextureSingleTMU_NoLock(GLcontext * ctx, GLuint textureset)
break;
case GL_REPLACE:
if ((ifmt == GL_RGB) || (ifmt == GL_LUMINANCE))
- FX_grAlphaCombine_NoLock(GR_COMBINE_FUNCTION_LOCAL,
+ grAlphaCombine(GR_COMBINE_FUNCTION_LOCAL,
GR_COMBINE_FACTOR_NONE,
locala, GR_COMBINE_OTHER_NONE, FXFALSE);
else
- FX_grAlphaCombine_NoLock(GR_COMBINE_FUNCTION_SCALE_OTHER,
+ grAlphaCombine(GR_COMBINE_FUNCTION_SCALE_OTHER,
GR_COMBINE_FACTOR_ONE,
locala, GR_COMBINE_OTHER_TEXTURE, FXFALSE);
if (ifmt == GL_ALPHA)
- FX_grColorCombine_NoLock(GR_COMBINE_FUNCTION_LOCAL,
+ grColorCombine(GR_COMBINE_FUNCTION_LOCAL,
GR_COMBINE_FACTOR_NONE,
localc, GR_COMBINE_OTHER_NONE, FXFALSE);
else
- FX_grColorCombine_NoLock(GR_COMBINE_FUNCTION_SCALE_OTHER,
+ grColorCombine(GR_COMBINE_FUNCTION_SCALE_OTHER,
GR_COMBINE_FACTOR_ONE,
localc, GR_COMBINE_OTHER_TEXTURE, FXFALSE);
break;
@@ -673,34 +670,29 @@ fxSetupDoubleTMU_NoLock(fxMesaContext fxMesa,
}
if (!fxMesa->haveGlobalPaletteTexture) {
+ /* [dBorca]
+ * all TMUs share the same table.
+ * The next test shouldn't be TMU specific...
+ */
if (ti0->info.format == GR_TEXFMT_P_8) {
if (MESA_VERBOSE & VERBOSE_DRIVER) {
fprintf(stderr, "fxmesa: uploading texture palette TMU0\n");
}
- FX_grTexDownloadTable_NoLock(tmu0, GR_TEXTABLE_PALETTE,
- &(ti0->palette));
- }
-
- if (ti1->info.format == GR_TEXFMT_P_8) {
- if (MESA_VERBOSE & VERBOSE_DRIVER) {
- fprintf(stderr, "fxmesa: uploading texture palette TMU1\n");
- }
- FX_grTexDownloadTable_NoLock(tmu1, GR_TEXTABLE_PALETTE,
- &(ti1->palette));
+ grTexDownloadTable(GR_TEXTABLE_PALETTE, &(ti0->palette));
}
}
- FX_grTexSource_NoLock(tmu0, ti0->tm[tmu0]->startAddr,
+ grTexSource(tmu0, ti0->tm[tmu0]->startAddr,
GR_MIPMAPLEVELMASK_BOTH, &(ti0->info));
- FX_grTexClampMode_NoLock(tmu0, ti0->sClamp, ti0->tClamp);
- FX_grTexFilterMode_NoLock(tmu0, ti0->minFilt, ti0->maxFilt);
- FX_grTexMipMapMode_NoLock(tmu0, ti0->mmMode, FXFALSE);
+ grTexClampMode(tmu0, ti0->sClamp, ti0->tClamp);
+ grTexFilterMode(tmu0, ti0->minFilt, ti0->maxFilt);
+ grTexMipMapMode(tmu0, ti0->mmMode, FXFALSE);
- FX_grTexSource_NoLock(tmu1, ti1->tm[tmu1]->startAddr,
+ grTexSource(tmu1, ti1->tm[tmu1]->startAddr,
GR_MIPMAPLEVELMASK_BOTH, &(ti1->info));
- FX_grTexClampMode_NoLock(tmu1, ti1->sClamp, ti1->tClamp);
- FX_grTexFilterMode_NoLock(tmu1, ti1->minFilt, ti1->maxFilt);
- FX_grTexMipMapMode_NoLock(tmu1, ti1->mmMode, FXFALSE);
+ grTexClampMode(tmu1, ti1->sClamp, ti1->tClamp);
+ grTexFilterMode(tmu1, ti1->minFilt, ti1->maxFilt);
+ grTexMipMapMode(tmu1, ti1->mmMode, FXFALSE);
#undef T0_NOT_IN_TMU
#undef T1_NOT_IN_TMU
@@ -784,62 +776,62 @@ fxSetupTextureDoubleTMU_NoLock(GLcontext * ctx)
isalpha[tmu1] = GL_FALSE;
if (isalpha[FX_TMU1])
- FX_grTexCombine_NoLock(GR_TMU1,
+ grTexCombine(GR_TMU1,
GR_COMBINE_FUNCTION_ZERO,
GR_COMBINE_FACTOR_NONE,
GR_COMBINE_FUNCTION_LOCAL,
GR_COMBINE_FACTOR_NONE, FXTRUE, FXFALSE);
else
- FX_grTexCombine_NoLock(GR_TMU1,
+ grTexCombine(GR_TMU1,
GR_COMBINE_FUNCTION_LOCAL,
GR_COMBINE_FACTOR_NONE,
GR_COMBINE_FUNCTION_LOCAL,
GR_COMBINE_FACTOR_NONE, FXFALSE, FXFALSE);
if (isalpha[FX_TMU0])
- FX_grTexCombine_NoLock(GR_TMU0,
+ grTexCombine(GR_TMU0,
GR_COMBINE_FUNCTION_BLEND_OTHER,
GR_COMBINE_FACTOR_ONE,
GR_COMBINE_FUNCTION_BLEND_OTHER,
GR_COMBINE_FACTOR_LOCAL, FXFALSE, FXFALSE);
else
- FX_grTexCombine_NoLock(GR_TMU0,
+ grTexCombine(GR_TMU0,
GR_COMBINE_FUNCTION_BLEND_OTHER,
GR_COMBINE_FACTOR_LOCAL,
GR_COMBINE_FUNCTION_BLEND_OTHER,
GR_COMBINE_FACTOR_LOCAL, FXFALSE, FXFALSE);
- FX_grColorCombine_NoLock(GR_COMBINE_FUNCTION_SCALE_OTHER,
+ grColorCombine(GR_COMBINE_FUNCTION_SCALE_OTHER,
GR_COMBINE_FACTOR_LOCAL,
localc, GR_COMBINE_OTHER_TEXTURE, FXFALSE);
- FX_grAlphaCombine_NoLock(GR_COMBINE_FUNCTION_SCALE_OTHER,
+ grAlphaCombine(GR_COMBINE_FUNCTION_SCALE_OTHER,
GR_COMBINE_FACTOR_LOCAL,
locala, GR_COMBINE_OTHER_TEXTURE, FXFALSE);
break;
}
case (FX_UM_E0_REPLACE | FX_UM_E1_BLEND): /* Only for GLQuake */
if (tmu1 == FX_TMU1) {
- FX_grTexCombine_NoLock(GR_TMU1,
+ grTexCombine(GR_TMU1,
GR_COMBINE_FUNCTION_LOCAL,
GR_COMBINE_FACTOR_NONE,
GR_COMBINE_FUNCTION_LOCAL,
GR_COMBINE_FACTOR_NONE, FXTRUE, FXFALSE);
- FX_grTexCombine_NoLock(GR_TMU0,
+ grTexCombine(GR_TMU0,
GR_COMBINE_FUNCTION_BLEND_OTHER,
GR_COMBINE_FACTOR_LOCAL,
GR_COMBINE_FUNCTION_BLEND_OTHER,
GR_COMBINE_FACTOR_LOCAL, FXFALSE, FXFALSE);
}
else {
- FX_grTexCombine_NoLock(GR_TMU1,
+ grTexCombine(GR_TMU1,
GR_COMBINE_FUNCTION_LOCAL,
GR_COMBINE_FACTOR_NONE,
GR_COMBINE_FUNCTION_LOCAL,
GR_COMBINE_FACTOR_NONE, FXFALSE, FXFALSE);
- FX_grTexCombine_NoLock(GR_TMU0,
+ grTexCombine(GR_TMU0,
GR_COMBINE_FUNCTION_BLEND_OTHER,
GR_COMBINE_FACTOR_ONE_MINUS_LOCAL,
GR_COMBINE_FUNCTION_BLEND_OTHER,
@@ -847,23 +839,23 @@ fxSetupTextureDoubleTMU_NoLock(GLcontext * ctx)
FXFALSE, FXFALSE);
}
- FX_grAlphaCombine_NoLock(GR_COMBINE_FUNCTION_LOCAL,
+ grAlphaCombine(GR_COMBINE_FUNCTION_LOCAL,
GR_COMBINE_FACTOR_NONE,
locala, GR_COMBINE_OTHER_NONE, FXFALSE);
- FX_grColorCombine_NoLock(GR_COMBINE_FUNCTION_SCALE_OTHER,
+ grColorCombine(GR_COMBINE_FUNCTION_SCALE_OTHER,
GR_COMBINE_FACTOR_ONE,
localc, GR_COMBINE_OTHER_TEXTURE, FXFALSE);
break;
case (FX_UM_E0_REPLACE | FX_UM_E1_MODULATE): /* Quake 2 and 3 */
if (tmu1 == FX_TMU1) {
- FX_grTexCombine_NoLock(GR_TMU1,
+ grTexCombine(GR_TMU1,
GR_COMBINE_FUNCTION_LOCAL,
GR_COMBINE_FACTOR_NONE,
GR_COMBINE_FUNCTION_ZERO,
GR_COMBINE_FACTOR_NONE, FXFALSE, FXTRUE);
- FX_grTexCombine_NoLock(GR_TMU0,
+ grTexCombine(GR_TMU0,
GR_COMBINE_FUNCTION_BLEND_OTHER,
GR_COMBINE_FACTOR_LOCAL,
GR_COMBINE_FUNCTION_BLEND_OTHER,
@@ -871,13 +863,13 @@ fxSetupTextureDoubleTMU_NoLock(GLcontext * ctx)
}
else {
- FX_grTexCombine_NoLock(GR_TMU1,
+ grTexCombine(GR_TMU1,
GR_COMBINE_FUNCTION_LOCAL,
GR_COMBINE_FACTOR_NONE,
GR_COMBINE_FUNCTION_LOCAL,
GR_COMBINE_FACTOR_NONE, FXFALSE, FXFALSE);
- FX_grTexCombine_NoLock(GR_TMU0,
+ grTexCombine(GR_TMU0,
GR_COMBINE_FUNCTION_BLEND_OTHER,
GR_COMBINE_FACTOR_LOCAL,
GR_COMBINE_FUNCTION_BLEND_OTHER,
@@ -885,16 +877,16 @@ fxSetupTextureDoubleTMU_NoLock(GLcontext * ctx)
}
if (ti0->baseLevelInternalFormat == GL_RGB)
- FX_grAlphaCombine_NoLock(GR_COMBINE_FUNCTION_LOCAL,
+ grAlphaCombine(GR_COMBINE_FUNCTION_LOCAL,
GR_COMBINE_FACTOR_NONE,
locala, GR_COMBINE_OTHER_NONE, FXFALSE);
else
- FX_grAlphaCombine_NoLock(GR_COMBINE_FUNCTION_SCALE_OTHER,
+ grAlphaCombine(GR_COMBINE_FUNCTION_SCALE_OTHER,
GR_COMBINE_FACTOR_ONE,
locala, GR_COMBINE_OTHER_NONE, FXFALSE);
- FX_grColorCombine_NoLock(GR_COMBINE_FUNCTION_SCALE_OTHER,
+ grColorCombine(GR_COMBINE_FUNCTION_SCALE_OTHER,
GR_COMBINE_FACTOR_ONE,
localc, GR_COMBINE_OTHER_TEXTURE, FXFALSE);
break;
@@ -915,36 +907,36 @@ fxSetupTextureDoubleTMU_NoLock(GLcontext * ctx)
isalpha[tmu1] = GL_FALSE;
if (isalpha[FX_TMU1])
- FX_grTexCombine_NoLock(GR_TMU1,
+ grTexCombine(GR_TMU1,
GR_COMBINE_FUNCTION_ZERO,
GR_COMBINE_FACTOR_NONE,
GR_COMBINE_FUNCTION_LOCAL,
GR_COMBINE_FACTOR_NONE, FXTRUE, FXFALSE);
else
- FX_grTexCombine_NoLock(GR_TMU1,
+ grTexCombine(GR_TMU1,
GR_COMBINE_FUNCTION_LOCAL,
GR_COMBINE_FACTOR_NONE,
GR_COMBINE_FUNCTION_LOCAL,
GR_COMBINE_FACTOR_NONE, FXFALSE, FXFALSE);
if (isalpha[FX_TMU0])
- FX_grTexCombine_NoLock(GR_TMU0,
+ grTexCombine(GR_TMU0,
GR_COMBINE_FUNCTION_SCALE_OTHER,
GR_COMBINE_FACTOR_ONE,
GR_COMBINE_FUNCTION_SCALE_OTHER_ADD_LOCAL,
GR_COMBINE_FACTOR_ONE, FXFALSE, FXFALSE);
else
- FX_grTexCombine_NoLock(GR_TMU0,
+ grTexCombine(GR_TMU0,
GR_COMBINE_FUNCTION_SCALE_OTHER_ADD_LOCAL,
GR_COMBINE_FACTOR_ONE,
GR_COMBINE_FUNCTION_SCALE_OTHER_ADD_LOCAL,
GR_COMBINE_FACTOR_ONE, FXFALSE, FXFALSE);
- FX_grColorCombine_NoLock(GR_COMBINE_FUNCTION_SCALE_OTHER,
+ grColorCombine(GR_COMBINE_FUNCTION_SCALE_OTHER,
GR_COMBINE_FACTOR_LOCAL,
localc, GR_COMBINE_OTHER_TEXTURE, FXFALSE);
- FX_grAlphaCombine_NoLock(GR_COMBINE_FUNCTION_SCALE_OTHER,
+ grAlphaCombine(GR_COMBINE_FUNCTION_SCALE_OTHER,
GR_COMBINE_FACTOR_LOCAL,
locala, GR_COMBINE_OTHER_TEXTURE, FXFALSE);
break;
@@ -983,11 +975,11 @@ fxSetupTextureNone_NoLock(GLcontext * ctx)
else
localc = GR_COMBINE_LOCAL_CONSTANT;
- FX_grAlphaCombine_NoLock(GR_COMBINE_FUNCTION_LOCAL,
+ grAlphaCombine(GR_COMBINE_FUNCTION_LOCAL,
GR_COMBINE_FACTOR_NONE,
locala, GR_COMBINE_OTHER_NONE, FXFALSE);
- FX_grColorCombine_NoLock(GR_COMBINE_FUNCTION_LOCAL,
+ grColorCombine(GR_COMBINE_FUNCTION_LOCAL,
GR_COMBINE_FACTOR_NONE,
localc, GR_COMBINE_OTHER_NONE, FXFALSE);
@@ -1161,10 +1153,10 @@ fxSetupBlend(GLcontext * ctx)
tfxUnitsState *us = &fxMesa->unitsState;
if (us->blendEnabled)
- FX_grAlphaBlendFunction(us->blendSrcFuncRGB, us->blendDstFuncRGB,
+ grAlphaBlendFunction(us->blendSrcFuncRGB, us->blendDstFuncRGB,
us->blendSrcFuncAlpha, us->blendDstFuncAlpha);
else
- FX_grAlphaBlendFunction(GR_BLEND_ONE, GR_BLEND_ZERO, GR_BLEND_ONE,
+ grAlphaBlendFunction(GR_BLEND_ONE, GR_BLEND_ZERO, GR_BLEND_ONE,
GR_BLEND_ZERO);
}
@@ -1230,11 +1222,11 @@ fxSetupAlphaTest(GLcontext * ctx)
if (us->alphaTestEnabled) {
GrAlpha_t ref = (GLint) (us->alphaTestRefValue * 255.0);
- FX_grAlphaTestFunction(us->alphaTestFunc);
- FX_grAlphaTestReferenceValue(ref);
+ grAlphaTestFunction(us->alphaTestFunc);
+ grAlphaTestReferenceValue(ref);
}
else
- FX_grAlphaTestFunction(GR_CMP_ALWAYS);
+ grAlphaTestFunction(GR_CMP_ALWAYS);
}
/************************************************************************/
@@ -1306,12 +1298,12 @@ fxSetupDepthTest(GLcontext * ctx)
tfxUnitsState *us = &fxMesa->unitsState;
if (us->depthTestEnabled) {
- FX_grDepthBufferFunction(us->depthTestFunc);
- FX_grDepthMask(us->depthMask);
+ grDepthBufferFunction(us->depthTestFunc);
+ grDepthMask(us->depthMask);
}
else {
- FX_grDepthBufferFunction(GR_CMP_ALWAYS);
- FX_grDepthMask(FXFALSE);
+ grDepthBufferFunction(GR_CMP_ALWAYS);
+ grDepthMask(FXFALSE);
}
}
@@ -1337,10 +1329,10 @@ fxSetupColorMask(GLcontext * ctx)
fxMesaContext fxMesa = FX_CONTEXT(ctx);
if (ctx->Color.DrawBuffer == GL_NONE) {
- FX_grColorMask(FXFALSE, FXFALSE);
+ grColorMask(FXFALSE, FXFALSE);
}
else {
- FX_grColorMask(ctx->Color.ColorMask[RCOMP] ||
+ grColorMask(ctx->Color.ColorMask[RCOMP] ||
ctx->Color.ColorMask[GCOMP] ||
ctx->Color.ColorMask[BCOMP],
ctx->Color.ColorMask[ACOMP] && fxMesa->haveAlphaBuffer);
@@ -1369,7 +1361,7 @@ fxSetupFog(GLcontext * ctx)
col[1] = (unsigned int) (255 * ctx->Fog.Color[1]);
col[2] = (unsigned int) (255 * ctx->Fog.Color[2]);
col[3] = (unsigned int) (255 * ctx->Fog.Color[3]);
- FX_grFogColorValue(FXCOLOR4(col));
+ grFogColorValue(FXCOLOR4(col));
if (fxMesa->fogTableMode != ctx->Fog.Mode ||
fxMesa->fogDensity != ctx->Fog.Density ||
@@ -1396,11 +1388,11 @@ fxSetupFog(GLcontext * ctx)
fxMesa->fogEnd = ctx->Fog.End;
}
- FX_grFogTable(fxMesa->fogTable);
- FX_grFogMode(GR_FOG_WITH_TABLE);
+ grFogTable(fxMesa->fogTable);
+ grFogMode(GR_FOG_WITH_TABLE);
}
else {
- FX_grFogMode(GR_FOG_DISABLE);
+ grFogMode(GR_FOG_DISABLE);
}
}
@@ -1444,7 +1436,7 @@ fxSetScissorValues(GLcontext * ctx)
ymin = fxMesa->screen_height - fxMesa->clipMaxY;
if (ymax > fxMesa->screen_height - fxMesa->clipMinY)
ymax = fxMesa->screen_height - fxMesa->clipMinY;
- FX_grClipWindow_NoLock(xmin, ymin, xmax, ymax);
+ grClipWindow(xmin, ymin, xmax, ymax);
}
static void
@@ -1509,7 +1501,7 @@ fxSetupCull(GLcontext * ctx)
FX_CONTEXT(ctx)->cullMode = GR_CULL_DISABLE;
if (FX_CONTEXT(ctx)->raster_primitive == GL_TRIANGLES)
- FX_grCullMode(FX_CONTEXT(ctx)->cullMode);
+ grCullMode(FX_CONTEXT(ctx)->cullMode);
}
@@ -1548,10 +1540,10 @@ fxDDEnable(GLcontext * ctx, GLenum cap, GLboolean state)
break;
case GL_DITHER:
if (state) {
- FX_grDitherMode(GR_DITHER_4x4);
+ grDitherMode(GR_DITHER_4x4);
}
else {
- FX_grDitherMode(GR_DITHER_DISABLE);
+ grDitherMode(GR_DITHER_DISABLE);
}
break;
case GL_SCISSOR_TEST:
diff --git a/src/mesa/drivers/glide/fxtexman.c b/src/mesa/drivers/glide/fxtexman.c
index b03122f8c1b..5189816cdef 100644
--- a/src/mesa/drivers/glide/fxtexman.c
+++ b/src/mesa/drivers/glide/fxtexman.c
@@ -1,4 +1,4 @@
-/* $Id: fxtexman.c,v 1.15 2001/09/23 16:50:01 brianp Exp $ */
+/* $Id: fxtexman.c,v 1.16 2003/08/19 15:52:53 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -29,6 +29,8 @@
* Brian Paul
* Daryll Strauss
* Keith Whitwell
+ * Daniel Borca
+ * Hiroshi Morii
*/
/* fxtexman.c - 3Dfx VooDoo texture memory functions */
@@ -137,11 +139,11 @@ fxTMUInit(fxMesaContext fxMesa, int tmu)
MemRange *tmn, *last;
FxU32 start, end, blockstart, blockend;
- start = FX_grTexMinAddress(tmu);
- end = FX_grTexMaxAddress(tmu);
+ start = grTexMinAddress(tmu);
+ end = grTexMaxAddress(tmu);
if (fxMesa->verbose) {
- fprintf(stderr, "Voodoo %s configuration:",
+ fprintf(stderr, "Voodoo %s configuration:\n",
(tmu == FX_TMU0) ? "TMU0" : "TMU1");
fprintf(stderr, "Voodoo Lower texture memory address (%u)\n",
(unsigned int) start);
@@ -308,7 +310,7 @@ static MemRange *
fxTMAddObj(fxMesaContext fxMesa,
struct gl_texture_object *tObj, GLint tmu, int texmemsize)
{
- FxU32 startAddr;
+ FxI32 startAddr;
MemRange *range;
startAddr = fxTMFindStartAddr(fxMesa, tmu, texmemsize);
@@ -363,16 +365,14 @@ fxTMMoveInTM_NoLock(fxMesaContext fxMesa, struct gl_texture_object *tObj,
switch (where) {
case FX_TMU0:
case FX_TMU1:
- texmemsize =
- (int) FX_grTexTextureMemRequired_NoLock(GR_MIPMAPLEVELMASK_BOTH,
- &(ti->info));
+ texmemsize = (int)grTexTextureMemRequired(GR_MIPMAPLEVELMASK_BOTH, &(ti->info));
ti->tm[where] = fxTMAddObj(fxMesa, tObj, where, texmemsize);
fxMesa->stats.memTexUpload += texmemsize;
for (i = FX_largeLodValue(ti->info), l = ti->minLevel;
i <= FX_smallLodValue(ti->info); i++, l++) {
struct gl_texture_image *texImage = tObj->Image[l];
- FX_grTexDownloadMipMapLevel_NoLock(where,
+ grTexDownloadMipMapLevel(where,
ti->tm[where]->startAddr,
FX_valueToLod(i),
FX_largeLodLog2(ti->info),
@@ -383,15 +383,11 @@ fxTMMoveInTM_NoLock(fxMesaContext fxMesa, struct gl_texture_object *tObj,
}
break;
case FX_TMU_SPLIT:
- texmemsize =
- (int) FX_grTexTextureMemRequired_NoLock(GR_MIPMAPLEVELMASK_ODD,
- &(ti->info));
+ texmemsize = (int)grTexTextureMemRequired(GR_MIPMAPLEVELMASK_ODD, &(ti->info));
ti->tm[FX_TMU0] = fxTMAddObj(fxMesa, tObj, FX_TMU0, texmemsize);
fxMesa->stats.memTexUpload += texmemsize;
- texmemsize =
- (int) FX_grTexTextureMemRequired_NoLock(GR_MIPMAPLEVELMASK_EVEN,
- &(ti->info));
+ texmemsize = (int)grTexTextureMemRequired(GR_MIPMAPLEVELMASK_EVEN, &(ti->info));
ti->tm[FX_TMU1] = fxTMAddObj(fxMesa, tObj, FX_TMU1, texmemsize);
fxMesa->stats.memTexUpload += texmemsize;
@@ -399,7 +395,7 @@ fxTMMoveInTM_NoLock(fxMesaContext fxMesa, struct gl_texture_object *tObj,
i <= FX_smallLodValue(ti->info); i++, l++) {
struct gl_texture_image *texImage = tObj->Image[l];
- FX_grTexDownloadMipMapLevel_NoLock(GR_TMU0,
+ grTexDownloadMipMapLevel(GR_TMU0,
ti->tm[FX_TMU0]->startAddr,
FX_valueToLod(i),
FX_largeLodLog2(ti->info),
@@ -408,7 +404,7 @@ fxTMMoveInTM_NoLock(fxMesaContext fxMesa, struct gl_texture_object *tObj,
GR_MIPMAPLEVELMASK_ODD,
texImage->Data);
- FX_grTexDownloadMipMapLevel_NoLock(GR_TMU1,
+ grTexDownloadMipMapLevel(GR_TMU1,
ti->tm[FX_TMU1]->startAddr,
FX_valueToLod(i),
FX_largeLodLog2(ti->info),
@@ -419,22 +415,18 @@ fxTMMoveInTM_NoLock(fxMesaContext fxMesa, struct gl_texture_object *tObj,
}
break;
case FX_TMU_BOTH:
- texmemsize =
- (int) FX_grTexTextureMemRequired_NoLock(GR_MIPMAPLEVELMASK_BOTH,
- &(ti->info));
+ texmemsize = (int)grTexTextureMemRequired(GR_MIPMAPLEVELMASK_BOTH, &(ti->info));
ti->tm[FX_TMU0] = fxTMAddObj(fxMesa, tObj, FX_TMU0, texmemsize);
fxMesa->stats.memTexUpload += texmemsize;
- texmemsize =
- (int) FX_grTexTextureMemRequired_NoLock(GR_MIPMAPLEVELMASK_BOTH,
- &(ti->info));
+ texmemsize = (int)grTexTextureMemRequired(GR_MIPMAPLEVELMASK_BOTH, &(ti->info));
ti->tm[FX_TMU1] = fxTMAddObj(fxMesa, tObj, FX_TMU1, texmemsize);
fxMesa->stats.memTexUpload += texmemsize;
for (i = FX_largeLodValue(ti->info), l = ti->minLevel;
i <= FX_smallLodValue(ti->info); i++, l++) {
struct gl_texture_image *texImage = tObj->Image[l];
- FX_grTexDownloadMipMapLevel_NoLock(GR_TMU0,
+ grTexDownloadMipMapLevel(GR_TMU0,
ti->tm[FX_TMU0]->startAddr,
FX_valueToLod(i),
FX_largeLodLog2(ti->info),
@@ -443,7 +435,7 @@ fxTMMoveInTM_NoLock(fxMesaContext fxMesa, struct gl_texture_object *tObj,
GR_MIPMAPLEVELMASK_BOTH,
texImage->Data);
- FX_grTexDownloadMipMapLevel_NoLock(GR_TMU1,
+ grTexDownloadMipMapLevel(GR_TMU1,
ti->tm[FX_TMU1]->startAddr,
FX_valueToLod(i),
FX_largeLodLog2(ti->info),
@@ -505,15 +497,11 @@ fxTMReloadMipMapLevel(fxMesaContext fxMesa, struct gl_texture_object *tObj,
fxTexGetInfo(mml->width, mml->height,
&lodlevel, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
-#ifdef FX_GLIDE3
lodlevel -= level;
-#else
- lodlevel += level;
-#endif
switch (tmu) {
case FX_TMU0:
case FX_TMU1:
- FX_grTexDownloadMipMapLevel(tmu,
+ grTexDownloadMipMapLevel(tmu,
ti->tm[tmu]->startAddr,
FX_valueToLod(FX_lodToValue(lodlevel)),
FX_largeLodLog2(ti->info),
@@ -522,7 +510,7 @@ fxTMReloadMipMapLevel(fxMesaContext fxMesa, struct gl_texture_object *tObj,
GR_MIPMAPLEVELMASK_BOTH, texImage->Data);
break;
case FX_TMU_SPLIT:
- FX_grTexDownloadMipMapLevel(GR_TMU0,
+ grTexDownloadMipMapLevel(GR_TMU0,
ti->tm[GR_TMU0]->startAddr,
FX_valueToLod(FX_lodToValue(lodlevel)),
FX_largeLodLog2(ti->info),
@@ -530,7 +518,7 @@ fxTMReloadMipMapLevel(fxMesaContext fxMesa, struct gl_texture_object *tObj,
ti->info.format,
GR_MIPMAPLEVELMASK_ODD, texImage->Data);
- FX_grTexDownloadMipMapLevel(GR_TMU1,
+ grTexDownloadMipMapLevel(GR_TMU1,
ti->tm[GR_TMU1]->startAddr,
FX_valueToLod(FX_lodToValue(lodlevel)),
FX_largeLodLog2(ti->info),
@@ -539,7 +527,7 @@ fxTMReloadMipMapLevel(fxMesaContext fxMesa, struct gl_texture_object *tObj,
GR_MIPMAPLEVELMASK_EVEN, texImage->Data);
break;
case FX_TMU_BOTH:
- FX_grTexDownloadMipMapLevel(GR_TMU0,
+ grTexDownloadMipMapLevel(GR_TMU0,
ti->tm[GR_TMU0]->startAddr,
FX_valueToLod(FX_lodToValue(lodlevel)),
FX_largeLodLog2(ti->info),
@@ -547,7 +535,7 @@ fxTMReloadMipMapLevel(fxMesaContext fxMesa, struct gl_texture_object *tObj,
ti->info.format,
GR_MIPMAPLEVELMASK_BOTH, texImage->Data);
- FX_grTexDownloadMipMapLevel(GR_TMU1,
+ grTexDownloadMipMapLevel(GR_TMU1,
ti->tm[GR_TMU1]->startAddr,
FX_valueToLod(FX_lodToValue(lodlevel)),
FX_largeLodLog2(ti->info),
@@ -602,7 +590,7 @@ fxTMReloadSubMipMapLevel(fxMesaContext fxMesa,
switch (tmu) {
case FX_TMU0:
case FX_TMU1:
- FX_grTexDownloadMipMapLevelPartial(tmu,
+ grTexDownloadMipMapLevelPartial(tmu,
ti->tm[tmu]->startAddr,
FX_valueToLod(FX_lodToValue(lodlevel)
+ level),
@@ -613,7 +601,7 @@ fxTMReloadSubMipMapLevel(fxMesaContext fxMesa,
yoffset, yoffset + height - 1);
break;
case FX_TMU_SPLIT:
- FX_grTexDownloadMipMapLevelPartial(GR_TMU0,
+ grTexDownloadMipMapLevelPartial(GR_TMU0,
ti->tm[FX_TMU0]->startAddr,
FX_valueToLod(FX_lodToValue(lodlevel)
+ level),
@@ -623,7 +611,7 @@ fxTMReloadSubMipMapLevel(fxMesaContext fxMesa,
GR_MIPMAPLEVELMASK_ODD, data,
yoffset, yoffset + height - 1);
- FX_grTexDownloadMipMapLevelPartial(GR_TMU1,
+ grTexDownloadMipMapLevelPartial(GR_TMU1,
ti->tm[FX_TMU1]->startAddr,
FX_valueToLod(FX_lodToValue(lodlevel)
+ level),
@@ -634,7 +622,7 @@ fxTMReloadSubMipMapLevel(fxMesaContext fxMesa,
yoffset, yoffset + height - 1);
break;
case FX_TMU_BOTH:
- FX_grTexDownloadMipMapLevelPartial(GR_TMU0,
+ grTexDownloadMipMapLevelPartial(GR_TMU0,
ti->tm[FX_TMU0]->startAddr,
FX_valueToLod(FX_lodToValue(lodlevel)
+ level),
@@ -644,7 +632,7 @@ fxTMReloadSubMipMapLevel(fxMesaContext fxMesa,
GR_MIPMAPLEVELMASK_BOTH, data,
yoffset, yoffset + height - 1);
- FX_grTexDownloadMipMapLevelPartial(GR_TMU1,
+ grTexDownloadMipMapLevelPartial(GR_TMU1,
ti->tm[FX_TMU1]->startAddr,
FX_valueToLod(FX_lodToValue(lodlevel)
+ level),
diff --git a/src/mesa/drivers/glide/fxwgl.c b/src/mesa/drivers/glide/fxwgl.c
index ab6b1a1fe85..a55b9cdf2c4 100644
--- a/src/mesa/drivers/glide/fxwgl.c
+++ b/src/mesa/drivers/glide/fxwgl.c
@@ -1,4 +1,4 @@
-/* $Id: fxwgl.c,v 1.16 2002/10/24 23:57:23 brianp Exp $ */
+/* $Id: fxwgl.c,v 1.17 2003/08/19 15:52:53 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -43,9 +43,9 @@ extern "C"
#endif
#include <windows.h>
-#include "glheader.h"
-#include "fxdrv.h"
-#include "glapi.h"
+#define GL_GLEXT_PROTOTYPES
+#include "GL/gl.h"
+#include "GL/glext.h"
#ifdef __cplusplus
}
@@ -53,6 +53,9 @@ extern "C"
#include <stdio.h>
#include "GL/fxmesa.h"
+#include "glheader.h"
+#include "fxdrv.h"
+#include "glapi.h"
#define MAX_MESA_ATTRS 20
@@ -71,6 +74,88 @@ struct __pixelformat__
WINGDIAPI void GLAPIENTRY gl3DfxSetPaletteEXT(GLuint *);
struct __pixelformat__ pix[] = {
+#if 0
+ /* None */
+ {
+ {
+ sizeof(PIXELFORMATDESCRIPTOR), 1,
+ PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL |
+ PFD_DOUBLEBUFFER | PFD_SWAP_COPY,
+ PFD_TYPE_RGBA,
+ 16,
+ 5, 11, 6, 5, 5, 0, 0, 0,
+ 0, 0, 0, 0, 0,
+ 0,
+ 0,
+ 0,
+ PFD_MAIN_PLANE,
+ 0, 0, 0, 0}
+ ,
+ {
+ FXMESA_COLORDEPTH, 16,
+ FXMESA_DOUBLEBUFFER,
+ FXMESA_ALPHA_SIZE, 0,
+ FXMESA_DEPTH_SIZE, 0,
+ FXMESA_STENCIL_SIZE, 0,
+ FXMESA_ACCUM_SIZE, 0,
+ FXMESA_NONE}
+ }
+ ,
+
+ /* Alpha */
+ {
+ {
+ sizeof(PIXELFORMATDESCRIPTOR), 1,
+ PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL |
+ PFD_DOUBLEBUFFER | PFD_SWAP_COPY,
+ PFD_TYPE_RGBA,
+ 16,
+ 5, 10, 5, 5, 5, 0, 1, 15,
+ 0, 0, 0, 0, 0,
+ 0,
+ 0,
+ 0,
+ PFD_MAIN_PLANE,
+ 0, 0, 0, 0}
+ ,
+ {
+ FXMESA_COLORDEPTH, 15,
+ FXMESA_DOUBLEBUFFER,
+ FXMESA_ALPHA_SIZE, 1,
+ FXMESA_DEPTH_SIZE, 0,
+ FXMESA_STENCIL_SIZE, 0,
+ FXMESA_ACCUM_SIZE, 0,
+ FXMESA_NONE}
+ }
+ ,
+
+ /* Depth */
+ {
+ {
+ sizeof(PIXELFORMATDESCRIPTOR), 1,
+ PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL |
+ PFD_DOUBLEBUFFER | PFD_SWAP_COPY,
+ PFD_TYPE_RGBA,
+ 16,
+ 5, 11, 6, 5, 5, 0, 0, 0,
+ 0, 0, 0, 0, 0,
+ 16,
+ 0,
+ 0,
+ PFD_MAIN_PLANE,
+ 0, 0, 0, 0}
+ ,
+ {
+ FXMESA_COLORDEPTH, 16,
+ FXMESA_DOUBLEBUFFER,
+ FXMESA_ALPHA_SIZE, 0,
+ FXMESA_DEPTH_SIZE, 16,
+ FXMESA_STENCIL_SIZE, 0,
+ FXMESA_ACCUM_SIZE, 0,
+ FXMESA_NONE}
+ }
+ ,
+
/* None */
{
{
@@ -79,7 +164,7 @@ struct __pixelformat__ pix[] = {
PFD_DOUBLEBUFFER | PFD_SWAP_COPY,
PFD_TYPE_RGBA,
32,
- 8, 0, 8, 8, 8, 16, 0, 24,
+ 8, 16, 8, 8, 8, 0, 0, 0,
0, 0, 0, 0, 0,
0,
0,
@@ -88,6 +173,7 @@ struct __pixelformat__ pix[] = {
0, 0, 0, 0}
,
{
+ FXMESA_COLORDEPTH, 32,
FXMESA_DOUBLEBUFFER,
FXMESA_ALPHA_SIZE, 0,
FXMESA_DEPTH_SIZE, 0,
@@ -105,7 +191,7 @@ struct __pixelformat__ pix[] = {
PFD_DOUBLEBUFFER | PFD_SWAP_COPY,
PFD_TYPE_RGBA,
32,
- 8, 0, 8, 8, 8, 16, 8, 24,
+ 8, 16, 8, 8, 8, 0, 8, 24,
0, 0, 0, 0, 0,
0,
0,
@@ -114,6 +200,7 @@ struct __pixelformat__ pix[] = {
0, 0, 0, 0}
,
{
+ FXMESA_COLORDEPTH, 32,
FXMESA_DOUBLEBUFFER,
FXMESA_ALPHA_SIZE, 8,
FXMESA_DEPTH_SIZE, 0,
@@ -131,7 +218,7 @@ struct __pixelformat__ pix[] = {
PFD_DOUBLEBUFFER | PFD_SWAP_COPY,
PFD_TYPE_RGBA,
32,
- 8, 0, 8, 8, 8, 16, 0, 24,
+ 8, 16, 8, 8, 8, 0, 0, 0,
0, 0, 0, 0, 0,
16,
0,
@@ -140,6 +227,7 @@ struct __pixelformat__ pix[] = {
0, 0, 0, 0}
,
{
+ FXMESA_COLORDEPTH, 32,
FXMESA_DOUBLEBUFFER,
FXMESA_ALPHA_SIZE, 0,
FXMESA_DEPTH_SIZE, 16,
@@ -147,6 +235,78 @@ struct __pixelformat__ pix[] = {
FXMESA_ACCUM_SIZE, 0,
FXMESA_NONE}
}
+#endif
+ /* 16bit RGB565 */
+ {
+ {sizeof(PIXELFORMATDESCRIPTOR), 1,
+ PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL |
+ PFD_DOUBLEBUFFER | PFD_SWAP_COPY,
+ PFD_TYPE_RGBA,
+ 16,
+ 5, 11, 6, 5, 5, 0, 0, 0,
+ 0, 0, 0, 0, 0,
+ 16,
+ 0,
+ 0,
+ PFD_MAIN_PLANE,
+ 0, 0, 0, 0}
+ ,
+ {FXMESA_COLORDEPTH, 16,
+ FXMESA_DOUBLEBUFFER,
+ FXMESA_ALPHA_SIZE, 0,
+ FXMESA_DEPTH_SIZE, 16,
+ FXMESA_STENCIL_SIZE, 0,
+ FXMESA_ACCUM_SIZE, 0,
+ FXMESA_NONE}
+ }
+ ,
+ /* 16bit ARGB1555 */
+ {
+ {sizeof(PIXELFORMATDESCRIPTOR), 1,
+ PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL |
+ PFD_DOUBLEBUFFER | PFD_SWAP_COPY,
+ PFD_TYPE_RGBA,
+ 16,
+ 5, 10, 5, 5, 5, 0, 1, 15,
+ 0, 0, 0, 0, 0,
+ 16,
+ 0,
+ 0,
+ PFD_MAIN_PLANE,
+ 0, 0, 0, 0}
+ ,
+ {FXMESA_COLORDEPTH, 15,
+ FXMESA_DOUBLEBUFFER,
+ FXMESA_ALPHA_SIZE, 1,
+ FXMESA_DEPTH_SIZE, 16,
+ FXMESA_STENCIL_SIZE, 0,
+ FXMESA_ACCUM_SIZE, 0,
+ FXMESA_NONE}
+ }
+ ,
+ /* 32bit ARGB8888 */
+ {
+ {sizeof(PIXELFORMATDESCRIPTOR), 1,
+ PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL |
+ PFD_DOUBLEBUFFER | PFD_SWAP_COPY,
+ PFD_TYPE_RGBA,
+ 32,
+ 8, 16, 8, 8, 8, 0, 8, 24,
+ 0, 0, 0, 0, 0,
+ 24,
+ 0,
+ 0,
+ PFD_MAIN_PLANE,
+ 0, 0, 0, 0}
+ ,
+ {FXMESA_COLORDEPTH, 32,
+ FXMESA_DOUBLEBUFFER,
+ FXMESA_ALPHA_SIZE, 8,
+ FXMESA_DEPTH_SIZE, 24,
+ FXMESA_STENCIL_SIZE, 0,
+ FXMESA_ACCUM_SIZE, 0,
+ FXMESA_NONE}
+ }
};
static int qt_pix = sizeof(pix) / sizeof(pix[0]);
@@ -160,8 +320,12 @@ static GLboolean haveDualHead;
/* For the in-window-rendering hack */
+#ifndef GR_CONTROL_RESIZE
+/* Apparently GR_CONTROL_RESIZE can be ignored. OK? */
+#define GR_CONTROL_RESIZE -1
+#endif
+
static GLboolean gdiWindowHack;
-static GLboolean gdiWindowHackEna;
static void *dibSurfacePtr;
static BITMAPINFO *dibBMI;
static HBITMAP dibHBM;
@@ -173,64 +337,39 @@ __wglMonitor(HWND hwnd, UINT message, UINT wParam, LONG lParam)
long ret; /* Now gives the resized window at the end to hWNDOldProc */
if (ctx && hwnd == hWND) {
- switch (message) {
- case WM_PAINT:
- case WM_MOVE:
- break;
- case WM_DISPLAYCHANGE:
- case WM_SIZE:
- if (wParam != SIZE_MINIMIZED) {
- static int moving = 0;
- if (!moving) {
- if (fxQueryHardware() != GR_SSTTYPE_VOODOO) {
- if (!FX_grSstControl(GR_CONTROL_RESIZE)) {
- moving = 1;
- SetWindowPos(hwnd, 0, 0, 0, 300, 300,
- SWP_NOMOVE | SWP_NOZORDER);
- moving = 0;
- if (!FX_grSstControl(GR_CONTROL_RESIZE)) {
- /*MessageBox(0,_T("Error changing windowsize"),_T("fxMESA"),MB_OK); */
- PostMessage(hWND, WM_CLOSE, 0, 0);
+ switch (message) {
+ case WM_PAINT:
+ case WM_MOVE:
+ break;
+ case WM_DISPLAYCHANGE:
+ case WM_SIZE:
+ if (wParam != SIZE_MINIMIZED) {
+ static int moving = 0;
+ if (!moving) {
+ if (!FX_grSstControl(GR_CONTROL_RESIZE)) {
+ moving = 1;
+ SetWindowPos(hwnd, 0, 0, 0, 300, 300, SWP_NOMOVE | SWP_NOZORDER);
+ moving = 0;
+ if (!FX_grSstControl(GR_CONTROL_RESIZE)) {
+ /*MessageBox(0,_T("Error changing windowsize"),_T("fxMESA"),MB_OK); */
+ PostMessage(hWND, WM_CLOSE, 0, 0);
}
- }
- }
-
+ }
/* Do the clipping in the glide library */
- FX_grClipWindow(0, 0, FX_grSstScreenWidth(),
- FX_grSstScreenHeight());
- /* And let the new size set in the context */
- fxMesaUpdateScreenSize(ctx);
- }
- }
- break;
- case WM_ACTIVATE:
- if ((fxQueryHardware() == GR_SSTTYPE_VOODOO) &&
- (!gdiWindowHack) && (!haveDualHead)) {
- WORD fActive = LOWORD(wParam);
- BOOL fMinimized = (BOOL) HIWORD(wParam);
-
- if ((fActive == WA_INACTIVE) || fMinimized)
- FX_grSstControl(GR_CONTROL_DEACTIVATE);
- else
- FX_grSstControl(GR_CONTROL_ACTIVATE);
- }
- break;
- case WM_SHOWWINDOW:
- break;
- case WM_SYSKEYDOWN:
- case WM_SYSCHAR:
- if (gdiWindowHackEna && (VK_RETURN == wParam)) {
- if (gdiWindowHack) {
- gdiWindowHack = GL_FALSE;
- FX_grSstControl(GR_CONTROL_ACTIVATE);
- }
- else {
- gdiWindowHack = GL_TRUE;
- FX_grSstControl(GR_CONTROL_DEACTIVATE);
- }
- }
- break;
- }
+ grClipWindow(0, 0, FX_grSstScreenWidth(), FX_grSstScreenHeight());
+ /* And let the new size set in the context */
+ fxMesaUpdateScreenSize(ctx);
+ }
+ }
+ break;
+ case WM_ACTIVATE:
+ break;
+ case WM_SHOWWINDOW:
+ break;
+ case WM_SYSKEYDOWN:
+ case WM_SYSCHAR:
+ break;
+ }
}
/* Finaly call the hWNDOldProc, which handles the resize witch the
@@ -277,85 +416,13 @@ wglCreateContext(HDC hdc)
freopen("MESA.LOG", "w", stderr);
#endif
- ShowWindow(hWnd, SW_SHOWNORMAL);
- SetForegroundWindow(hWnd);
- Sleep(100); /* an hack for win95 */
-
- if (fxQueryHardware() == GR_SSTTYPE_VOODOO) {
- RECT cliRect;
-
- GetClientRect(hWnd, &cliRect);
- error = !(ctx =
- fxMesaCreateBestContext((GLuint) hWnd, cliRect.right,
- cliRect.bottom,
- pix[curPFD - 1].mesaAttr));
-
- if (!error) {
- /* create the DIB section for windowed rendering */
- DWORD *p;
-
- dibWnd = hWnd;
-
- hDC = GetDC(dibWnd);
-
- dibBMI =
- (BITMAPINFO *) MALLOC(sizeof(BITMAPINFO) +
- (256 * sizeof(RGBQUAD)));
-
- memset(dibBMI, 0, sizeof(BITMAPINFO) + (256 * sizeof(RGBQUAD)));
-
- dibBMI->bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
- dibBMI->bmiHeader.biWidth = ctx->width;
- dibBMI->bmiHeader.biHeight = -ctx->height;
- dibBMI->bmiHeader.biPlanes = (short) 1;
- dibBMI->bmiHeader.biBitCount = (short) 16;
- dibBMI->bmiHeader.biCompression = BI_BITFIELDS;
- dibBMI->bmiHeader.biSizeImage = 0;
- dibBMI->bmiHeader.biXPelsPerMeter = 0;
- dibBMI->bmiHeader.biYPelsPerMeter = 0;
- dibBMI->bmiHeader.biClrUsed = 3;
- dibBMI->bmiHeader.biClrImportant = 3;
-
- p = (DWORD *) dibBMI->bmiColors;
- p[0] = 0xF800;
- p[1] = 0x07E0;
- p[2] = 0x001F;
-
- dibHBM =
- CreateDIBSection(hDC, dibBMI, DIB_RGB_COLORS, &dibSurfacePtr,
- NULL, 0);
-
- ReleaseDC(dibWnd, hDC);
-
- gdiWindowHackEna = (dibHBM != NULL ? GL_TRUE : GL_FALSE);
-
- if (!getenv("MESA_WGL_FX")
- || !strcmp(getenv("MESA_WGL_FX"), "fullscreen"))
- gdiWindowHack = GL_FALSE;
- else {
- gdiWindowHack = GL_TRUE;
- FX_grSstControl(GR_CONTROL_DEACTIVATE);
- }
- }
- }
- else {
- /* For the Voodoo Rush */
-
- if (getenv("MESA_WGL_FX")
- && !strcmp(getenv("MESA_WGL_FX"), "fullscreen")) {
- RECT cliRect;
-
- GetClientRect(hWnd, &cliRect);
- error = !(ctx =
- fxMesaCreateBestContext((GLuint) hWnd, cliRect.right,
- cliRect.bottom,
- pix[curPFD - 1].mesaAttr));
- }
- else
- error = !(ctx =
- fxMesaCreateContext((GLuint) hWnd, GR_RESOLUTION_NONE,
- GR_REFRESH_75Hz,
- pix[curPFD - 1].mesaAttr));
+ {
+ RECT cliRect;
+ ShowWindow(hWnd, SW_SHOWNORMAL);
+ SetForegroundWindow(hWnd);
+ Sleep(100); /* a hack for win95 */
+ GetClientRect(hWnd, &cliRect);
+ error = !(ctx = fxMesaCreateBestContext((GLuint) hWnd, cliRect.right, cliRect.bottom, pix[curPFD - 1].mesaAttr));
}
if (getenv("SST_DUALHEAD"))
@@ -389,15 +456,6 @@ BOOL GLAPIENTRY
wglDeleteContext(HGLRC hglrc)
{
if (ctx && hglrc == (HGLRC) 1) {
- if (gdiWindowHackEna) {
- DeleteObject(dibHBM);
- FREE(dibBMI);
-
- dibSurfacePtr = NULL;
- dibBMI = NULL;
- dibHBM = NULL;
- dibWnd = NULL;
- }
fxMesaDestroyContext(ctx);
@@ -505,7 +563,7 @@ wglUseFontBitmaps(HDC fontDevice, DWORD firstChar, DWORD numChars,
// Place chars based on base line
VERIFY(SetTextAlign(bitDevice, TA_BASELINE) >= 0 ? 1 : 0);
- for (i = 0; i < numChars; i++) {
+ for (i = 0; i < (int)numChars; i++) {
SIZE size;
char curChar;
int charWidth, charHeight, bmapWidth, bmapHeight, numBytes, res;
@@ -513,7 +571,7 @@ wglUseFontBitmaps(HDC fontDevice, DWORD firstChar, DWORD numChars,
HGDIOBJ origBmap;
unsigned char *bmap;
- curChar = i + firstChar;
+ curChar = (char)(i + firstChar); // [koolsmoky] explicit cast
// Find how high/wide this character is
VERIFY(GetTextExtentPoint32(bitDevice, &curChar, 1, &size));
@@ -624,6 +682,9 @@ wglChoosePixelFormat(HDC hdc, CONST PIXELFORMATDESCRIPTOR * ppfd)
}
for (i = 0; i < qt_valid_pix; i++) {
+ if (ppfd->cColorBits > 0 && pix[i].pfd.cColorBits != ppfd->cColorBits)
+ continue;
+
if ((ppfd->dwFlags & PFD_DRAW_TO_WINDOW)
&& !(pix[i].pfd.dwFlags & PFD_DRAW_TO_WINDOW)) continue;
if ((ppfd->dwFlags & PFD_DRAW_TO_BITMAP)
@@ -737,53 +798,6 @@ wglSwapBuffers(HDC hdc)
fxMesaSwapBuffers();
- if (gdiWindowHack) {
- GLuint width = ctx->width;
- GLuint height = ctx->height;
-
- HDC hdcScreen = GetDC(dibWnd);
- HDC hdcDIBSection = CreateCompatibleDC(hdcScreen);
- HBITMAP holdBitmap = (HBITMAP) SelectObject(hdcDIBSection, dibHBM);
-
- FX_grLfbReadRegion(GR_BUFFER_FRONTBUFFER, 0, 0,
- width, height, width * 2, dibSurfacePtr);
-
- /* Since the hardware is configured for GR_COLORFORMAT_ABGR the pixel data is
- * going to come out as BGR 565, which is reverse of what we need for blitting
- * to screen, so we need to convert it here pixel-by-pixel (ick). This loop would NOT
- * be required if the color format was changed to GR_COLORFORMAT_ARGB, but I do
- * not know the ramifications of that, so this will work until that is resolved.
- *
- * This routine CRIES out for MMX implementation, however since that's not
- * guaranteed to be running on MMX enabled hardware so I'm not going to do
- * that. I'm just going to try to make a reasonably efficient C
- * version. -TAJ
- *
- * This routine drops frame rate by <1 fps on a 200Mhz MMX processor with a 640x480
- * display. Obviously, it's performance hit will be higher on larger displays and
- * less on smaller displays. To support the window-hack display this is probably fine.
- */
-#if FXMESA_USE_ARGB
- {
- unsigned long *pixel = dibSurfacePtr;
- unsigned long count = (width * height) / 2;
-
- while (count--) {
- *pixel++ = (*pixel & 0x07e007e0) /* greens */
- |((*pixel & 0xf800f800) >> 11) /* swap blues */
- |((*pixel & 0x001f001f) << 11) /* swap reds */
- ;
- }
- }
-#endif
-
- BitBlt(hdcScreen, 0, 0, width, height, hdcDIBSection, 0, 0, SRCCOPY);
-
- ReleaseDC(dibWnd, hdcScreen);
- SelectObject(hdcDIBSection, holdBitmap);
- DeleteDC(hdcDIBSection);
- }
-
return (TRUE);
}