Compare commits
	
		
			98 Commits
		
	
	
		
			mesa-24.2.
			...
			mesa_3_4
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
|  | e5c8261f76 | ||
|  | 57db1be417 | ||
|  | ebeb5da82c | ||
|  | bd1b6ef5af | ||
|  | 672da3532f | ||
|  | 554cd6ba8c | ||
|  | 585b358204 | ||
|  | 1a87813f14 | ||
|  | fab2936ea2 | ||
|  | 510d86231d | ||
|  | 183e09ee42 | ||
|  | feb83f991e | ||
|  | 5c4f8bdfc7 | ||
|  | 16deaa9c49 | ||
|  | 12dbb90d4a | ||
|  | 0bf5284850 | ||
|  | e3650179c6 | ||
|  | c089afb55b | ||
|  | bfaab253d1 | ||
|  | 4c782b7470 | ||
|  | fceecc5bc1 | ||
|  | cb5d29cd17 | ||
|  | 807544498a | ||
|  | 17f2610d03 | ||
|  | 00935d9eab | ||
|  | c8c04359dd | ||
|  | 534bc2e2a9 | ||
|  | 82960fbf69 | ||
|  | b0c8df81ab | ||
|  | ceab228540 | ||
|  | 03614d2f33 | ||
|  | e17c1d2202 | ||
|  | e27b783426 | ||
|  | 18ef8e7c98 | ||
|  | b34a9dab57 | ||
|  | 7a13c83663 | ||
|  | d4e84664a5 | ||
|  | 29f19424ab | ||
|  | 813e8585a6 | ||
|  | 88337d5109 | ||
|  | 77a5bab1a3 | ||
|  | de63653835 | ||
|  | 2f095b9b09 | ||
|  | 94b61f99c4 | ||
|  | 44b450728d | ||
|  | bc2b379ad0 | ||
|  | f35a545d4f | ||
|  | 0248965561 | ||
|  | 29fb6b3525 | ||
|  | 93bff74a02 | ||
|  | 211c30cbc9 | ||
|  | 1ef3d8407b | ||
|  | b64ede6f45 | ||
|  | a11f829108 | ||
|  | 5715ee5d5d | ||
|  | 08056a38ee | ||
|  | 2591e8f1db | ||
|  | b92036499d | ||
|  | 60a0b0d7c6 | ||
|  | c68f4fb958 | ||
|  | b9a3c2b3ce | ||
|  | 2cddd4cd79 | ||
|  | 052512e2ec | ||
|  | dc1e96acdc | ||
|  | 0eb94349b6 | ||
|  | 846101fe60 | ||
|  | 9af68b1222 | ||
|  | 5c4431cc0a | ||
|  | 308b5f2e0d | ||
|  | 013a664712 | ||
|  | 52eee51001 | ||
|  | 5d62414004 | ||
|  | 5917ec0983 | ||
|  | 06e32f455f | ||
|  | 0ead11e448 | ||
|  | 3edbaf7de6 | ||
|  | e6d349d8e4 | ||
|  | c25a8f9317 | ||
|  | 9f5ddba23f | ||
|  | f5de04549e | ||
|  | fb027ada34 | ||
|  | e990e8c166 | ||
|  | 394ecbde83 | ||
|  | 7ea41a18a5 | ||
|  | 262112dafa | ||
|  | e0fd3762ce | ||
|  | 1274afbe0b | ||
|  | 5f9760b572 | ||
|  | 107c1a4d40 | ||
|  | 809c5a7fc7 | ||
|  | aaab86427a | ||
|  | 5e2c92b8b6 | ||
|  | 84e8b8ea5a | ||
|  | 051690168a | ||
|  | 652f3b41c1 | ||
|  | c5e6547a95 | ||
|  | bc8257a729 | ||
|  | b353233325 | 
							
								
								
									
										442
									
								
								Make-config
									
									
									
									
									
								
							
							
						
						
									
										442
									
								
								Make-config
									
									
									
									
									
								
							| @@ -1,7 +1,7 @@ | ||||
| # $Id: Make-config,v 1.25 2000/06/08 15:19:12 brianp Exp $ | ||||
| # $Id: Make-config,v 1.25.4.5 2000/11/03 01:58:06 brianp Exp $ | ||||
|  | ||||
| MESA_MAJOR=3 | ||||
| MESA_MINOR=3 | ||||
| MESA_MINOR=4 | ||||
| MESA_TINY=0 | ||||
| VERSION=$(MESA_MAJOR).$(MESA_MINOR) | ||||
|  | ||||
| @@ -200,7 +200,11 @@ freebsd-386: | ||||
| 	"CFLAGS = -O3 -ffast-math -fPIC -pedantic -I/usr/X11R6/include -DUSE_XSHM -DHZ=100 -DUSE_X86_ASM -DFREEBSD" \ | ||||
| 	"MAKELIB = ../bin/mklib.freebsd" \ | ||||
| 	"APP_LIB_DEPS = -L/usr/X11R6/lib -lXext -lXmu -lXi -lX11 -lm" \ | ||||
| 	"ASM_SOURCES = X86/x86a.S X86/common_x86asm.S X86/glapi_x86.S" | ||||
| 	"ASM_SOURCES = X86/common_x86_asm.S X86/glapi_x86.S \ | ||||
| 		X86/x86_xform_raw2.S X86/x86_xform_raw3.S \ | ||||
| 		X86/x86_xform_raw4.S X86/x86_xform_masked2.S \ | ||||
| 		X86/x86_xform_masked3.S X86/x86_xform_masked4.S \ | ||||
| 		X86/x86_cliptest.S" | ||||
|  | ||||
| gcc: | ||||
| 	$(MAKE) $(MFLAGS) -f Makefile.X11 targets \ | ||||
| @@ -467,136 +471,7 @@ linux-static: | ||||
| 	"MAKELIB = ../bin/mklib.ar-ruv" \ | ||||
| 	"APP_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lXmu -lXt -lXi -lm -lpthread" | ||||
|  | ||||
| linux-386: | ||||
| 	$(MAKE) $(MFLAGS) -f Makefile.X11 targets \ | ||||
| 	"GL_LIB = libGL.so" \ | ||||
| 	"GLU_LIB = libGLU.so" \ | ||||
| 	"GLUT_LIB = libglut.so" \ | ||||
| 	"GLW_LIB = libGLw.so" \ | ||||
| 	"CC = gcc" \ | ||||
| 	"CFLAGS = -O3 -ansi -pedantic -fPIC -ffast-math -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_XSHM -DUSE_X86_ASM  -DPTHREADS -I/usr/X11R6/include" \ | ||||
| 	"MAKELIB = ../bin/mklib.linux" \ | ||||
| 	"GL_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lm -lpthread" \ | ||||
| 	"GLU_LIB_DEPS = -L../lib -lGL -lm" \ | ||||
| 	"GLUT_LIB_DEPS = -L../lib -lGLU -lGL -L/usr/X11R6/lib -lX11 -lXmu -lXt -lXi -lm" \ | ||||
| 	"APP_LIB_DEPS = -lm" \ | ||||
| 	"ASM_SOURCES = X86/x86a.S X86/common_x86asm.S X86/glapi_x86.S X86/vertex.S" | ||||
|  | ||||
| linux-386-static: | ||||
| 	$(MAKE) $(MFLAGS) -f Makefile.X11 targets \ | ||||
| 	"GL_LIB = libGL.a" \ | ||||
| 	"GLU_LIB = libGLU.a" \ | ||||
| 	"GLUT_LIB = libglut.a" \ | ||||
| 	"GLW_LIB = libGLw.a" \ | ||||
| 	"CC = gcc" \ | ||||
| 	"CFLAGS = -O3 -funroll-loops -ansi -pedantic -ffast-math -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_XSHM -DUSE_X86_ASM -DPTHREADS -I/usr/X11R6/include" \ | ||||
| 	"MAKELIB = ../bin/mklib.ar-ruv" \ | ||||
| 	"APP_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lXmu -lXt -lXi -lm -lpthread" \ | ||||
| 	"ASM_SOURCES = X86/x86a.S X86/common_x86asm.S X86/glapi_x86.S X86/vertex.S" | ||||
|  | ||||
| linux-glide: | ||||
| 	$(MAKE) $(MFLAGS) -f Makefile.X11 targets \ | ||||
| 	"GL_LIB = libGL.so" \ | ||||
| 	"GLU_LIB = libGLU.so" \ | ||||
| 	"GLUT_LIB = libglut.so" \ | ||||
| 	"GLW_LIB = libGLw.so" \ | ||||
| 	"CC = gcc" \ | ||||
| 	"CFLAGS = -O3 -ansi -pedantic -fPIC -ffast-math -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_XSHM -DFX -DPTHREADS -I/usr/X11R6/include -I/usr/include/glide -I/usr/local/glide/include" \ | ||||
| 	"MAKELIB = ../bin/mklib.linux" \ | ||||
| 	"GL_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lm -lpthread -L/usr/local/glide/lib -lglide2x" \ | ||||
| 	"GLU_LIB_DEPS = -L../lib -lGL -lm" \ | ||||
| 	"GLUT_LIB_DEPS = -L../lib -lGLU -lGL -L/usr/X11R6/lib -lX11 -lXmu -lXt -lXi -lm" \ | ||||
| 	"APP_LIB_DEPS = -lglut -lGLU -lGL" | ||||
|  | ||||
| linux-386-glide: | ||||
| 	$(MAKE) $(MFLAGS) -f Makefile.X11 targets \ | ||||
| 	"GL_LIB = libGL.so" \ | ||||
| 	"GLU_LIB = libGLU.so" \ | ||||
| 	"GLUT_LIB = libglut.so" \ | ||||
| 	"GLW_LIB = libGLw.so" \ | ||||
| 	"CC = gcc" \ | ||||
| 	"CFLAGS = -O3 -ansi -pedantic -fPIC -ffast-math -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_X86_ASM -DUSE_XSHM -DFX -DPTHREADS -I/usr/X11R6/include -I/usr/include/glide -I/usr/local/glide/include" \ | ||||
| 	"MAKELIB = ../bin/mklib.linux" \ | ||||
| 	"GL_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lm -L/usr/local/glide/lib -lglide2x -lm -lpthread" \ | ||||
| 	"GLU_LIB_DEPS = -L../lib -lGL -lm" \ | ||||
| 	"GLUT_LIB_DEPS = -L../lib -lGLU -lGL -L/usr/X11R6/lib -lX11 -lXmu -lXt -lXi -lm" \ | ||||
| 	"APP_LIB_DEPS = -lm" \ | ||||
| 	"ASM_SOURCES = X86/x86a.S X86/common_x86asm.S X86/glapi_x86.S X86/vertex.S" | ||||
|  | ||||
| linux-386-opt-V2-glide: | ||||
| 	$(MAKE) $(MFLAGS) -f Makefile.X11 targets \ | ||||
| 	"GL_LIB = libGL.so" \ | ||||
| 	"GLU_LIB = libGLU.so" \ | ||||
| 	"GLUT_LIB = libglut.so" \ | ||||
| 	"GLW_LIB = libGLw.so" \ | ||||
| 	"CC = gcc" \ | ||||
| 	"CFLAGS = -O3 -m486 -fomit-frame-pointer -pipe -ansi -pedantic -ffast-math -fexpensive-optimizations -malign-loops=2 -malign-jumps=2 -malign-functions=2 -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_XSHM -DFX -DFX_V2 -DUSE_X86_ASM -DPTHREAD -I/usr/X11R6/include -I/usr/include/glide -I/usr/local/glide/include"\ | ||||
| 	"MAKELIB = ../bin/mklib.linux" \ | ||||
| 	"GL_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lm -L/usr/local/glide/lib -lglide2x -lm -lpthread" \ | ||||
| 	"GLU_LIB_DEPS = -L../lib -lGL -lm" \ | ||||
| 	"GLUT_LIB_DEPS = -L../lib -lGLU -lGL -L/usr/X11R6/lib -lX11 -lXmu -lXt -lXi -lm" \ | ||||
| 	"APP_LIB_DEPS = -lm" \ | ||||
| 	"ASM_SOURCES = X86/x86a.S X86/common_x86asm.S X86/glapi_x86.S X86/vertex.S" | ||||
|  | ||||
| linux-386-opt-glide: | ||||
| 	$(MAKE) $(MFLAGS) -f Makefile.X11 targets \ | ||||
| 	"GL_LIB = libGL.so" \ | ||||
| 	"GLU_LIB = libGLU.so" \ | ||||
| 	"GLUT_LIB = libglut.so" \ | ||||
| 	"GLW_LIB = libGLw.so" \ | ||||
| 	"CC = gcc" \ | ||||
| 	"CFLAGS = -O3 -m486 -fomit-frame-pointer -pipe -ansi -pedantic -ffast-math -fexpensive-optimizations -malign-loops=2 -malign-jumps=2 -malign-functions=2 -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_XSHM -DFX -DUSE_X86_ASM -DPTHREADS -I/usr/X11R6/include -I/usr/include/glide -I/usr/local/glide/include" \ | ||||
| 	"MAKELIB = ../bin/mklib.linux" \ | ||||
| 	"GL_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lm -L/usr/local/glide/lib -lglide2x -lm -lpthread" \ | ||||
| 	"GLU_LIB_DEPS = -L../lib -lGL -lm" \ | ||||
| 	"GLUT_LIB_DEPS = -L../lib -lGLU -lGL -L/usr/X11R6/lib -lX11 -lXmu -lXt -lXi -lm" \ | ||||
| 	"APP_LIB_DEPS = -lm" \ | ||||
| 	"ASM_SOURCES = X86/x86a.S X86/common_x86asm.S X86/glapi_x86.S X86/vertex.S" | ||||
|  | ||||
| linux-3dnow: | ||||
| 	$(MAKE) $(MFLAGS) -f Makefile.X11 targets \ | ||||
| 	"GL_LIB = libGL.so" \ | ||||
| 	"GLU_LIB = libGLU.so" \ | ||||
| 	"GLUT_LIB = libglut.so" \ | ||||
| 	"GLW_LIB = libGLw.so" \ | ||||
| 	"CC = gcc -malign-loops=2 -malign-jumps=2 -malign-functions=2" \ | ||||
| 	"CFLAGS = -Wall -O3 -ansi -pedantic -fPIC -ffast-math -funroll-loops -fomit-frame-pointer -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_XSHM -DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_3DNOW_ASM -DPTHREADS -I/usr/X11R6/include" \ | ||||
| 	"MAKELIB = ../bin/mklib.linux" \ | ||||
| 	"GL_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lm -lm -lpthread" \ | ||||
| 	"GLU_LIB_DEPS = -L../lib -lGL -lm" \ | ||||
| 	"GLUT_LIB_DEPS = -L../lib -lGLU -lGL -L/usr/X11R6/lib -lX11 -lXmu -lXt -lXi -lm" \ | ||||
| 	"APP_LIB_DEPS = -lm" \ | ||||
| 	"ASM_SOURCES = X86/x86a.S X86/common_x86asm.S X86/glapi_x86.S \ | ||||
| 	X86/mmx_blend.S \ | ||||
| 	X86/3dnow_xform_raw1.S X86/3dnow_xform_raw2.S \ | ||||
| 	X86/3dnow_xform_raw3.S X86/3dnow_xform_raw4.S \ | ||||
| 	X86/3dnow_xform_masked1.S X86/3dnow_xform_masked2.S \ | ||||
| 	X86/3dnow_xform_masked3.S X86/3dnow_xform_masked4.S \ | ||||
| 	X86/3dnow_norm_raw.S X86/vertex.S X86/vertex_3dnow.S"  | ||||
|  | ||||
| linux-3dnow-glide: | ||||
| 	$(MAKE) $(MFLAGS) -f Makefile.X11 targets \ | ||||
| 	"GL_LIB = libGL.so" \ | ||||
| 	"GLU_LIB = libGLU.so" \ | ||||
| 	"GLUT_LIB = libglut.so" \ | ||||
| 	"GLW_LIB = libGLw.so" \ | ||||
| 	"CC = gcc -malign-loops=2 -malign-jumps=2 -malign-functions=2" \ | ||||
| 	"CFLAGS = -O3 -ansi -pedantic -fPIC -ffast-math -funroll-loops -fomit-frame-pointer -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_3DNOW_ASM -DUSE_XSHM -DFX -DPTHREADS -I/usr/X11R6/include -I/usr/include/glide -I/usr/local/glide/include -I/usr/src/mesa-glx/src/FX/X86" \ | ||||
| 	"MAKELIB = ../bin/mklib.linux" \ | ||||
| 	"GL_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lm -L/usr/local/glide/lib -lglide2x -lm -lpthread" \ | ||||
| 	"GLU_LIB_DEPS = -L../lib -lGL -lm" \ | ||||
| 	"GLUT_LIB_DEPS = -L../lib -lGLU -lGL -L/usr/X11R6/lib -lX11 -lXmu -lXt -lXi -lm" \ | ||||
| 	"APP_LIB_DEPS = -lm" \ | ||||
| 	"ASM_SOURCES = X86/x86a.S X86/common_x86asm.S X86/glapi_x86.S \ | ||||
| 	X86/mmx_blend.S \ | ||||
| 	X86/3dnow_xform_raw1.S X86/3dnow_xform_raw2.S \ | ||||
| 	X86/3dnow_xform_raw3.S X86/3dnow_xform_raw4.S \ | ||||
| 	X86/3dnow_xform_masked1.S X86/3dnow_xform_masked2.S \ | ||||
| 	X86/3dnow_xform_masked3.S X86/3dnow_xform_masked4.S \ | ||||
| 	X86/3dnow_norm_raw.S X86/vertex.S X86/vertex_3dnow.S \ | ||||
| 	FX/X86/fx_3dnow_fastpath.S" | ||||
|  | ||||
| linux-katmai: | ||||
| linux-x86: | ||||
| 	$(MAKE) $(MFLAGS) -f Makefile.X11 targets \ | ||||
| 	"GL_LIB = libGL.so" \ | ||||
| 	"GLU_LIB = libGLU.so" \ | ||||
| @@ -609,47 +484,52 @@ linux-katmai: | ||||
| 	"GLU_LIB_DEPS = -L../lib -lGL -lm" \ | ||||
| 	"GLUT_LIB_DEPS = -L../lib -lGLU -lGL -L/usr/X11R6/lib -lX11 -lXmu -lXt -lXi -lm" \ | ||||
| 	"APP_LIB_DEPS = -lm" \ | ||||
| 	"ASM_SOURCES = X86/x86a.S X86/common_x86asm.S X86/glapi_x86.S \ | ||||
| 	X86/mmx_blend.S \ | ||||
| 	X86/3dnow_xform_raw1.S X86/3dnow_xform_raw2.S \ | ||||
| 	X86/3dnow_xform_raw3.S X86/3dnow_xform_raw4.S \ | ||||
| 	X86/3dnow_xform_masked1.S X86/3dnow_xform_masked2.S \ | ||||
| 	X86/3dnow_xform_masked3.S X86/3dnow_xform_masked4.S \ | ||||
| 	X86/3dnow_norm_raw.S X86/vertex.S X86/vertex_3dnow.S \ | ||||
| 	X86/katmai_norm_raw.S \ | ||||
| 	X86/katmai_xform_raw1.S X86/katmai_xform_masked1.S \ | ||||
| 	X86/katmai_xform_raw2.S X86/katmai_xform_masked2.S \ | ||||
| 	X86/katmai_xform_raw3.S X86/katmai_xform_masked3.S \ | ||||
| 	X86/katmai_xform_raw4.S X86/katmai_xform_masked4.S \ | ||||
| 	X86/vertex_katmai.S" | ||||
| 	"ASM_SOURCES = X86/common_x86_asm.S X86/glapi_x86.S \ | ||||
| 		X86/x86_xform_raw2.S X86/x86_xform_raw3.S \ | ||||
| 		X86/x86_xform_raw4.S X86/x86_xform_masked2.S \ | ||||
| 		X86/x86_xform_masked3.S X86/x86_xform_masked4.S \ | ||||
| 		X86/x86_cliptest.S X86/x86_vertex.S \ | ||||
| 		X86/mmx_blend.S \ | ||||
| 		X86/3dnow_xform_raw1.S X86/3dnow_xform_raw2.S \ | ||||
| 		X86/3dnow_xform_raw3.S X86/3dnow_xform_raw4.S \ | ||||
| 		X86/3dnow_xform_masked1.S X86/3dnow_xform_masked2.S \ | ||||
| 		X86/3dnow_xform_masked3.S X86/3dnow_xform_masked4.S \ | ||||
| 		X86/3dnow_norm_raw.S X86/3dnow_vertex.S \ | ||||
| 		X86/katmai_xform_raw1.S X86/katmai_xform_masked1.S \ | ||||
| 		X86/katmai_xform_raw2.S X86/katmai_xform_masked2.S \ | ||||
| 		X86/katmai_xform_raw3.S X86/katmai_xform_masked3.S \ | ||||
| 		X86/katmai_xform_raw4.S X86/katmai_xform_masked4.S \ | ||||
| 		X86/katmai_norm_raw.S X86/katmai_vertex.S" | ||||
|  | ||||
| linux-katmai-glide: | ||||
| linux-x86-static: | ||||
| 	$(MAKE) $(MFLAGS) -f Makefile.X11 targets \ | ||||
| 	"GL_LIB = libGL.so" \ | ||||
| 	"GLU_LIB = libGLU.so" \ | ||||
| 	"GLUT_LIB = libglut.so" \ | ||||
| 	"GLW_LIB = libGLw.so" \ | ||||
| 	"GL_LIB = libGL.a" \ | ||||
| 	"GLU_LIB = libGLU.a" \ | ||||
| 	"GLUT_LIB = libglut.a" \ | ||||
| 	"GLW_LIB = libGLw.a" \ | ||||
| 	"CC = gcc -malign-loops=2 -malign-jumps=2 -malign-functions=2" \ | ||||
| 	"CFLAGS = -O3 -ansi -pedantic -fPIC -ffast-math -funroll-loops -fomit-frame-pointer -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_3DNOW_ASM -DUSE_KATMAI_ASM -DUSE_XSHM -DFX -DPTHREADS -I/usr/X11R6/include -I/usr/include/glide -I/usr/local/glide/include -I/usr/src/mesa-glx/src/FX/X86" \ | ||||
| 	"MAKELIB = ../bin/mklib.linux" \ | ||||
| 	"GL_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lm -L/usr/local/glide/lib -lglide2x -lm -lpthread" \ | ||||
| 	"CFLAGS = -Wall -O3 -ansi -pedantic -fPIC -ffast-math -funroll-loops -fomit-frame-pointer -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_XSHM -DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_3DNOW_ASM -DUSE_KATMAI_ASM -DPTHREADS -I/usr/X11R6/include" \ | ||||
| 	"MAKELIB = ../bin/mklib.ar-ruv" \ | ||||
| 	"GL_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lm -lm -lpthread" \ | ||||
| 	"GLU_LIB_DEPS = -L../lib -lGL -lm" \ | ||||
| 	"GLUT_LIB_DEPS = -L../lib -lGLU -lGL -L/usr/X11R6/lib -lX11 -lXmu -lXt -lXi -lm" \ | ||||
| 	"APP_LIB_DEPS = -lm" \ | ||||
| 	"ASM_SOURCES = X86/x86a.S X86/common_x86asm.S X86/glapi_x86.S \ | ||||
| 	X86/mmx_blend.S \ | ||||
| 	X86/3dnow_xform_raw1.S X86/3dnow_xform_raw2.S \ | ||||
| 	X86/3dnow_xform_raw3.S X86/3dnow_xform_raw4.S \ | ||||
| 	X86/3dnow_xform_masked1.S X86/3dnow_xform_masked2.S \ | ||||
| 	X86/3dnow_xform_masked3.S X86/3dnow_xform_masked4.S \ | ||||
| 	X86/3dnow_norm_raw.S X86/vertex.S X86/vertex_3dnow.S \ | ||||
| 	FX/X86/fx_3dnow_fastpath.S \ | ||||
| 	X86/katmai_norm_raw.S \ | ||||
| 	X86/katmai_xform_raw1.S X86/katmai_xform_masked1.S \ | ||||
| 	X86/katmai_xform_raw2.S X86/katmai_xform_masked2.S \ | ||||
| 	X86/katmai_xform_raw3.S X86/katmai_xform_masked3.S \ | ||||
| 	X86/katmai_xform_raw4.S X86/katmai_xform_masked4.S \ | ||||
| 	X86/vertex_katmai.S"  | ||||
| 	"ASM_SOURCES = X86/common_x86_asm.S X86/glapi_x86.S \ | ||||
| 		X86/x86_xform_raw2.S X86/x86_xform_raw3.S \ | ||||
| 		X86/x86_xform_raw4.S X86/x86_xform_masked2.S \ | ||||
| 		X86/x86_xform_masked3.S X86/x86_xform_masked4.S \ | ||||
| 		X86/x86_cliptest.S X86/x86_vertex.S \ | ||||
| 		X86/mmx_blend.S \ | ||||
| 		X86/3dnow_xform_raw1.S X86/3dnow_xform_raw2.S \ | ||||
| 		X86/3dnow_xform_raw3.S X86/3dnow_xform_raw4.S \ | ||||
| 		X86/3dnow_xform_masked1.S X86/3dnow_xform_masked2.S \ | ||||
| 		X86/3dnow_xform_masked3.S X86/3dnow_xform_masked4.S \ | ||||
| 		X86/3dnow_norm_raw.S X86/3dnow_vertex.S \ | ||||
| 		X86/katmai_xform_raw1.S X86/katmai_xform_masked1.S \ | ||||
| 		X86/katmai_xform_raw2.S X86/katmai_xform_masked2.S \ | ||||
| 		X86/katmai_xform_raw3.S X86/katmai_xform_masked3.S \ | ||||
| 		X86/katmai_xform_raw4.S X86/katmai_xform_masked4.S \ | ||||
| 		X86/katmai_norm_raw.S X86/katmai_vertex.S" | ||||
|  | ||||
| # Contributed by Uwe_Maurer@t-online.de | ||||
| linux-ggi: | ||||
| @@ -674,7 +554,113 @@ linux-386-ggi: | ||||
| 	"CFLAGS = -O3 -fPIC -ffast-math -D_SVID_SOURCE -D_BSD_SOURCE -I/usr/X11R6/include -DUSE_XSHM -DUSE_X86_ASM -DGGI -DCDECL=" \ | ||||
| 	"MAKELIB = ../bin/mklib.ggi" \ | ||||
| 	"APP_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lXmu -lXt -lXi -lggi -lm" \ | ||||
| 	"ASM_SOURCES = X86/x86a.S X86/common_x86asm.S X86/glapi_x86.S X86/vertex.S" | ||||
| 	"ASM_SOURCES = X86/common_x86_asm.S X86/glapi_x86.S \ | ||||
| 		X86/x86_xform_raw2.S X86/x86_xform_raw3.S \ | ||||
| 		X86/x86_xform_raw4.S X86/x86_xform_masked2.S \ | ||||
| 		X86/x86_xform_masked3.S X86/x86_xform_masked4.S \ | ||||
| 		X86/x86_cliptest.S X86/x86_vertex.S" | ||||
|  | ||||
| linux-glide: | ||||
| 	$(MAKE) $(MFLAGS) -f Makefile.X11 targets \ | ||||
| 	"GL_LIB = libGL.so" \ | ||||
| 	"GLU_LIB = libGLU.so" \ | ||||
| 	"GLUT_LIB = libglut.so" \ | ||||
| 	"GLW_LIB = libGLw.so" \ | ||||
| 	"CC = gcc" \ | ||||
| 	"CFLAGS = -O3 -ansi -pedantic -fPIC -ffast-math -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_XSHM -DFX -DPTHREADS -I/usr/X11R6/include -I/usr/include/glide -I/usr/local/glide/include" \ | ||||
| 	"MAKELIB = ../bin/mklib.linux" \ | ||||
| 	"GL_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lm -lpthread -L/usr/local/glide/lib -lglide2x" \ | ||||
| 	"GLU_LIB_DEPS = -L../lib -lGL -lm" \ | ||||
| 	"GLUT_LIB_DEPS = -L../lib -lGLU -lGL -L/usr/X11R6/lib -lX11 -lXmu -lXt -lXi -lm" \ | ||||
| 	"APP_LIB_DEPS = -L/usr/local/glide/lib -lglide2x -lglut -lGLU -lGL" | ||||
|  | ||||
| linux-386-glide: | ||||
| 	$(MAKE) $(MFLAGS) -f Makefile.X11 targets \ | ||||
| 	"GL_LIB = libGL.so" \ | ||||
| 	"GLU_LIB = libGLU.so" \ | ||||
| 	"GLUT_LIB = libglut.so" \ | ||||
| 	"GLW_LIB = libGLw.so" \ | ||||
| 	"CC = gcc" \ | ||||
| 	"CFLAGS = -O3 -ansi -pedantic -fPIC -ffast-math -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_X86_ASM -DUSE_XSHM -DFX -DPTHREADS -I/usr/X11R6/include -I/usr/include/glide -I/usr/local/glide/include" \ | ||||
| 	"MAKELIB = ../bin/mklib.linux" \ | ||||
| 	"GL_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lm -L/usr/local/glide/lib -lglide2x -lm -lpthread" \ | ||||
| 	"GLU_LIB_DEPS = -L../lib -lGL -lm" \ | ||||
| 	"GLUT_LIB_DEPS = -L../lib -lGLU -lGL -L/usr/X11R6/lib -lX11 -lXmu -lXt -lXi -lm" \ | ||||
| 	"APP_LIB_DEPS = -L/usr/local/glide/lib -lglide2x -lm" \ | ||||
| 	"ASM_SOURCES = X86/common_x86_asm.S X86/glapi_x86.S \ | ||||
| 		X86/x86_xform_raw2.S X86/x86_xform_raw3.S \ | ||||
| 		X86/x86_xform_raw4.S X86/x86_xform_masked2.S \ | ||||
| 		X86/x86_xform_masked3.S X86/x86_xform_masked4.S \ | ||||
| 		X86/x86_cliptest.S X86/x86_vertex.S" | ||||
|  | ||||
| linux-386-opt-glide: | ||||
| 	$(MAKE) $(MFLAGS) -f Makefile.X11 targets \ | ||||
| 	"GL_LIB = libGL.so" \ | ||||
| 	"GLU_LIB = libGLU.so" \ | ||||
| 	"GLUT_LIB = libglut.so" \ | ||||
| 	"GLW_LIB = libGLw.so" \ | ||||
| 	"CC = gcc" \ | ||||
| 	"CFLAGS = -O3 -m486 -fomit-frame-pointer -pipe -ansi -pedantic -ffast-math -fexpensive-optimizations -malign-loops=2 -malign-jumps=2 -malign-functions=2 -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_XSHM -DFX -DUSE_X86_ASM -DPTHREADS -I/usr/X11R6/include -I/usr/include/glide -I/usr/local/glide/include" \ | ||||
| 	"MAKELIB = ../bin/mklib.linux" \ | ||||
| 	"GL_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lm -L/usr/local/glide/lib -lglide2x -lm -lpthread" \ | ||||
| 	"GLU_LIB_DEPS = -L../lib -lGL -lm" \ | ||||
| 	"GLUT_LIB_DEPS = -L../lib -lGLU -lGL -L/usr/X11R6/lib -lX11 -lXmu -lXt -lXi -lm" \ | ||||
| 	"APP_LIB_DEPS = -L/usr/local/glide/lib -lglide2x -lm" \ | ||||
| 	"ASM_SOURCES = X86/common_x86_asm.S X86/glapi_x86.S \ | ||||
| 		X86/x86_xform_raw2.S X86/x86_xform_raw3.S \ | ||||
| 		X86/x86_xform_raw4.S X86/x86_xform_masked2.S \ | ||||
| 		X86/x86_xform_masked3.S X86/x86_xform_masked4.S \ | ||||
| 		X86/x86_cliptest.S X86/x86_vertex.S" | ||||
|  | ||||
| linux-386-opt-V2-glide: | ||||
| 	$(MAKE) $(MFLAGS) -f Makefile.X11 targets \ | ||||
| 	"GL_LIB = libGL.so" \ | ||||
| 	"GLU_LIB = libGLU.so" \ | ||||
| 	"GLUT_LIB = libglut.so" \ | ||||
| 	"GLW_LIB = libGLw.so" \ | ||||
| 	"CC = gcc" \ | ||||
| 	"CFLAGS = -O3 -m486 -fomit-frame-pointer -pipe -ansi -pedantic -ffast-math -fexpensive-optimizations -malign-loops=2 -malign-jumps=2 -malign-functions=2 -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_XSHM -DFX -DFX_V2 -DUSE_X86_ASM -DPTHREAD -I/usr/X11R6/include -I/usr/include/glide -I/usr/local/glide/include"\ | ||||
| 	"MAKELIB = ../bin/mklib.linux" \ | ||||
| 	"GL_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lm -L/usr/local/glide/lib -lglide2x -lm -lpthread" \ | ||||
| 	"GLU_LIB_DEPS = -L../lib -lGL -lm" \ | ||||
| 	"GLUT_LIB_DEPS = -L../lib -lGLU -lGL -L/usr/X11R6/lib -lX11 -lXmu -lXt -lXi -lm" \ | ||||
| 	"APP_LIB_DEPS = -L/usr/local/glide/lib -lglide2x -lm" \ | ||||
| 	"ASM_SOURCES = X86/common_x86_asm.S X86/glapi_x86.S \ | ||||
| 		X86/x86_xform_raw2.S X86/x86_xform_raw3.S \ | ||||
| 		X86/x86_xform_raw4.S X86/x86_xform_masked2.S \ | ||||
| 		X86/x86_xform_masked3.S X86/x86_xform_masked4.S \ | ||||
| 		X86/x86_cliptest.S X86/x86_vertex.S" | ||||
|  | ||||
| linux-x86-glide: | ||||
| 	$(MAKE) $(MFLAGS) -f Makefile.X11 targets \ | ||||
| 	"GL_LIB = libGL.so" \ | ||||
| 	"GLU_LIB = libGLU.so" \ | ||||
| 	"GLUT_LIB = libglut.so" \ | ||||
| 	"GLW_LIB = libGLw.so" \ | ||||
| 	"CC = gcc -malign-loops=2 -malign-jumps=2 -malign-functions=2" \ | ||||
| 	"CFLAGS = -O3 -ansi -pedantic -fPIC -ffast-math -funroll-loops -fomit-frame-pointer -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_3DNOW_ASM -DUSE_KATMAI_ASM -DUSE_XSHM -DFX -DPTHREADS -I/usr/X11R6/include -I/usr/include/glide -I/usr/local/glide/include -I/usr/src/mesa-glx/src/FX/X86" \ | ||||
| 	"MAKELIB = ../bin/mklib.linux" \ | ||||
| 	"GL_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lm -L/usr/local/glide/lib -lglide2x -lm -lpthread" \ | ||||
| 	"GLU_LIB_DEPS = -L../lib -lGL -lm" \ | ||||
| 	"GLUT_LIB_DEPS = -L../lib -lGLU -lGL -L/usr/X11R6/lib -lX11 -lXmu -lXt -lXi -lm" \ | ||||
| 	"APP_LIB_DEPS = -L/usr/local/glide/lib -lglide2x -lm" \ | ||||
| 	"ASM_SOURCES = X86/common_x86_asm.S X86/glapi_x86.S \ | ||||
| 		X86/x86_xform_raw2.S X86/x86_xform_raw3.S \ | ||||
| 		X86/x86_xform_raw4.S X86/x86_xform_masked2.S \ | ||||
| 		X86/x86_xform_masked3.S X86/x86_xform_masked4.S \ | ||||
| 		X86/x86_cliptest.S X86/x86_vertex.S \ | ||||
| 		X86/mmx_blend.S \ | ||||
| 		X86/3dnow_xform_raw1.S X86/3dnow_xform_raw2.S \ | ||||
| 		X86/3dnow_xform_raw3.S X86/3dnow_xform_raw4.S \ | ||||
| 		X86/3dnow_xform_masked1.S X86/3dnow_xform_masked2.S \ | ||||
| 		X86/3dnow_xform_masked3.S X86/3dnow_xform_masked4.S \ | ||||
| 		X86/3dnow_norm_raw.S X86/3dnow_vertex.S \ | ||||
| 		FX/X86/fx_3dnow_fastpath.S \ | ||||
| 		X86/katmai_xform_raw1.S X86/katmai_xform_masked1.S \ | ||||
| 		X86/katmai_xform_raw2.S X86/katmai_xform_masked2.S \ | ||||
| 		X86/katmai_xform_raw3.S X86/katmai_xform_masked3.S \ | ||||
| 		X86/katmai_xform_raw4.S X86/katmai_xform_masked4.S \ | ||||
| 		X86/katmai_norm_raw.S X86/katmai_vertex.S" | ||||
|  | ||||
| linux-alpha: | ||||
| 	$(MAKE) $(MFLAGS) -f Makefile.X11 targets \ | ||||
| @@ -874,7 +860,11 @@ os2-x11: | ||||
| 	"CFLAGS = -Zmt -O3 -m486 -funroll-loops -Wall -Wno-unused -ansi -pedantic -ffast-math -DUSE_X86_ASM -D_SVID_SOURCE -D_BSD_SOURCE -I$(X11ROOT)/XFree86/include" \ | ||||
| 	"MAKELIB = ..\\bin\\mklib-emx.cmd " \ | ||||
| 	"APP_LIB_DEPS = -Zmt -Zcrtdll -Zexe -L$(X11ROOT)/XFree86/lib -lXt -lX11 -lm" \ | ||||
| 	"ASM_SOURCES = X86/x86a.S X86/common_x86asm.S X86/glapi_x86.S X86/vertex.S" | ||||
| 	"ASM_SOURCES = X86/common_x86_asm.S X86/glapi_x86.S \ | ||||
| 		X86/x86_xform_raw2.S X86/x86_xform_raw3.S \ | ||||
| 		X86/x86_xform_raw4.S X86/x86_xform_masked2.S \ | ||||
| 		X86/x86_xform_masked3.S X86/x86_xform_masked4.S \ | ||||
| 		X86/x86_cliptest.S X86/x86_vertex.S" | ||||
|  | ||||
| osf1: | ||||
| 	$(MAKE) $(MFLAGS) -f Makefile.X11 targets \ | ||||
| @@ -1273,19 +1263,7 @@ DEBUG: | ||||
| 	"APP_LIB_DEPS = -lX11 -lXext -lXmu -lXi -lfpe -lm" | ||||
|  | ||||
| # for debugging on Linux systems | ||||
| linux-static-debug: | ||||
| 	$(MAKE) $(MFLAGS) -f Makefile.X11 targets \ | ||||
| 	"GL_LIB = libGL.a" \ | ||||
| 	"GLU_LIB = libGLU.a" \ | ||||
| 	"GLUT_LIB = libglut.a" \ | ||||
| 	"GLW_LIB = libGLw.a" \ | ||||
| 	"CC = gcc" \ | ||||
| 	"CFLAGS = -g -ansi -pedantic -Wall -Wmissing-prototypes -DUSE_XSHM -DDEBUG -DSVGA -DFX -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_X86_ASM_not -I/usr/include/glide -I/usr/local/glide/include" \ | ||||
| 	"MAKELIB = ../bin/mklib.ar-ruv" \ | ||||
| 	"APP_LIB_DEPS = -L/usr/local/glide/lib -lglide2x -ltexus -L/usr/X11R6/lib -lX11 -lXext -lXmu -lXt -lXi -lvga -lm" \ | ||||
| 	"ASM_SOURCES = X86/x86a.S X86/common_x86asm.S X86/glapi_x86.S X86/vertex.S" | ||||
|  | ||||
| linux-elf-debug: | ||||
| linux-debug: | ||||
| 	$(MAKE) $(MFLAGS) -f Makefile.X11 targets \ | ||||
| 	"GL_LIB = libGL.so" \ | ||||
| 	"GLU_LIB = libGLU.so" \ | ||||
| @@ -1297,7 +1275,48 @@ linux-elf-debug: | ||||
| 	"GL_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lm -lpthread -lvga -L/usr/local/glide/lib -lglide2x" \ | ||||
| 	"GLU_LIB_DEPS = -L../lib -lGL -lm" \ | ||||
| 	"GLUT_LIB_DEPS = -L../lib -lGLU -lGL -L/usr/X11R6/lib -lX11 -lXmu -lXt -lXi -lm" \ | ||||
| 	"APP_LIB_DEPS = -lglut -lGLU -lGL" | ||||
| 	"APP_LIB_DEPS = -L/usr/local/glide/lib -lglide2x -lglut -lGLU -lGL" | ||||
|  | ||||
| linux-static-debug: | ||||
| 	$(MAKE) $(MFLAGS) -f Makefile.X11 targets \ | ||||
| 	"GL_LIB = libGL.a" \ | ||||
| 	"GLU_LIB = libGLU.a" \ | ||||
| 	"GLUT_LIB = libglut.a" \ | ||||
| 	"GLW_LIB = libGLw.a" \ | ||||
| 	"CC = gcc" \ | ||||
| 	"CFLAGS = -g -ansi -pedantic -Wall -Wmissing-prototypes -DUSE_XSHM -DDEBUG -DMESA_DEBUG -DSVGA -DFX -D_SVID_SOURCE -D_BSD_SOURCE -I/usr/include/glide -I/usr/local/glide/include" \ | ||||
| 	"MAKELIB = ../bin/mklib.ar-ruv" \ | ||||
| 	"APP_LIB_DEPS = -L/usr/local/glide/lib -lglide2x -ltexus -L/usr/X11R6/lib -lX11 -lXext -lXmu -lXt -lXi -lvga -lm" \ | ||||
|  | ||||
| linux-x86-debug: | ||||
| 	$(MAKE) $(MFLAGS) -f Makefile.X11 targets \ | ||||
| 	"GL_LIB = libGL.so" \ | ||||
| 	"GLU_LIB = libGLU.so" \ | ||||
| 	"GLUT_LIB = libglut.so" \ | ||||
| 	"GLW_LIB = libGLw.so" \ | ||||
| 	"CC = gcc -malign-loops=2 -malign-jumps=2 -malign-functions=2" \ | ||||
| 	"CFLAGS = -O2 -g -ansi -pedantic -Wall -Wmissing-prototypes -fPIC -ffast-math -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_XSHM -DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_3DNOW_ASM -DUSE_KATMAI_ASM -DPTHREADS -I/usr/X11R6/include -DDEBUG -DMESA_DEBUG" \ | ||||
| 	"MAKELIB = ../bin/mklib.linux" \ | ||||
| 	"GL_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lm -lm -lpthread" \ | ||||
| 	"GLU_LIB_DEPS = -L../lib -lGL -lm" \ | ||||
| 	"GLUT_LIB_DEPS = -L../lib -lGLU -lGL -L/usr/X11R6/lib -lX11 -lXmu -lXt -lXi -lm" \ | ||||
| 	"APP_LIB_DEPS = -lm" \ | ||||
| 	"ASM_SOURCES = X86/common_x86_asm.S X86/glapi_x86.S \ | ||||
| 		X86/x86_xform_raw2.S X86/x86_xform_raw3.S \ | ||||
| 		X86/x86_xform_raw4.S X86/x86_xform_masked2.S \ | ||||
| 		X86/x86_xform_masked3.S X86/x86_xform_masked4.S \ | ||||
| 		X86/x86_cliptest.S X86/x86_vertex.S \ | ||||
| 		X86/mmx_blend.S \ | ||||
| 		X86/3dnow_xform_raw1.S X86/3dnow_xform_raw2.S \ | ||||
| 		X86/3dnow_xform_raw3.S X86/3dnow_xform_raw4.S \ | ||||
| 		X86/3dnow_xform_masked1.S X86/3dnow_xform_masked2.S \ | ||||
| 		X86/3dnow_xform_masked3.S X86/3dnow_xform_masked4.S \ | ||||
| 		X86/3dnow_norm_raw.S X86/3dnow_vertex.S \ | ||||
| 		X86/katmai_xform_raw1.S X86/katmai_xform_masked1.S \ | ||||
| 		X86/katmai_xform_raw2.S X86/katmai_xform_masked2.S \ | ||||
| 		X86/katmai_xform_raw3.S X86/katmai_xform_masked3.S \ | ||||
| 		X86/katmai_xform_raw4.S X86/katmai_xform_masked4.S \ | ||||
| 		X86/katmai_norm_raw.S X86/katmai_vertex.S" | ||||
|  | ||||
| linux-glide-debug: | ||||
| 	$(MAKE) $(MFLAGS) -f Makefile.X11 targets \ | ||||
| @@ -1318,14 +1337,51 @@ linux-prof: | ||||
| 	"GLUT_LIB = libglut.a" \ | ||||
| 	"GLW_LIB = libGLw.a" \ | ||||
| 	"CC = gcc" \ | ||||
| 	"CFLAGS = -O2 -pg -ansi -pedantic -Wall -DUSE_XSHM -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_3DNOW_ASM -I/usr/include/glide -I/usr/local/glide/include" \ | ||||
| 	"CFLAGS = -Wall -O2 -pg -ansi -pedantic -ffast-math -DUSE_XSHM -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_3DNOW_ASM -DUSE_KATMAI_ASM" \ | ||||
| 	"MAKELIB = ../bin/mklib.ar-ruv" \ | ||||
| 	"APP_LIB_DEPS = -L/usr/X11/lib -lX11 -lXext -lXmu -lXt -lXi -lSM -lICE -lm" \ | ||||
| 	"ASM_SOURCES = X86/common_x86_asm.S X86/glapi_x86.S \ | ||||
| 		X86/x86_xform_raw2.S X86/x86_xform_raw3.S \ | ||||
| 		X86/x86_xform_raw4.S X86/x86_xform_masked2.S \ | ||||
| 		X86/x86_xform_masked3.S X86/x86_xform_masked4.S \ | ||||
| 		X86/x86_cliptest.S X86/x86_vertex.S \ | ||||
| 		X86/mmx_blend.S \ | ||||
| 		X86/3dnow_xform_raw1.S X86/3dnow_xform_raw2.S \ | ||||
| 		X86/3dnow_xform_raw3.S X86/3dnow_xform_raw4.S \ | ||||
| 		X86/3dnow_xform_masked1.S X86/3dnow_xform_masked2.S \ | ||||
| 		X86/3dnow_xform_masked3.S X86/3dnow_xform_masked4.S \ | ||||
| 		X86/3dnow_norm_raw.S X86/3dnow_vertex.S \ | ||||
| 		FX/X86/fx_3dnow_fastpath.S \ | ||||
| 		X86/katmai_xform_raw1.S X86/katmai_xform_masked1.S \ | ||||
| 		X86/katmai_xform_raw2.S X86/katmai_xform_masked2.S \ | ||||
| 		X86/katmai_xform_raw3.S X86/katmai_xform_masked3.S \ | ||||
| 		X86/katmai_xform_raw4.S X86/katmai_xform_masked4.S \ | ||||
| 		X86/katmai_norm_raw.S X86/katmai_vertex.S" | ||||
|  | ||||
| linux-glide-prof: | ||||
| 	$(MAKE) $(MFLAGS) -f Makefile.X11 targets \ | ||||
| 	"GL_LIB = libGL.a" \ | ||||
| 	"GLU_LIB = libGLU.a" \ | ||||
| 	"GLUT_LIB = libglut.a" \ | ||||
| 	"GLW_LIB = libGLw.a" \ | ||||
| 	"CC = gcc" \ | ||||
| 	"CFLAGS = -O2 -pg -ansi -pedantic -Wall -DUSE_XSHM -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_3DNOW_ASM -DUSE_KATMAI_ASM -I/usr/include/glide -I/usr/local/glide/include" \ | ||||
| 	"MAKELIB = ../bin/mklib.ar-ruv" \ | ||||
| 	"APP_LIB_DEPS = -L/usr/local/glide/lib -lglide2x -L/usr/X11/lib -lX11 -lXext -lXmu -lXt -lXi -lSM -lICE -lm" \ | ||||
| 	"ASM_SOURCES = X86/x86a.S X86/common_x86asm.S X86/glapi_x86.S \ | ||||
| 	X86/mmx_blend.S \ | ||||
| 	X86/3dnow_xform_raw1.S X86/3dnow_xform_raw2.S \ | ||||
| 	X86/3dnow_xform_raw3.S X86/3dnow_xform_raw4.S \ | ||||
| 	X86/3dnow_xform_masked1.S X86/3dnow_xform_masked2.S \ | ||||
| 	X86/3dnow_xform_masked3.S X86/3dnow_xform_masked4.S \ | ||||
| 	X86/3dnow_norm_raw.S X86/vertex.S X86/vertex_3dnow.S \ | ||||
| 	FX/X86/fx_3dnow_fastpath.S" | ||||
| 	"ASM_SOURCES = X86/common_x86_asm.S X86/glapi_x86.S \ | ||||
| 		X86/x86_xform_raw2.S X86/x86_xform_raw3.S \ | ||||
| 		X86/x86_xform_raw4.S X86/x86_xform_masked2.S \ | ||||
| 		X86/x86_xform_masked3.S X86/x86_xform_masked4.S \ | ||||
| 		X86/x86_cliptest.S X86/x86_vertex.S \ | ||||
| 		X86/mmx_blend.S \ | ||||
| 		X86/3dnow_xform_raw1.S X86/3dnow_xform_raw2.S \ | ||||
| 		X86/3dnow_xform_raw3.S X86/3dnow_xform_raw4.S \ | ||||
| 		X86/3dnow_xform_masked1.S X86/3dnow_xform_masked2.S \ | ||||
| 		X86/3dnow_xform_masked3.S X86/3dnow_xform_masked4.S \ | ||||
| 		X86/3dnow_norm_raw.S X86/3dnow_vertex.S \ | ||||
| 		FX/X86/fx_3dnow_fastpath.S \ | ||||
| 		X86/katmai_xform_raw1.S X86/katmai_xform_masked1.S \ | ||||
| 		X86/katmai_xform_raw2.S X86/katmai_xform_masked2.S \ | ||||
| 		X86/katmai_xform_raw3.S X86/katmai_xform_masked3.S \ | ||||
| 		X86/katmai_xform_raw4.S X86/katmai_xform_masked4.S \ | ||||
| 		X86/katmai_norm_raw.S X86/katmai_vertex.S" | ||||
|   | ||||
							
								
								
									
										42
									
								
								Makefile.X11
									
									
									
									
									
								
							
							
						
						
									
										42
									
								
								Makefile.X11
									
									
									
									
									
								
							| @@ -1,20 +1,20 @@ | ||||
| # $Id: Makefile.X11,v 1.32 2000/07/21 16:36:35 brianp Exp $ | ||||
| # $Id: Makefile.X11,v 1.32.2.5 2000/10/26 19:35:53 brianp Exp $ | ||||
|  | ||||
| # Mesa 3-D graphics library | ||||
| # Version:  3.3 | ||||
| #  | ||||
| # Version:  3.4 | ||||
| # | ||||
| # Copyright (C) 1999-2000  Brian Paul   All Rights Reserved. | ||||
| #  | ||||
| # | ||||
| # Permission is hereby granted, free of charge, to any person obtaining a | ||||
| # copy of this software and associated documentation files (the "Software"), | ||||
| # to deal in the Software without restriction, including without limitation | ||||
| # the rights to use, copy, modify, merge, publish, distribute, sublicense, | ||||
| # and/or sell copies of the Software, and to permit persons to whom the | ||||
| # Software is furnished to do so, subject to the following conditions: | ||||
| #  | ||||
| # | ||||
| # The above copyright notice and this permission notice shall be included | ||||
| # in all copies or substantial portions of the Software. | ||||
| #  | ||||
| # | ||||
| # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS | ||||
| # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||||
| # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL | ||||
| @@ -68,18 +68,15 @@ default: | ||||
|  | ||||
| 	@echo "  make linux                for Linux systems, make shared .so libs" | ||||
| 	@echo "  make linux-static         for Linux systems, make static .a libs" | ||||
| 	@echo "  make linux-386            for Linux on Intel, make shared .so libs" | ||||
| 	@echo "  make linux-386-static     for Linux on Intel, make static .a libs" | ||||
| 	@echo "  make linux-x86            for Linux on Intel, make shared .so libs" | ||||
| 	@echo "  make linux-x86-static     for Linux on Intel, make static .a libs" | ||||
| 	@echo "  make linux-ggi            for Linux systems with libggi" | ||||
| 	@echo "  make linux-386-ggi        for Linux systems with libggi w/ Intel assembly" | ||||
| 	@echo "  make linux-glide          for Linux w/ 3Dfx Glide driver" | ||||
| 	@echo "  make linux-386-glide      for Linux w/ 3Dfx Glide driver, Intel assembly" | ||||
| 	@echo "  make linux-386-opt-glide  for Linux with 3Dfx Voodoo1 for GLQuake" | ||||
| 	@echo "  make linux-386-opt-V2-glide  for Linux with 3Dfx Voodoo2 for GLQuake" | ||||
| 	@echo "  make linux-3dnow          for Linux on AMD w/ 3DNow!" | ||||
| 	@echo "  make linux-3dnow-glide    for Linux on AMD w/ 3DNow! for Glide" | ||||
| 	@echo "  make linux-katmai         for Linux on PentiumIII w/ SSE" | ||||
| 	@echo "  make linux-katmai-glide   for Linux on PentiumIII w/ SSE for Glide" | ||||
| 	@echo "  make linux-x86-glide      for Linux w/ all x86 asm for Glide" | ||||
| 	@echo "  make linux-alpha          for Linux on Alpha systems" | ||||
| 	@echo "  make linux-alpha-static   for Linux on Alpha systems, static libs" | ||||
| 	@echo "  make linux-ppc            for Linux on PowerPC systems" | ||||
| @@ -139,13 +136,10 @@ aix aix-sl amix bsdos bsdos4 dgux freebsd freebsd-386 gcc \ | ||||
| hpux9 hpux9-sl hpux9-gcc hpux9-gcc-sl \ | ||||
| hpux10 hpux10-sl hpux10-gcc hpux10-gcc-sl \ | ||||
| irix4 irix5 irix5-gcc irix5-dso irix6-o32 irix6-o32-dso \ | ||||
| linux-static-debug linux-elf-debug linux-prof linux-glide-debug \ | ||||
| linux linux-static \ | ||||
| linux-386 linux-386-static \ | ||||
| linux linux-static linux-debug linux-static-debug linux-prof \ | ||||
| linux-x86 linux-x86-static linux-x86-debug \ | ||||
| linux-glide linux-386-glide linux-386-opt-glide \ | ||||
| linux-386-opt-V2-glide \ | ||||
| linux-3dnow linux-3dnow-glide \ | ||||
| linux-katmai linux-katmai-glide \ | ||||
| linux-386-opt-V2-glide linux-x86-glide linux-glide-debug linux-glide-prof \ | ||||
| linux-alpha-static linux-alpha \ | ||||
| linux-ppc-static linux-ppc \ | ||||
| linux-sparc \ | ||||
| @@ -326,10 +320,10 @@ realclean: clean | ||||
|  | ||||
|  | ||||
|  | ||||
| DIRECTORY = Mesa-3.3 | ||||
| LIB_NAME = MesaLib-3.3 | ||||
| DEMO_NAME = MesaDemos-3.3 | ||||
| GLU_NAME = MesaGLU-3.3 | ||||
| DIRECTORY = Mesa-3.4 | ||||
| LIB_NAME = MesaLib-3.4 | ||||
| DEMO_NAME = MesaDemos-3.4 | ||||
| GLU_NAME = MesaGLU-3.4 | ||||
| GLUT_NAME = GLUT-3.7 | ||||
|  | ||||
|  | ||||
| @@ -388,6 +382,7 @@ LIB_FILES =	\ | ||||
| 	$(DIRECTORY)/include/GL/glu_mangle.h	\ | ||||
| 	$(DIRECTORY)/include/GL/glx.h		\ | ||||
| 	$(DIRECTORY)/include/GL/glx_mangle.h	\ | ||||
| 	$(DIRECTORY)/include/GL/mesa_wgl.h	\ | ||||
| 	$(DIRECTORY)/include/GL/mglmesa.h	\ | ||||
| 	$(DIRECTORY)/include/GL/osmesa.h	\ | ||||
| 	$(DIRECTORY)/include/GL/svgamesa.h	\ | ||||
| @@ -463,7 +458,6 @@ LIB_FILES =	\ | ||||
| 	$(DIRECTORY)/src/X86/*.[ch]				\ | ||||
| 	$(DIRECTORY)/src/X86/Makefile.am			\ | ||||
| 	$(DIRECTORY)/src/X86/Makefile.in			\ | ||||
| 	$(DIRECTORY)/src/X86/*.m4				\ | ||||
| 	$(DIRECTORY)/src/X86/*.S				\ | ||||
| 	$(DIRECTORY)/src-glu/README[12]				\ | ||||
| 	$(DIRECTORY)/src-glu/Makefile*				\ | ||||
| @@ -494,6 +488,8 @@ LIB_FILES =	\ | ||||
| 	$(DIRECTORY)/widgets-mesa/man/Makefile.in		\ | ||||
| 	$(DIRECTORY)/widgets-mesa/man/Mesa*			\ | ||||
| 	$(DIRECTORY)/widgets-mesa/src/ChangeLog			\ | ||||
| 	$(DIRECTORY)/widgets-mesa/src/*.c			\ | ||||
| 	$(DIRECTORY)/widgets-mesa/src/Makefile.in		\ | ||||
| 	$(DIRECTORY)/widgets-sgi/*.[ch]				\ | ||||
| 	$(DIRECTORY)/widgets-sgi/Makefile*			\ | ||||
| 	$(DIRECTORY)/widgets-sgi/README				\ | ||||
|   | ||||
| @@ -1,5 +1,5 @@ | ||||
|  | ||||
|                      3Dfx Glide device driver for Mesa 3.3 | ||||
|                      3Dfx Glide device driver for Mesa 3.4 | ||||
| 				(see below for FAQ) | ||||
|  | ||||
|  | ||||
|   | ||||
| @@ -1,5 +1,5 @@ | ||||
|  | ||||
|                          Mesa 3.3 Unix/X11 Information | ||||
|                          Mesa 3.4 Unix/X11 Information | ||||
|  | ||||
|  | ||||
|  | ||||
| @@ -323,4 +323,4 @@ Summary of X-related environment variables: | ||||
|  | ||||
|  | ||||
| ---------------------------------------------------------------------- | ||||
| $Id: README.X11,v 3.5 2000/04/04 15:14:48 brianp Exp $ | ||||
| $Id: README.X11,v 3.5.4.1 2000/11/02 18:05:34 brianp Exp $ | ||||
|   | ||||
							
								
								
									
										22
									
								
								docs/RELNOTES-3.4
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										22
									
								
								docs/RELNOTES-3.4
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,22 @@ | ||||
|  | ||||
|                          Mesa 3.4 release notes | ||||
|  | ||||
|                              November 3, 2000 | ||||
|  | ||||
|                              PLEASE READ!!!! | ||||
|  | ||||
|  | ||||
|  | ||||
| Introduction | ||||
| ------------ | ||||
|  | ||||
| Mesa uses an even/odd version number scheme like the Linux kernel. | ||||
| Odd numbered versions (such as 3.3) designate new developmental releases. | ||||
| Even numbered versions (such as 3.4) designate stable releases. | ||||
|  | ||||
| Mesa 3.4 simply fixes bugs found in the Mesa 3.3 release.  For details, | ||||
| see the VERSIONS file. | ||||
|  | ||||
|  | ||||
| ---------------------------------------------------------------------- | ||||
| $Id: RELNOTES-3.4,v 1.1.2.2 2000/11/02 18:05:34 brianp Exp $ | ||||
| @@ -1,4 +1,4 @@ | ||||
| $Id: VERSIONS,v 1.38 2000/07/21 15:41:59 brianp Exp $ | ||||
| $Id: VERSIONS,v 1.38.2.18 2000/11/03 02:39:00 brianp Exp $ | ||||
|  | ||||
|  | ||||
| Mesa Version History | ||||
| @@ -746,3 +746,32 @@ Mesa Version History | ||||
| 	- gl.h now uses #defines instead of C enums for all tokens | ||||
| 	- glu.h now uses #defines instead of C enums for all tokens | ||||
| 	- moved programs from 3Dfx/demos/ into demos/ directory | ||||
|  | ||||
|  | ||||
| 3.4  November 3, 2000 | ||||
|     New: | ||||
| 	- optimized glDrawPixels for glPixelZoom(1,-1) | ||||
|     Bug Fixes: | ||||
| 	- widgets-mesa/src/*.c files were missing from 3.3 distro | ||||
| 	- include/GL/mesa_wgl.h file was missing from 3.3 distro | ||||
| 	- fixed some Win32 compile problems | ||||
| 	- texture object priorities weren't getting initialized to 1.0 | ||||
| 	- glAreTexturesResident return value was wrong when using hardware | ||||
| 	- glXUseXFont segfaulted when using 3dfx driver (via MESA_GLX_FX) | ||||
| 	- glReadPixels with GLushort packed types was broken | ||||
| 	- fixed a few bugs in the GL_EXT_texture_env_combine texture code | ||||
| 	- glPush/PopAttrib(GL_ENABLE_BIT) mishandled multi-texture enables | ||||
| 	- fixed some typos/bugs in the VB code | ||||
| 	- glDrawPixels(GL_COLOR_INDEX) to RGB window didn't work | ||||
| 	- optimized glDrawPixels paths weren't being used | ||||
| 	- per-fragment fog calculation didn't work without a Z buffer | ||||
| 	- improved blending accuracy, fixes Glean blendFunc test failures | ||||
| 	- glPixelStore(GL_PACK/UNPACK_SKIP_IMAGES) wasn't handled correctly | ||||
| 	- glXGetProcAddressARB() didn't always return the right address | ||||
| 	- gluBuild[12]DMipmaps() didn't grok the GL_BGR pixel format | ||||
| 	- texture matrix changes weren't always detected (GLUT projtex demo) | ||||
| 	- fixed random color problem in vertex fog code | ||||
| 	- fixed Glide-related bug that let Quake get a 24-bit Z buffer | ||||
|     Changes: | ||||
| 	- finished internal support for compressed textures for DRI | ||||
|  | ||||
|   | ||||
| @@ -29,6 +29,6 @@ endif | ||||
| EXTRA_DIST = fxmesa.h ggimesa.h osmesa.h svgamesa.h \ | ||||
| 	glx.h glx_mangle.h xmesa.h xmesa_x.h xmesa_xf86.h | ||||
|  | ||||
| GLinclude_HEADERS = gl.h gl_mangle.h glu.h glu_mangle.h \ | ||||
| GLinclude_HEADERS = gl.h glext.h gl_mangle.h glu.h glu_mangle.h \ | ||||
| 	$(INC_FX) $(INC_GGI) $(INC_OSMESA) $(INC_SVGA) $(INC_X11) $(INC_GLUT) | ||||
|  | ||||
|   | ||||
| @@ -1,8 +1,8 @@ | ||||
| /* $Id: gl.h,v 1.44 2000/07/13 17:45:13 brianp Exp $ */ | ||||
| /* $Id: gl.h,v 1.44.4.1 2000/09/06 17:47:47 brianp Exp $ */ | ||||
|  | ||||
| /* | ||||
|  * Mesa 3-D graphics library | ||||
|  * Version:  3.3 | ||||
|  * Version:  3.4 | ||||
|  * | ||||
|  * Copyright (C) 1999-2000  Brian Paul   All Rights Reserved. | ||||
|  * | ||||
|   | ||||
| @@ -1,4 +1,4 @@ | ||||
| /* $Id: glu.h,v 1.22 2000/07/11 14:11:44 brianp Exp $ */ | ||||
| /* $Id: glu.h,v 1.22.4.1 2000/10/26 15:32:46 brianp Exp $ */ | ||||
|  | ||||
| /* | ||||
|  * Mesa 3-D graphics library | ||||
| @@ -200,7 +200,7 @@ extern "C" { | ||||
| #define GLU_NURBS_ERROR37	100287   /* duplicate point on pwlcurve */ | ||||
|  | ||||
| /* GLU 1.3 and later */ | ||||
| #define GLU_NURBS_MODE ? | ||||
| #define GLU_NURBS_MODE		100160 | ||||
|  | ||||
|  | ||||
| /* Errors */ | ||||
|   | ||||
| @@ -1,4 +1,4 @@ | ||||
| /* $Id: xmesa.h,v 1.8 2000/05/02 02:30:01 brianp Exp $ */ | ||||
| /* $Id: xmesa.h,v 1.8.4.1 2000/11/02 18:08:28 brianp Exp $ */ | ||||
|  | ||||
| /* | ||||
|  * Mesa 3-D graphics library | ||||
| @@ -89,7 +89,7 @@ extern struct Library *XLibBase; | ||||
|  | ||||
|  | ||||
| #define XMESA_MAJOR_VERSION 3 | ||||
| #define XMESA_MINOR_VERSION 3 | ||||
| #define XMESA_MINOR_VERSION 4 | ||||
|  | ||||
|  | ||||
|  | ||||
|   | ||||
| @@ -1,36 +1,13 @@ | ||||
| /* $Id: bounce.c,v 1.2 2000/06/27 17:04:43 brianp Exp $ */ | ||||
| /* $Id: bounce.c,v 1.2.4.1 2000/08/16 20:36:32 brianp Exp $ */ | ||||
|  | ||||
| /* | ||||
|  * Bouncing ball demo.  Color index mode only! | ||||
|  * Bouncing ball demo. | ||||
|  * | ||||
|  * This program is in the public domain | ||||
|  * | ||||
|  * Brian Paul | ||||
|  */ | ||||
|  | ||||
| /* Conversion to GLUT by Mark J. Kilgard */ | ||||
|  | ||||
| /* | ||||
|  * $Log: bounce.c,v $ | ||||
|  * Revision 1.2  2000/06/27 17:04:43  brianp | ||||
|  * fixed compiler warnings | ||||
|  * | ||||
|  * Revision 1.1.1.1  1999/08/19 00:55:40  jtg | ||||
|  * Imported sources | ||||
|  * | ||||
|  * Revision 3.3  1999/03/18 08:16:14  joukj | ||||
|  * | ||||
|  *     cmpstr needs string.h to included to avoid warnings | ||||
|  * | ||||
|  * Revision 3.2  1998/11/28 01:13:02  brianp | ||||
|  * now sets an initial window position and size | ||||
|  * | ||||
|  * Revision 3.1  1998/11/28 01:06:57  brianp | ||||
|  * now works in RGB mode by default | ||||
|  * | ||||
|  * Revision 3.0  1998/02/14 18:42:29  brianp | ||||
|  * initial rev | ||||
|  * | ||||
|  * Conversion to GLUT by Mark J. Kilgard | ||||
|  */ | ||||
|  | ||||
|  | ||||
| @@ -84,9 +61,9 @@ make_ball(void) | ||||
|         glColor3f(1, 1, 1); | ||||
|       } | ||||
|  | ||||
|       x = COS(b) * COS(a); | ||||
|       y = SIN(b) * COS(a); | ||||
|       z = SIN(a); | ||||
|       x = radius * COS(b) * COS(a); | ||||
|       y = radius * SIN(b) * COS(a); | ||||
|       z = radius * SIN(a); | ||||
|       glVertex3f(x, y, z); | ||||
|  | ||||
|       x = radius * COS(b) * COS(a + da); | ||||
|   | ||||
| @@ -1,4 +1,4 @@ | ||||
| /* $Id: gloss.c,v 1.4 2000/06/27 17:04:43 brianp Exp $ */ | ||||
| /* $Id: gloss.c,v 1.4.4.1 2000/08/29 21:17:25 brianp Exp $ */ | ||||
|  | ||||
| /* | ||||
|  * Specular reflection demo.  The specular highlight is modulated by | ||||
| @@ -46,7 +46,7 @@ static GLfloat DXrot = 1.0, DYrot = 2.5; | ||||
| static GLfloat Black[4] = { 0, 0, 0, 0 }; | ||||
| static GLfloat White[4] = { 1, 1, 1, 1 }; | ||||
| static GLfloat Diffuse[4] = { .3, .3, 1.0, 1.0 };  /* blue */ | ||||
| static GLfloat Shininess = 15; | ||||
| static GLfloat Shininess = 6; | ||||
|  | ||||
| static GLuint BaseTexture, SpecularTexture; | ||||
| static GLboolean DoSpecTexture = GL_TRUE; | ||||
|   | ||||
| @@ -561,24 +561,28 @@ static void drawSample( int x, int y, int w, int h, | ||||
|    if ( drawSmooth ) { | ||||
|       glShadeModel( GL_SMOOTH ); | ||||
|    } | ||||
|    else { | ||||
|       glShadeModel( GL_FLAT ); | ||||
|       glColor4f(1, 1, 1, 1); | ||||
|    } | ||||
|    if ( drawTextured ) { | ||||
|       glEnable( GL_TEXTURE_2D ); | ||||
|    } | ||||
|  | ||||
|    glBegin( GL_QUADS ); | ||||
|       glColor4f( 1.0, 0.0, 0.0, 1.0 ); | ||||
|       if ( drawSmooth )  glColor4f( 1.0, 0.0, 1.0, 1.0 ); | ||||
|       glTexCoord2f( 0.0, 0.0 ); | ||||
|       glVertex2f( -0.8, -0.8 ); | ||||
|  | ||||
|       glColor4f( 0.0, 1.0, 0.0, 1.0 ); | ||||
|       if ( drawSmooth )  glColor4f( 1.0, 0.0, 1.0, 1.0 ); | ||||
|       glTexCoord2f( 1.0, 0.0 ); | ||||
|       glVertex2f( 0.8, -0.8 ); | ||||
|  | ||||
|       glColor4f( 0.0, 0.0, 1.0, 1.0 ); | ||||
|       if ( drawSmooth )  glColor4f( 0.0, 1.0, 0.0, 1.0 ); | ||||
|       glTexCoord2f( 1.0, 1.0 ); | ||||
|       glVertex2f( 0.8, 0.8 ); | ||||
|  | ||||
|       glColor4f( 1.0, 1.0, 1.0, 1.0 ); | ||||
|       if ( drawSmooth )  glColor4f( 0.0, 1.0, 0.0, 1.0 ); | ||||
|       glTexCoord2f( 0.0, 1.0 ); | ||||
|       glVertex2f( -0.8, 0.8 ); | ||||
|    glEnd(); | ||||
| @@ -587,7 +591,18 @@ static void drawSample( int x, int y, int w, int h, | ||||
|    glShadeModel( GL_FLAT ); | ||||
|    glDisable( GL_TEXTURE_2D ); | ||||
|  | ||||
|    if ( displayLevelInfo ) { | ||||
|    if ( envMode->mode == GL_DECAL && | ||||
|         (format->baseFormat == GL_ALPHA || | ||||
|          format->baseFormat == GL_LUMINANCE || | ||||
|          format->baseFormat == GL_LUMINANCE_ALPHA || | ||||
|          format->baseFormat == GL_INTENSITY)) { | ||||
|       /* undefined format/mode combination */ | ||||
|       begin2D( w, h ); | ||||
|       drawStringOutline( "UNDEFINED MODE", 15, h / 2, | ||||
|                          labelLevelColor0, labelLevelColor1 ); | ||||
|       end2D(); | ||||
|    } | ||||
|    else if ( displayLevelInfo ) { | ||||
|       GLint width, height, border, components; | ||||
|       GLint redSize, greenSize, blueSize, alphaSize; | ||||
|       GLint luminanceSize, intensitySize; | ||||
|   | ||||
| @@ -1,4 +1,4 @@ | ||||
| /* $Id: trispd.c,v 1.1 1999/08/19 00:55:40 jtg Exp $ */ | ||||
| /* $Id: trispd.c,v 1.1.1.1.6.1 2000/10/26 15:26:27 brianp Exp $ */ | ||||
|  | ||||
| /* | ||||
|  * Simple GLUT program to measure triangle strip rendering speed. | ||||
| @@ -7,8 +7,11 @@ | ||||
|  | ||||
| /* | ||||
|  * $Log: trispd.c,v $ | ||||
|  * Revision 1.1  1999/08/19 00:55:40  jtg | ||||
|  * Initial revision | ||||
|  * Revision 1.1.1.1.6.1  2000/10/26 15:26:27  brianp | ||||
|  * added a glFinish() call | ||||
|  * | ||||
|  * Revision 1.1.1.1  1999/08/19 00:55:40  jtg | ||||
|  * Imported sources | ||||
|  * | ||||
|  * Revision 3.4  1999/03/28 18:24:37  brianp | ||||
|  * minor clean-up | ||||
| @@ -107,6 +110,7 @@ static void Display( void ) | ||||
| 	 } | ||||
|       } | ||||
|    } | ||||
|    glFinish(); | ||||
|    t1 = glutGet(GLUT_ELAPSED_TIME) * 0.001; | ||||
|     | ||||
|    if (t1-t0 < MinPeriod) { | ||||
|   | ||||
| @@ -27,7 +27,8 @@ static int fullscreen = 1; | ||||
| static int WIDTH = 640; | ||||
| static int HEIGHT = 480; | ||||
|  | ||||
| #define FRAME 50 | ||||
| static GLint T0 = 0; | ||||
| static GLint Frames = 0; | ||||
|  | ||||
| #define NUMBLOC 5 | ||||
|  | ||||
| @@ -56,7 +57,7 @@ static float v = 0.5; | ||||
| static float alpha = 90.0; | ||||
| static float beta = 90.0; | ||||
|  | ||||
| static int fog = 0; | ||||
| static int fog = 1; | ||||
| static int bfcull = 1; | ||||
| static int usetex = 1; | ||||
| static int cstrip = 0; | ||||
| @@ -154,21 +155,6 @@ drawobjs(int *l, float *f) | ||||
|       } | ||||
| } | ||||
|  | ||||
| static float | ||||
| gettime(void) | ||||
| { | ||||
|    static clock_t told = 0; | ||||
|    clock_t tnew, ris; | ||||
|  | ||||
|    tnew = clock(); | ||||
|  | ||||
|    ris = tnew - told; | ||||
|  | ||||
|    told = tnew; | ||||
|  | ||||
|    return (ris / (float) CLOCKS_PER_SEC); | ||||
| } | ||||
|  | ||||
| static void | ||||
| calcposobs(void) | ||||
| { | ||||
| @@ -221,7 +207,6 @@ key(unsigned char k, int x, int y) | ||||
|       XMesaSetFXmode(fullscreen ? XMESA_FX_FULLSCREEN : XMESA_FX_WINDOW); | ||||
|       break; | ||||
| #endif | ||||
|  | ||||
|    case 'j': | ||||
|       joyactive = (!joyactive); | ||||
|       break; | ||||
| @@ -257,6 +242,7 @@ key(unsigned char k, int x, int y) | ||||
|       fprintf(stderr, "Done.\n"); | ||||
|       break; | ||||
|    } | ||||
|    glutPostRedisplay(); | ||||
| } | ||||
|  | ||||
| static void | ||||
| @@ -366,10 +352,9 @@ dojoy(void) | ||||
| static void | ||||
| draw(void) | ||||
| { | ||||
|    static int count = 0; | ||||
|    static char frbuf[80]; | ||||
|    static char frbuf[80] = ""; | ||||
|    int i; | ||||
|    float fr, base, offset; | ||||
|    float base, offset; | ||||
|  | ||||
|    dojoy(); | ||||
|  | ||||
| @@ -416,11 +401,6 @@ draw(void) | ||||
|    glPopMatrix(); | ||||
|    glPopMatrix(); | ||||
|  | ||||
|    if ((count % FRAME) == 0) { | ||||
|       fr = gettime(); | ||||
|       sprintf(frbuf, "Frame rate: %f", FRAME / fr); | ||||
|    } | ||||
|  | ||||
|    glDisable(GL_TEXTURE_2D); | ||||
|    glDisable(GL_FOG); | ||||
|    glShadeModel(GL_FLAT); | ||||
| @@ -449,9 +429,27 @@ draw(void) | ||||
|  | ||||
|    glutSwapBuffers(); | ||||
|  | ||||
|    count++; | ||||
|    Frames++; | ||||
|    { | ||||
|       GLint t = glutGet(GLUT_ELAPSED_TIME); | ||||
|       if (t - T0 >= 2000) { | ||||
|          GLfloat seconds = (t - T0) / 1000.0; | ||||
|          GLfloat fps = Frames / seconds; | ||||
|          sprintf(frbuf, "Frame rate: %f", fps); | ||||
|          T0 = t; | ||||
|          Frames = 0; | ||||
|       } | ||||
|    } | ||||
| } | ||||
|  | ||||
| static void | ||||
| idle(void) | ||||
| { | ||||
|    glutPostRedisplay(); | ||||
| } | ||||
|  | ||||
|  | ||||
|  | ||||
| int | ||||
| main(int ac, char **av) | ||||
| { | ||||
| @@ -500,7 +498,7 @@ main(int ac, char **av) | ||||
|    glutDisplayFunc(draw); | ||||
|    glutKeyboardFunc(key); | ||||
|    glutSpecialFunc(special); | ||||
|    glutIdleFunc(draw); | ||||
|    glutIdleFunc(idle); | ||||
|  | ||||
|    glEnable(GL_BLEND); | ||||
|    /*glBlendFunc(GL_SRC_ALPHA_SATURATE,GL_ONE); */ | ||||
|   | ||||
| @@ -41,55 +41,55 @@ GLint cubeList = 1; | ||||
| float scp[18][3] = { | ||||
|     { | ||||
| 	1.000000, 0.000000, 0.000000 | ||||
|     },	 | ||||
|     }, | ||||
|     { | ||||
| 	1.000000, 0.000000, 5.000000 | ||||
|     }, | ||||
|     { | ||||
| 	0.707107, 0.707107, 0.000000 | ||||
|     },	 | ||||
|     }, | ||||
|     { | ||||
| 	0.707107, 0.707107, 5.000000 | ||||
|     }, | ||||
|     { | ||||
| 	0.000000, 1.000000, 0.000000 | ||||
|     },	 | ||||
|     }, | ||||
|     { | ||||
| 	0.000000, 1.000000, 5.000000 | ||||
|     }, | ||||
|     { | ||||
| 	-0.707107, 0.707107, 0.000000 | ||||
|     },	 | ||||
|     }, | ||||
|     { | ||||
| 	-0.707107, 0.707107, 5.000000 | ||||
|     }, | ||||
|     { | ||||
| 	-1.000000, 0.000000, 0.000000 | ||||
|     },	 | ||||
|     }, | ||||
|     { | ||||
| 	-1.000000, 0.000000, 5.000000 | ||||
|     }, | ||||
|     { | ||||
| 	-0.707107, -0.707107, 0.000000 | ||||
|     },	 | ||||
|     }, | ||||
|     { | ||||
| 	-0.707107, -0.707107, 5.000000 | ||||
|     }, | ||||
|     { | ||||
| 	0.000000, -1.000000, 0.000000 | ||||
|     },	 | ||||
|     }, | ||||
|     { | ||||
| 	0.000000, -1.000000, 5.000000 | ||||
|     }, | ||||
|     { | ||||
| 	0.707107, -0.707107, 0.000000 | ||||
|     },	 | ||||
|     }, | ||||
|     { | ||||
| 	0.707107, -0.707107, 5.000000 | ||||
|     }, | ||||
|     { | ||||
| 	1.000000, 0.000000, 0.000000 | ||||
|     },	 | ||||
|     }, | ||||
|     { | ||||
| 	1.000000, 0.000000, 5.000000 | ||||
|     }, | ||||
| @@ -136,7 +136,7 @@ static void Init(void) | ||||
|     static float back_mat_diffuse[] = {1.0, 0.0, 0.0, 1.0}; | ||||
|     static float lmodel_ambient[] = {0.0, 0.0, 0.0, 1.0}; | ||||
|     static float fog_color[] = {0.8, 0.8, 0.8, 1.0}; | ||||
|      | ||||
|  | ||||
|     glFrontFace(GL_CW); | ||||
|  | ||||
|     glEnable(GL_DEPTH_TEST); | ||||
| @@ -148,7 +148,7 @@ static void Init(void) | ||||
|     glLightModeli(GL_LIGHT_MODEL_TWO_SIDE, GL_TRUE); | ||||
|     glEnable(GL_LIGHTING); | ||||
|     glEnable(GL_LIGHT0); | ||||
|      | ||||
|  | ||||
|     glMaterialfv(GL_FRONT, GL_SHININESS, front_mat_shininess); | ||||
|     glMaterialfv(GL_FRONT, GL_SPECULAR, front_mat_specular); | ||||
|     glMaterialfv(GL_FRONT, GL_DIFFUSE, front_mat_diffuse); | ||||
| @@ -258,7 +258,7 @@ static GLenum Args(int argc, char **argv) | ||||
|     GLint i; | ||||
|  | ||||
|     rgb = GL_TRUE; | ||||
|     doubleBuffer = GL_FALSE; | ||||
|     doubleBuffer = GL_TRUE; | ||||
|  | ||||
|     for (i = 1; i < argc; i++) { | ||||
| 	if (strcmp(argv[i], "-ci") == 0) { | ||||
|   | ||||
| @@ -123,7 +123,7 @@ static void Draw(void) | ||||
|     } else { | ||||
| 	glDisable(GL_LINE_STIPPLE); | ||||
|     } | ||||
|      | ||||
|  | ||||
|     if (mode2) { | ||||
| 	ci = CI_OFFSET; | ||||
| 	glEnable(GL_LINE_SMOOTH); | ||||
| @@ -170,7 +170,7 @@ static GLenum Args(int argc, char **argv) | ||||
|     GLint i; | ||||
|  | ||||
|     rgb = GL_TRUE; | ||||
|     doubleBuffer = GL_FALSE; | ||||
|     doubleBuffer = GL_TRUE; | ||||
|  | ||||
|     for (i = 1; i < argc; i++) { | ||||
| 	if (strcmp(argv[i], "-ci") == 0) { | ||||
|   | ||||
| @@ -26,7 +26,7 @@ | ||||
|  * Nov 20, 1995 use stdlib's rand()/srand() instead of random()/srand48(), etc. | ||||
|  */ | ||||
|  | ||||
| /*  | ||||
| /* | ||||
|  * Modified by Li Wei(liwei@aiar.xjtu.edu.cn) to be able to run in Windows | ||||
|  * 6/13 | ||||
|  * | ||||
| @@ -83,7 +83,7 @@ void FillTorus(float rc, int numc, float rt, int numt) | ||||
|  | ||||
|     pi = 3.14159265358979323846; | ||||
|     twopi = 2 * pi; | ||||
|   | ||||
|  | ||||
|     for (i = 0; i < numc; i++) { | ||||
| 	glBegin(GL_QUAD_STRIP); | ||||
|         for (j = 0; j <= numt; j++) { | ||||
| @@ -136,7 +136,7 @@ void DrawScene(void) | ||||
|     } | ||||
|  | ||||
|     glPushMatrix(); | ||||
|      | ||||
|  | ||||
|     glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT); | ||||
|     gluLookAt(0,0,10, 0,0,0, 0,1,0); | ||||
|  | ||||
| @@ -252,7 +252,7 @@ void Init(void) | ||||
|     dests[GREENRING][1] = bottom_y; | ||||
|     dests[GREENRING][2] = bottom_z; | ||||
|  | ||||
|     base = 2.0;  | ||||
|     base = 2.0; | ||||
|     height = 2.0; | ||||
|     theTorus = glGenLists(1); | ||||
|     glNewList(theTorus, GL_COMPILE); | ||||
| @@ -321,7 +321,7 @@ GLenum Args(int argc, char **argv) | ||||
|     GLint i; | ||||
|  | ||||
|     rgb = GL_TRUE; | ||||
|     doubleBuffer = GL_FALSE; | ||||
|     doubleBuffer = GL_TRUE; | ||||
|  | ||||
|     for (i = 1; i < argc; i++) { | ||||
| 	if (strcmp(argv[i], "-ci") == 0) { | ||||
|   | ||||
| @@ -326,7 +326,7 @@ static GLenum Args(int argc, char **argv) | ||||
| { | ||||
|     GLint i; | ||||
|  | ||||
|     doubleBuffer = GL_FALSE; | ||||
|     doubleBuffer = GL_TRUE; | ||||
|  | ||||
|     for (i = 1; i < argc; i++) { | ||||
| 	if (strcmp(argv[i], "-sb") == 0) { | ||||
|   | ||||
| @@ -85,7 +85,7 @@ float c[6][4][4][3] = { | ||||
| 	{ | ||||
| 	    { | ||||
| 		1.0, 1.0, -1.0 | ||||
| 	    },  | ||||
| 	    }, | ||||
| 	    { | ||||
| 		0.0, 1.0, -1.0 | ||||
| 	    }, | ||||
| @@ -102,10 +102,10 @@ float c[6][4][4][3] = { | ||||
| 	    }, | ||||
| 	    { | ||||
| 		-1.0, 1.0, -1.0 | ||||
| 	    },  | ||||
| 	    }, | ||||
| 	    { | ||||
| 		-1.0, 0.0, -1.0 | ||||
| 	    },  | ||||
| 	    }, | ||||
| 	    { | ||||
| 		0.0, 0.0, -1.0 | ||||
| 	    }, | ||||
| @@ -269,7 +269,7 @@ float c[6][4][4][3] = { | ||||
| 	    { | ||||
| 		-1.0, 0.0, -1.0 | ||||
| 	    }, | ||||
| 	},  | ||||
| 	}, | ||||
| 	{ | ||||
| 	    { | ||||
| 		-1.0, 1.0, 0.0 | ||||
| @@ -283,7 +283,7 @@ float c[6][4][4][3] = { | ||||
| 	    { | ||||
| 		-1.0, 0.0, 0.0 | ||||
| 	    }, | ||||
| 	},  | ||||
| 	}, | ||||
| 	{ | ||||
| 	    { | ||||
| 		-1.0, 0.0, 1.0 | ||||
| @@ -297,7 +297,7 @@ float c[6][4][4][3] = { | ||||
| 	    { | ||||
| 		-1.0, 0.0, 0.0 | ||||
| 	    }, | ||||
| 	},  | ||||
| 	}, | ||||
| 	{ | ||||
| 	    { | ||||
| 		-1.0, -1.0, 0.0 | ||||
| @@ -311,7 +311,7 @@ float c[6][4][4][3] = { | ||||
| 	    { | ||||
| 		-1.0, 0.0, 0.0 | ||||
| 	    }, | ||||
| 	},  | ||||
| 	}, | ||||
|     }, | ||||
|     { | ||||
| 	{ | ||||
| @@ -463,8 +463,8 @@ GLfloat identity[16] = { | ||||
| void BuildCylinder(int numEdges) | ||||
| { | ||||
|     int i, top = 1.0, bottom = -1.0; | ||||
|     float x[100], y[100], angle;  | ||||
|      | ||||
|     float x[100], y[100], angle; | ||||
|  | ||||
|     for (i = 0; i <= numEdges; i++) { | ||||
| 	angle = i * 2.0 * PI / numEdges; | ||||
| 	x[i] = cos(angle);   /* was cosf() */ | ||||
| @@ -505,7 +505,7 @@ void BuildTorus(float rc, int numc, float rt, int numt) | ||||
|  | ||||
|     pi = 3.14159265358979323846; | ||||
|     twopi = 2.0 * pi; | ||||
|   | ||||
|  | ||||
|     glNewList(torus, GL_COMPILE); | ||||
|     for (i = 0; i < numc; i++) { | ||||
| 	glBegin(GL_QUAD_STRIP); | ||||
| @@ -542,7 +542,7 @@ void BuildCage(void) | ||||
|     left   = -4.0; | ||||
|     bottom = -4.0; | ||||
|     right  = 4.0; | ||||
|     top    = 4.0;  | ||||
|     top    = 4.0; | ||||
|  | ||||
|     inc = 2.0 * 4.0 * 0.1; | ||||
|  | ||||
| @@ -631,7 +631,7 @@ void BuildCube(void) | ||||
|     glNewList(cube, GL_COMPILE); | ||||
|     for (i = 0; i < 6; i++) { | ||||
| 	for (j = 0; j < 4; j++) { | ||||
| 	    glNormal3fv(n[i]);  | ||||
| 	    glNormal3fv(n[i]); | ||||
| 	    glBegin(GL_POLYGON); | ||||
| 		glVertex3fv(c[i][j][0]); | ||||
| 		glVertex3fv(c[i][j][1]); | ||||
| @@ -670,7 +670,7 @@ void SetDeepestColor(void) | ||||
|     glGetIntegerv(GL_BLUE_BITS, &blueBits); | ||||
|  | ||||
|     deepestColor = (redBits >= greenBits) ? COLOR_RED : COLOR_GREEN; | ||||
|     deepestColor = (deepestColor >= blueBits) ? deepestColor : COLOR_BLUE;  | ||||
|     deepestColor = (deepestColor >= blueBits) ? deepestColor : COLOR_BLUE; | ||||
| } | ||||
|  | ||||
| void SetDefaultSettings(void) | ||||
| @@ -726,17 +726,17 @@ void Init(void) | ||||
| 	image->data = AlphaPadImage(image->sizeX*image->sizeY, | ||||
|                                     image->data, 128); | ||||
| 	glPixelStorei(GL_UNPACK_ALIGNMENT, 1); | ||||
| 	gluBuild2DMipmaps(GL_TEXTURE_2D, numComponents,  | ||||
| 			  image->sizeX, image->sizeY,  | ||||
| 	gluBuild2DMipmaps(GL_TEXTURE_2D, numComponents, | ||||
| 			  image->sizeX, image->sizeY, | ||||
| 			  GL_RGBA, GL_UNSIGNED_BYTE, image->data); | ||||
|     } else { | ||||
| 	image = LoadPPM(imageFileName); | ||||
| 	glPixelStorei(GL_UNPACK_ALIGNMENT, 1); | ||||
| 	gluBuild2DMipmaps(GL_TEXTURE_2D, numComponents,  | ||||
| 			  image->sizeX, image->sizeY,  | ||||
| 	gluBuild2DMipmaps(GL_TEXTURE_2D, numComponents, | ||||
| 			  image->sizeX, image->sizeY, | ||||
| 			  GL_RGB, GL_UNSIGNED_BYTE, image->data); | ||||
|     } | ||||
|      | ||||
|  | ||||
|     glFogf(GL_FOG_DENSITY, 0.125); | ||||
|     glFogi(GL_FOG_MODE, GL_LINEAR); | ||||
|     glFogf(GL_FOG_START, 4.0); | ||||
| @@ -747,7 +747,7 @@ void Init(void) | ||||
|     glLightfv(GL_LIGHT0, GL_DIFFUSE, diffuse); | ||||
|     glLightfv(GL_LIGHT0, GL_SPECULAR, specular); | ||||
|     glLightfv(GL_LIGHT0, GL_POSITION, position); | ||||
|      | ||||
|  | ||||
|     glMaterialfv(GL_FRONT_AND_BACK, GL_SHININESS, mat_shininess); | ||||
|     glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, mat_specular); | ||||
|     glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, mat_diffuse); | ||||
| @@ -845,7 +845,7 @@ void Draw(void) | ||||
|     if (autoRotate) { | ||||
| 	xRotation += .75; | ||||
| 	yRotation += .375; | ||||
|     }  | ||||
|     } | ||||
|     glutSwapBuffers(); | ||||
| } | ||||
|  | ||||
| @@ -964,7 +964,7 @@ GLenum Args(int argc, char **argv) | ||||
| { | ||||
|     GLint i; | ||||
|  | ||||
|     doubleBuffer = GL_FALSE; | ||||
|     doubleBuffer = GL_TRUE; | ||||
|     numComponents = 4; | ||||
|  | ||||
|     for (i = 1; i < argc; i++) { | ||||
|   | ||||
| @@ -281,7 +281,7 @@ static GLenum Args(int argc, char **argv) | ||||
| { | ||||
|     GLint i; | ||||
|  | ||||
|     doubleBuffer = GL_FALSE; | ||||
|     doubleBuffer = GL_TRUE; | ||||
|  | ||||
|     for (i = 1; i < argc; i++) { | ||||
| 	if (strcmp(argv[i], "-sb") == 0) { | ||||
|   | ||||
| @@ -285,7 +285,7 @@ static GLenum Args(int argc, char **argv) | ||||
| { | ||||
|     GLint i; | ||||
|  | ||||
|     doubleBuffer = GL_FALSE; | ||||
|     doubleBuffer = GL_TRUE; | ||||
|  | ||||
|     for (i = 1; i < argc; i++) { | ||||
| 	if (strcmp(argv[i], "-sb") == 0) { | ||||
|   | ||||
| @@ -128,7 +128,7 @@ static void Animate(void) | ||||
| 		    glColor3fv(facet->color); | ||||
| 		} else { | ||||
| 		    thisColor = facet->color; | ||||
| 		    glMaterialfv(GL_FRONT_AND_BACK, GL_COLOR_INDEXES,  | ||||
| 		    glMaterialfv(GL_FRONT_AND_BACK, GL_COLOR_INDEXES, | ||||
| 				 facet->color); | ||||
| 		} | ||||
| 	    } else { | ||||
| @@ -182,7 +182,7 @@ static void Animate(void) | ||||
|     } | ||||
| } | ||||
|  | ||||
| static void SetColorMap(void)  | ||||
| static void SetColorMap(void) | ||||
| { | ||||
|     static float green[3] = {0.2, 1.0, 0.2}; | ||||
|     static float red[3] = {1.0, 0.2, 0.2}; | ||||
| @@ -360,7 +360,7 @@ static void InitMaterials(void) | ||||
|     glLightModelfv(GL_LIGHT_MODEL_TWO_SIDE, lmodel_twoside); | ||||
|     glEnable(GL_LIGHTING); | ||||
|     glEnable(GL_LIGHT0); | ||||
|      | ||||
|  | ||||
|     glMaterialfv(GL_FRONT, GL_SHININESS, front_mat_shininess); | ||||
|     glMaterialfv(GL_FRONT, GL_SPECULAR, front_mat_specular); | ||||
|     glMaterialfv(GL_FRONT, GL_DIFFUSE, front_mat_diffuse); | ||||
| @@ -394,7 +394,7 @@ static void Init(void) | ||||
|     glClearColor(0.0, 0.0, 0.0, 0.0); | ||||
|  | ||||
|     glShadeModel(GL_FLAT); | ||||
|      | ||||
|  | ||||
|     glFrontFace(GL_CW); | ||||
|  | ||||
|     glEnable(GL_DEPTH_TEST); | ||||
| @@ -515,7 +515,7 @@ static GLenum Args(int argc, char **argv) | ||||
|     GLint i; | ||||
|  | ||||
|     rgb = GL_TRUE; | ||||
|     doubleBuffer = GL_FALSE; | ||||
|     doubleBuffer = GL_TRUE; | ||||
|     frames = 10; | ||||
|     widthX = 10; | ||||
|     widthY = 10; | ||||
|   | ||||
| @@ -53,7 +53,7 @@ PERFORMANCE OF THIS SOFTWARE. | ||||
| #include <stdio.h> | ||||
| #include <string.h> | ||||
|  | ||||
| /*#undef GL_EXT_polygon_offset   uncomment to use new version*/ | ||||
| #undef GL_EXT_polygon_offset  /* use GL 1.1 version instead of extension */ | ||||
|  | ||||
|  | ||||
| #ifndef EXIT_FAILURE | ||||
|   | ||||
| @@ -1,61 +1,62 @@ | ||||
| LIBRARY GLU32 | ||||
| DESCRIPTION 'GLU for Windows Mesa' | ||||
| EXETYPE WINDOWS | ||||
| CODE MOVEABLE DISCARDABLE | ||||
| DATA MOVEABLE SINGLE | ||||
| HEAPSIZE 256000 | ||||
|  | ||||
| STACKSIZE 4096 | ||||
|  | ||||
| EXPORTS | ||||
|     gluLookAt | ||||
|     gluOrtho2D | ||||
|     gluPerspective | ||||
|     gluPickMatrix | ||||
|     gluProject | ||||
|     gluUnProject | ||||
|     gluErrorString | ||||
|     gluScaleImage | ||||
|     gluBuild1DMipmaps | ||||
|     gluBuild2DMipmaps | ||||
|     gluNewQuadric | ||||
|     gluDeleteQuadric | ||||
|     gluQuadricDrawStyle | ||||
|     gluQuadricOrientation | ||||
|     gluQuadricNormals | ||||
|     gluQuadricTexture | ||||
|     gluQuadricCallback | ||||
|     gluCylinder | ||||
|     gluSphere | ||||
|     gluDisk | ||||
|     gluPartialDisk | ||||
|     gluNewNurbsRenderer | ||||
|     gluDeleteNurbsRenderer | ||||
|     gluLoadSamplingMatrices | ||||
|     gluNurbsProperty | ||||
|     gluGetNurbsProperty | ||||
|     gluBeginCurve | ||||
|     gluEndCurve | ||||
|     gluNurbsCurve | ||||
|     gluBeginSurface | ||||
|     gluEndSurface | ||||
|     gluNurbsSurface | ||||
|     gluBeginTrim | ||||
|     gluEndTrim | ||||
|     gluPwlCurve | ||||
|     gluNurbsCallback | ||||
|     gluNewTess | ||||
|     gluDeleteTess | ||||
|     gluTessBeginPolygon | ||||
|     gluTessBeginContour | ||||
|     gluTessVertex | ||||
|     gluTessEndContour | ||||
|     gluTessEndPolygon | ||||
|     gluTessProperty | ||||
|     gluTessNormal | ||||
|     gluTessCallback | ||||
|     gluGetTessProperty | ||||
|     gluBeginPolygon | ||||
|     gluNextContour | ||||
|     gluEndPolygon | ||||
|     gluGetString | ||||
| LIBRARY GLU32 | ||||
| DESCRIPTION 'GLU for Windows Mesa' | ||||
| EXETYPE WINDOWS | ||||
| CODE MOVEABLE DISCARDABLE | ||||
| DATA MOVEABLE SINGLE | ||||
| HEAPSIZE 256000 | ||||
|  | ||||
| STACKSIZE 4096 | ||||
|  | ||||
| EXPORTS | ||||
|     gluLookAt | ||||
|     gluOrtho2D | ||||
|     gluPerspective | ||||
|     gluPickMatrix | ||||
|     gluProject | ||||
|     gluUnProject | ||||
|     gluErrorString | ||||
|     gluScaleImage | ||||
|     gluBuild1DMipmaps | ||||
|     gluBuild2DMipmaps | ||||
|     gluNewQuadric | ||||
|     gluDeleteQuadric | ||||
|     gluQuadricDrawStyle | ||||
|     gluQuadricOrientation | ||||
|     gluQuadricNormals | ||||
|     gluQuadricTexture | ||||
|     gluQuadricCallback | ||||
|     gluCylinder | ||||
|     gluSphere | ||||
|     gluDisk | ||||
|     gluPartialDisk | ||||
|     gluNewNurbsRenderer | ||||
|     gluDeleteNurbsRenderer | ||||
|     gluLoadSamplingMatrices | ||||
|     gluNurbsProperty | ||||
|     gluGetNurbsProperty | ||||
|     gluBeginCurve | ||||
|     gluEndCurve | ||||
|     gluNurbsCurve | ||||
|     gluBeginSurface | ||||
|     gluEndSurface | ||||
|     gluNurbsSurface | ||||
|     gluBeginTrim | ||||
|     gluEndTrim | ||||
|     gluPwlCurve | ||||
|     gluNurbsCallback | ||||
|     gluNewTess | ||||
|     gluDeleteTess | ||||
| ;    gluTessBeginPolygon | ||||
| ;    gluTessBeginContour | ||||
|     gluTessVertex | ||||
| ;    gluTessEndContour | ||||
| ;    gluTessEndPolygon | ||||
| ;    gluTessProperty | ||||
| ;    gluTessNormal | ||||
|     gluTessCallback | ||||
| ;    gluGetTessProperty | ||||
|     gluBeginPolygon | ||||
|     gluNextContour | ||||
|     gluEndPolygon | ||||
|     gluGetString | ||||
|  | ||||
|   | ||||
| @@ -1,8 +1,8 @@ | ||||
| /* $Id: glu.c,v 1.21 2000/07/18 01:13:28 brianp Exp $ */ | ||||
| /* $Id: glu.c,v 1.21.2.1 2000/11/02 17:59:43 brianp Exp $ */ | ||||
|  | ||||
| /* | ||||
|  * Mesa 3-D graphics library | ||||
|  * Version:  3.3 | ||||
|  * Version:  3.4 | ||||
|  * Copyright (C) 1995-2000  Brian Paul | ||||
|  * | ||||
|  * This library is free software; you can redistribute it and/or | ||||
| @@ -302,7 +302,7 @@ const GLubyte *GLAPIENTRY | ||||
| gluGetString(GLenum name) | ||||
| { | ||||
|    static char *extensions = "GL_EXT_abgr"; | ||||
|    static char *version = "1.1 Mesa 3.3"; | ||||
|    static char *version = "1.1 Mesa 3.4"; | ||||
|  | ||||
|    switch (name) { | ||||
|    case GLU_EXTENSIONS: | ||||
|   | ||||
| @@ -1,8 +1,8 @@ | ||||
| /* $Id: mipmap.c,v 1.7 2000/07/11 14:11:04 brianp Exp $ */ | ||||
| /* $Id: mipmap.c,v 1.7.4.1 2000/10/26 21:48:37 brianp Exp $ */ | ||||
|  | ||||
| /* | ||||
|  * Mesa 3-D graphics library | ||||
|  * Version:  3.3 | ||||
|  * Version:  3.4 | ||||
|  * Copyright (C) 1995-2000  Brian Paul | ||||
|  * | ||||
|  * This library is free software; you can redistribute it and/or | ||||
| @@ -576,6 +576,7 @@ bytes_per_pixel(GLenum format, GLenum type) | ||||
|       n = 2; | ||||
|       break; | ||||
|    case GL_RGB: | ||||
|    case GL_BGR: | ||||
|       n = 3; | ||||
|       break; | ||||
|    case GL_RGBA: | ||||
|   | ||||
| @@ -1511,7 +1511,7 @@ static void SetRenderStates( GLcontext *ctx ) | ||||
|    /*================================================*/ | ||||
|    /* Check too see if there are new TEXTURE states. */ | ||||
|    /*================================================*/ | ||||
|    if ( ctx->Texture.Enabled ) | ||||
|    if ( ctx->Texture.ReallyEnabled ) | ||||
|    { | ||||
|       switch( ctx->Texture.Set[ctx->Texture.CurrentSet].EnvMode ) | ||||
|       { | ||||
| @@ -1871,9 +1871,9 @@ static void DebugRenderStates( GLcontext *ctx, BOOL bForce ) | ||||
|    /*================================================*/ | ||||
|    /* Check too see if there are new TEXTURE states. */ | ||||
|    /*================================================*/ | ||||
|    if ( texture != ctx->Texture.Enabled ) | ||||
|    if ( texture != ctx->Texture.ReallyEnabled ) | ||||
|    { | ||||
| 	texture = ctx->Texture.Enabled; | ||||
| 	texture = ctx->Texture.ReallyEnabled; | ||||
| 	DPF(( 0, "\tTexture\t\t%s", (texture) ? "ENABLED" : "--------" )); | ||||
|    }	 | ||||
|  | ||||
|   | ||||
| @@ -725,6 +725,8 @@ void GLAPIENTRY gl3DfxSetPaletteEXT(GLuint *pal) | ||||
| static GrScreenResolution_t fxBestResolution(int width, int height, int aux) | ||||
| { | ||||
|   static int resolutions[][5]={  | ||||
|     { 320, 200, GR_RESOLUTION_320x200, 2, 2 }, | ||||
|     { 320, 240, GR_RESOLUTION_320x240, 2, 2 }, | ||||
|     { 512, 384, GR_RESOLUTION_512x384, 2, 2 }, | ||||
|     { 640, 400, GR_RESOLUTION_640x400, 2, 2 }, | ||||
|     { 640, 480, GR_RESOLUTION_640x480, 2, 2 }, | ||||
| @@ -734,15 +736,15 @@ static GrScreenResolution_t fxBestResolution(int width, int height, int aux) | ||||
|     ,{ 1024, 768, GR_RESOLUTION_1024x768, 8, 4 } | ||||
| #endif | ||||
| #ifdef GR_RESOLUTION_1280x1024 | ||||
|     ,{ 1024, 768, GR_RESOLUTION_1280x1024, 8, 8 } | ||||
|     ,{ 1280, 1024, GR_RESOLUTION_1280x1024, 8, 8 } | ||||
| #endif | ||||
| #ifdef GR_RESOLUTION_1600x1200 | ||||
|     ,{ 1024, 768, GR_RESOLUTION_1600x1200, 16, 8 } | ||||
|     ,{ 1600, 1200, GR_RESOLUTION_1600x1200, 16, 8 } | ||||
| #endif | ||||
|   }; | ||||
|   int NUM_RESOLUTIONS = sizeof(resolutions) / (sizeof(int)*5); | ||||
|   int i,fbmem; | ||||
|   GrScreenResolution_t lastvalidres=resolutions[1][2]; | ||||
|   GrScreenResolution_t lastvalidres=resolutions[4][2]; | ||||
|  | ||||
|   fxQueryHardware(); | ||||
|  | ||||
| @@ -943,7 +945,7 @@ fxMesaContext GLAPIENTRY fxMesaCreateContext(GLuint win, | ||||
|    fxMesa->haveDoubleBuffer=doubleBuffer; | ||||
|    fxMesa->haveAlphaBuffer=alphaBuffer; | ||||
|    fxMesa->haveGlobalPaletteTexture=GL_FALSE; | ||||
|    fxMesa->haveZBuffer=depthSize ? 1 : 0; | ||||
|    fxMesa->haveZBuffer=depthSize ? 16 : 0; | ||||
|    fxMesa->verbose=verbose; | ||||
|    fxMesa->board=glbCurrentBoard; | ||||
|  | ||||
|   | ||||
| @@ -274,6 +274,8 @@ static GLbitfield fxDDClear(GLcontext *ctx, GLbitfield mask, GLboolean all, | ||||
|       FX_grColorMask(FXTRUE, ctx->Color.ColorMask[ACOMP] && fxMesa->haveAlphaBuffer); | ||||
|       if (ctx->Color.DrawDestMask & FRONT_LEFT_BIT) | ||||
|         FX_grRenderBuffer(GR_BUFFER_FRONTBUFFER); | ||||
|       if (!ctx->Depth.Test || !ctx->Depth.Mask) | ||||
|         FX_grDepthMask(FXFALSE); | ||||
|       break; | ||||
|     default: | ||||
|       /* error */ | ||||
|   | ||||
| @@ -1,4 +1,4 @@ | ||||
| /* $Id: osmesa.c,v 1.19 2000/06/27 21:42:14 brianp Exp $ */ | ||||
| /* $Id: osmesa.c,v 1.19.4.1 2000/09/28 22:39:42 brianp Exp $ */ | ||||
|  | ||||
| /* | ||||
|  * Mesa 3-D graphics library | ||||
| @@ -1357,7 +1357,7 @@ static line_func choose_line_function( GLcontext *ctx ) | ||||
|    OSMesaContext osmesa = (OSMesaContext) ctx; | ||||
|  | ||||
|    if (ctx->Line.SmoothFlag)              return NULL; | ||||
|    if (ctx->Texture.Enabled)              return NULL; | ||||
|    if (ctx->Texture.ReallyEnabled)        return NULL; | ||||
|    if (ctx->Light.ShadeModel!=GL_FLAT)    return NULL; | ||||
|  | ||||
|    if (ctx->Line.Width==1.0F | ||||
| @@ -1543,7 +1543,7 @@ static triangle_func choose_triangle_function( GLcontext *ctx ) | ||||
|  | ||||
|    if (ctx->Polygon.SmoothFlag)     return NULL; | ||||
|    if (ctx->Polygon.StippleFlag)    return NULL; | ||||
|    if (ctx->Texture.Enabled)        return NULL; | ||||
|    if (ctx->Texture.ReallyEnabled)  return NULL; | ||||
|  | ||||
|    if (ctx->RasterMask==DEPTH_BIT | ||||
|        && ctx->Depth.Func==GL_LESS | ||||
|   | ||||
| @@ -1,4 +1,4 @@ | ||||
| /* $Id: wgl.c,v 1.2 1999/09/19 09:59:20 tjump Exp $ */ | ||||
| /* $Id: wgl.c,v 1.2.6.1 2000/08/02 20:28:19 brianp Exp $ */ | ||||
|  | ||||
| /* | ||||
| * This library is free software; you can redistribute it and/or | ||||
| @@ -30,8 +30,9 @@ extern "C" { | ||||
| #endif | ||||
|  | ||||
| #include <windows.h> | ||||
|  | ||||
| #define GL_GLEXT_PROTOTYPES | ||||
| #include <GL/gl.h> | ||||
| #include <GL/glext.h> | ||||
| //#include <GL/glu.h> | ||||
|  | ||||
| #ifdef __cplusplus | ||||
| @@ -90,7 +91,7 @@ struct __extensions__	ext[] = { | ||||
|    { (PROC)glGetColorTableParameterivEXT,	"glGetColorTableParameterivEXT"	}, | ||||
|    { (PROC)glPointParameterfEXT,		"glPointParameterfEXT"		}, | ||||
|    { (PROC)glPointParameterfvEXT,		"glPointParameterfvEXT"		}, | ||||
|    { (PROC)glBlendFuncSeparateINGR,		"glBlendFuncSeparateINGR"	}, | ||||
|    { (PROC)glBlendFuncSeparateEXT,		"glBlendFuncSeparateEXT"	}, | ||||
|    { (PROC)glLockArraysEXT,			"glLockArraysEXT"		}, | ||||
|    { (PROC)glUnlockArraysEXT,			"glUnlockArraysEXT"		} | ||||
| }; | ||||
|   | ||||
| @@ -1,69 +1,20 @@ | ||||
| /* $Id: wmesa.c,v 1.3 2000/03/03 23:21:57 brianp Exp $ */ | ||||
| /* $Id: wmesa.c,v 1.3.4.3 2000/09/28 22:39:43 brianp Exp $ */ | ||||
|  | ||||
| /* | ||||
| *   File name   :   wmesa.c | ||||
| *  Version      :   2.3 | ||||
| * | ||||
| *  Display driver for Mesa 2.3  under | ||||
| *   Windows95 and WindowsNT | ||||
| * | ||||
| *   Copyright (C) 1996-  Li Wei | ||||
| *  Address      :       Institute of Artificial Intelligence | ||||
| *               :           & Robotics | ||||
| *               :       Xi'an Jiaotong University | ||||
| *  Email        :       liwei@aiar.xjtu.edu.cn | ||||
| *  Web page :       http://sun.aiar.xjtu.edu.cn | ||||
| * | ||||
| *  This file and its associations are partially borrowed from the | ||||
| *  Windows NT driver for Mesa 1.8 , written by Mark Leaming | ||||
| *  (mark@rsinc.com). | ||||
| */ | ||||
|  | ||||
|  | ||||
| /* | ||||
|  * $Log: wmesa.c,v $ | ||||
|  * Revision 1.3  2000/03/03 23:21:57  brianp | ||||
|  * removed obsolete logicop function | ||||
|  * Windows (Win32) device driver for Mesa 3.4 | ||||
|  * | ||||
|  * Revision 1.2  2000/02/17 20:52:02  brianp | ||||
|  * replaced renderer_string() with get_string() func | ||||
|  * Original author: | ||||
|  * | ||||
|  * Revision 1.1.1.1  1999/08/19 00:55:42  jtg | ||||
|  * Imported sources | ||||
|  * | ||||
|  * Revision 3.10  1999/06/15 01:35:06  brianp | ||||
|  * small change to wmSetPixel() from TWILMOT@cpr.fr | ||||
|  * | ||||
|  * Revision 3.9  1999/05/11 19:06:01  brianp | ||||
|  * fixed a few VB->Index bugs (mikec@ensoniq.com) | ||||
|  * | ||||
|  * Revision 3.8  1999/05/08 15:15:23  brianp | ||||
|  * various updates from mikec@ensoniq.com | ||||
|  * | ||||
|  * Revision 3.7  1999/04/01 01:27:34  brianp | ||||
|  * always flip Y coord in read_rgba_span() | ||||
|  * | ||||
|  * Revision 3.6  1999/03/28 21:17:27  brianp | ||||
|  * updated SetBuffer driver function | ||||
|  * | ||||
|  * Revision 3.5  1999/03/16 01:36:42  brianp | ||||
|  * patched dither() to check if Current is NULL, per xzhou@nyx.net | ||||
|  * | ||||
|  * Revision 3.4  1999/02/25 14:12:33  keithw | ||||
|  * Merged in kw3 patch | ||||
|  * | ||||
|  * Revision 3.3  1999/01/03 03:08:57  brianp | ||||
|  * Ted Jump's changes | ||||
|  * | ||||
|  * Revision 3.2  1998/08/29 00:26:01 | ||||
|  * updated for Mesa 3.0 to accomodate EGCS-Mingw32 build | ||||
|  * | ||||
|  * Revision 3.1  1998/06/11 01:42:08  brianp | ||||
|  * updated for Mesa 3.0 device driver interface (but not tested) | ||||
|  * | ||||
|  * Revision 3.0  1998/06/11 01:18:25  brianp | ||||
|  * initial revision | ||||
|  *  Copyright (C) 1996-  Li Wei | ||||
|  *  Address      :       Institute of Artificial Intelligence | ||||
|  *               :           & Robotics | ||||
|  *               :       Xi'an Jiaotong University | ||||
|  *  Email        :       liwei@aiar.xjtu.edu.cn | ||||
|  *  Web page :       http://sun.aiar.xjtu.edu.cn | ||||
|  * | ||||
|  *  This file and its associations are partially borrowed from the | ||||
|  *  Windows NT driver for Mesa 1.8 , written by Mark Leaming | ||||
|  *  (mark@rsinc.com). | ||||
|  */ | ||||
|  | ||||
|  | ||||
| @@ -84,7 +35,7 @@ | ||||
| #include "depth.h" | ||||
| #include "wmesadef.h" | ||||
|  | ||||
| #pragma warning ( disable : 4133 4761 ) | ||||
| #pragma warning ( disable : 4100 4133 4761 ) | ||||
|  | ||||
| #ifdef PROFILE | ||||
| //  #include "profile.h" | ||||
| @@ -430,9 +381,9 @@ static void clear_color( GLcontext* ctx, GLubyte r, GLubyte g, GLubyte b, GLubyt | ||||
| */ | ||||
| //static void clear(GLcontext* ctx, | ||||
| //                  GLboolean all,GLint x, GLint y, GLint width, GLint height ) | ||||
| // TODO: I modified this function to match the prototype in dd.h. (swansma@geocities.com) | ||||
| //       dd.h does not explain what the return type is so I could not set this to the proper | ||||
| //       value. | ||||
| // TODO: I modified this function to match the prototype in | ||||
| //       dd.h. (swansma@geocities.com) | ||||
|  | ||||
| static GLbitfield clear(GLcontext* ctx, GLbitfield mask, | ||||
|                   GLboolean all, GLint x, GLint y, GLint width, GLint height) | ||||
| { | ||||
| @@ -599,7 +550,7 @@ static void dither( GLcontext* ctx, GLboolean enable ) | ||||
|  | ||||
|  | ||||
|  | ||||
| static GLboolean set_buffer( GLcontext* ctx, GLenum mode ) | ||||
| static GLboolean set_draw_buffer( GLcontext* ctx, GLenum mode ) | ||||
| { | ||||
|    STARTPROFILE | ||||
|    /* TODO: this could be better */ | ||||
| @@ -609,7 +560,15 @@ static GLboolean set_buffer( GLcontext* ctx, GLenum mode ) | ||||
|    else { | ||||
|       return GL_FALSE; | ||||
|    } | ||||
|    ENDPROFILE(set_buffer) | ||||
|    ENDPROFILE(set_draw_buffer) | ||||
| } | ||||
|  | ||||
|  | ||||
| static void set_read_buffer(GLcontext *ctx, GLframebuffer *colorBuffer, | ||||
|                             GLenum buffer ) | ||||
| { | ||||
|    /* XXX todo */ | ||||
|    return; | ||||
| } | ||||
|  | ||||
|  | ||||
| @@ -711,7 +670,7 @@ extern points_func choose_points_function( GLcontext* ctx ) | ||||
| { | ||||
|     STARTPROFILE | ||||
|         if (ctx->Point.Size==1.0 && !ctx->Point.SmoothFlag && ctx->RasterMask==0 | ||||
|             && !ctx->Texture.Enabled  && ctx->Visual->RGBAflag) { | ||||
|             && !ctx->Texture.ReallyEnabled  && ctx->Visual->RGBAflag) { | ||||
|             ENDPROFILE(choose_points_function) | ||||
|                 return fast_rgb_points; | ||||
|         } | ||||
| @@ -769,7 +728,7 @@ static line_func choose_line_function( GLcontext* ctx ) | ||||
|     STARTPROFILE | ||||
|     if (ctx->Line.Width==1.0 && !ctx->Line.SmoothFlag && !ctx->Line.StippleFlag | ||||
|         && ctx->Light.ShadeModel==GL_FLAT && ctx->RasterMask==0 | ||||
|         && !ctx->Texture.Enabled && Current->rgb_flag) { | ||||
|         && !ctx->Texture.ReallyEnabled && Current->rgb_flag) { | ||||
|        ENDPROFILE(choose_line_function) | ||||
|        return fast_flat_rgb_line; | ||||
|     } | ||||
| @@ -1176,7 +1135,8 @@ void setup_DD_pointers( GLcontext* ctx ) | ||||
|  | ||||
|     ctx->Driver.Dither = dither; | ||||
|  | ||||
|     ctx->Driver.SetBuffer = set_buffer; | ||||
|     ctx->Driver.SetDrawBuffer = set_draw_buffer; | ||||
|     ctx->Driver.SetReadBuffer = set_read_buffer; | ||||
|     ctx->Driver.GetBufferSize = buffer_size; | ||||
|  | ||||
|     ctx->Driver.PointsFunc = choose_points_function(ctx); | ||||
| @@ -1364,7 +1324,11 @@ WMesaContext WMesaCreateContext( HWND hWnd, HPALETTE* Pal, | ||||
|         return NULL; | ||||
|     } | ||||
|  | ||||
|     c->gl_buffer = gl_create_framebuffer( c->gl_visual ); | ||||
|     c->gl_buffer = gl_create_framebuffer( c->gl_visual, | ||||
|                                           c->gl_visual->DepthBits > 0, | ||||
|                                           c->gl_visual->StencilBits > 0, | ||||
|                                           c->gl_visual->AccumRedBits > 0, | ||||
|                                           c->gl_visual->AlphaBits > 0 ); | ||||
|     if (!c->gl_buffer) { | ||||
|         gl_destroy_visual( c->gl_visual ); | ||||
|         gl_destroy_context( c->gl_ctx ); | ||||
| @@ -2153,6 +2117,7 @@ static void smooth_8A8B8G8R_z_triangle( GLcontext *ctx, | ||||
| { | ||||
|     WMesaContext wmesa = (WMesaContext) ctx->DriverCtx; | ||||
| #define INTERP_Z 1 | ||||
| #define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE | ||||
| #define INTERP_RGB 1 | ||||
| #define PIXEL_ADDRESS(X,Y) PIXELADDR4(X,Y) | ||||
| #define PIXEL_TYPE GLuint | ||||
| @@ -2907,7 +2872,7 @@ static triangle_func choose_triangle_function( GLcontext *ctx ) | ||||
|     int depth = wmesa->cColorBits; | ||||
|  | ||||
|     if (ctx->Polygon.SmoothFlag)     return NULL; | ||||
|     if (ctx->Texture.Enabled)        return NULL; | ||||
|     if (ctx->Texture.ReallyEnabled)  return NULL; | ||||
|     if (!wmesa->db_flag) return NULL; | ||||
|     /*if (wmesa->xm_buffer->buffer==XIMAGE)*/ { | ||||
|     if (   ctx->Light.ShadeModel==GL_SMOOTH | ||||
|   | ||||
| @@ -458,7 +458,7 @@ extern points_func choose_points_function( GLcontext* ctx ) | ||||
| { | ||||
|    STARTPROFILE | ||||
|    if (ctx->Point.Size==1.0 && !ctx->Point.SmoothFlag && ctx->RasterMask==0 | ||||
|        && !ctx->Texture.Enabled  && ctx->Visual->RGBAflag) { | ||||
|        && !ctx->Texture.ReallyEnabled  && ctx->Visual->RGBAflag) { | ||||
|    ENDPROFILE(choose_points_function) | ||||
|       return fast_rgb_points; | ||||
|    } | ||||
| @@ -516,7 +516,7 @@ static line_func choose_line_function( GLcontext* ctx ) | ||||
| 	STARTPROFILE | ||||
|    if (ctx->Line.Width==1.0 && !ctx->Line.SmoothFlag && !ctx->Line.StippleFlag | ||||
|        && ctx->Light.ShadeModel==GL_FLAT && ctx->RasterMask==0 | ||||
|        && !ctx->Texture.Enabled && Current->rgb_flag) { | ||||
|        && !ctx->Texture.ReallyEnabled && Current->rgb_flag) { | ||||
|    ENDPROFILE(choose_line_function) | ||||
|       return fast_flat_rgb_line; | ||||
|    } | ||||
| @@ -627,7 +627,7 @@ static triangle_func choose_triangle_function( GLcontext *ctx ) | ||||
| { | ||||
|    if (ctx->Polygon.SmoothFlag)     return NULL; | ||||
|    if (ctx->Polygon.StippleFlag)    return NULL; | ||||
|    if (ctx->Texture.Enabled)        return NULL; | ||||
|    if (ctx->Texture.ReallyEnabled)  return NULL; | ||||
|  | ||||
|    if (ctx->RasterMask==DEPTH_BIT | ||||
|        && ctx->Depth.Func==GL_LESS | ||||
| @@ -698,7 +698,7 @@ static polygon_func choose_polygon_function( GLcontext* ctx ) | ||||
| 	STARTPROFILE | ||||
|    if (!ctx->Polygon.SmoothFlag && !ctx->Polygon.StippleFlag | ||||
|        && ctx->Light.ShadeModel==GL_FLAT && ctx->RasterMask==0 | ||||
|        && !ctx->Texture.Enabled && Current->rgb_flag==GL_TRUE) { | ||||
|        && !ctx->Texture.ReallyEnabled && Current->rgb_flag==GL_TRUE) { | ||||
|    ENDPROFILE(choose_polygon_function) | ||||
|       return fast_flat_rgb_polygon; | ||||
|    } | ||||
|   | ||||
| @@ -1,8 +1,8 @@ | ||||
| /* $Id: fakeglx.c,v 1.34 2000/06/08 22:50:28 brianp Exp $ */ | ||||
| /* $Id: fakeglx.c,v 1.34.4.4 2000/11/03 02:35:54 brianp Exp $ */ | ||||
|  | ||||
| /* | ||||
|  * Mesa 3-D graphics library | ||||
|  * Version:  3.3 | ||||
|  * Version:  3.4 | ||||
|  *  | ||||
|  * Copyright (C) 1999-2000  Brian Paul   All Rights Reserved. | ||||
|  *  | ||||
| @@ -31,7 +31,7 @@ | ||||
|  * | ||||
|  * Thanks to the contributors: | ||||
|  * | ||||
|  * Initial version:  Philip Brown (philb@CSUA.Berkeley.EDU) | ||||
|  * Initial version:  Philip Brown (phil@bolthole.com) | ||||
|  * Better glXGetConfig() support: Armin Liebchen (liebchen@asylum.cs.utah.edu) | ||||
|  * Further visual-handling refinements: Wolfram Gloger | ||||
|  *    (wmglo@Dent.MED.Uni-Muenchen.DE). | ||||
| @@ -65,7 +65,7 @@ | ||||
| #define SERVER_MINOR_VERSION 3 | ||||
|  | ||||
| /* This is appended onto the glXGetClient/ServerString version strings. */ | ||||
| #define MESA_GLX_VERSION "Mesa 3.3" | ||||
| #define MESA_GLX_VERSION "Mesa 3.4" | ||||
|  | ||||
| /* Who implemented this GLX? */ | ||||
| #define VENDOR "Brian Paul" | ||||
| @@ -858,7 +858,7 @@ Fake_glXChooseVisual( Display *dpy, int screen, int *list ) | ||||
|    int *parselist; | ||||
|    XVisualInfo *vis; | ||||
|    int min_ci = 0; | ||||
|    int min_red=0, min_green=0, min_blue=0; | ||||
|    int min_red=0, min_green=0, min_blue=0, min_alpha=0; | ||||
|    GLboolean rgb_flag = GL_FALSE; | ||||
|    GLboolean alpha_flag = GL_FALSE; | ||||
|    GLboolean double_flag = GL_FALSE; | ||||
| @@ -922,10 +922,8 @@ Fake_glXChooseVisual( Display *dpy, int screen, int *list ) | ||||
| 	    break; | ||||
| 	 case GLX_ALPHA_SIZE: | ||||
| 	    parselist++; | ||||
|             { | ||||
|                GLint size = *parselist++; | ||||
|                alpha_flag = size>0 ? 1 : 0; | ||||
|             } | ||||
|             min_alpha = *parselist++; | ||||
|             alpha_flag = (min_alpha > 0); | ||||
| 	    break; | ||||
| 	 case GLX_DEPTH_SIZE: | ||||
| 	    parselist++; | ||||
| @@ -1004,6 +1002,16 @@ Fake_glXChooseVisual( Display *dpy, int screen, int *list ) | ||||
|       } | ||||
|    } | ||||
|  | ||||
|    /* DEBUG | ||||
|    printf("glXChooseVisual:\n"); | ||||
|    printf("  GLX_RED_SIZE = %d\n", min_red); | ||||
|    printf("  GLX_GREEN_SIZE = %d\n", min_green); | ||||
|    printf("  GLX_BLUE_SIZE = %d\n", min_blue); | ||||
|    printf("  GLX_ALPHA_SIZE = %d\n", min_alpha); | ||||
|    printf("  GLX_DEPTH_SIZE = %d\n", depth_size); | ||||
|    printf("  GLX_STENCIL_SIZE = %d\n", stencil_size); | ||||
|    */ | ||||
|  | ||||
|    /* | ||||
|     * Since we're only simulating the GLX extension this function will never | ||||
|     * find any real GL visuals.  Instead, all we can do is try to find an RGB | ||||
| @@ -1050,15 +1058,32 @@ Fake_glXChooseVisual( Display *dpy, int screen, int *list ) | ||||
|    if (vis) { | ||||
|       /* Note: we're not exactly obeying the glXChooseVisual rules here. | ||||
|        * When GLX_DEPTH_SIZE = 1 is specified we're supposed to choose the | ||||
|        * largest depth buffer size, which is 32bits/value.  However, we | ||||
|        * largest depth buffer size, which is 32bits/value.  Instead, we | ||||
|        * return 16 to maintain performance with earlier versions of Mesa. | ||||
|        */ | ||||
|       if (depth_size == 1) | ||||
|          depth_size = DEFAULT_SOFTWARE_DEPTH_BITS; | ||||
|       else if (depth_size > 24) | ||||
|          depth_size = 31; | ||||
|       if (depth_size > 24) | ||||
|          depth_size = 31;   /* 32 causes int overflow problems */ | ||||
|       else if (depth_size > 16) | ||||
|          depth_size = 24; | ||||
|       else if (depth_size > 0) | ||||
|          depth_size = DEFAULT_SOFTWARE_DEPTH_BITS; /*16*/ | ||||
|  | ||||
|       /* If using Glide, make sure we don't try to setup an impossible | ||||
|        * visual.  This fixes the Q3 bug in which 24-bit Z was being reported. | ||||
|        */ | ||||
|       { | ||||
|          const char *fx = getenv("MESA_GLX_FX"); | ||||
|          if (fx && fx[0] != 'd') | ||||
|             if (depth_size > 16 || | ||||
|                 stencil_size > 0 || | ||||
|                 (min_red > 1 && min_red > 5) || | ||||
|                 (min_green > 1 && min_green > 6) || | ||||
|                 (min_blue > 1 && min_blue > 5) || | ||||
|                 alpha_flag) | ||||
|                return NULL; | ||||
|       } | ||||
|  | ||||
|  | ||||
|       /* we only support one size of stencil and accum buffers. */ | ||||
|       if (stencil_size > 0) | ||||
|          stencil_size = STENCIL_BITS; | ||||
|   | ||||
| @@ -1,8 +1,8 @@ | ||||
| /* $Id: xfonts.c,v 1.6 2000/04/19 01:44:02 brianp Exp $ */ | ||||
| /* $Id: xfonts.c,v 1.6.4.2 2000/08/13 03:54:04 brianp Exp $ */ | ||||
|  | ||||
| /* | ||||
|  * Mesa 3-D graphics library | ||||
|  * Version:  3.3 | ||||
|  * Version:  3.4 | ||||
|  * | ||||
|  * Copyright (C) 1999-2000  Brian Paul   All Rights Reserved. | ||||
|  * | ||||
| @@ -41,11 +41,9 @@ | ||||
| #include <X11/Xutil.h> | ||||
| #include "GL/gl.h" | ||||
| #include "GL/glx.h" | ||||
| #include "GL/xmesa.h" | ||||
| #include "context.h" | ||||
| #include "mem.h" | ||||
| #include "xfonts.h" | ||||
| #include "xmesaP.h" | ||||
|  | ||||
|  | ||||
| /* Some debugging info.  */ | ||||
| @@ -223,7 +221,6 @@ static XCharStruct *isvalid(XFontStruct *fs, int which) | ||||
|  | ||||
| void Fake_glXUseXFont( Font font, int first, int count, int listbase ) | ||||
| { | ||||
|   XMesaContext CC; | ||||
|   Display *dpy; | ||||
|   Window win; | ||||
|   Pixmap pixmap; | ||||
| @@ -231,26 +228,23 @@ void Fake_glXUseXFont( Font font, int first, int count, int listbase ) | ||||
|   XGCValues values; | ||||
|   unsigned long valuemask; | ||||
|   XFontStruct *fs; | ||||
|  | ||||
|   GLint swapbytes, lsbfirst, rowlength; | ||||
|   GLint skiprows, skippixels, alignment; | ||||
|  | ||||
|   unsigned int max_width, max_height, max_bm_width, max_bm_height; | ||||
|   GLubyte *bm; | ||||
|  | ||||
|   int i; | ||||
|  | ||||
|   CC = XMesaGetCurrentContext(); | ||||
|   dpy = CC->display; | ||||
|   win = CC->xm_buffer->frontbuffer; | ||||
|   dpy = glXGetCurrentDisplay(); | ||||
|   if (!dpy) | ||||
|      return;  /* I guess glXMakeCurrent wasn't called */ | ||||
|   win = RootWindow(dpy, DefaultScreen(dpy)); | ||||
|  | ||||
|   fs = XQueryFont (dpy, font); | ||||
|   if (!fs) | ||||
|     { | ||||
|       gl_error (CC->gl_ctx, GL_INVALID_VALUE, | ||||
|                 "Couldn't get font structure information"); | ||||
|   if (!fs) { | ||||
|       gl_error(NULL, GL_INVALID_VALUE, | ||||
|                "Couldn't get font structure information"); | ||||
|       return; | ||||
|     } | ||||
|   } | ||||
|  | ||||
|   /* Allocate a bitmap that can fit all characters.  */ | ||||
|   max_width = fs->max_bounds.rbearing - fs->min_bounds.lbearing; | ||||
| @@ -262,10 +256,10 @@ void Fake_glXUseXFont( Font font, int first, int count, int listbase ) | ||||
| (GLubyte)); | ||||
|   if (!bm) { | ||||
|       XFreeFontInfo( NULL, fs, 0 ); | ||||
|       gl_error (CC->gl_ctx, GL_OUT_OF_MEMORY, | ||||
|       gl_error(NULL, GL_OUT_OF_MEMORY, | ||||
|                 "Couldn't allocate bitmap in glXUseXFont()"); | ||||
|       return; | ||||
|     } | ||||
|   } | ||||
|  | ||||
| #if 0 | ||||
|   /* get the page info */ | ||||
| @@ -387,16 +381,3 @@ bm_height); | ||||
|   glPixelStorei(GL_UNPACK_SKIP_PIXELS, skippixels); | ||||
|   glPixelStorei(GL_UNPACK_ALIGNMENT, alignment); | ||||
| } | ||||
|  | ||||
|  | ||||
| extern void xmesa_xfonts_dummy( void ); | ||||
| void xmesa_xfonts_dummy( void ) | ||||
| { | ||||
|    /* silence unused var warnings */ | ||||
|    (void) kernel8; | ||||
|    (void) DitherValues; | ||||
|    (void) HPCR_DRGB; | ||||
|    (void) kernel1; | ||||
| } | ||||
|  | ||||
| /* The End. */ | ||||
|   | ||||
| @@ -1,8 +1,8 @@ | ||||
| /* $Id: glapi.c,v 1.42 2000/05/24 17:53:30 brianp Exp $ */ | ||||
| /* $Id: glapi.c,v 1.42.4.1 2000/10/19 20:14:57 brianp Exp $ */ | ||||
|  | ||||
| /* | ||||
|  * Mesa 3-D graphics library | ||||
|  * Version:  3.3 | ||||
|  * Version:  3.4 | ||||
|  * | ||||
|  * Copyright (C) 1999-2000  Brian Paul   All Rights Reserved. | ||||
|  * | ||||
| @@ -1479,11 +1479,13 @@ get_static_proc_offset(const char *funcName) | ||||
| static GLvoid * | ||||
| get_static_proc_address(const char *funcName) | ||||
| { | ||||
|    GLint i = get_static_proc_offset(funcName); | ||||
|    if (i >= 0) | ||||
|       return static_functions[i].Address; | ||||
|    else | ||||
|       return NULL; | ||||
|    GLint i; | ||||
|    for (i = 0; static_functions[i].Name; i++) { | ||||
|       if (strcmp(static_functions[i].Name, funcName) == 0) { | ||||
|          return static_functions[i].Address; | ||||
|       } | ||||
|    } | ||||
|    return NULL; | ||||
| } | ||||
|  | ||||
|  | ||||
|   | ||||
| @@ -1,9 +1,9 @@ | ||||
| #!/usr/bin/env python | ||||
|  | ||||
| # $Id: glx86asm.py,v 1.1 2000/05/11 23:14:57 brianp Exp $ | ||||
| # $Id: glx86asm.py,v 1.1.4.1 2000/09/06 17:33:32 brianp Exp $ | ||||
|  | ||||
| # Mesa 3-D graphics library | ||||
| # Version:  3.3 | ||||
| # Version:  3.4 | ||||
| #  | ||||
| # Copyright (C) 1999-2000  Brian Paul   All Rights Reserved. | ||||
| #  | ||||
| @@ -48,9 +48,9 @@ def PrintHead(): | ||||
| 	print '#ifndef __WIN32__' | ||||
| 	print '' | ||||
| 	print '#if defined(USE_MGL_NAMESPACE)' | ||||
| 	print '#define GL_PREFIX(n) GLNAME(mgl ## n)' | ||||
| 	print '#define GL_PREFIX(n) GLNAME(CONCAT(mgl,n))' | ||||
| 	print '#else' | ||||
| 	print '#define GL_PREFIX(n) GLNAME(gl ## n)' | ||||
| 	print '#define GL_PREFIX(n) GLNAME(CONCAT(gl,n))' | ||||
| 	print '#endif' | ||||
| 	print '' | ||||
| 	print '#define GL_OFFSET(x) CODEPTR(REGOFF(4 * x, EAX))' | ||||
|   | ||||
| @@ -1,8 +1,8 @@ | ||||
| /* $Id: accum.c,v 1.23 2000/07/15 03:14:25 brianp Exp $ */ | ||||
| /* $Id: accum.c,v 1.23.2.1 2000/10/17 00:24:11 brianp Exp $ */ | ||||
|  | ||||
| /* | ||||
|  * Mesa 3-D graphics library | ||||
|  * Version:  3.3 | ||||
|  * Version:  3.4 | ||||
|  *  | ||||
|  * Copyright (C) 1999-2000  Brian Paul   All Rights Reserved. | ||||
|  *  | ||||
| @@ -235,6 +235,8 @@ _mesa_Accum( GLenum op, GLfloat value ) | ||||
|          if (ctx->IntegerAccumMode && value != ctx->IntegerAccumScaler) | ||||
|             rescale_accum(ctx); | ||||
|              | ||||
|          RENDER_START(ctx); | ||||
|  | ||||
|          if (ctx->IntegerAccumMode) { | ||||
|             /* simply add integer color values into accum buffer */ | ||||
|             GLuint j; | ||||
| @@ -278,6 +280,7 @@ _mesa_Accum( GLenum op, GLfloat value ) | ||||
|          /* restore read buffer = draw buffer (the default) */ | ||||
|          (*ctx->Driver.SetReadBuffer)( ctx, ctx->DrawBuffer, | ||||
|                                        ctx->Color.DriverDrawBuffer ); | ||||
|          RENDER_FINISH(ctx); | ||||
| 	 break; | ||||
|  | ||||
|       case GL_LOAD: | ||||
| @@ -298,6 +301,7 @@ _mesa_Accum( GLenum op, GLfloat value ) | ||||
|             ctx->IntegerAccumScaler = 0.0; | ||||
|          } | ||||
|  | ||||
|          RENDER_START(ctx); | ||||
|          if (ctx->IntegerAccumMode) { | ||||
|             /* just copy values into accum buffer */ | ||||
|             GLuint j; | ||||
| @@ -341,6 +345,7 @@ _mesa_Accum( GLenum op, GLfloat value ) | ||||
|          /* restore read buffer = draw buffer (the default) */ | ||||
|          (*ctx->Driver.SetReadBuffer)( ctx, ctx->DrawBuffer, | ||||
|                                        ctx->Color.DriverDrawBuffer ); | ||||
|          RENDER_FINISH(ctx); | ||||
| 	 break; | ||||
|  | ||||
|       case GL_RETURN: | ||||
| @@ -348,6 +353,7 @@ _mesa_Accum( GLenum op, GLfloat value ) | ||||
|          if (ctx->IntegerAccumMode && value != 1.0) | ||||
|             rescale_accum(ctx); | ||||
|  | ||||
|          RENDER_START(ctx); | ||||
|          if (ctx->IntegerAccumMode && ctx->IntegerAccumScaler > 0) { | ||||
|             /* build lookup table to avoid many floating point multiplies */ | ||||
|             const GLfloat mult = ctx->IntegerAccumScaler; | ||||
| @@ -411,6 +417,7 @@ _mesa_Accum( GLenum op, GLfloat value ) | ||||
|                ypos++; | ||||
|             } | ||||
| 	 } | ||||
|          RENDER_FINISH(ctx); | ||||
| 	 break; | ||||
|  | ||||
|       default: | ||||
|   | ||||
| @@ -1,8 +1,8 @@ | ||||
| /* $Id: attrib.c,v 1.25 2000/07/19 18:34:00 brianp Exp $ */ | ||||
| /* $Id: attrib.c,v 1.25.2.1 2000/09/28 22:39:41 brianp Exp $ */ | ||||
|  | ||||
| /* | ||||
|  * Mesa 3-D graphics library | ||||
|  * Version:  3.3 | ||||
|  * Version:  3.4 | ||||
|  *  | ||||
|  * Copyright (C) 1999-2000  Brian Paul   All Rights Reserved. | ||||
|  *  | ||||
| @@ -213,8 +213,8 @@ _mesa_PushAttrib(GLbitfield mask) | ||||
|       attr->RescaleNormals = ctx->Transform.RescaleNormals; | ||||
|       attr->Scissor = ctx->Scissor.Enabled; | ||||
|       attr->Stencil = ctx->Stencil.Enabled; | ||||
|       attr->Texture = ctx->Texture.Enabled; | ||||
|       for (i=0; i<MAX_TEXTURE_UNITS; i++) { | ||||
|          attr->Texture[i] = ctx->Texture.Unit[i].Enabled; | ||||
|          attr->TexGen[i] = ctx->Texture.Unit[i].TexGenEnabled; | ||||
|       } | ||||
|       newnode = new_attrib_node( GL_ENABLE_BIT ); | ||||
| @@ -393,6 +393,148 @@ _mesa_PushAttrib(GLbitfield mask) | ||||
|  | ||||
|  | ||||
|  | ||||
| static void | ||||
| pop_enable_group(GLcontext *ctx, const struct gl_enable_attrib *enable) | ||||
| { | ||||
|    GLuint i; | ||||
|  | ||||
| #define TEST_AND_UPDATE(VALUE, NEWVALUE, ENUM)		\ | ||||
| 	if ((VALUE) != (NEWVALUE)) {			\ | ||||
| 	   _mesa_set_enable( ctx, ENUM, (NEWVALUE) );	\ | ||||
| 	} | ||||
|  | ||||
|    TEST_AND_UPDATE(ctx->Color.AlphaEnabled, enable->AlphaTest, GL_ALPHA_TEST); | ||||
|    TEST_AND_UPDATE(ctx->Transform.Normalize, enable->AutoNormal, GL_NORMALIZE); | ||||
|    TEST_AND_UPDATE(ctx->Color.BlendEnabled, enable->Blend, GL_BLEND); | ||||
|  | ||||
|    for (i=0;i<MAX_CLIP_PLANES;i++) { | ||||
|       if (ctx->Transform.ClipEnabled[i] != enable->ClipPlane[i]) | ||||
|          _mesa_set_enable(ctx, (GLenum) (GL_CLIP_PLANE0 + i), | ||||
|                           enable->ClipPlane[i]); | ||||
|    } | ||||
|  | ||||
|    TEST_AND_UPDATE(ctx->Light.ColorMaterialEnabled, enable->ColorMaterial, | ||||
|                    GL_COLOR_MATERIAL); | ||||
|    TEST_AND_UPDATE(ctx->Polygon.CullFlag, enable->CullFace, GL_CULL_FACE); | ||||
|    TEST_AND_UPDATE(ctx->Depth.Test, enable->DepthTest, GL_DEPTH_TEST); | ||||
|    TEST_AND_UPDATE(ctx->Color.DitherFlag, enable->Dither, GL_DITHER); | ||||
|    TEST_AND_UPDATE(ctx->Pixel.Convolution1DEnabled, enable->Convolution1D, | ||||
|                    GL_CONVOLUTION_1D); | ||||
|    TEST_AND_UPDATE(ctx->Pixel.Convolution2DEnabled, enable->Convolution2D, | ||||
|                    GL_CONVOLUTION_2D); | ||||
|    TEST_AND_UPDATE(ctx->Pixel.Separable2DEnabled, enable->Separable2D, | ||||
|                    GL_SEPARABLE_2D); | ||||
|    TEST_AND_UPDATE(ctx->Fog.Enabled, enable->Fog, GL_FOG); | ||||
|    TEST_AND_UPDATE(ctx->Light.Enabled, enable->Lighting, GL_LIGHTING); | ||||
|    TEST_AND_UPDATE(ctx->Line.SmoothFlag, enable->LineSmooth, GL_LINE_SMOOTH); | ||||
|    TEST_AND_UPDATE(ctx->Line.StippleFlag, enable->LineStipple, | ||||
|                    GL_LINE_STIPPLE); | ||||
|    TEST_AND_UPDATE(ctx->Color.IndexLogicOpEnabled, enable->IndexLogicOp, | ||||
|                    GL_INDEX_LOGIC_OP); | ||||
|    TEST_AND_UPDATE(ctx->Color.ColorLogicOpEnabled, enable->ColorLogicOp, | ||||
|                    GL_COLOR_LOGIC_OP); | ||||
|    TEST_AND_UPDATE(ctx->Eval.Map1Color4, enable->Map1Color4, GL_MAP1_COLOR_4); | ||||
|    TEST_AND_UPDATE(ctx->Eval.Map1Index, enable->Map1Index, GL_MAP1_INDEX); | ||||
|    TEST_AND_UPDATE(ctx->Eval.Map1Normal, enable->Map1Normal, GL_MAP1_NORMAL); | ||||
|    TEST_AND_UPDATE(ctx->Eval.Map1TextureCoord1, enable->Map1TextureCoord1, | ||||
|                    GL_MAP1_TEXTURE_COORD_1); | ||||
|    TEST_AND_UPDATE(ctx->Eval.Map1TextureCoord2, enable->Map1TextureCoord2, | ||||
|                    GL_MAP1_TEXTURE_COORD_2); | ||||
|    TEST_AND_UPDATE(ctx->Eval.Map1TextureCoord3, enable->Map1TextureCoord3, | ||||
|                    GL_MAP1_TEXTURE_COORD_3); | ||||
|    TEST_AND_UPDATE(ctx->Eval.Map1TextureCoord4, enable->Map1TextureCoord4, | ||||
|                    GL_MAP1_TEXTURE_COORD_4); | ||||
|    TEST_AND_UPDATE(ctx->Eval.Map1Vertex3, enable->Map1Vertex3, | ||||
|                    GL_MAP1_VERTEX_3); | ||||
|    TEST_AND_UPDATE(ctx->Eval.Map1Vertex4, enable->Map1Vertex4, | ||||
|                    GL_MAP1_VERTEX_4); | ||||
|    TEST_AND_UPDATE(ctx->Eval.Map2Color4, enable->Map2Color4, GL_MAP2_COLOR_4); | ||||
|    TEST_AND_UPDATE(ctx->Eval.Map2Index, enable->Map2Index, GL_MAP2_INDEX); | ||||
|    TEST_AND_UPDATE(ctx->Eval.Map2Normal, enable->Map2Normal, GL_MAP2_NORMAL); | ||||
|    TEST_AND_UPDATE(ctx->Eval.Map2TextureCoord1, enable->Map2TextureCoord1, | ||||
|                    GL_MAP2_TEXTURE_COORD_1); | ||||
|    TEST_AND_UPDATE(ctx->Eval.Map2TextureCoord2, enable->Map2TextureCoord2, | ||||
|                    GL_MAP2_TEXTURE_COORD_2); | ||||
|    TEST_AND_UPDATE(ctx->Eval.Map2TextureCoord3, enable->Map2TextureCoord3, | ||||
|                    GL_MAP2_TEXTURE_COORD_3); | ||||
|    TEST_AND_UPDATE(ctx->Eval.Map2TextureCoord4, enable->Map2TextureCoord4, | ||||
|                    GL_MAP2_TEXTURE_COORD_4); | ||||
|    TEST_AND_UPDATE(ctx->Eval.Map2Vertex3, enable->Map2Vertex3, | ||||
|                    GL_MAP2_VERTEX_3); | ||||
|    TEST_AND_UPDATE(ctx->Eval.Map2Vertex4, enable->Map2Vertex4, | ||||
|                    GL_MAP2_VERTEX_4); | ||||
|    TEST_AND_UPDATE(ctx->Transform.Normalize, enable->Normalize, GL_NORMALIZE); | ||||
|    TEST_AND_UPDATE(ctx->Transform.RescaleNormals, enable->RescaleNormals, | ||||
|                    GL_RESCALE_NORMAL_EXT); | ||||
|    TEST_AND_UPDATE(ctx->Pixel.PixelTextureEnabled, enable->PixelTexture, | ||||
|                    GL_POINT_SMOOTH); | ||||
|    TEST_AND_UPDATE(ctx->Point.SmoothFlag, enable->PointSmooth, | ||||
|                    GL_POINT_SMOOTH); | ||||
|    TEST_AND_UPDATE(ctx->Polygon.OffsetPoint, enable->PolygonOffsetPoint, | ||||
|                    GL_POLYGON_OFFSET_POINT); | ||||
|    TEST_AND_UPDATE(ctx->Polygon.OffsetLine, enable->PolygonOffsetLine, | ||||
|                    GL_POLYGON_OFFSET_LINE); | ||||
|    TEST_AND_UPDATE(ctx->Polygon.OffsetFill, enable->PolygonOffsetFill, | ||||
|                    GL_POLYGON_OFFSET_FILL); | ||||
|    TEST_AND_UPDATE(ctx->Polygon.SmoothFlag, enable->PolygonSmooth, | ||||
|                    GL_POLYGON_SMOOTH); | ||||
|    TEST_AND_UPDATE(ctx->Polygon.StippleFlag, enable->PolygonStipple, | ||||
|                    GL_POLYGON_STIPPLE); | ||||
|    TEST_AND_UPDATE(ctx->Scissor.Enabled, enable->Scissor, GL_SCISSOR_TEST); | ||||
|    TEST_AND_UPDATE(ctx->Stencil.Enabled, enable->Stencil, GL_STENCIL_TEST); | ||||
| #undef TEST_AND_UPDATE | ||||
|  | ||||
|    /* texture unit enables */ | ||||
|    for (i = 0; i < ctx->Const.MaxTextureUnits; i++) { | ||||
|       if (ctx->Texture.Unit[i].Enabled != enable->Texture[i]) { | ||||
|          ctx->Texture.Unit[i].Enabled = enable->Texture[i]; | ||||
|          if (ctx->Driver.Enable) { | ||||
|             if (ctx->Driver.ActiveTexture) { | ||||
|                (*ctx->Driver.ActiveTexture)(ctx, i); | ||||
|             } | ||||
|             (*ctx->Driver.Enable)( ctx, GL_TEXTURE_1D, | ||||
|                              (GLboolean) (enable->Texture[i] & TEXTURE0_1D) ); | ||||
|             (*ctx->Driver.Enable)( ctx, GL_TEXTURE_2D, | ||||
|                              (GLboolean) (enable->Texture[i] & TEXTURE0_2D) ); | ||||
|             (*ctx->Driver.Enable)( ctx, GL_TEXTURE_3D, | ||||
|                              (GLboolean) (enable->Texture[i] & TEXTURE0_3D) ); | ||||
|          } | ||||
|       } | ||||
|  | ||||
|       if (ctx->Texture.Unit[i].TexGenEnabled != enable->TexGen[i]) { | ||||
|          ctx->Texture.Unit[i].TexGenEnabled = enable->TexGen[i]; | ||||
|          if (ctx->Driver.Enable) { | ||||
|             if (ctx->Driver.ActiveTexture) { | ||||
|                (*ctx->Driver.ActiveTexture)(ctx, i); | ||||
|             } | ||||
|             if (enable->TexGen[i] & S_BIT) | ||||
|                (*ctx->Driver.Enable)( ctx, GL_TEXTURE_GEN_S, GL_TRUE); | ||||
|             else | ||||
|                (*ctx->Driver.Enable)( ctx, GL_TEXTURE_GEN_S, GL_FALSE); | ||||
|             if (enable->TexGen[i] & T_BIT) | ||||
|                (*ctx->Driver.Enable)( ctx, GL_TEXTURE_GEN_T, GL_TRUE); | ||||
|             else | ||||
|                (*ctx->Driver.Enable)( ctx, GL_TEXTURE_GEN_T, GL_FALSE); | ||||
|             if (enable->TexGen[i] & R_BIT) | ||||
|                (*ctx->Driver.Enable)( ctx, GL_TEXTURE_GEN_R, GL_TRUE); | ||||
|             else | ||||
|                (*ctx->Driver.Enable)( ctx, GL_TEXTURE_GEN_R, GL_FALSE); | ||||
|             if (enable->TexGen[i] & Q_BIT) | ||||
|                (*ctx->Driver.Enable)( ctx, GL_TEXTURE_GEN_Q, GL_TRUE); | ||||
|             else | ||||
|                (*ctx->Driver.Enable)( ctx, GL_TEXTURE_GEN_Q, GL_FALSE); | ||||
|          } | ||||
|       } | ||||
|    } | ||||
|  | ||||
|    if (ctx->Driver.ActiveTexture) { | ||||
|       (*ctx->Driver.ActiveTexture)(ctx, ctx->Texture.CurrentUnit); | ||||
|    } | ||||
| } | ||||
|  | ||||
|  | ||||
|  | ||||
|  | ||||
| /* | ||||
|  * This function is kind of long just because we have to call a lot | ||||
|  * of device driver functions to update device driver state. | ||||
| @@ -495,116 +637,7 @@ _mesa_PopAttrib(void) | ||||
|             { | ||||
|                const struct gl_enable_attrib *enable; | ||||
|                enable = (const struct gl_enable_attrib *) attr->data; | ||||
|  | ||||
| #define TEST_AND_UPDATE(VALUE, NEWVALUE, ENUM)		\ | ||||
| 	if ((VALUE) != (NEWVALUE)) {			\ | ||||
| 	   _mesa_set_enable( ctx, ENUM, (NEWVALUE) );	\ | ||||
| 	} | ||||
|  | ||||
|                TEST_AND_UPDATE(ctx->Color.AlphaEnabled, enable->AlphaTest, GL_ALPHA_TEST); | ||||
|                TEST_AND_UPDATE(ctx->Transform.Normalize, enable->AutoNormal, GL_NORMALIZE); | ||||
|                TEST_AND_UPDATE(ctx->Color.BlendEnabled, enable->Blend, GL_BLEND); | ||||
|                { | ||||
|                   GLuint i; | ||||
|                   for (i=0;i<MAX_CLIP_PLANES;i++) { | ||||
|                      if (ctx->Transform.ClipEnabled[i] != enable->ClipPlane[i]) | ||||
|                         _mesa_set_enable( ctx, (GLenum) (GL_CLIP_PLANE0 + i), enable->ClipPlane[i] ); | ||||
|                   } | ||||
|                } | ||||
|                TEST_AND_UPDATE(ctx->Light.ColorMaterialEnabled, enable->ColorMaterial, GL_COLOR_MATERIAL); | ||||
|                TEST_AND_UPDATE(ctx->Polygon.CullFlag, enable->CullFace, GL_CULL_FACE); | ||||
|                TEST_AND_UPDATE(ctx->Depth.Test, enable->DepthTest, GL_DEPTH_TEST); | ||||
|                TEST_AND_UPDATE(ctx->Color.DitherFlag, enable->Dither, GL_DITHER); | ||||
|                TEST_AND_UPDATE(ctx->Pixel.Convolution1DEnabled, enable->Convolution1D, GL_CONVOLUTION_1D); | ||||
|                TEST_AND_UPDATE(ctx->Pixel.Convolution2DEnabled, enable->Convolution2D, GL_CONVOLUTION_2D); | ||||
|                TEST_AND_UPDATE(ctx->Pixel.Separable2DEnabled, enable->Separable2D, GL_SEPARABLE_2D); | ||||
|                TEST_AND_UPDATE(ctx->Fog.Enabled, enable->Fog, GL_FOG); | ||||
|                TEST_AND_UPDATE(ctx->Light.Enabled, enable->Lighting, GL_LIGHTING); | ||||
|                TEST_AND_UPDATE(ctx->Line.SmoothFlag, enable->LineSmooth, GL_LINE_SMOOTH); | ||||
|                TEST_AND_UPDATE(ctx->Line.StippleFlag, enable->LineStipple, GL_LINE_STIPPLE); | ||||
|                TEST_AND_UPDATE(ctx->Color.IndexLogicOpEnabled, enable->IndexLogicOp, GL_INDEX_LOGIC_OP); | ||||
|                TEST_AND_UPDATE(ctx->Color.ColorLogicOpEnabled, enable->ColorLogicOp, GL_COLOR_LOGIC_OP); | ||||
|                TEST_AND_UPDATE(ctx->Eval.Map1Color4, enable->Map1Color4, GL_MAP1_COLOR_4); | ||||
|                TEST_AND_UPDATE(ctx->Eval.Map1Index, enable->Map1Index, GL_MAP1_INDEX); | ||||
|                TEST_AND_UPDATE(ctx->Eval.Map1Normal, enable->Map1Normal, GL_MAP1_NORMAL); | ||||
|                TEST_AND_UPDATE(ctx->Eval.Map1TextureCoord1, enable->Map1TextureCoord1, GL_MAP1_TEXTURE_COORD_1); | ||||
|                TEST_AND_UPDATE(ctx->Eval.Map1TextureCoord2, enable->Map1TextureCoord2, GL_MAP1_TEXTURE_COORD_2); | ||||
|                TEST_AND_UPDATE(ctx->Eval.Map1TextureCoord3, enable->Map1TextureCoord3, GL_MAP1_TEXTURE_COORD_3); | ||||
|                TEST_AND_UPDATE(ctx->Eval.Map1TextureCoord4, enable->Map1TextureCoord4, GL_MAP1_TEXTURE_COORD_4); | ||||
|                TEST_AND_UPDATE(ctx->Eval.Map1Vertex3, enable->Map1Vertex3, GL_MAP1_VERTEX_3); | ||||
|                TEST_AND_UPDATE(ctx->Eval.Map1Vertex4, enable->Map1Vertex4, GL_MAP1_VERTEX_4); | ||||
|                TEST_AND_UPDATE(ctx->Eval.Map2Color4, enable->Map2Color4, GL_MAP2_COLOR_4); | ||||
|                TEST_AND_UPDATE(ctx->Eval.Map2Index, enable->Map2Index, GL_MAP2_INDEX); | ||||
|                TEST_AND_UPDATE(ctx->Eval.Map2Normal, enable->Map2Normal, GL_MAP2_NORMAL); | ||||
|                TEST_AND_UPDATE(ctx->Eval.Map2TextureCoord1, enable->Map2TextureCoord1, GL_MAP2_TEXTURE_COORD_1); | ||||
|                TEST_AND_UPDATE(ctx->Eval.Map2TextureCoord2, enable->Map2TextureCoord2, GL_MAP2_TEXTURE_COORD_2); | ||||
|                TEST_AND_UPDATE(ctx->Eval.Map2TextureCoord3, enable->Map2TextureCoord3, GL_MAP2_TEXTURE_COORD_3); | ||||
|                TEST_AND_UPDATE(ctx->Eval.Map2TextureCoord4, enable->Map2TextureCoord4, GL_MAP2_TEXTURE_COORD_4); | ||||
|                TEST_AND_UPDATE(ctx->Eval.Map2Vertex3, enable->Map2Vertex3, GL_MAP2_VERTEX_3); | ||||
|                TEST_AND_UPDATE(ctx->Eval.Map2Vertex4, enable->Map2Vertex4, GL_MAP2_VERTEX_4); | ||||
|                TEST_AND_UPDATE(ctx->Transform.Normalize, enable->Normalize, GL_NORMALIZE); | ||||
|                TEST_AND_UPDATE(ctx->Transform.RescaleNormals, enable->RescaleNormals, GL_RESCALE_NORMAL_EXT); | ||||
|                TEST_AND_UPDATE(ctx->Pixel.PixelTextureEnabled, enable->PixelTexture, GL_POINT_SMOOTH); | ||||
|                TEST_AND_UPDATE(ctx->Point.SmoothFlag, enable->PointSmooth, GL_POINT_SMOOTH); | ||||
|                TEST_AND_UPDATE(ctx->Polygon.OffsetPoint, enable->PolygonOffsetPoint, GL_POLYGON_OFFSET_POINT); | ||||
|                TEST_AND_UPDATE(ctx->Polygon.OffsetLine, enable->PolygonOffsetLine, GL_POLYGON_OFFSET_LINE); | ||||
|                TEST_AND_UPDATE(ctx->Polygon.OffsetFill, enable->PolygonOffsetFill, GL_POLYGON_OFFSET_FILL); | ||||
|                TEST_AND_UPDATE(ctx->Polygon.SmoothFlag, enable->PolygonSmooth, GL_POLYGON_SMOOTH); | ||||
|                TEST_AND_UPDATE(ctx->Polygon.StippleFlag, enable->PolygonStipple, GL_POLYGON_STIPPLE); | ||||
|                TEST_AND_UPDATE(ctx->Scissor.Enabled, enable->Scissor, GL_SCISSOR_TEST); | ||||
|                TEST_AND_UPDATE(ctx->Stencil.Enabled, enable->Stencil, GL_STENCIL_TEST); | ||||
|                if (ctx->Texture.Enabled != enable->Texture) { | ||||
|                   ctx->Texture.Enabled = enable->Texture; | ||||
|                   if (ctx->Driver.Enable) { | ||||
|                      if (ctx->Driver.ActiveTexture) | ||||
|                         (*ctx->Driver.ActiveTexture)( ctx, 0 ); | ||||
|                      (*ctx->Driver.Enable)( ctx, GL_TEXTURE_1D, (GLboolean) (enable->Texture & TEXTURE0_1D) ); | ||||
|                      (*ctx->Driver.Enable)( ctx, GL_TEXTURE_2D, (GLboolean) (enable->Texture & TEXTURE0_2D) ); | ||||
|                      (*ctx->Driver.Enable)( ctx, GL_TEXTURE_3D, (GLboolean) (enable->Texture & TEXTURE0_3D) ); | ||||
|                      if (ctx->Driver.ActiveTexture) | ||||
|                         (*ctx->Driver.ActiveTexture)( ctx, 1 ); | ||||
|                      (*ctx->Driver.Enable)( ctx, GL_TEXTURE_1D, (GLboolean) (enable->Texture & TEXTURE1_1D) ); | ||||
|                      (*ctx->Driver.Enable)( ctx, GL_TEXTURE_2D, (GLboolean) (enable->Texture & TEXTURE1_2D) ); | ||||
|                      (*ctx->Driver.Enable)( ctx, GL_TEXTURE_3D, (GLboolean) (enable->Texture & TEXTURE1_3D) ); | ||||
|                      if (ctx->Driver.ActiveTexture) | ||||
|                         (*ctx->Driver.ActiveTexture)( ctx, ctx->Texture.CurrentUnit ); | ||||
|                   } | ||||
|                } | ||||
| #undef TEST_AND_UPDATE | ||||
|                { | ||||
|                   GLuint i; | ||||
|                   for (i=0; i<MAX_TEXTURE_UNITS; i++) { | ||||
|                      if (ctx->Texture.Unit[i].TexGenEnabled != enable->TexGen[i]) { | ||||
|                         ctx->Texture.Unit[i].TexGenEnabled = enable->TexGen[i]; | ||||
|  | ||||
| 			/* ctx->Enabled recalculated in state change | ||||
|                            processing */ | ||||
| 			 | ||||
|                         if (ctx->Driver.Enable) { | ||||
|                            if (ctx->Driver.ActiveTexture) | ||||
|                               (*ctx->Driver.ActiveTexture)( ctx, i ); | ||||
|                            if (enable->TexGen[i] & S_BIT) | ||||
|                               (*ctx->Driver.Enable)( ctx, GL_TEXTURE_GEN_S, GL_TRUE); | ||||
|                            else | ||||
|                               (*ctx->Driver.Enable)( ctx, GL_TEXTURE_GEN_S, GL_FALSE); | ||||
|                            if (enable->TexGen[i] & T_BIT) | ||||
|                               (*ctx->Driver.Enable)( ctx, GL_TEXTURE_GEN_T, GL_TRUE); | ||||
|                            else | ||||
|                               (*ctx->Driver.Enable)( ctx, GL_TEXTURE_GEN_T, GL_FALSE); | ||||
|                            if (enable->TexGen[i] & R_BIT) | ||||
|                               (*ctx->Driver.Enable)( ctx, GL_TEXTURE_GEN_R, GL_TRUE); | ||||
|                            else | ||||
|                               (*ctx->Driver.Enable)( ctx, GL_TEXTURE_GEN_R, GL_FALSE); | ||||
|                            if (enable->TexGen[i] & Q_BIT) | ||||
|                               (*ctx->Driver.Enable)( ctx, GL_TEXTURE_GEN_Q, GL_TRUE); | ||||
|                            else | ||||
|                               (*ctx->Driver.Enable)( ctx, GL_TEXTURE_GEN_Q, GL_FALSE); | ||||
|                         } | ||||
|                      } | ||||
|                   } | ||||
|                   if (ctx->Driver.ActiveTexture) | ||||
|                      (*ctx->Driver.ActiveTexture)( ctx, ctx->Texture.CurrentUnit ); | ||||
|                } | ||||
|                pop_enable_group(ctx, enable); | ||||
|             } | ||||
|             break; | ||||
|          case GL_EVAL_BIT: | ||||
|   | ||||
| @@ -1,21 +1,21 @@ | ||||
| /* $Id: blend.c,v 1.16 2000/06/29 22:06:22 brianp Exp $ */ | ||||
| /* $Id: blend.c,v 1.16.4.2 2000/10/22 23:10:49 gareth Exp $ */ | ||||
|  | ||||
| /* | ||||
|  * Mesa 3-D graphics library | ||||
|  * Version:  3.3 | ||||
|  *  | ||||
|  * Copyright (C) 1999  Brian Paul   All Rights Reserved. | ||||
|  *  | ||||
|  * Version:  3.4 | ||||
|  * | ||||
|  * Copyright (C) 1999-2000  Brian Paul   All Rights Reserved. | ||||
|  * | ||||
|  * Permission is hereby granted, free of charge, to any person obtaining a | ||||
|  * copy of this software and associated documentation files (the "Software"), | ||||
|  * to deal in the Software without restriction, including without limitation | ||||
|  * the rights to use, copy, modify, merge, publish, distribute, sublicense, | ||||
|  * and/or sell copies of the Software, and to permit persons to whom the | ||||
|  * Software is furnished to do so, subject to the following conditions: | ||||
|  *  | ||||
|  * | ||||
|  * The above copyright notice and this permission notice shall be included | ||||
|  * in all copies or substantial portions of the Software. | ||||
|  *  | ||||
|  * | ||||
|  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS | ||||
|  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||||
|  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL | ||||
| @@ -289,7 +289,7 @@ _mesa_BlendEquation( GLenum mode ) | ||||
|  | ||||
|    ctx->Color.BlendFunc = NULL; | ||||
|    ctx->NewState |= NEW_RASTER_OPS; | ||||
|     | ||||
|  | ||||
|    if (ctx->Driver.BlendEquation) | ||||
|       ctx->Driver.BlendEquation( ctx, mode ); | ||||
| } | ||||
| @@ -339,11 +339,31 @@ blend_transparency( GLcontext *ctx, GLuint n, const GLubyte mask[], | ||||
|             /* 100% alpha, no-op */ | ||||
|          } | ||||
|          else { | ||||
| #if 0 | ||||
|             /* This is pretty close, but Glean complains */ | ||||
|             const GLint s = CHAN_MAX - t; | ||||
|             const GLint r = (rgba[i][RCOMP] * t + dest[i][RCOMP] * s) >> 8; | ||||
|             const GLint g = (rgba[i][GCOMP] * t + dest[i][GCOMP] * s) >> 8; | ||||
|             const GLint b = (rgba[i][BCOMP] * t + dest[i][BCOMP] * s) >> 8; | ||||
|             const GLint a = (rgba[i][ACOMP] * t + dest[i][ACOMP] * s) >> 8; | ||||
|             const GLint r = (rgba[i][RCOMP] * t + dest[i][RCOMP] * s + 1) >> 8; | ||||
|             const GLint g = (rgba[i][GCOMP] * t + dest[i][GCOMP] * s + 1) >> 8; | ||||
|             const GLint b = (rgba[i][BCOMP] * t + dest[i][BCOMP] * s + 1) >> 8; | ||||
|             const GLint a = (rgba[i][ACOMP] * t + dest[i][ACOMP] * s + 1) >> 8; | ||||
| #elif 0 | ||||
|             /* This is slower but satisfies Glean */ | ||||
|             const GLint s = CHAN_MAX - t; | ||||
|             const GLint r = (rgba[i][RCOMP] * t + dest[i][RCOMP] * s) / 255; | ||||
|             const GLint g = (rgba[i][GCOMP] * t + dest[i][GCOMP] * s) / 255; | ||||
|             const GLint b = (rgba[i][BCOMP] * t + dest[i][BCOMP] * s) / 255; | ||||
|             const GLint a = (rgba[i][ACOMP] * t + dest[i][ACOMP] * s) / 255; | ||||
| #else | ||||
|             /* This satisfies Glean and should be reasonably fast */ | ||||
|             /* Contributed by Nathan Hand */ | ||||
| #define DIV255(X)  (((X) << 8) + (X) + 256) >> 16 | ||||
|             const GLint s = CHAN_MAX - t; | ||||
|             const GLint r = DIV255(rgba[i][RCOMP] * t + dest[i][RCOMP] * s); | ||||
|             const GLint g = DIV255(rgba[i][GCOMP] * t + dest[i][GCOMP] * s); | ||||
|             const GLint b = DIV255(rgba[i][BCOMP] * t + dest[i][BCOMP] * s); | ||||
|             const GLint a = DIV255(rgba[i][ACOMP] * t + dest[i][ACOMP] * s); | ||||
| #undef DIV255 | ||||
| #endif | ||||
|             ASSERT(r <= CHAN_MAX); | ||||
|             ASSERT(g <= CHAN_MAX); | ||||
|             ASSERT(b <= CHAN_MAX); | ||||
| @@ -755,22 +775,22 @@ blend_general( GLcontext *ctx, GLuint n, const GLubyte mask[], | ||||
|  | ||||
|          /* compute blended color */ | ||||
|          if (ctx->Color.BlendEquation==GL_FUNC_ADD_EXT) { | ||||
|             r = Rs * sR + Rd * dR; | ||||
|             g = Gs * sG + Gd * dG; | ||||
|             b = Bs * sB + Bd * dB; | ||||
|             a = As * sA + Ad * dA; | ||||
|             r = Rs * sR + Rd * dR + 0.5F; | ||||
|             g = Gs * sG + Gd * dG + 0.5F; | ||||
|             b = Bs * sB + Bd * dB + 0.5F; | ||||
|             a = As * sA + Ad * dA + 0.5F; | ||||
|          } | ||||
|          else if (ctx->Color.BlendEquation==GL_FUNC_SUBTRACT_EXT) { | ||||
|             r = Rs * sR - Rd * dR; | ||||
|             g = Gs * sG - Gd * dG; | ||||
|             b = Bs * sB - Bd * dB; | ||||
|             a = As * sA - Ad * dA; | ||||
|             r = Rs * sR - Rd * dR + 0.5F; | ||||
|             g = Gs * sG - Gd * dG + 0.5F; | ||||
|             b = Bs * sB - Bd * dB + 0.5F; | ||||
|             a = As * sA - Ad * dA + 0.5F; | ||||
|          } | ||||
|          else if (ctx->Color.BlendEquation==GL_FUNC_REVERSE_SUBTRACT_EXT) { | ||||
|             r = Rd * dR - Rs * sR; | ||||
|             g = Gd * dG - Gs * sG; | ||||
|             b = Bd * dB - Bs * sB; | ||||
|             a = Ad * dA - As * sA; | ||||
|             r = Rd * dR - Rs * sR + 0.5F; | ||||
|             g = Gd * dG - Gs * sG + 0.5F; | ||||
|             b = Bd * dB - Bs * sB + 0.5F; | ||||
|             a = Ad * dA - As * sA + 0.5F; | ||||
|          } | ||||
|          else { | ||||
|             /* should never get here */ | ||||
| @@ -791,7 +811,7 @@ blend_general( GLcontext *ctx, GLuint n, const GLubyte mask[], | ||||
|  | ||||
| #if defined(USE_MMX_ASM) | ||||
| #include "X86/mmx.h" | ||||
| #include "X86/common_x86asm.h" | ||||
| #include "X86/common_x86_asm.h" | ||||
| #endif | ||||
|  | ||||
|  | ||||
| @@ -811,8 +831,8 @@ static void set_blend_function( GLcontext *ctx ) | ||||
|    /* Hmm.  A table here would have 12^4 == way too many entries. | ||||
|     * Provide a hook for MMX instead. | ||||
|     */ | ||||
|    if (gl_x86_cpu_features & GL_CPU_MMX) { | ||||
|       gl_mmx_set_blend_function (ctx); | ||||
|    if ( cpu_has_mmx ) { | ||||
|       gl_mmx_set_blend_function( ctx ); | ||||
|    } | ||||
|    else | ||||
| #endif | ||||
|   | ||||
| @@ -1,7 +1,8 @@ | ||||
| /* $Id: buffers.c,v 1.9.4.2 2000/10/19 18:14:58 brianp Exp $ */ | ||||
|  | ||||
| /* | ||||
|  * Mesa 3-D graphics library | ||||
|  * Version:  3.3 | ||||
|  * Version:  3.4 | ||||
|  *  | ||||
|  * Copyright (C) 1999-2000  Brian Paul   All Rights Reserved. | ||||
|  *  | ||||
| @@ -208,15 +209,19 @@ clear_color_buffers(GLcontext *ctx) | ||||
|       if (bufferBit & ctx->Color.DrawDestMask) { | ||||
|          if (bufferBit == FRONT_LEFT_BIT) { | ||||
|             (void) (*ctx->Driver.SetDrawBuffer)( ctx, GL_FRONT_LEFT); | ||||
|             (void) (*ctx->Driver.SetReadBuffer)( ctx, ctx->DrawBuffer, GL_FRONT_LEFT); | ||||
|          } | ||||
|          else if (bufferBit == FRONT_RIGHT_BIT) { | ||||
|             (void) (*ctx->Driver.SetDrawBuffer)( ctx, GL_FRONT_RIGHT); | ||||
|             (void) (*ctx->Driver.SetReadBuffer)( ctx, ctx->DrawBuffer, GL_FRONT_RIGHT); | ||||
|          } | ||||
|          else if (bufferBit == BACK_LEFT_BIT) { | ||||
|             (void) (*ctx->Driver.SetDrawBuffer)( ctx, GL_BACK_LEFT); | ||||
|             (void) (*ctx->Driver.SetReadBuffer)( ctx, ctx->DrawBuffer, GL_BACK_LEFT); | ||||
|          } | ||||
|          else { | ||||
|             (void) (*ctx->Driver.SetDrawBuffer)( ctx, GL_BACK_RIGHT); | ||||
|             (void) (*ctx->Driver.SetReadBuffer)( ctx, ctx->DrawBuffer, GL_BACK_RIGHT); | ||||
|          } | ||||
|           | ||||
|          if (ctx->Color.SWmasking) { | ||||
| @@ -228,8 +233,9 @@ clear_color_buffers(GLcontext *ctx) | ||||
|       } | ||||
|    } | ||||
|  | ||||
|    /* restore default dest buffer */ | ||||
|    /* restore default read/draw buffers */ | ||||
|    (void) (*ctx->Driver.SetDrawBuffer)( ctx, ctx->Color.DriverDrawBuffer ); | ||||
|    (void) (*ctx->Driver.SetReadBuffer)( ctx, ctx->ReadBuffer, ctx->Pixel.DriverReadBuffer ); | ||||
| } | ||||
|  | ||||
|  | ||||
| @@ -287,6 +293,8 @@ _mesa_Clear( GLbitfield mask ) | ||||
|       } | ||||
| #endif | ||||
|  | ||||
|       RENDER_START(ctx); | ||||
|  | ||||
|       /* do software clearing here */ | ||||
|       if (newMask) { | ||||
|          if (newMask & ctx->Color.DrawDestMask)   clear_color_buffers(ctx); | ||||
| @@ -302,6 +310,8 @@ _mesa_Clear( GLbitfield mask ) | ||||
|          _mesa_clear_alpha_buffers( ctx ); | ||||
|       } | ||||
|  | ||||
|       RENDER_FINISH(ctx); | ||||
|  | ||||
| #ifdef PROFILE | ||||
|       ctx->ClearTime += gl_time() - t0; | ||||
|       ctx->ClearCount++; | ||||
|   | ||||
| @@ -1,8 +1,8 @@ | ||||
| /* $Id: context.c,v 1.79 2000/07/19 20:58:59 brianp Exp $ */ | ||||
| /* $Id: context.c,v 1.79.2.5 2000/10/17 00:24:11 brianp Exp $ */ | ||||
|  | ||||
| /* | ||||
|  * Mesa 3-D graphics library | ||||
|  * Version:  3.3 | ||||
|  * Version:  3.4 | ||||
|  * | ||||
|  * Copyright (C) 1999-2000  Brian Paul   All Rights Reserved. | ||||
|  * | ||||
| @@ -211,10 +211,11 @@ _mesa_initialize_visual( GLvisual *vis, | ||||
|  | ||||
|    if (depthBits == 0) { | ||||
|       /* Special case.  Even if we don't have a depth buffer we need | ||||
|        * good values for DepthMax for Z vertex transformation purposes. | ||||
|        * good values for DepthMax for Z vertex transformation purposes | ||||
|        * and for per-fragment fog computation. | ||||
|        */ | ||||
|       vis->DepthMax = 1; | ||||
|       vis->DepthMaxF = 1.0F; | ||||
|       vis->DepthMax = 1 << 16; | ||||
|       vis->DepthMaxF = (GLfloat) vis->DepthMax; | ||||
|    } | ||||
|    else if (depthBits < 32) { | ||||
|       vis->DepthMax = (1 << depthBits) - 1; | ||||
| @@ -452,8 +453,9 @@ alloc_shared_state( void ) | ||||
|    if (!ss) | ||||
|       return NULL; | ||||
|  | ||||
|    ss->DisplayList = _mesa_NewHashTable(); | ||||
|    _glthread_INIT_MUTEX(ss->Mutex); | ||||
|  | ||||
|    ss->DisplayList = _mesa_NewHashTable(); | ||||
|    ss->TexObjects = _mesa_NewHashTable(); | ||||
|  | ||||
|    /* Default Texture objects */ | ||||
| @@ -593,6 +595,8 @@ init_texture_unit( GLcontext *ctx, GLuint unit ) | ||||
| { | ||||
|    struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit]; | ||||
|  | ||||
|    texUnit->Enabled = 0; | ||||
|    texUnit->ReallyEnabled = 0; | ||||
|    texUnit->EnvMode = GL_MODULATE; | ||||
|    texUnit->CombineModeRGB = GL_MODULATE; | ||||
|    texUnit->CombineModeA = GL_MODULATE; | ||||
| @@ -1149,9 +1153,10 @@ init_attrib_groups( GLcontext *ctx ) | ||||
|    /* Texture group */ | ||||
|    ctx->Texture.CurrentUnit = 0;      /* multitexture */ | ||||
|    ctx->Texture.CurrentTransformUnit = 0; /* multitexture */ | ||||
|    ctx->Texture.Enabled = 0; | ||||
|    ctx->Texture.ReallyEnabled = 0; | ||||
|    for (i=0; i<MAX_TEXTURE_UNITS; i++) | ||||
|       init_texture_unit( ctx, i ); | ||||
|    ctx->Texture.SharedPalette = GL_FALSE; | ||||
|    _mesa_init_colortable(&ctx->Texture.Palette); | ||||
|  | ||||
|    /* Transformation group */ | ||||
| @@ -1376,7 +1381,8 @@ alloc_proxy_textures( GLcontext *ctx ) | ||||
|  | ||||
|  | ||||
| /* | ||||
|  * Initialize a GLcontext struct. | ||||
|  * Initialize a GLcontext struct.  This includes allocating all the | ||||
|  * other structs and arrays which hang off of the context by pointers. | ||||
|  */ | ||||
| GLboolean | ||||
| _mesa_initialize_context( GLcontext *ctx, | ||||
| @@ -1399,7 +1405,6 @@ _mesa_initialize_context( GLcontext *ctx, | ||||
|  | ||||
|    ctx->VB = gl_vb_create_for_immediate( ctx ); | ||||
|    if (!ctx->VB) { | ||||
|       FREE( ctx ); | ||||
|       return GL_FALSE; | ||||
|    } | ||||
|    ctx->input = ctx->VB->IM; | ||||
| @@ -1407,7 +1412,6 @@ _mesa_initialize_context( GLcontext *ctx, | ||||
|    ctx->PB = gl_alloc_pb(); | ||||
|    if (!ctx->PB) { | ||||
|       ALIGN_FREE( ctx->VB ); | ||||
|       FREE( ctx ); | ||||
|       return GL_FALSE; | ||||
|    } | ||||
|  | ||||
| @@ -1421,7 +1425,6 @@ _mesa_initialize_context( GLcontext *ctx, | ||||
|       if (!ctx->Shared) { | ||||
|          ALIGN_FREE( ctx->VB ); | ||||
|          FREE( ctx->PB ); | ||||
|          FREE( ctx ); | ||||
|          return GL_FALSE; | ||||
|       } | ||||
|    } | ||||
| @@ -1453,7 +1456,6 @@ _mesa_initialize_context( GLcontext *ctx, | ||||
|       free_shared_state(ctx, ctx->Shared); | ||||
|       ALIGN_FREE( ctx->VB ); | ||||
|       FREE( ctx->PB ); | ||||
|       FREE( ctx ); | ||||
|       return GL_FALSE; | ||||
|    } | ||||
|  | ||||
| @@ -1484,7 +1486,6 @@ _mesa_initialize_context( GLcontext *ctx, | ||||
|       FREE( ctx->PB ); | ||||
|       if (ctx->Exec) | ||||
|          FREE( ctx->Exec ); | ||||
|       FREE( ctx ); | ||||
|    } | ||||
|    _mesa_init_exec_table(ctx->Exec, dispatchSize); | ||||
|    _mesa_init_dlist_table(ctx->Save, dispatchSize); | ||||
|   | ||||
| @@ -1,7 +1,8 @@ | ||||
| /* $Id: dd.h,v 1.26.4.4 2000/09/28 18:25:00 brianp Exp $ */ | ||||
|  | ||||
| /* | ||||
|  * Mesa 3-D graphics library | ||||
|  * Version:  3.3 | ||||
|  * Version:  3.4 | ||||
|  *  | ||||
|  * Copyright (C) 1999-2000  Brian Paul   All Rights Reserved. | ||||
|  *  | ||||
| @@ -640,18 +641,31 @@ struct dd_function_table { | ||||
|     * Core Mesa will perform any image format/type conversions that are needed. | ||||
|     */ | ||||
|  | ||||
|    GLboolean (*TestProxyTexImage)(GLcontext *ctx, GLenum target, | ||||
|                                   GLint level, GLint internalFormat, | ||||
|                                   GLenum format, GLenum type, | ||||
|                                   GLint width, GLint height, | ||||
|                                   GLint depth, GLint border); | ||||
|    /* Called by glTexImage[123]D when user specifies a proxy texture | ||||
|     * target.  Return GL_TRUE if the proxy test passes, return GL_FALSE | ||||
|     * if the test fails. | ||||
|     */ | ||||
|  | ||||
|    GLboolean (*CompressedTexImage1D)( GLcontext *ctx, GLenum target, | ||||
|                                       GLint level, const GLvoid *data, | ||||
|                                       GLint level, GLsizei imageSize, | ||||
|                                       const GLvoid *data, | ||||
|                                       struct gl_texture_object *texObj, | ||||
|                                       struct gl_texture_image *texImage, | ||||
|                                       GLboolean *retainInternalCopy); | ||||
|    GLboolean (*CompressedTexImage2D)( GLcontext *ctx, GLenum target, | ||||
|                                       GLint level, const GLvoid *data, | ||||
|                                       GLint level, GLsizei imageSize, | ||||
|                                       const GLvoid *data, | ||||
|                                       struct gl_texture_object *texObj, | ||||
|                                       struct gl_texture_image *texImage, | ||||
|                                       GLboolean *retainInternalCopy); | ||||
|    GLboolean (*CompressedTexImage3D)( GLcontext *ctx, GLenum target, | ||||
|                                       GLint level, const GLvoid *data, | ||||
|                                       GLint level, GLsizei imageSize, | ||||
|                                       const GLvoid *data, | ||||
|                                       struct gl_texture_object *texObj, | ||||
|                                       struct gl_texture_image *texImage, | ||||
|                                       GLboolean *retainInternalCopy); | ||||
| @@ -699,6 +713,49 @@ struct dd_function_table { | ||||
|     * should do the job. | ||||
|     */ | ||||
|  | ||||
|    GLint (*BaseCompressedTexFormat)(GLcontext *ctx, | ||||
|                                     GLint internalFormat); | ||||
|    /* Called to compute the base format for a specific compressed | ||||
|     * format.  Return -1 if the internalFormat is not a specific | ||||
|     * compressed format that the driver recognizes.  Note the | ||||
|     * return value differences between this function and | ||||
|     * SpecificCompressedTexFormat below. | ||||
|     */ | ||||
|  | ||||
|    GLint (*SpecificCompressedTexFormat)(GLcontext *ctx, | ||||
|                                         GLint      internalFormat, | ||||
|                                         GLint      numDimensions, | ||||
|                                         GLint     *levelp, | ||||
|                                         GLsizei   *widthp, | ||||
|                                         GLsizei   *heightp, | ||||
|                                         GLsizei   *depthp, | ||||
|                                         GLint     *borderp, | ||||
|                                         GLenum    *formatp, | ||||
|                                         GLenum    *typep); | ||||
|    /* Called to turn a generic texture format into a specific | ||||
|     * texture format.  For example, if a driver implements | ||||
|     * GL_3DFX_texture_compression_FXT1, this would map | ||||
|     * GL_COMPRESSED_RGBA_ARB to GL_COMPRESSED_RGBA_FXT1_3DFX. | ||||
|     * | ||||
|     * If the driver does not know how to handle the compressed | ||||
|     * format, then just return the generic format, and Mesa will | ||||
|     * do the right thing with it. | ||||
|     */ | ||||
|  | ||||
|    GLboolean (*IsCompressedFormat)(GLcontext *ctx, GLint internalFormat); | ||||
|    /* Called to tell if a format is a compressed format. | ||||
|     */ | ||||
|  | ||||
|    GLsizei (*CompressedImageSize)(GLcontext *ctx, | ||||
|                                   GLenum internalFormat, | ||||
|                                   GLuint numDimensions, | ||||
|                                   GLuint width, | ||||
|                                   GLuint height, | ||||
|                                   GLuint depth); | ||||
|    /* Calculate the size of a compressed image, given the image's | ||||
|     * format and dimensions. | ||||
|     */ | ||||
|  | ||||
|    void (*GetCompressedTexImage)( GLcontext *ctx, GLenum target, | ||||
|                                   GLint lod, void *image, | ||||
|                                   const struct gl_texture_object *texObj, | ||||
| @@ -759,7 +816,7 @@ struct dd_function_table { | ||||
|  | ||||
|  | ||||
|    /*** | ||||
|     *** Accelerated point, line, polygon, glDrawPixels and glBitmap functions: | ||||
|     *** Accelerated point, line, polygon, quad and rect functions: | ||||
|     ***/ | ||||
|  | ||||
|    points_func   PointsFunc; | ||||
| @@ -906,6 +963,16 @@ struct dd_function_table { | ||||
|    void (*StencilMask)(GLcontext *ctx, GLuint mask); | ||||
|    void (*StencilOp)(GLcontext *ctx, GLenum fail, GLenum zfail, GLenum zpass); | ||||
|    void (*Viewport)(GLcontext *ctx, GLint x, GLint y, GLsizei w, GLsizei h); | ||||
|  | ||||
|    /* State-query functions | ||||
|     * | ||||
|     * Return GL_TRUE if query was completed, GL_FALSE otherwise. | ||||
|     */ | ||||
|    GLboolean (*GetBooleanv)(GLcontext *ctx, GLenum pname, GLboolean *result); | ||||
|    GLboolean (*GetDoublev)(GLcontext *ctx, GLenum pname, GLdouble *result); | ||||
|    GLboolean (*GetFloatv)(GLcontext *ctx, GLenum pname, GLfloat *result); | ||||
|    GLboolean (*GetIntegerv)(GLcontext *ctx, GLenum pname, GLint *result); | ||||
|    GLboolean (*GetPointerv)(GLcontext *ctx, GLenum pname, GLvoid **result); | ||||
| }; | ||||
|  | ||||
|  | ||||
|   | ||||
| @@ -1,8 +1,8 @@ | ||||
| /* $Id: drawpix.c,v 1.26 2000/06/30 22:19:41 brianp Exp $ */ | ||||
| /* $Id: drawpix.c,v 1.26.4.6 2000/10/17 00:24:11 brianp Exp $ */ | ||||
|  | ||||
| /* | ||||
|  * Mesa 3-D graphics library | ||||
|  * Version:  3.3 | ||||
|  * Version:  3.4 | ||||
|  *  | ||||
|  * Copyright (C) 1999-2000  Brian Paul   All Rights Reserved. | ||||
|  *  | ||||
| @@ -122,11 +122,10 @@ simple_DrawPixels( GLcontext *ctx, GLint x, GLint y, | ||||
|        && ctx->ColorMatrix.type == MATRIX_IDENTITY | ||||
|        && !ctx->Pixel.ColorTableEnabled | ||||
|        && !ctx->Pixel.PostColorMatrixColorTableEnabled | ||||
|        && ctx->Pixel.PostConvolutionColorTableEnabled | ||||
|        && !ctx->Pixel.PostConvolutionColorTableEnabled | ||||
|        && !ctx->Pixel.MinMaxEnabled | ||||
|        && !ctx->Pixel.HistogramEnabled | ||||
|        && ctx->Pixel.IndexShift==0 && ctx->Pixel.IndexOffset==0 | ||||
|        && ctx->Pixel.MapColorFlag==0 | ||||
|        && ctx->Texture.ReallyEnabled == 0 | ||||
|        && unpack->Alignment==1 | ||||
|        && !unpack->SwapBytes | ||||
| @@ -140,7 +139,7 @@ simple_DrawPixels( GLcontext *ctx, GLint x, GLint y, | ||||
|       GLint skipRows = unpack->SkipRows; | ||||
|       GLint rowLength; | ||||
|       GLdepth zSpan[MAX_WIDTH];  /* only used when zooming */ | ||||
|       GLint zoomY0; | ||||
|       GLint zoomY0 = 0; | ||||
|  | ||||
|       if (unpack->RowLength > 0) | ||||
|          rowLength = unpack->RowLength; | ||||
| @@ -173,14 +172,36 @@ simple_DrawPixels( GLcontext *ctx, GLint x, GLint y, | ||||
|             drawHeight -= (destY + drawHeight - ctx->DrawBuffer->Ymax - 1); | ||||
|          if (drawHeight <= 0) | ||||
|             return GL_TRUE; | ||||
|       } | ||||
|       else if (ctx->Pixel.ZoomX==1.0F && ctx->Pixel.ZoomY==-1.0F) { | ||||
|          /* upside-down image */ | ||||
|          /* horizontal clipping */ | ||||
|          if (destX < ctx->DrawBuffer->Xmin) { | ||||
|             skipPixels += (ctx->DrawBuffer->Xmin - destX); | ||||
|             drawWidth  -= (ctx->DrawBuffer->Xmin - destX); | ||||
|             destX = ctx->DrawBuffer->Xmin; | ||||
|          } | ||||
|          if (destX + drawWidth > ctx->DrawBuffer->Xmax) | ||||
|             drawWidth -= (destX + drawWidth - ctx->DrawBuffer->Xmax - 1); | ||||
|          if (drawWidth <= 0) | ||||
|             return GL_TRUE; | ||||
|  | ||||
|          zoomY0 = 0;  /* not used - silence compiler warning */ | ||||
|          /* vertical clipping */ | ||||
|          if (destY > ctx->DrawBuffer->Ymax) { | ||||
|             skipRows   += (destY - ctx->DrawBuffer->Ymax - 1); | ||||
|             drawHeight -= (destY - ctx->DrawBuffer->Ymax - 1); | ||||
|             destY = ctx->DrawBuffer->Ymax + 1; | ||||
|          } | ||||
|          if (destY - drawHeight < ctx->DrawBuffer->Ymin) | ||||
|             drawHeight -= (ctx->DrawBuffer->Ymin - (destY - drawHeight)); | ||||
|          if (drawHeight <= 0) | ||||
|             return GL_TRUE; | ||||
|       } | ||||
|       else { | ||||
|          /* setup array of fragment Z value to pass to zoom function */ | ||||
|          GLdepth z = (GLdepth) (ctx->Current.RasterPos[2] * ctx->Visual->DepthMaxF); | ||||
|          GLint i; | ||||
|          assert(drawWidth < MAX_WIDTH); | ||||
|          ASSERT(drawWidth < MAX_WIDTH); | ||||
|          for (i=0; i<drawWidth; i++) | ||||
|             zSpan[i] = z; | ||||
|  | ||||
| @@ -197,7 +218,8 @@ simple_DrawPixels( GLcontext *ctx, GLint x, GLint y, | ||||
|        * skip "skipRows" rows and skip "skipPixels" pixels/row. | ||||
|        */ | ||||
|  | ||||
|       if (format==GL_RGBA && type==GL_UNSIGNED_BYTE) { | ||||
|       if (format==GL_RGBA && type==GL_UNSIGNED_BYTE | ||||
|           && ctx->Pixel.MapColorFlag==0) { | ||||
|          if (ctx->Visual->RGBAflag) { | ||||
|             GLubyte *src = (GLubyte *) pixels | ||||
|                + (skipRows * rowLength + skipPixels) * 4; | ||||
| @@ -211,6 +233,16 @@ simple_DrawPixels( GLcontext *ctx, GLint x, GLint y, | ||||
|                   destY++; | ||||
|                } | ||||
|             } | ||||
|             else if (ctx->Pixel.ZoomX==1.0F && ctx->Pixel.ZoomY==-1.0F) { | ||||
|                /* upside-down */ | ||||
|                GLint row; | ||||
|                for (row=0; row<drawHeight; row++) { | ||||
|                   destY--; | ||||
|                   (*ctx->Driver.WriteRGBASpan)(ctx, drawWidth, destX, destY, | ||||
|                                               (void *) src, NULL); | ||||
|                   src += rowLength * 4; | ||||
|                } | ||||
|             } | ||||
|             else { | ||||
|                /* with zooming */ | ||||
|                GLint row; | ||||
| @@ -224,7 +256,8 @@ simple_DrawPixels( GLcontext *ctx, GLint x, GLint y, | ||||
|          } | ||||
|          return GL_TRUE; | ||||
|       } | ||||
|       else if (format==GL_RGB && type==GL_UNSIGNED_BYTE) { | ||||
|       else if (format==GL_RGB && type==GL_UNSIGNED_BYTE | ||||
|                && ctx->Pixel.MapColorFlag==0) { | ||||
|          if (ctx->Visual->RGBAflag) { | ||||
|             GLubyte *src = (GLubyte *) pixels | ||||
|                + (skipRows * rowLength + skipPixels) * 3; | ||||
| @@ -237,6 +270,16 @@ simple_DrawPixels( GLcontext *ctx, GLint x, GLint y, | ||||
|                   destY++; | ||||
|                } | ||||
|             } | ||||
|             else if (ctx->Pixel.ZoomX==1.0F && ctx->Pixel.ZoomY==-1.0F) { | ||||
|                /* upside-down */ | ||||
|                GLint row; | ||||
|                for (row=0; row<drawHeight; row++) { | ||||
|                   destY--; | ||||
|                   (*ctx->Driver.WriteRGBSpan)(ctx, drawWidth, destX, destY, | ||||
|                                               (void *) src, NULL); | ||||
|                   src += rowLength * 3; | ||||
|                } | ||||
|             } | ||||
|             else { | ||||
|                /* with zooming */ | ||||
|                GLint row; | ||||
| @@ -250,14 +293,15 @@ simple_DrawPixels( GLcontext *ctx, GLint x, GLint y, | ||||
|          } | ||||
|          return GL_TRUE; | ||||
|       } | ||||
|       else if (format==GL_LUMINANCE && type==GL_UNSIGNED_BYTE) { | ||||
|       else if (format==GL_LUMINANCE && type==GL_UNSIGNED_BYTE | ||||
|                && ctx->Pixel.MapColorFlag==0) { | ||||
|          if (ctx->Visual->RGBAflag) { | ||||
|             GLubyte *src = (GLubyte *) pixels | ||||
|                + (skipRows * rowLength + skipPixels); | ||||
|             if (ctx->Pixel.ZoomX==1.0F && ctx->Pixel.ZoomY==1.0F) { | ||||
|                /* no zooming */ | ||||
|                GLint row; | ||||
|                assert(drawWidth < MAX_WIDTH); | ||||
|                ASSERT(drawWidth < MAX_WIDTH); | ||||
|                for (row=0; row<drawHeight; row++) { | ||||
|                   GLint i; | ||||
| 		  for (i=0;i<drawWidth;i++) { | ||||
| @@ -271,10 +315,27 @@ simple_DrawPixels( GLcontext *ctx, GLint x, GLint y, | ||||
|                   destY++; | ||||
|                } | ||||
|             } | ||||
|             else if (ctx->Pixel.ZoomX==1.0F && ctx->Pixel.ZoomY==-1.0F) { | ||||
|                /* upside-down */ | ||||
|                GLint row; | ||||
|                ASSERT(drawWidth < MAX_WIDTH); | ||||
|                for (row=0; row<drawHeight; row++) { | ||||
|                   GLint i; | ||||
|                   for (i=0;i<drawWidth;i++) { | ||||
|                      rgb[i][0] = src[i]; | ||||
|                      rgb[i][1] = src[i]; | ||||
|                      rgb[i][2] = src[i]; | ||||
|                   } | ||||
|                   destY--; | ||||
|                   (*ctx->Driver.WriteRGBSpan)(ctx, drawWidth, destX, destY, | ||||
|                                               (void *) rgb, NULL); | ||||
|                   src += rowLength; | ||||
|                } | ||||
|             } | ||||
|             else { | ||||
|                /* with zooming */ | ||||
|                GLint row; | ||||
|                assert(drawWidth < MAX_WIDTH); | ||||
|                ASSERT(drawWidth < MAX_WIDTH); | ||||
|                for (row=0; row<drawHeight; row++) { | ||||
|                   GLint i; | ||||
| 		  for (i=0;i<drawWidth;i++) { | ||||
| @@ -291,14 +352,15 @@ simple_DrawPixels( GLcontext *ctx, GLint x, GLint y, | ||||
|          } | ||||
|          return GL_TRUE; | ||||
|       } | ||||
|       else if (format==GL_LUMINANCE_ALPHA && type==GL_UNSIGNED_BYTE) { | ||||
|       else if (format==GL_LUMINANCE_ALPHA && type==GL_UNSIGNED_BYTE | ||||
|                && ctx->Pixel.MapColorFlag==0) { | ||||
|          if (ctx->Visual->RGBAflag) { | ||||
|             GLubyte *src = (GLubyte *) pixels | ||||
|                + (skipRows * rowLength + skipPixels)*2; | ||||
|             if (ctx->Pixel.ZoomX==1.0F && ctx->Pixel.ZoomY==1.0F) { | ||||
|                /* no zooming */ | ||||
|                GLint row; | ||||
|                assert(drawWidth < MAX_WIDTH); | ||||
|                ASSERT(drawWidth < MAX_WIDTH); | ||||
|                for (row=0; row<drawHeight; row++) { | ||||
|                   GLint i; | ||||
|                   GLubyte *ptr = src; | ||||
| @@ -314,10 +376,29 @@ simple_DrawPixels( GLcontext *ctx, GLint x, GLint y, | ||||
|                   destY++; | ||||
|                } | ||||
|             } | ||||
|             else if (ctx->Pixel.ZoomX==1.0F && ctx->Pixel.ZoomY==-1.0F) { | ||||
|                /* upside-down */ | ||||
|                GLint row; | ||||
|                ASSERT(drawWidth < MAX_WIDTH); | ||||
|                for (row=0; row<drawHeight; row++) { | ||||
|                   GLint i; | ||||
|                   GLubyte *ptr = src; | ||||
|                   for (i=0;i<drawWidth;i++) { | ||||
|                      rgba[i][0] = *ptr; | ||||
|                      rgba[i][1] = *ptr; | ||||
|                      rgba[i][2] = *ptr++; | ||||
|                      rgba[i][3] = *ptr++; | ||||
|                   } | ||||
|                   destY--; | ||||
|                   (*ctx->Driver.WriteRGBASpan)(ctx, drawWidth, destX, destY, | ||||
|                                                (void *) rgba, NULL); | ||||
|                   src += rowLength*2; | ||||
|                } | ||||
|             } | ||||
|             else { | ||||
|                /* with zooming */ | ||||
|                GLint row; | ||||
|                assert(drawWidth < MAX_WIDTH); | ||||
|                ASSERT(drawWidth < MAX_WIDTH); | ||||
|                for (row=0; row<drawHeight; row++) { | ||||
|                   GLubyte *ptr = src; | ||||
|                   GLint i; | ||||
| @@ -344,7 +425,7 @@ simple_DrawPixels( GLcontext *ctx, GLint x, GLint y, | ||||
|                /* no zooming */ | ||||
|                GLint row; | ||||
|                for (row=0; row<drawHeight; row++) { | ||||
|                   assert(drawWidth < MAX_WIDTH); | ||||
|                   ASSERT(drawWidth < MAX_WIDTH); | ||||
|                   _mesa_map_ci8_to_rgba(ctx, drawWidth, src, rgba); | ||||
|                   (*ctx->Driver.WriteRGBASpan)(ctx, drawWidth, destX, destY, | ||||
|                                                (const GLubyte (*)[4])rgba,  | ||||
| @@ -354,11 +435,25 @@ simple_DrawPixels( GLcontext *ctx, GLint x, GLint y, | ||||
|                } | ||||
|                return GL_TRUE; | ||||
|             } | ||||
|             else if (ctx->Pixel.ZoomX==1.0F && ctx->Pixel.ZoomY==-1.0F) { | ||||
|                /* upside-down */ | ||||
|                GLint row; | ||||
|                for (row=0; row<drawHeight; row++) { | ||||
|                   ASSERT(drawWidth < MAX_WIDTH); | ||||
|                   _mesa_map_ci8_to_rgba(ctx, drawWidth, src, rgba); | ||||
|                   destY--; | ||||
|                   (*ctx->Driver.WriteRGBASpan)(ctx, drawWidth, destX, destY, | ||||
|                                                (const GLubyte (*)[4])rgba,  | ||||
|                                                NULL); | ||||
|                   src += rowLength; | ||||
|                } | ||||
|                return GL_TRUE; | ||||
|             } | ||||
|             else { | ||||
|                /* with zooming */ | ||||
|                GLint row; | ||||
|                for (row=0; row<drawHeight; row++) { | ||||
|                   assert(drawWidth < MAX_WIDTH); | ||||
|                   ASSERT(drawWidth < MAX_WIDTH); | ||||
|                   _mesa_map_ci8_to_rgba(ctx, drawWidth, src, rgba); | ||||
|                   gl_write_zoomed_rgba_span(ctx, drawWidth, destX, destY, | ||||
|                                             zSpan, (void *) rgba, zoomY0); | ||||
| @@ -616,6 +711,11 @@ draw_rgba_pixels( GLcontext *ctx, GLint x, GLint y, | ||||
|    GLdepth zspan[MAX_WIDTH]; | ||||
|    GLboolean quickDraw; | ||||
|  | ||||
|    if (!_mesa_is_legal_format_and_type(format, type)) { | ||||
|       gl_error(ctx, GL_INVALID_ENUM, "glDrawPixels(format or type)"); | ||||
|       return; | ||||
|    } | ||||
|  | ||||
|    /* Try an optimized glDrawPixels first */ | ||||
|    if (simple_DrawPixels(ctx, x, y, width, height, format, type, pixels)) | ||||
|       return; | ||||
| @@ -723,6 +823,7 @@ _mesa_DrawPixels( GLsizei width, GLsizei height, | ||||
|          return; | ||||
|       } | ||||
|  | ||||
|       RENDER_START(ctx); | ||||
|       switch (format) { | ||||
| 	 case GL_STENCIL_INDEX: | ||||
| 	    draw_stencil_pixels( ctx, x, y, width, height, type, pixels ); | ||||
| @@ -751,8 +852,8 @@ _mesa_DrawPixels( GLsizei width, GLsizei height, | ||||
| 	    break; | ||||
| 	 default: | ||||
| 	    gl_error( ctx, GL_INVALID_ENUM, "glDrawPixels(format)" ); | ||||
|             return; | ||||
|       } | ||||
|       RENDER_FINISH(ctx); | ||||
|    } | ||||
|    else if (ctx->RenderMode==GL_FEEDBACK) { | ||||
|       if (ctx->Current.RasterPosValid) { | ||||
|   | ||||
| @@ -1,10 +1,10 @@ | ||||
| /* $Id: enable.c,v 1.21 2000/05/23 15:17:12 brianp Exp $ */ | ||||
| /* $Id: enable.c,v 1.21.4.2 2000/10/21 01:22:13 brianp Exp $ */ | ||||
|  | ||||
| /* | ||||
|  * Mesa 3-D graphics library | ||||
|  * Version:  3.3 | ||||
|  * Version:  3.4 | ||||
|  *  | ||||
|  * Copyright (C) 1999  Brian Paul   All Rights Reserved. | ||||
|  * Copyright (C) 1999-2000  Brian Paul   All Rights Reserved. | ||||
|  *  | ||||
|  * Permission is hereby granted, free of charge, to any person obtaining a | ||||
|  * copy of this software and associated documentation files (the "Software"), | ||||
| @@ -285,12 +285,14 @@ void _mesa_set_enable( GLcontext *ctx, GLenum cap, GLboolean state ) | ||||
|       case GL_POINT_SMOOTH: | ||||
| 	 if (ctx->Point.SmoothFlag!=state) { | ||||
|             ctx->Point.SmoothFlag = state; | ||||
| 	    ctx->TriangleCaps ^= DD_POINT_SMOOTH; | ||||
|             ctx->NewState |= NEW_RASTER_OPS; | ||||
|          } | ||||
| 	 break; | ||||
|       case GL_POLYGON_SMOOTH: | ||||
| 	 if (ctx->Polygon.SmoothFlag!=state) { | ||||
|             ctx->Polygon.SmoothFlag = state; | ||||
| 	    ctx->TriangleCaps ^= DD_TRI_SMOOTH; | ||||
|             ctx->NewState |= NEW_RASTER_OPS; | ||||
|          } | ||||
| 	 break; | ||||
| @@ -350,48 +352,39 @@ void _mesa_set_enable( GLcontext *ctx, GLenum cap, GLboolean state ) | ||||
|       case GL_TEXTURE_1D: | ||||
|          if (ctx->Visual->RGBAflag) { | ||||
| 	    const GLuint curr = ctx->Texture.CurrentUnit; | ||||
| 	    const GLuint flag = TEXTURE0_1D << (curr * 4); | ||||
|             struct gl_texture_unit *texUnit = &ctx->Texture.Unit[curr]; | ||||
| 	    ctx->NewState |= NEW_TEXTURE_ENABLE; | ||||
|             if (state) { | ||||
| 	       texUnit->Enabled |= TEXTURE0_1D; | ||||
| 	       ctx->Enabled |= flag; | ||||
| 	    } | ||||
|             else { | ||||
|                texUnit->Enabled &= ~TEXTURE0_1D; | ||||
|                ctx->Enabled &= ~flag; | ||||
|             } | ||||
|          } | ||||
|          break; | ||||
|       case GL_TEXTURE_2D: | ||||
|          if (ctx->Visual->RGBAflag) { | ||||
| 	    const GLuint curr = ctx->Texture.CurrentUnit; | ||||
| 	    const GLuint flag = TEXTURE0_2D << (curr * 4); | ||||
|             struct gl_texture_unit *texUnit = &ctx->Texture.Unit[curr]; | ||||
| 	    ctx->NewState |= NEW_TEXTURE_ENABLE; | ||||
|             if (state) { | ||||
| 	       texUnit->Enabled |= TEXTURE0_2D; | ||||
| 	       ctx->Enabled |= flag; | ||||
| 	    } | ||||
|             else { | ||||
|                texUnit->Enabled &= ~TEXTURE0_2D; | ||||
|                ctx->Enabled &= ~flag; | ||||
|             } | ||||
|          } | ||||
| 	 break; | ||||
|       case GL_TEXTURE_3D: | ||||
|          if (ctx->Visual->RGBAflag) { | ||||
| 	    const GLuint curr = ctx->Texture.CurrentUnit; | ||||
| 	    const GLuint flag = TEXTURE0_3D << (curr * 4); | ||||
|             struct gl_texture_unit *texUnit = &ctx->Texture.Unit[curr]; | ||||
| 	    ctx->NewState |= NEW_TEXTURE_ENABLE; | ||||
|             if (state) { | ||||
| 	       texUnit->Enabled |= TEXTURE0_3D; | ||||
| 	       ctx->Enabled |= flag; | ||||
| 	    } | ||||
|             else { | ||||
|                texUnit->Enabled &= ~TEXTURE0_3D; | ||||
|                ctx->Enabled &= ~flag; | ||||
|             } | ||||
|          } | ||||
|          break; | ||||
| @@ -511,35 +504,24 @@ void _mesa_set_enable( GLcontext *ctx, GLenum cap, GLboolean state ) | ||||
|          if (ctx->Extensions.HaveTextureCubeMap) { | ||||
|             if (ctx->Visual->RGBAflag) { | ||||
|                const GLuint curr = ctx->Texture.CurrentUnit; | ||||
|                const GLuint flag = TEXTURE0_CUBE << (curr * 4); | ||||
|                struct gl_texture_unit *texUnit = &ctx->Texture.Unit[curr]; | ||||
|                ctx->NewState |= NEW_TEXTURE_ENABLE; | ||||
|                if (state) { | ||||
|                   texUnit->Enabled |= TEXTURE0_CUBE; | ||||
|                   ctx->Enabled |= flag; | ||||
|                } | ||||
|                else { | ||||
|                   texUnit->Enabled &= ~TEXTURE0_CUBE; | ||||
|                   ctx->Enabled &= ~flag; | ||||
|                } | ||||
|             } | ||||
|          } | ||||
|          else { | ||||
|             if (state) | ||||
|                gl_error(ctx, GL_INVALID_ENUM, "glEnable"); | ||||
|             else | ||||
|                gl_error(ctx, GL_INVALID_ENUM, "glDisable"); | ||||
|             gl_error(ctx, GL_INVALID_ENUM, state ? "glEnable" : "glDisable"); | ||||
|             return; | ||||
|          } | ||||
| 	 break; | ||||
|  | ||||
|       default: | ||||
| 	 if (state) { | ||||
| 	    gl_error( ctx, GL_INVALID_ENUM, "glEnable" ); | ||||
| 	 } | ||||
| 	 else { | ||||
| 	    gl_error( ctx, GL_INVALID_ENUM, "glDisable" ); | ||||
| 	 } | ||||
|          gl_error(ctx, GL_INVALID_ENUM, state ? "glEnable" : "glDisable"); | ||||
|          return; | ||||
|    } | ||||
|  | ||||
|   | ||||
| @@ -1,8 +1,8 @@ | ||||
| /* $Id: extensions.c,v 1.32 2000/06/27 21:42:13 brianp Exp $ */ | ||||
| /* $Id: extensions.c,v 1.32.4.1 2000/08/29 22:58:57 brianp Exp $ */ | ||||
|  | ||||
| /* | ||||
|  * Mesa 3-D graphics library | ||||
|  * Version:  3.3 | ||||
|  * Version:  3.4 | ||||
|  *  | ||||
|  * Copyright (C) 1999-2000  Brian Paul   All Rights Reserved. | ||||
|  *  | ||||
| @@ -51,7 +51,7 @@ struct extension { | ||||
| static struct { int enabled; const char *name; } default_extensions[] = { | ||||
|    { DEFAULT_OFF,    "GL_ARB_imaging" },  /* in progress */ | ||||
|    { DEFAULT_ON,     "GL_ARB_multitexture" }, | ||||
|    { DEFAULT_OFF,    "GL_ARB_texture_compression" },  /* in progress */ | ||||
|    { DEFAULT_OFF,    "GL_ARB_texture_compression" }, | ||||
|    { DEFAULT_OFF,    "GL_ARB_texture_cube_map" },  /* in progress */ | ||||
|    { ALWAYS_ENABLED, "GL_ARB_tranpose_matrix" }, | ||||
|    { ALWAYS_ENABLED, "GL_EXT_abgr" }, | ||||
|   | ||||
| @@ -1,8 +1,8 @@ | ||||
| /* $Id: fog.c,v 1.19 2000/07/07 15:10:35 keithw Exp $ */ | ||||
| /* $Id: fog.c,v 1.19.4.1 2000/10/17 00:24:11 brianp Exp $ */ | ||||
|  | ||||
| /* | ||||
|  * Mesa 3-D graphics library | ||||
|  * Version:  3.3 | ||||
|  * Version:  3.4 | ||||
|  *  | ||||
|  * Copyright (C) 1999-2000  Brian Paul   All Rights Reserved. | ||||
|  *  | ||||
| @@ -331,7 +331,7 @@ _mesa_fog_rgba_pixels( const GLcontext *ctx, | ||||
|                GLfloat eyez = d / (c+ndcz); | ||||
|                GLfloat f, g; | ||||
|                GLfloat tmp = negDensitySquared * eyez * eyez; | ||||
| #ifdef __alpha__ | ||||
| #if defined(__alpha__) || defined(__alpha) | ||||
|                /* XXX this underflow check may be needed for other systems */ | ||||
|                if (tmp < FLT_MIN_10_EXP) | ||||
|                   f = exp( FLT_MIN_10_EXP ); | ||||
| @@ -410,7 +410,7 @@ _mesa_fog_ci_pixels( const GLcontext *ctx, | ||||
|                if (eyez < 0.0) | ||||
|                   eyez = -eyez; | ||||
|                tmp = negDensitySquared * eyez * eyez; | ||||
| #ifdef __alpha__ | ||||
| #if defined(__alpha__) || defined(__alpha) | ||||
|                /* XXX this underflow check may be needed for other systems */ | ||||
|                if (tmp < FLT_MIN_10_EXP) | ||||
|                   f = exp( FLT_MIN_10_EXP ); | ||||
|   | ||||
| @@ -1,8 +1,8 @@ | ||||
| /* $Id: get.c,v 1.30 2000/07/21 15:41:08 brianp Exp $ */ | ||||
| /* $Id: get.c,v 1.30.2.1 2000/08/08 16:02:10 brianp Exp $ */ | ||||
|  | ||||
| /* | ||||
|  * Mesa 3-D graphics library | ||||
|  * Version:  3.3 | ||||
|  * Version:  3.4 | ||||
|  *  | ||||
|  * Copyright (C) 1999-2000  Brian Paul   All Rights Reserved. | ||||
|  *  | ||||
| @@ -92,9 +92,16 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params ) | ||||
|  | ||||
|    ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glGetBooleanv"); | ||||
|  | ||||
|    if (!params) | ||||
|       return; | ||||
|  | ||||
|    if (MESA_VERBOSE & VERBOSE_API)  | ||||
|       fprintf(stderr, "glGetBooleanv %s\n", gl_lookup_enum_by_nr(pname)); | ||||
|  | ||||
|    if (ctx->Driver.GetBooleanv | ||||
|        && (*ctx->Driver.GetBooleanv)(ctx, pname, params)) | ||||
|       return; | ||||
|  | ||||
|    switch (pname) { | ||||
|       case GL_ACCUM_RED_BITS: | ||||
|          *params = INT_TO_BOOL(ctx->Visual->AccumRedBits); | ||||
| @@ -1235,9 +1242,15 @@ _mesa_GetDoublev( GLenum pname, GLdouble *params ) | ||||
|  | ||||
|    ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glGetDoublev"); | ||||
|  | ||||
|    if (!params) | ||||
|       return; | ||||
|  | ||||
|    if (MESA_VERBOSE & VERBOSE_API)  | ||||
|       fprintf(stderr, "glGetDoublev %s\n", gl_lookup_enum_by_nr(pname)); | ||||
|  | ||||
|    if (ctx->Driver.GetDoublev && (*ctx->Driver.GetDoublev)(ctx, pname, params)) | ||||
|       return; | ||||
|  | ||||
|    switch (pname) { | ||||
|       case GL_ACCUM_RED_BITS: | ||||
|          *params = (GLdouble) ctx->Visual->AccumRedBits; | ||||
| @@ -2378,9 +2391,15 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params ) | ||||
|  | ||||
|    ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glGetFloatv"); | ||||
|  | ||||
|    if (!params) | ||||
|       return; | ||||
|  | ||||
|    if (MESA_VERBOSE & VERBOSE_API)  | ||||
|       fprintf(stderr, "glGetFloatv %s\n", gl_lookup_enum_by_nr(pname)); | ||||
|  | ||||
|    if (ctx->Driver.GetFloatv && (*ctx->Driver.GetFloatv)(ctx, pname, params)) | ||||
|       return; | ||||
|  | ||||
|    switch (pname) { | ||||
|       case GL_ACCUM_RED_BITS: | ||||
|          *params = (GLfloat) ctx->Visual->AccumRedBits; | ||||
| @@ -3492,9 +3511,16 @@ _mesa_GetIntegerv( GLenum pname, GLint *params ) | ||||
|  | ||||
|    ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glGetIntegerv"); | ||||
|  | ||||
|    if (!params) | ||||
|       return; | ||||
|  | ||||
|    if (MESA_VERBOSE & VERBOSE_API)  | ||||
|       fprintf(stderr, "glGetIntegerv %s\n", gl_lookup_enum_by_nr(pname)); | ||||
|  | ||||
|    if (ctx->Driver.GetIntegerv | ||||
|        && (*ctx->Driver.GetIntegerv)(ctx, pname, params)) | ||||
|       return; | ||||
|  | ||||
|    switch (pname) { | ||||
|       case GL_ACCUM_RED_BITS: | ||||
|          *params = (GLint) ctx->Visual->AccumRedBits; | ||||
| @@ -4629,11 +4655,19 @@ _mesa_GetPointerv( GLenum pname, GLvoid **params ) | ||||
| { | ||||
|    GET_CURRENT_CONTEXT(ctx); | ||||
|    GLuint texUnit = ctx->Texture.CurrentUnit; | ||||
|    /*GLuint texTransformUnit = ctx->Texture.CurrentTransformUnit;*/ | ||||
|  | ||||
|    ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glGetPointerv"); | ||||
|  | ||||
|    if (!params) | ||||
|       return; | ||||
|  | ||||
|    if (MESA_VERBOSE & VERBOSE_API)  | ||||
|       fprintf(stderr, "glGetPointerv %s\n", gl_lookup_enum_by_nr(pname)); | ||||
|  | ||||
|    if (ctx->Driver.GetPointerv | ||||
|        && (*ctx->Driver.GetPointerv)(ctx, pname, params)) | ||||
|       return; | ||||
|  | ||||
|    switch (pname) { | ||||
|       case GL_VERTEX_ARRAY_POINTER: | ||||
|          *params = ctx->Array.Vertex.Ptr; | ||||
| @@ -4673,7 +4707,7 @@ _mesa_GetString( GLenum name ) | ||||
|    GET_CURRENT_CONTEXT(ctx); | ||||
|    static const char *vendor = "Brian Paul"; | ||||
|    static const char *renderer = "Mesa"; | ||||
|    static const char *version = "1.2 Mesa 3.3"; | ||||
|    static const char *version = "1.2 Mesa 3.4"; | ||||
|  | ||||
|    ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH_WITH_RETVAL(ctx, "glGetString", 0); | ||||
|  | ||||
|   | ||||
| @@ -1,8 +1,8 @@ | ||||
| /* $Id: glheader.h,v 1.11 2000/06/12 15:40:47 brianp Exp $ */ | ||||
| /* $Id: glheader.h,v 1.11.4.3 2000/09/15 15:42:51 brianp Exp $ */ | ||||
|  | ||||
| /* | ||||
|  * Mesa 3-D graphics library | ||||
|  * Version:  3.3 | ||||
|  * Version:  3.4 | ||||
|  * | ||||
|  * Copyright (C) 1999-2000  Brian Paul   All Rights Reserved. | ||||
|  * | ||||
| @@ -47,7 +47,12 @@ | ||||
| #else | ||||
| #include <assert.h> | ||||
| #include <ctype.h> | ||||
| /* If we can use Compaq's Fast Math Library on Alpha */ | ||||
| #if defined(__alpha__) && defined(CCPML) | ||||
| #include <cpml.h> | ||||
| #else | ||||
| #include <math.h> | ||||
| #endif | ||||
| #include <limits.h> | ||||
| #include <stdlib.h> | ||||
| #include <stdio.h> | ||||
| @@ -132,13 +137,18 @@ | ||||
| #if defined(_WIN32) && !defined(_WINDEF_) && !defined(_GNU_H_WINDOWS32_BASE) && !defined(OPENSTEP) | ||||
| #if 0 | ||||
| #	define CALLBACK GLCALLBACK | ||||
| #endif | ||||
| typedef int (GLAPIENTRY *PROC)(); | ||||
| typedef void *HGLRC; | ||||
| typedef void *HDC; | ||||
| #endif | ||||
| typedef int (GLAPIENTRY *PROC)(); | ||||
| typedef unsigned long COLORREF; | ||||
| #endif | ||||
|  | ||||
|  | ||||
| /* Make sure we include glext.h from gl.h */ | ||||
| #define GL_GLEXT_PROTOTYPES | ||||
|  | ||||
|  | ||||
| #if defined(_WIN32) && !defined(_WINGDI_) && !defined(_GNU_H_WINDOWS32_DEFINES) && !defined(OPENSTEP) | ||||
| #	define WGL_FONT_LINES      0 | ||||
| #	define WGL_FONT_POLYGONS   1 | ||||
| @@ -160,8 +170,6 @@ typedef struct tagPIXELFORMATDESCRIPTOR PIXELFORMATDESCRIPTOR, *PPIXELFORMATDESC | ||||
|  | ||||
|  | ||||
|  | ||||
| /* Make sure we include glext.h */ | ||||
| #define GL_GLEXT_PROTOTYPES | ||||
| #include "GL/gl.h" | ||||
| #include "GL/glext.h" | ||||
|  | ||||
|   | ||||
| @@ -1,8 +1,8 @@ | ||||
| /* $Id: image.c,v 1.35 2000/06/30 22:12:00 brianp Exp $ */ | ||||
| /* $Id: image.c,v 1.35.4.2 2000/10/05 16:23:18 brianp Exp $ */ | ||||
|  | ||||
| /* | ||||
|  * Mesa 3-D graphics library | ||||
|  * Version:  3.3 | ||||
|  * Version:  3.4 | ||||
|  *  | ||||
|  * Copyright (C) 1999-2000  Brian Paul   All Rights Reserved. | ||||
|  *  | ||||
| @@ -1277,7 +1277,7 @@ _mesa_pack_rgba_span( GLcontext *ctx, | ||||
|             } | ||||
|             break; | ||||
|          case GL_UNSIGNED_SHORT_4_4_4_4: | ||||
|             if (format == GL_RGB) { | ||||
|             if (format == GL_RGBA) { | ||||
|                GLushort *dst = (GLushort *) destination; | ||||
|                for (i=0;i<n;i++) { | ||||
|                   dst[i] = (((GLint) (rgba[i][RCOMP] * 15.0F)) << 12) | ||||
| @@ -1286,9 +1286,27 @@ _mesa_pack_rgba_span( GLcontext *ctx, | ||||
|                          | (((GLint) (rgba[i][ACOMP] * 15.0F))      ); | ||||
|                } | ||||
|             } | ||||
|             else if (format == GL_BGRA) { | ||||
|                GLushort *dst = (GLushort *) destination; | ||||
|                for (i=0;i<n;i++) { | ||||
|                   dst[i] = (((GLint) (rgba[i][BCOMP] * 15.0F)) << 12) | ||||
|                          | (((GLint) (rgba[i][GCOMP] * 15.0F)) <<  8) | ||||
|                          | (((GLint) (rgba[i][RCOMP] * 15.0F)) <<  4) | ||||
|                          | (((GLint) (rgba[i][ACOMP] * 15.0F))      ); | ||||
|                } | ||||
|             } | ||||
|             else if (format == GL_ABGR_EXT) { | ||||
|                GLushort *dst = (GLushort *) destination; | ||||
|                for (i=0;i<n;i++) { | ||||
|                   dst[i] = (((GLint) (rgba[i][ACOMP] * 15.0F)) <<  4) | ||||
|                          | (((GLint) (rgba[i][BCOMP] * 15.0F)) <<  8) | ||||
|                          | (((GLint) (rgba[i][GCOMP] * 15.0F)) << 12) | ||||
|                          | (((GLint) (rgba[i][RCOMP] * 15.0F))      ); | ||||
|                } | ||||
|             } | ||||
|             break; | ||||
|          case GL_UNSIGNED_SHORT_4_4_4_4_REV: | ||||
|             if (format == GL_RGB) { | ||||
|             if (format == GL_RGBA) { | ||||
|                GLushort *dst = (GLushort *) destination; | ||||
|                for (i=0;i<n;i++) { | ||||
|                   dst[i] = (((GLint) (rgba[i][RCOMP] * 15.0F))      ) | ||||
| @@ -1297,9 +1315,27 @@ _mesa_pack_rgba_span( GLcontext *ctx, | ||||
|                          | (((GLint) (rgba[i][ACOMP] * 15.0F)) << 12); | ||||
|                } | ||||
|             } | ||||
|             else if (format == GL_BGRA) { | ||||
|                GLushort *dst = (GLushort *) destination; | ||||
|                for (i=0;i<n;i++) { | ||||
|                   dst[i] = (((GLint) (rgba[i][BCOMP] * 15.0F))      ) | ||||
|                          | (((GLint) (rgba[i][GCOMP] * 15.0F)) <<  4) | ||||
|                          | (((GLint) (rgba[i][RCOMP] * 15.0F)) <<  8) | ||||
|                          | (((GLint) (rgba[i][ACOMP] * 15.0F)) << 12); | ||||
|                } | ||||
|             } | ||||
|             else if (format == GL_ABGR_EXT) { | ||||
|                GLushort *dst = (GLushort *) destination; | ||||
|                for (i=0;i<n;i++) { | ||||
|                   dst[i] = (((GLint) (rgba[i][ACOMP] * 15.0F))      ) | ||||
|                          | (((GLint) (rgba[i][BCOMP] * 15.0F)) <<  4) | ||||
|                          | (((GLint) (rgba[i][GCOMP] * 15.0F)) <<  8) | ||||
|                          | (((GLint) (rgba[i][RCOMP] * 15.0F)) << 12); | ||||
|                } | ||||
|             } | ||||
|             break; | ||||
|          case GL_UNSIGNED_SHORT_5_5_5_1: | ||||
|             if (format == GL_RGB) { | ||||
|             if (format == GL_RGBA) { | ||||
|                GLushort *dst = (GLushort *) destination; | ||||
|                for (i=0;i<n;i++) { | ||||
|                   dst[i] = (((GLint) (rgba[i][RCOMP] * 31.0F)) << 11) | ||||
| @@ -1308,9 +1344,27 @@ _mesa_pack_rgba_span( GLcontext *ctx, | ||||
|                          | (((GLint) (rgba[i][ACOMP] *  1.0F))      ); | ||||
|                } | ||||
|             } | ||||
|             else if (format == GL_BGRA) { | ||||
|                GLushort *dst = (GLushort *) destination; | ||||
|                for (i=0;i<n;i++) { | ||||
|                   dst[i] = (((GLint) (rgba[i][BCOMP] * 31.0F)) << 11) | ||||
|                          | (((GLint) (rgba[i][GCOMP] * 31.0F)) <<  6) | ||||
|                          | (((GLint) (rgba[i][RCOMP] * 31.0F)) <<  1) | ||||
|                          | (((GLint) (rgba[i][ACOMP] *  1.0F))      ); | ||||
|                } | ||||
|             } | ||||
|             else if (format == GL_ABGR_EXT) { | ||||
|                GLushort *dst = (GLushort *) destination; | ||||
|                for (i=0;i<n;i++) { | ||||
|                   dst[i] = (((GLint) (rgba[i][ACOMP] * 31.0F)) << 11) | ||||
|                          | (((GLint) (rgba[i][BCOMP] * 31.0F)) <<  6) | ||||
|                          | (((GLint) (rgba[i][GCOMP] * 31.0F)) <<  1) | ||||
|                          | (((GLint) (rgba[i][RCOMP] *  1.0F))      ); | ||||
|                } | ||||
|             } | ||||
|             break; | ||||
|          case GL_UNSIGNED_SHORT_1_5_5_5_REV: | ||||
|             if (format == GL_RGB) { | ||||
|             if (format == GL_RGBA) { | ||||
|                GLushort *dst = (GLushort *) destination; | ||||
|                for (i=0;i<n;i++) { | ||||
|                   dst[i] = (((GLint) (rgba[i][RCOMP] * 31.0F))      ) | ||||
| @@ -1319,6 +1373,24 @@ _mesa_pack_rgba_span( GLcontext *ctx, | ||||
|                          | (((GLint) (rgba[i][ACOMP] *  1.0F)) << 15); | ||||
|                } | ||||
|             } | ||||
|             else if (format == GL_BGRA) { | ||||
|                GLushort *dst = (GLushort *) destination; | ||||
|                for (i=0;i<n;i++) { | ||||
|                   dst[i] = (((GLint) (rgba[i][BCOMP] * 31.0F))      ) | ||||
|                          | (((GLint) (rgba[i][GCOMP] * 31.0F)) <<  5) | ||||
|                          | (((GLint) (rgba[i][RCOMP] * 31.0F)) << 10) | ||||
|                          | (((GLint) (rgba[i][ACOMP] *  1.0F)) << 15); | ||||
|                } | ||||
|             } | ||||
|             else if (format == GL_ABGR_EXT) { | ||||
|                GLushort *dst = (GLushort *) destination; | ||||
|                for (i=0;i<n;i++) { | ||||
|                   dst[i] = (((GLint) (rgba[i][ACOMP] * 31.0F))      ) | ||||
|                          | (((GLint) (rgba[i][BCOMP] * 31.0F)) <<  5) | ||||
|                          | (((GLint) (rgba[i][GCOMP] * 31.0F)) << 10) | ||||
|                          | (((GLint) (rgba[i][RCOMP] *  1.0F)) << 15); | ||||
|                } | ||||
|             } | ||||
|             break; | ||||
|          case GL_UNSIGNED_INT_8_8_8_8: | ||||
|             if (format == GL_RGBA) { | ||||
| @@ -2281,7 +2353,7 @@ _mesa_unpack_ubyte_color_span( GLcontext *ctx, | ||||
|                               unpacking); | ||||
|  | ||||
|          if (applyTransferOps) { | ||||
|             if (ctx->Pixel.MapColorFlag) { | ||||
|             if (dstFormat == GL_COLOR_INDEX && ctx->Pixel.MapColorFlag) { | ||||
|                _mesa_map_ci(ctx, n, indexes); | ||||
|             } | ||||
|             if (ctx->Pixel.IndexShift || ctx->Pixel.IndexOffset) { | ||||
| @@ -2550,7 +2622,7 @@ _mesa_unpack_float_color_span( GLcontext *ctx, | ||||
|                               unpacking); | ||||
|  | ||||
|          if (applyTransferOps) { | ||||
|             if (ctx->Pixel.MapColorFlag) { | ||||
|             if (dstFormat == GL_COLOR_INDEX && ctx->Pixel.MapColorFlag) { | ||||
|                _mesa_map_ci(ctx, n, indexes); | ||||
|             } | ||||
|             if (ctx->Pixel.IndexShift || ctx->Pixel.IndexOffset) { | ||||
|   | ||||
| @@ -1,8 +1,8 @@ | ||||
| /* $Id: matrix.c,v 1.18 2000/06/27 22:10:00 brianp Exp $ */ | ||||
| /* $Id: matrix.c,v 1.18.4.1 2000/07/31 15:31:17 brianp Exp $ */ | ||||
|  | ||||
| /* | ||||
|  * Mesa 3-D graphics library | ||||
|  * Version:  3.3 | ||||
|  * Version:  3.4 | ||||
|  *  | ||||
|  * Copyright (C) 1999-2000  Brian Paul   All Rights Reserved. | ||||
|  *  | ||||
| @@ -597,7 +597,7 @@ void gl_rotation_matrix( GLfloat angle, GLfloat x, GLfloat y, GLfloat z, | ||||
|  | ||||
|    mag = GL_SQRT( x*x + y*y + z*z ); | ||||
|  | ||||
|    if (mag == 0.0) { | ||||
|    if (mag <= 1.0e-4) { | ||||
|       /* generate an identity matrix and return */ | ||||
|       MEMCPY(m, Identity, sizeof(GLfloat)*16); | ||||
|       return; | ||||
|   | ||||
| @@ -1,4 +1,4 @@ | ||||
| /* $Id: pixel.c,v 1.11 2000/05/07 20:41:30 brianp Exp $ */ | ||||
| /* $Id: pixel.c,v 1.11.4.1 2000/10/19 20:09:29 brianp Exp $ */ | ||||
|  | ||||
| /* | ||||
|  * Mesa 3-D graphics library | ||||
| @@ -105,6 +105,14 @@ _mesa_PixelStorei( GLenum pname, GLint param ) | ||||
| 	    ctx->Pack.SkipRows = param; | ||||
| 	 } | ||||
| 	 break; | ||||
|       case GL_PACK_SKIP_IMAGES: | ||||
| 	 if (param<0) { | ||||
| 	    gl_error( ctx, GL_INVALID_VALUE, "glPixelStore(param)" ); | ||||
| 	 } | ||||
| 	 else { | ||||
| 	    ctx->Pack.SkipImages = param; | ||||
| 	 } | ||||
| 	 break; | ||||
|       case GL_PACK_ALIGNMENT: | ||||
|          if (param==1 || param==2 || param==4 || param==8) { | ||||
| 	    ctx->Pack.Alignment = param; | ||||
| @@ -149,6 +157,14 @@ _mesa_PixelStorei( GLenum pname, GLint param ) | ||||
| 	    ctx->Unpack.SkipRows = param; | ||||
| 	 } | ||||
| 	 break; | ||||
|       case GL_UNPACK_SKIP_IMAGES: | ||||
| 	 if (param < 0) { | ||||
| 	    gl_error( ctx, GL_INVALID_VALUE, "glPixelStore(param)" ); | ||||
| 	 } | ||||
| 	 else { | ||||
| 	    ctx->Unpack.SkipImages = param; | ||||
| 	 } | ||||
| 	 break; | ||||
|       case GL_UNPACK_ALIGNMENT: | ||||
|          if (param==1 || param==2 || param==4 || param==8) { | ||||
| 	    ctx->Unpack.Alignment = param; | ||||
|   | ||||
| @@ -1,8 +1,8 @@ | ||||
| /* $Id: points.c,v 1.11 2000/07/15 03:13:43 brianp Exp $ */ | ||||
| /* $Id: points.c,v 1.11.2.1 2000/08/16 17:25:40 brianp Exp $ */ | ||||
|  | ||||
| /* | ||||
|  * Mesa 3-D graphics library | ||||
|  * Version:  3.3 | ||||
|  * Version:  3.4 | ||||
|  *  | ||||
|  * Copyright (C) 1999-2000  Brian Paul   All Rights Reserved. | ||||
|  *  | ||||
| @@ -555,8 +555,8 @@ antialiased_rgba_points( GLcontext *ctx, GLuint first, GLuint last ) | ||||
|          if (VB->ClipMask[i] == 0) { | ||||
|             GLint x, y; | ||||
|             GLint red, green, blue, alpha; | ||||
|             GLfloat s, t, u; | ||||
|             GLfloat s1, t1, u1; | ||||
|             GLfloat s = 0.0F, t = 0.0F, u = 0.0F; | ||||
|             GLfloat s1 = 0.0F, t1 = 0.0F, u1 = 0.0F; | ||||
|             GLfloat vx = VB->Win.data[i][0]; | ||||
|             GLfloat vy = VB->Win.data[i][1]; | ||||
|  | ||||
| @@ -962,8 +962,8 @@ dist_atten_textured_rgba_points( GLcontext *ctx, GLuint first, GLuint last ) | ||||
|          GLint ix, iy; | ||||
|          GLint isize, radius; | ||||
|          GLint red, green, blue, alpha; | ||||
|          GLfloat s, t, u; | ||||
|          GLfloat s1, t1, u1; | ||||
|          GLfloat s = 0.0F, t = 0.0F, u = 0.0F; | ||||
|          GLfloat s1 = 0.0F, t1 = 0.0F, u1 = 0.0F; | ||||
|  | ||||
|          GLint x = (GLint)  VB->Win.data[i][0]; | ||||
|          GLint y = (GLint)  VB->Win.data[i][1]; | ||||
| @@ -1110,8 +1110,8 @@ dist_atten_antialiased_rgba_points( GLcontext *ctx, GLuint first, GLuint last ) | ||||
|             GLint xmin, ymin, xmax, ymax; | ||||
|             GLint x, y, z; | ||||
|             GLint red, green, blue, alpha; | ||||
|             GLfloat s, t, u; | ||||
|             GLfloat s1, t1, u1; | ||||
|             GLfloat s = 0.0F, t = 0.0F, u = 0.0F; | ||||
|             GLfloat s1 = 0.0F, t1 = 0.0F, u1 = 0.0F; | ||||
|             GLfloat dsize = psize * dist[i]; | ||||
|  | ||||
|             if (dsize >= ctx->Point.Threshold) { | ||||
|   | ||||
| @@ -1,8 +1,8 @@ | ||||
| /* $Id: state.c,v 1.21 2000/06/30 14:14:37 brianp Exp $ */ | ||||
| /* $Id: state.c,v 1.21.4.4 2000/10/31 19:57:39 brianp Exp $ */ | ||||
|  | ||||
| /* | ||||
|  * Mesa 3-D graphics library | ||||
|  * Version:  3.3 | ||||
|  * Version:  3.4 | ||||
|  * | ||||
|  * Copyright (C) 1999-2000  Brian Paul   All Rights Reserved. | ||||
|  * | ||||
| @@ -778,7 +778,7 @@ static void update_fog_mode( GLcontext *ctx ) | ||||
|    int old_mode = ctx->FogMode; | ||||
|  | ||||
|    if (ctx->Fog.Enabled) { | ||||
|       if (ctx->Texture.Enabled) | ||||
|       if (ctx->Texture.ReallyEnabled) | ||||
|          ctx->FogMode = FOG_FRAGMENT; | ||||
|       else if (ctx->Hint.Fog == GL_NICEST) | ||||
|          ctx->FogMode = FOG_FRAGMENT; | ||||
| @@ -922,8 +922,9 @@ void gl_update_state( GLcontext *ctx ) | ||||
|       gl_update_client_state( ctx ); | ||||
|  | ||||
|    if ((ctx->NewState & NEW_TEXTURE_ENABLE) && | ||||
|        (ctx->Enabled & ENABLE_TEX_ANY) != ctx->Texture.Enabled) | ||||
|        (ctx->Enabled & ENABLE_TEX_ANY) != ctx->Texture.ReallyEnabled) { | ||||
|       ctx->NewState |= NEW_TEXTURING | NEW_RASTER_OPS; | ||||
|    } | ||||
|  | ||||
|    if (ctx->NewState & NEW_TEXTURE_ENV) { | ||||
|       if (ctx->Texture.Unit[0].EnvMode == ctx->Texture.Unit[0].LastEnvMode && | ||||
| @@ -933,21 +934,23 @@ void gl_update_state( GLcontext *ctx ) | ||||
|       ctx->Texture.Unit[1].LastEnvMode = ctx->Texture.Unit[1].EnvMode; | ||||
|    } | ||||
|  | ||||
|    if (ctx->NewState & NEW_TEXTURE_MATRIX) { | ||||
|       ctx->Enabled &= ~(ENABLE_TEXMAT0|ENABLE_TEXMAT1); | ||||
|    /* Update ctx->Enabled's ENABLE_TEXMATn flags */ | ||||
|    if (ctx->NewState & (NEW_TEXTURE_MATRIX | NEW_TEXTURE_ENABLE)) { | ||||
|       ctx->Enabled &= ~(ENABLE_TEXMAT0 | ENABLE_TEXMAT1); | ||||
|  | ||||
|       for (i=0; i < MAX_TEXTURE_UNITS; i++) { | ||||
| 	 if (ctx->TextureMatrix[i].flags & MAT_DIRTY_ALL_OVER) { | ||||
| 	    gl_matrix_analyze( &ctx->TextureMatrix[i] ); | ||||
| 	    ctx->TextureMatrix[i].flags &= ~MAT_DIRTY_DEPENDENTS; | ||||
|  | ||||
| 	    if (ctx->Texture.Unit[i].Enabled && | ||||
| 		ctx->TextureMatrix[i].type != MATRIX_IDENTITY) | ||||
| 	       ctx->Enabled |= ENABLE_TEXMAT0 << i; | ||||
| 	 } | ||||
|          if (ctx->Texture.Unit[i].Enabled && | ||||
|              ctx->TextureMatrix[i].type != MATRIX_IDENTITY) { | ||||
|             ctx->Enabled |= ENABLE_TEXMAT0 << i; | ||||
|          } | ||||
|       } | ||||
|    } | ||||
|  | ||||
|    /* Update ctx->Enabled's ENABLE_TEXGENn and ENABLE_TEXn flags */ | ||||
|    if (ctx->NewState & (NEW_TEXTURING | NEW_TEXTURE_ENABLE)) { | ||||
|       ctx->Texture.NeedNormals = GL_FALSE; | ||||
|       gl_update_dirty_texobjs(ctx); | ||||
| @@ -974,9 +977,11 @@ void gl_update_state( GLcontext *ctx ) | ||||
| 	       } | ||||
| 	    } | ||||
| 	 } | ||||
|          else { | ||||
|             ctx->Texture.Unit[i].ReallyEnabled = 0; | ||||
|          } | ||||
|       } | ||||
|  | ||||
|       ctx->Texture.Enabled = ctx->Enabled & ENABLE_TEX_ANY; | ||||
|       ctx->Enabled = (ctx->Enabled & ~ENABLE_TEX_ANY) | ctx->Texture.ReallyEnabled; | ||||
|       ctx->NeedNormals = (ctx->Light.Enabled || ctx->Texture.NeedNormals); | ||||
|    } | ||||
|  | ||||
| @@ -1187,8 +1192,9 @@ void gl_update_state( GLcontext *ctx ) | ||||
| 	 } | ||||
| 	 ctx->NeedEyeNormals = ctx->NeedEyeCoords; | ||||
|       } | ||||
|       if (ctx->Texture.Enabled || ctx->RenderMode==GL_FEEDBACK) { | ||||
| 	 if (ctx->Texture.NeedEyeCoords) ctx->NeedEyeCoords = GL_TRUE; | ||||
|       if (ctx->Texture.ReallyEnabled || ctx->RenderMode==GL_FEEDBACK) { | ||||
| 	 if (ctx->Texture.NeedEyeCoords) | ||||
|             ctx->NeedEyeCoords = GL_TRUE; | ||||
| 	 if (ctx->Texture.NeedNormals) | ||||
| 	    ctx->NeedNormals = ctx->NeedEyeNormals = GL_TRUE; | ||||
|       } | ||||
|   | ||||
| @@ -1,7 +1,8 @@ | ||||
| /* $Id: teximage.c,v 1.39.4.7 2000/10/16 23:37:16 brianp Exp $ */ | ||||
|  | ||||
| /* | ||||
|  * Mesa 3-D graphics library | ||||
|  * Version:  3.3 | ||||
|  * Version:  3.4 | ||||
|  *  | ||||
|  * Copyright (C) 1999-2000  Brian Paul   All Rights Reserved. | ||||
|  *  | ||||
| @@ -139,21 +140,23 @@ logbase2( int n ) | ||||
| GLint | ||||
| _mesa_base_tex_format( GLcontext *ctx, GLint format ) | ||||
| { | ||||
|   /* | ||||
|    * Ask the driver for the base format, if it doesn't | ||||
|    * know, it will return -1; | ||||
|    */ | ||||
|    if (ctx->Driver.BaseCompressedTexFormat) { | ||||
|       GLint ifmt = (*ctx->Driver.BaseCompressedTexFormat)(ctx, format); | ||||
|       if (ifmt >= 0) { | ||||
|          return ifmt; | ||||
|       } | ||||
|    } | ||||
|    switch (format) { | ||||
|       case GL_COMPRESSED_ALPHA_ARB: | ||||
|          if (ctx && !ctx->Extensions.HaveTextureCompression) | ||||
|             return -1; | ||||
|          /* fall-through */ | ||||
|       case GL_ALPHA: | ||||
|       case GL_ALPHA4: | ||||
|       case GL_ALPHA8: | ||||
|       case GL_ALPHA12: | ||||
|       case GL_ALPHA16: | ||||
|          return GL_ALPHA; | ||||
|       case GL_COMPRESSED_LUMINANCE_ARB: | ||||
|          if (ctx && !ctx->Extensions.HaveTextureCompression) | ||||
|             return -1; | ||||
|          /* fall-through */ | ||||
|       case 1: | ||||
|       case GL_LUMINANCE: | ||||
|       case GL_LUMINANCE4: | ||||
| @@ -161,10 +164,6 @@ _mesa_base_tex_format( GLcontext *ctx, GLint format ) | ||||
|       case GL_LUMINANCE12: | ||||
|       case GL_LUMINANCE16: | ||||
|          return GL_LUMINANCE; | ||||
|       case GL_COMPRESSED_LUMINANCE_ALPHA_ARB: | ||||
|          if (ctx && !ctx->Extensions.HaveTextureCompression) | ||||
|             return -1; | ||||
|          /* fall-through */ | ||||
|       case 2: | ||||
|       case GL_LUMINANCE_ALPHA: | ||||
|       case GL_LUMINANCE4_ALPHA4: | ||||
| @@ -174,31 +173,12 @@ _mesa_base_tex_format( GLcontext *ctx, GLint format ) | ||||
|       case GL_LUMINANCE12_ALPHA12: | ||||
|       case GL_LUMINANCE16_ALPHA16: | ||||
|          return GL_LUMINANCE_ALPHA; | ||||
|       case GL_COMPRESSED_INTENSITY_ARB: | ||||
|          if (ctx && !ctx->Extensions.HaveTextureCompression) | ||||
|             return -1; | ||||
|          /* fall-through */ | ||||
|       case GL_INTENSITY: | ||||
|       case GL_INTENSITY4: | ||||
|       case GL_INTENSITY8: | ||||
|       case GL_INTENSITY12: | ||||
|       case GL_INTENSITY16: | ||||
|          return GL_INTENSITY; | ||||
|       case GL_COMPRESSED_RGB_ARB: | ||||
|          if (ctx && ctx->Extensions.HaveTextureCompression) | ||||
|             return GL_RGB; | ||||
|          else | ||||
|             return -1; | ||||
|       case GL_COMPRESSED_RGB_FXT1_3DFX: | ||||
|          if (ctx && ctx->Extensions.HaveTextureCompressionFXT1) | ||||
|             return GL_RGB; | ||||
|          else | ||||
|             return -1; | ||||
|       case GL_COMPRESSED_RGB_S3TC_DXT1_EXT: | ||||
|          if (ctx && ctx->Extensions.HaveTextureCompressionS3TC) | ||||
|             return GL_RGB; | ||||
|          else | ||||
|             return -1; | ||||
|       case 3: | ||||
|       case GL_RGB: | ||||
|       case GL_R3_G3_B2: | ||||
| @@ -209,23 +189,6 @@ _mesa_base_tex_format( GLcontext *ctx, GLint format ) | ||||
|       case GL_RGB12: | ||||
|       case GL_RGB16: | ||||
|          return GL_RGB; | ||||
|       case GL_COMPRESSED_RGBA_ARB: | ||||
|          if (ctx && ctx->Extensions.HaveTextureCompression) | ||||
|             return GL_RGBA; | ||||
|          else | ||||
|             return -1; | ||||
|       case GL_COMPRESSED_RGBA_FXT1_3DFX: | ||||
|          if (ctx && ctx->Extensions.HaveTextureCompressionFXT1) | ||||
|             return GL_RGBA; | ||||
|          else | ||||
|             return -1; | ||||
|       case GL_COMPRESSED_RGBA_S3TC_DXT1_EXT: | ||||
|       case GL_COMPRESSED_RGBA_S3TC_DXT3_EXT: | ||||
|       case GL_COMPRESSED_RGBA_S3TC_DXT5_EXT: | ||||
|          if (ctx && ctx->Extensions.HaveTextureCompressionS3TC) | ||||
|             return GL_RGBA; | ||||
|          else | ||||
|             return -1; | ||||
|       case 4: | ||||
|       case GL_RGBA: | ||||
|       case GL_RGBA2: | ||||
| @@ -328,25 +291,12 @@ components_in_intformat( GLint format ) | ||||
|  * otherwise. | ||||
|  */ | ||||
| static GLboolean | ||||
| is_compressed_format(GLenum internalFormat) | ||||
| is_compressed_format(GLcontext *ctx, GLenum internalFormat) | ||||
| { | ||||
|    switch (internalFormat) { | ||||
|       case GL_COMPRESSED_ALPHA_ARB: | ||||
|       case GL_COMPRESSED_LUMINANCE_ARB: | ||||
|       case GL_COMPRESSED_LUMINANCE_ALPHA_ARB: | ||||
|       case GL_COMPRESSED_INTENSITY_ARB: | ||||
|       case GL_COMPRESSED_RGB_ARB: | ||||
|       case GL_COMPRESSED_RGBA_ARB: | ||||
|       case GL_COMPRESSED_RGB_S3TC_DXT1_EXT: | ||||
|       case GL_COMPRESSED_RGBA_S3TC_DXT1_EXT: | ||||
|       case GL_COMPRESSED_RGBA_S3TC_DXT3_EXT: | ||||
|       case GL_COMPRESSED_RGBA_S3TC_DXT5_EXT: | ||||
|       case GL_COMPRESSED_RGB_FXT1_3DFX: | ||||
|       case GL_COMPRESSED_RGBA_FXT1_3DFX: | ||||
|          return GL_TRUE; | ||||
|       default: | ||||
|          return GL_FALSE; | ||||
|    } | ||||
|     if (ctx->Driver.IsCompressedFormat) { | ||||
|         return (*ctx->Driver.IsCompressedFormat)(ctx, internalFormat); | ||||
|     } | ||||
|     return GL_FALSE; | ||||
| } | ||||
|  | ||||
|  | ||||
| @@ -511,13 +461,14 @@ _mesa_alloc_texture_image( void ) | ||||
|  * Initialize most fields of a gl_texture_image struct. | ||||
|  */ | ||||
| static void | ||||
| init_texture_image( struct gl_texture_image *img, | ||||
| init_texture_image( GLcontext *ctx, | ||||
|                     struct gl_texture_image *img, | ||||
|                     GLsizei width, GLsizei height, GLsizei depth, | ||||
|                     GLint border, GLenum internalFormat ) | ||||
| { | ||||
|    ASSERT(img); | ||||
|    ASSERT(!img->Data); | ||||
|    img->Format = (GLenum) _mesa_base_tex_format(NULL, internalFormat); | ||||
|    img->Format = (GLenum) _mesa_base_tex_format(ctx, internalFormat); | ||||
|    set_teximage_component_sizes( img ); | ||||
|    img->IntFormat = (GLenum) internalFormat; | ||||
|    img->Border = border; | ||||
| @@ -537,7 +488,7 @@ init_texture_image( struct gl_texture_image *img, | ||||
|    img->Height2 = 1 << img->HeightLog2; | ||||
|    img->Depth2 = 1 << img->DepthLog2; | ||||
|    img->MaxLog2 = MAX2(img->WidthLog2, img->HeightLog2); | ||||
|    img->IsCompressed = is_compressed_format(internalFormat); | ||||
|    img->IsCompressed = is_compressed_format(ctx, internalFormat); | ||||
| } | ||||
|  | ||||
|  | ||||
| @@ -556,13 +507,26 @@ _mesa_free_texture_image( struct gl_texture_image *teximage ) | ||||
|  | ||||
| /* | ||||
|  * Return number of bytes of storage needed to store a compressed texture | ||||
|  * image. | ||||
|  * image.  Only the driver knows for sure.  If the driver can't help us, | ||||
|  * we must return 0. | ||||
|  */ | ||||
| GLuint | ||||
| _mesa_compressed_image_size(GLenum internalFormat, | ||||
|                             GLint width, GLint height, GLint depth) | ||||
| _mesa_compressed_image_size(GLcontext *ctx, | ||||
|                             GLenum internalFormat, | ||||
|                             GLint numDimensions, | ||||
|                             GLint width, | ||||
|                             GLint height, | ||||
|                             GLint depth) | ||||
| { | ||||
|    return 0; | ||||
|    if (ctx->Driver.CompressedImageSize) { | ||||
|       return (*ctx->Driver.CompressedImageSize)(ctx, internalFormat, | ||||
|                                                 numDimensions, | ||||
|                                                 width, height, depth); | ||||
|    } | ||||
|    else { | ||||
|       /* Shouldn't this be an internal error of some sort? */ | ||||
|       return 0; | ||||
|    } | ||||
| } | ||||
|  | ||||
|  | ||||
| @@ -877,6 +841,40 @@ make_null_texture( struct gl_texture_image *texImage ) | ||||
|  | ||||
|  | ||||
|  | ||||
| /* | ||||
|  * This is called when a proxy texture test fails, we set all the | ||||
|  * image members (except DriverData) to zero. | ||||
|  */ | ||||
| static void | ||||
| clear_proxy_teximage(struct gl_texture_image *img) | ||||
| { | ||||
|    ASSERT(img); | ||||
|    img->Format = 0; | ||||
|    img->IntFormat = 0; | ||||
|    img->RedBits = 0; | ||||
|    img->GreenBits = 0; | ||||
|    img->BlueBits = 0; | ||||
|    img->AlphaBits = 0; | ||||
|    img->IntensityBits = 0; | ||||
|    img->LuminanceBits = 0; | ||||
|    img->IndexBits = 0; | ||||
|    img->Border = 0; | ||||
|    img->Width = 0; | ||||
|    img->Height = 0; | ||||
|    img->Depth = 0; | ||||
|    img->Width2 = 0; | ||||
|    img->Height2 = 0; | ||||
|    img->Depth2 = 0; | ||||
|    img->WidthLog2 = 0; | ||||
|    img->HeightLog2 = 0; | ||||
|    img->DepthLog2 = 0; | ||||
|    img->Data = NULL; | ||||
|    img->IsCompressed = 0; | ||||
|    img->CompressedSize = 0; | ||||
| } | ||||
|  | ||||
|  | ||||
|  | ||||
| /* | ||||
|  * Test glTexImage[123]D() parameters for errors. | ||||
|  * Input: | ||||
| @@ -999,7 +997,7 @@ texture_error_check( GLcontext *ctx, GLenum target, | ||||
|       return GL_TRUE; | ||||
|    } | ||||
|  | ||||
|    if (!is_compressed_format(internalFormat)) { | ||||
|    if (!is_compressed_format(ctx, internalFormat)) { | ||||
|       if (!_mesa_is_legal_format_and_type( format, type )) { | ||||
|          /* Yes, generate GL_INVALID_OPERATION, not GL_INVALID_ENUM, if there | ||||
|           * is a type/format mismatch.  See 1.2 spec page 94, sec 3.6.4. | ||||
| @@ -1125,7 +1123,7 @@ subtexture_error_check( GLcontext *ctx, GLuint dimensions, | ||||
|       } | ||||
|    } | ||||
|  | ||||
|    if (!is_compressed_format(destTex->IntFormat)) { | ||||
|    if (!is_compressed_format(ctx, destTex->IntFormat)) { | ||||
|       if (!_mesa_is_legal_format_and_type(format, type)) { | ||||
|          char message[100]; | ||||
|          sprintf(message, "glTexSubImage%dD(format or type)", dimensions); | ||||
| @@ -1343,6 +1341,103 @@ copytexsubimage_error_check( GLcontext *ctx, GLuint dimensions, | ||||
|  | ||||
|  | ||||
|  | ||||
| /* | ||||
|  * Turn generic compressed formats into specific compressed format. | ||||
|  * Some of the compressed formats we don't support, so we | ||||
|  * fall back to the uncompressed format.  (See issue 15 of | ||||
|  * the GL_ARB_texture_compression specification.) | ||||
|  */ | ||||
| static GLint | ||||
| get_specific_compressed_tex_format(GLcontext *ctx, | ||||
|                                    GLint ifmt, GLint numDimensions, | ||||
|                                    GLint     *levelp, | ||||
|                                    GLsizei   *widthp, | ||||
|                                    GLsizei   *heightp, | ||||
|                                    GLsizei   *depthp, | ||||
|                                    GLint     *borderp, | ||||
|                                    GLenum    *formatp, | ||||
|                                    GLenum    *typep) | ||||
| { | ||||
|    char message[100]; | ||||
|    GLint internalFormat = ifmt; | ||||
|  | ||||
|    if (ctx->Extensions.HaveTextureCompression | ||||
|        && ctx->Driver.SpecificCompressedTexFormat) { | ||||
|       /* | ||||
|        * First, ask the driver for the specific format. | ||||
|        * We do this for all formats, since we may want to | ||||
|        * fake one compressed format for another. | ||||
|        */ | ||||
|        internalFormat = (*ctx->Driver.SpecificCompressedTexFormat) | ||||
|                                (ctx, internalFormat, numDimensions, | ||||
|                                 levelp, | ||||
|                                 widthp, heightp, depthp, | ||||
|                                 borderp, formatp, typep); | ||||
|    } | ||||
|  | ||||
|    /* | ||||
|     * Now, convert any generic format left to an uncompressed | ||||
|     * specific format.  If the driver does not support compression | ||||
|     * of the format, we must drop back to the uncompressed format. | ||||
|     * See issue 15 of the GL_ARB_texture_compression specification. | ||||
|     */ | ||||
|    switch (internalFormat) { | ||||
|       case GL_COMPRESSED_ALPHA_ARB: | ||||
|          if (ctx && !ctx->Extensions.HaveTextureCompression) { | ||||
|             sprintf(message, "glTexImage%dD(internalFormat)", numDimensions); | ||||
|             gl_error(ctx, GL_INVALID_VALUE, message); | ||||
|             return -1; | ||||
|          } | ||||
|          internalFormat = GL_ALPHA; | ||||
|          break; | ||||
|       case GL_COMPRESSED_LUMINANCE_ARB: | ||||
|          if (ctx && !ctx->Extensions.HaveTextureCompression) { | ||||
|             sprintf(message, "glTexImage%dD(internalFormat)", numDimensions); | ||||
|             gl_error(ctx, GL_INVALID_VALUE, message); | ||||
|             return -1; | ||||
|          } | ||||
|          internalFormat = GL_LUMINANCE; | ||||
|          break; | ||||
|       case GL_COMPRESSED_LUMINANCE_ALPHA_ARB: | ||||
|          if (ctx && !ctx->Extensions.HaveTextureCompression) { | ||||
|             sprintf(message, "glTexImage%dD(internalFormat)", numDimensions); | ||||
|             gl_error(ctx, GL_INVALID_VALUE, message); | ||||
|             return -1; | ||||
|          } | ||||
|          internalFormat = GL_LUMINANCE_ALPHA; | ||||
|          break; | ||||
|       case GL_COMPRESSED_INTENSITY_ARB: | ||||
|          if (ctx && !ctx->Extensions.HaveTextureCompression) { | ||||
|             sprintf(message, "glTexImage%dD(internalFormat)", numDimensions); | ||||
|             gl_error(ctx, GL_INVALID_VALUE, message); | ||||
|             return -1; | ||||
|          } | ||||
|          internalFormat = GL_INTENSITY; | ||||
|          break; | ||||
|       case GL_COMPRESSED_RGB_ARB: | ||||
|          if (ctx && !ctx->Extensions.HaveTextureCompression) { | ||||
|             sprintf(message, "glTexImage%dD(internalFormat)", numDimensions); | ||||
|             gl_error(ctx, GL_INVALID_VALUE, message); | ||||
|             return -1; | ||||
|          } | ||||
|          internalFormat = GL_RGB; | ||||
|          break; | ||||
|       case GL_COMPRESSED_RGBA_ARB: | ||||
|          if (ctx && !ctx->Extensions.HaveTextureCompression) { | ||||
|             sprintf(message, "glTexImage%dD(internalFormat)", numDimensions); | ||||
|             gl_error(ctx, GL_INVALID_VALUE, message); | ||||
|             return -1; | ||||
|          } | ||||
|          internalFormat = GL_RGBA; | ||||
|          break; | ||||
|       default: | ||||
|          /* silence compiler warning */ | ||||
|          ; | ||||
|    } | ||||
|    return internalFormat; | ||||
| } | ||||
|  | ||||
|  | ||||
| /* | ||||
|  * Called from the API.  Note that width includes the border. | ||||
|  */ | ||||
| @@ -1358,6 +1453,22 @@ _mesa_TexImage1D( GLenum target, GLint level, GLint internalFormat, | ||||
|       struct gl_texture_unit *texUnit; | ||||
|       struct gl_texture_object *texObj; | ||||
|       struct gl_texture_image *texImage; | ||||
|       GLint ifmt; | ||||
|  | ||||
|       ifmt = get_specific_compressed_tex_format(ctx, internalFormat, 1, | ||||
|                                                 &level, | ||||
|                                                 &width, 0, 0, | ||||
|                                                 &border, &format, &type); | ||||
|       if (ifmt < 0) { | ||||
|          /* | ||||
|           * The error here is that we were sent a generic compressed | ||||
|           * format, but the extension is not supported. | ||||
|           */ | ||||
|          return; | ||||
|       } | ||||
|       else { | ||||
|          internalFormat = ifmt; | ||||
|       } | ||||
|  | ||||
|       if (texture_error_check(ctx, target, level, internalFormat, | ||||
|                               format, type, 1, width, 1, 1, border)) { | ||||
| @@ -1382,7 +1493,7 @@ _mesa_TexImage1D( GLenum target, GLint level, GLint internalFormat, | ||||
|       } | ||||
|  | ||||
|       /* setup the teximage struct's fields */ | ||||
|       init_texture_image(texImage, width, 1, 1, border, internalFormat); | ||||
|       init_texture_image(ctx, texImage, width, 1, 1, border, internalFormat); | ||||
|  | ||||
|       /* process the texture image */ | ||||
|       if (pixels) { | ||||
| @@ -1427,19 +1538,24 @@ _mesa_TexImage1D( GLenum target, GLint level, GLint internalFormat, | ||||
|       gl_put_texobj_on_dirty_list( ctx, texObj ); | ||||
|       ctx->NewState |= NEW_TEXTURING; | ||||
|    } | ||||
|    else if (target==GL_PROXY_TEXTURE_1D) { | ||||
|    else if (target == GL_PROXY_TEXTURE_1D) { | ||||
|       /* Proxy texture: check for errors and update proxy state */ | ||||
|       if (texture_error_check(ctx, target, level, internalFormat, | ||||
|                               format, type, 1, width, 1, 1, border)) { | ||||
|       GLenum error = texture_error_check(ctx, target, level, internalFormat, | ||||
|                                          format, type, 1, width, 1, 1, border); | ||||
|       if (!error && ctx->Driver.TestProxyTexImage) { | ||||
|          error = !(*ctx->Driver.TestProxyTexImage)(ctx, target, level, | ||||
|                                                   internalFormat, format, type, | ||||
|                                                   width, 1, 1, border); | ||||
|       } | ||||
|       if (error) { | ||||
|          /* if error, clear all proxy texture image parameters */ | ||||
|          if (level>=0 && level<ctx->Const.MaxTextureLevels) { | ||||
|             MEMSET( ctx->Texture.Proxy1D->Image[level], 0, | ||||
|                     sizeof(struct gl_texture_image) ); | ||||
|             clear_proxy_teximage(ctx->Texture.Proxy1D->Image[level]); | ||||
|          } | ||||
|       } | ||||
|       else { | ||||
|          /* if no error, update proxy texture image parameters */ | ||||
|          init_texture_image(ctx->Texture.Proxy1D->Image[level], | ||||
|          init_texture_image(ctx, ctx->Texture.Proxy1D->Image[level], | ||||
|                             width, 1, 1, border, internalFormat); | ||||
|       } | ||||
|    } | ||||
| @@ -1466,6 +1582,22 @@ _mesa_TexImage2D( GLenum target, GLint level, GLint internalFormat, | ||||
|       struct gl_texture_unit *texUnit; | ||||
|       struct gl_texture_object *texObj; | ||||
|       struct gl_texture_image *texImage; | ||||
|       GLint ifmt; | ||||
|  | ||||
|       ifmt = get_specific_compressed_tex_format(ctx, internalFormat, 2, | ||||
|                                                 &level, | ||||
|                                                 &width, &height, 0, | ||||
|                                                 &border, &format, &type); | ||||
|       if (ifmt < 0) { | ||||
|          /* | ||||
|           * The error here is that we were sent a generic compressed | ||||
|           * format, but the extension is not supported. | ||||
|           */ | ||||
|          return; | ||||
|       } | ||||
|       else { | ||||
|          internalFormat = ifmt; | ||||
|       } | ||||
|  | ||||
|       if (texture_error_check(ctx, target, level, internalFormat, | ||||
|                               format, type, 2, width, height, 1, border)) { | ||||
| @@ -1491,7 +1623,8 @@ _mesa_TexImage2D( GLenum target, GLint level, GLint internalFormat, | ||||
|       } | ||||
|  | ||||
|       /* setup the teximage struct's fields */ | ||||
|       init_texture_image(texImage, width, height, 1, border, internalFormat); | ||||
|       init_texture_image(ctx, texImage, width, height, | ||||
|                          1, border, internalFormat); | ||||
|  | ||||
|       /* process the texture image */ | ||||
|       if (pixels) { | ||||
| @@ -1545,19 +1678,25 @@ _mesa_TexImage2D( GLenum target, GLint level, GLint internalFormat, | ||||
|       gl_put_texobj_on_dirty_list( ctx, texObj ); | ||||
|       ctx->NewState |= NEW_TEXTURING; | ||||
|    } | ||||
|    else if (target==GL_PROXY_TEXTURE_2D) { | ||||
|    else if (target == GL_PROXY_TEXTURE_2D) { | ||||
|       /* Proxy texture: check for errors and update proxy state */ | ||||
|       if (texture_error_check(ctx, target, level, internalFormat, | ||||
|                               format, type, 2, width, height, 1, border)) { | ||||
|       GLenum error = texture_error_check(ctx, target, level, internalFormat, | ||||
|                                     format, type, 2, width, height, 1, border); | ||||
|       if (!error && ctx->Driver.TestProxyTexImage) { | ||||
|          error = !(*ctx->Driver.TestProxyTexImage)(ctx, target, level, | ||||
|                                                   internalFormat, format, type, | ||||
|                                                   width, height, 1, border); | ||||
|       } | ||||
|       if (error) { | ||||
|          /* if error, clear all proxy texture image parameters */ | ||||
|          if (level>=0 && level<ctx->Const.MaxTextureLevels) { | ||||
|             MEMSET( ctx->Texture.Proxy2D->Image[level], 0, | ||||
|                     sizeof(struct gl_texture_image) ); | ||||
|             clear_proxy_teximage(ctx->Texture.Proxy2D->Image[level]); | ||||
|          } | ||||
|       } | ||||
|       else { | ||||
|          /* if no error, update proxy texture image parameters */ | ||||
|          init_texture_image(ctx->Texture.Proxy2D->Image[level], | ||||
|          init_texture_image(ctx, | ||||
|                             ctx->Texture.Proxy2D->Image[level], | ||||
|                             width, height, 1, border, internalFormat); | ||||
|       } | ||||
|    } | ||||
| @@ -1568,7 +1707,6 @@ _mesa_TexImage2D( GLenum target, GLint level, GLint internalFormat, | ||||
| } | ||||
|  | ||||
|  | ||||
|  | ||||
| /* | ||||
|  * Called by the API or display list executor. | ||||
|  * Note that width and height include the border. | ||||
| @@ -1586,6 +1724,23 @@ _mesa_TexImage3D( GLenum target, GLint level, GLint internalFormat, | ||||
|       struct gl_texture_unit *texUnit; | ||||
|       struct gl_texture_object *texObj; | ||||
|       struct gl_texture_image *texImage; | ||||
|       GLint ifmt; | ||||
|  | ||||
|       ifmt = get_specific_compressed_tex_format(ctx, internalFormat, 3, | ||||
|                                                 &level, | ||||
|                                                 &width, &height, &depth, | ||||
|                                                 &border, &format, &type); | ||||
|       if (ifmt < 0) { | ||||
|          /* | ||||
|           * The error here is that we were sent a generic compressed | ||||
|           * format, but the extension is not supported. | ||||
|           */ | ||||
|          return; | ||||
|       } | ||||
|       else { | ||||
|          internalFormat = ifmt; | ||||
|       } | ||||
|  | ||||
|       if (texture_error_check(ctx, target, level, internalFormat, | ||||
|                               format, type, 3, width, height, depth, border)) { | ||||
|          return;   /* error in texture image was detected */ | ||||
| @@ -1609,7 +1764,7 @@ _mesa_TexImage3D( GLenum target, GLint level, GLint internalFormat, | ||||
|       } | ||||
|  | ||||
|       /* setup the teximage struct's fields */ | ||||
|       init_texture_image(texImage, width, height, depth, | ||||
|       init_texture_image(ctx, texImage, width, height, depth, | ||||
|                          border, internalFormat); | ||||
|  | ||||
|       /* process the texture image */ | ||||
| @@ -1655,19 +1810,24 @@ _mesa_TexImage3D( GLenum target, GLint level, GLint internalFormat, | ||||
|       gl_put_texobj_on_dirty_list( ctx, texObj ); | ||||
|       ctx->NewState |= NEW_TEXTURING; | ||||
|    } | ||||
|    else if (target==GL_PROXY_TEXTURE_3D) { | ||||
|    else if (target == GL_PROXY_TEXTURE_3D) { | ||||
|       /* Proxy texture: check for errors and update proxy state */ | ||||
|       if (texture_error_check(ctx, target, level, internalFormat, | ||||
|                               format, type, 3, width, height, depth, border)) { | ||||
|       GLenum error = texture_error_check(ctx, target, level, internalFormat, | ||||
|                                 format, type, 3, width, height, depth, border); | ||||
|       if (!error && ctx->Driver.TestProxyTexImage) { | ||||
|          error = !(*ctx->Driver.TestProxyTexImage)(ctx, target, level, | ||||
|                                                  internalFormat, format, type, | ||||
|                                                  width, height, depth, border); | ||||
|       } | ||||
|       if (error) { | ||||
|          /* if error, clear all proxy texture image parameters */ | ||||
|          if (level>=0 && level<ctx->Const.MaxTextureLevels) { | ||||
|             MEMSET( ctx->Texture.Proxy3D->Image[level], 0, | ||||
|                     sizeof(struct gl_texture_image) ); | ||||
|             clear_proxy_teximage(ctx->Texture.Proxy3D->Image[level]); | ||||
|          } | ||||
|       } | ||||
|       else { | ||||
|          /* if no error, update proxy texture image parameters */ | ||||
|          init_texture_image(ctx->Texture.Proxy3D->Image[level], | ||||
|          init_texture_image(ctx, ctx->Texture.Proxy3D->Image[level], | ||||
|                             width, height, depth, border, internalFormat); | ||||
|       } | ||||
|    } | ||||
| @@ -1780,6 +1940,56 @@ _mesa_get_teximage_from_driver( GLcontext *ctx, GLenum target, GLint level, | ||||
| } | ||||
|  | ||||
|  | ||||
| /* | ||||
|  * Get all the mipmap images for a texture object from the device driver. | ||||
|  * Actually, only get mipmap images if we're using a mipmap filter. | ||||
|  */ | ||||
| GLboolean | ||||
| _mesa_get_teximages_from_driver(GLcontext *ctx, | ||||
|                                 struct gl_texture_object *texObj) | ||||
| { | ||||
|    if (ctx->Driver.GetTexImage) { | ||||
|       static const GLenum targets[] = { | ||||
|          GL_TEXTURE_1D, | ||||
|          GL_TEXTURE_2D, | ||||
|          GL_TEXTURE_3D, | ||||
|          GL_TEXTURE_CUBE_MAP_ARB, | ||||
|          GL_TEXTURE_CUBE_MAP_ARB, | ||||
|          GL_TEXTURE_CUBE_MAP_ARB | ||||
|       }; | ||||
|       GLboolean needLambda = (texObj->MinFilter != texObj->MagFilter); | ||||
|       GLenum target = targets[texObj->Dimensions - 1]; | ||||
|       if (needLambda) { | ||||
|          GLint level; | ||||
|          /* Get images for all mipmap levels.  We might not need them | ||||
|           * all but this is easier.  We're on a (slow) software path | ||||
|           * anyway. | ||||
|           */ | ||||
|          for (level = 0; level <= texObj->P; level++) { | ||||
|             struct gl_texture_image *texImg = texObj->Image[level]; | ||||
|             if (texImg && !texImg->Data) { | ||||
|                _mesa_get_teximage_from_driver(ctx, target, level, texObj); | ||||
|                if (!texImg->Data) | ||||
|                   return GL_FALSE;  /* out of memory */ | ||||
|             } | ||||
|          } | ||||
|       } | ||||
|       else { | ||||
|          GLint level = texObj->BaseLevel; | ||||
|          struct gl_texture_image *texImg = texObj->Image[level]; | ||||
|          if (texImg && !texImg->Data) { | ||||
|             _mesa_get_teximage_from_driver(ctx, target, level, texObj); | ||||
|             if (!texImg->Data) | ||||
|                return GL_FALSE;  /* out of memory */ | ||||
|          } | ||||
|       } | ||||
|       return GL_TRUE; | ||||
|    } | ||||
|    return GL_FALSE; | ||||
| } | ||||
|  | ||||
|  | ||||
|  | ||||
| void | ||||
| _mesa_GetTexImage( GLenum target, GLint level, GLenum format, | ||||
|                    GLenum type, GLvoid *pixels ) | ||||
| @@ -2511,10 +2721,25 @@ _mesa_CompressedTexImage1DARB(GLenum target, GLint level, | ||||
|    GET_CURRENT_CONTEXT(ctx); | ||||
|    ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glCompressedTexImage1DARB"); | ||||
|  | ||||
|    switch (internalFormat) { | ||||
|       case GL_COMPRESSED_ALPHA_ARB: | ||||
|       case GL_COMPRESSED_LUMINANCE_ARB: | ||||
|       case GL_COMPRESSED_LUMINANCE_ALPHA_ARB: | ||||
|       case GL_COMPRESSED_INTENSITY_ARB: | ||||
|       case GL_COMPRESSED_RGB_ARB: | ||||
|       case GL_COMPRESSED_RGBA_ARB: | ||||
|          gl_error(ctx, GL_INVALID_ENUM, "glCompressedTexImage1DARB"); | ||||
|          return; | ||||
|       default: | ||||
|          /* silence compiler warning */ | ||||
|          ; | ||||
|    } | ||||
|  | ||||
|    if (target == GL_TEXTURE_1D) { | ||||
|       struct gl_texture_unit *texUnit; | ||||
|       struct gl_texture_object *texObj; | ||||
|       struct gl_texture_image *texImage; | ||||
|       GLsizei computedImageSize; | ||||
|  | ||||
|       if (texture_error_check(ctx, target, level, internalFormat, | ||||
|                               GL_NONE, GL_NONE, 1, width, 1, 1, border)) { | ||||
| @@ -2539,23 +2764,32 @@ _mesa_CompressedTexImage1DARB(GLenum target, GLint level, | ||||
|       } | ||||
|  | ||||
|       /* setup the teximage struct's fields */ | ||||
|       init_texture_image(texImage, width, 1, 1, border, internalFormat); | ||||
|       init_texture_image(ctx, texImage, width, 1, 1, | ||||
|                          border, internalFormat); | ||||
|  | ||||
|       /* process the texture image */ | ||||
|       if (data) { | ||||
|          GLboolean retain = GL_TRUE; | ||||
|          GLboolean success = GL_FALSE; | ||||
|          if (ctx->Driver.CompressedTexImage1D) { | ||||
|             success = (*ctx->Driver.CompressedTexImage1D)( ctx, target, level, | ||||
|                                               data, texObj, texImage, &retain); | ||||
|             success = (*ctx->Driver.CompressedTexImage1D)(ctx, target, level, | ||||
|                                imageSize, data, texObj, texImage, &retain); | ||||
|          } | ||||
|          if (retain || !success) { | ||||
|             /* make internal copy of the texture image */ | ||||
|             GLuint imageSize = _mesa_compressed_image_size(internalFormat, | ||||
|                                                            width, 1, 1); | ||||
|             texImage->Data = MALLOC(imageSize); | ||||
|             computedImageSize = _mesa_compressed_image_size(ctx, | ||||
|                                                         internalFormat, | ||||
|                                                         1,    /* num dims */ | ||||
|                                                         width, | ||||
|                                                         1,    /* height   */ | ||||
|                                                         1);   /* depth    */ | ||||
|             if (computedImageSize != imageSize) { | ||||
|                 gl_error(ctx, GL_INVALID_VALUE, "glCompressedTexImage1DARB(imageSize)"); | ||||
|                 return; | ||||
|             } | ||||
|             texImage->Data = MALLOC(computedImageSize); | ||||
|             if (texImage->Data) { | ||||
|                MEMCPY(texImage->Data, data, imageSize); | ||||
|                MEMCPY(texImage->Data, data, computedImageSize); | ||||
|             } | ||||
|          } | ||||
|          if (!retain && texImage->Data) { | ||||
| @@ -2567,8 +2801,9 @@ _mesa_CompressedTexImage1DARB(GLenum target, GLint level, | ||||
|          make_null_texture(texImage); | ||||
|          if (ctx->Driver.CompressedTexImage1D) { | ||||
|             GLboolean retain; | ||||
|             (*ctx->Driver.CompressedTexImage1D)( ctx, target, level, | ||||
|                                     texImage->Data, texObj, texImage, &retain); | ||||
|             (*ctx->Driver.CompressedTexImage1D)(ctx, target, level, 0, | ||||
|                                                 texImage->Data, texObj, | ||||
|                                                 texImage, &retain); | ||||
|          } | ||||
|       } | ||||
|  | ||||
| @@ -2578,17 +2813,22 @@ _mesa_CompressedTexImage1DARB(GLenum target, GLint level, | ||||
|    } | ||||
|    else if (target == GL_PROXY_TEXTURE_1D) { | ||||
|       /* Proxy texture: check for errors and update proxy state */ | ||||
|       if (texture_error_check(ctx, target, level, internalFormat, | ||||
|                               GL_NONE, GL_NONE, 1, width, 1, 1, border)) { | ||||
|       GLenum error = texture_error_check(ctx, target, level, internalFormat, | ||||
|                                     GL_NONE, GL_NONE, 1, width, 1, 1, border); | ||||
|       if (!error && ctx->Driver.TestProxyTexImage) { | ||||
|          error = !(*ctx->Driver.TestProxyTexImage)(ctx, target, level, | ||||
|                                              internalFormat, GL_NONE, GL_NONE, | ||||
|                                              width, 1, 1, border); | ||||
|       } | ||||
|       if (error) { | ||||
|          /* if error, clear all proxy texture image parameters */ | ||||
|          if (level>=0 && level<ctx->Const.MaxTextureLevels) { | ||||
|             MEMSET( ctx->Texture.Proxy1D->Image[level], 0, | ||||
|                     sizeof(struct gl_texture_image) ); | ||||
|             clear_proxy_teximage(ctx->Texture.Proxy1D->Image[level]); | ||||
|          } | ||||
|       } | ||||
|       else { | ||||
|          /* if no error, update proxy texture image parameters */ | ||||
|          init_texture_image(ctx->Texture.Proxy1D->Image[level], | ||||
|          init_texture_image(ctx, ctx->Texture.Proxy1D->Image[level], | ||||
|                             width, 1, 1, border, internalFormat); | ||||
|       } | ||||
|    } | ||||
| @@ -2608,6 +2848,20 @@ _mesa_CompressedTexImage2DARB(GLenum target, GLint level, | ||||
|    GET_CURRENT_CONTEXT(ctx); | ||||
|    ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glCompressedTexImage2DARB"); | ||||
|  | ||||
|    switch (internalFormat) { | ||||
|       case GL_COMPRESSED_ALPHA_ARB: | ||||
|       case GL_COMPRESSED_LUMINANCE_ARB: | ||||
|       case GL_COMPRESSED_LUMINANCE_ALPHA_ARB: | ||||
|       case GL_COMPRESSED_INTENSITY_ARB: | ||||
|       case GL_COMPRESSED_RGB_ARB: | ||||
|       case GL_COMPRESSED_RGBA_ARB: | ||||
|          gl_error(ctx, GL_INVALID_ENUM, "glCompressedTexImage2DARB"); | ||||
|          return; | ||||
|       default: | ||||
|          /* silence compiler warning */ | ||||
|          ; | ||||
|    } | ||||
|  | ||||
|    if (target==GL_TEXTURE_2D || | ||||
|        (ctx->Extensions.HaveTextureCubeMap && | ||||
|         target >= GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB && | ||||
| @@ -2615,6 +2869,7 @@ _mesa_CompressedTexImage2DARB(GLenum target, GLint level, | ||||
|       struct gl_texture_unit *texUnit; | ||||
|       struct gl_texture_object *texObj; | ||||
|       struct gl_texture_image *texImage; | ||||
|       GLsizei computedImageSize; | ||||
|  | ||||
|       if (texture_error_check(ctx, target, level, internalFormat, | ||||
|                               GL_NONE, GL_NONE, 1, width, height, 1, border)) { | ||||
| @@ -2639,23 +2894,37 @@ _mesa_CompressedTexImage2DARB(GLenum target, GLint level, | ||||
|       } | ||||
|  | ||||
|       /* setup the teximage struct's fields */ | ||||
|       init_texture_image(texImage, width, height, 1, border, internalFormat); | ||||
|       init_texture_image(ctx, texImage, width, height, 1, border, internalFormat); | ||||
|  | ||||
|       /* process the texture image */ | ||||
|       if (data) { | ||||
|          GLboolean retain = GL_TRUE; | ||||
|          GLboolean success = GL_FALSE; | ||||
|          if (ctx->Driver.CompressedTexImage2D) { | ||||
|             success = (*ctx->Driver.CompressedTexImage2D)( ctx, target, level, | ||||
|                                               data, texObj, texImage, &retain); | ||||
|             success = (*ctx->Driver.CompressedTexImage2D)( ctx, | ||||
|                                                            target, | ||||
|                                                            level, | ||||
|                                                            imageSize, | ||||
|                                                            data, | ||||
|                                                            texObj, | ||||
|                                                            texImage, | ||||
|                                                            &retain); | ||||
|          } | ||||
|          if (retain || !success) { | ||||
|             /* make internal copy of the texture image */ | ||||
|             GLuint imageSize = _mesa_compressed_image_size(internalFormat, | ||||
|                                                            width, height, 1); | ||||
|             texImage->Data = MALLOC(imageSize); | ||||
|             computedImageSize = _mesa_compressed_image_size(ctx, | ||||
|                                                            internalFormat, | ||||
|                                                            2,    /* num dims */ | ||||
|                                                            width, | ||||
|                                                            height, | ||||
|                                                            1);   /* depth    */ | ||||
|             if (computedImageSize != imageSize) { | ||||
|                 gl_error(ctx, GL_INVALID_VALUE, "glCompressedTexImage2DARB(imageSize)"); | ||||
|                 return; | ||||
|             } | ||||
|             texImage->Data = MALLOC(computedImageSize); | ||||
|             if (texImage->Data) { | ||||
|                MEMCPY(texImage->Data, data, imageSize); | ||||
|                MEMCPY(texImage->Data, data, computedImageSize); | ||||
|             } | ||||
|          } | ||||
|          if (!retain && texImage->Data) { | ||||
| @@ -2667,8 +2936,9 @@ _mesa_CompressedTexImage2DARB(GLenum target, GLint level, | ||||
|          make_null_texture(texImage); | ||||
|          if (ctx->Driver.CompressedTexImage2D) { | ||||
|             GLboolean retain; | ||||
|             (*ctx->Driver.CompressedTexImage2D)( ctx, target, level, | ||||
|                                     texImage->Data, texObj, texImage, &retain); | ||||
|             (*ctx->Driver.CompressedTexImage2D)( ctx, target, level, 0, | ||||
|                                                  texImage->Data, texObj, | ||||
|                                                  texImage, &retain); | ||||
|          } | ||||
|       } | ||||
|  | ||||
| @@ -2678,17 +2948,22 @@ _mesa_CompressedTexImage2DARB(GLenum target, GLint level, | ||||
|    } | ||||
|    else if (target == GL_PROXY_TEXTURE_2D) { | ||||
|       /* Proxy texture: check for errors and update proxy state */ | ||||
|       if (texture_error_check(ctx, target, level, internalFormat, | ||||
|                               GL_NONE, GL_NONE, 1, width, 1, 1, border)) { | ||||
|       GLenum error = texture_error_check(ctx, target, level, internalFormat, | ||||
|                                 GL_NONE, GL_NONE, 2, width, height, 1, border); | ||||
|       if (!error && ctx->Driver.TestProxyTexImage) { | ||||
|          error = !(*ctx->Driver.TestProxyTexImage)(ctx, target, level, | ||||
|                                               internalFormat, GL_NONE, GL_NONE, | ||||
|                                               width, height, 1, border); | ||||
|       } | ||||
|       if (error) { | ||||
|          /* if error, clear all proxy texture image parameters */ | ||||
|          if (level>=0 && level<ctx->Const.MaxTextureLevels) { | ||||
|             MEMSET( ctx->Texture.Proxy2D->Image[level], 0, | ||||
|                     sizeof(struct gl_texture_image) ); | ||||
|             clear_proxy_teximage(ctx->Texture.Proxy2D->Image[level]); | ||||
|          } | ||||
|       } | ||||
|       else { | ||||
|          /* if no error, update proxy texture image parameters */ | ||||
|          init_texture_image(ctx->Texture.Proxy2D->Image[level], | ||||
|          init_texture_image(ctx, ctx->Texture.Proxy2D->Image[level], | ||||
|                             width, 1, 1, border, internalFormat); | ||||
|       } | ||||
|    } | ||||
| @@ -2708,10 +2983,25 @@ _mesa_CompressedTexImage3DARB(GLenum target, GLint level, | ||||
|    GET_CURRENT_CONTEXT(ctx); | ||||
|    ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glCompressedTexImage3DARB"); | ||||
|  | ||||
|    switch (internalFormat) { | ||||
|       case GL_COMPRESSED_ALPHA_ARB: | ||||
|       case GL_COMPRESSED_LUMINANCE_ARB: | ||||
|       case GL_COMPRESSED_LUMINANCE_ALPHA_ARB: | ||||
|       case GL_COMPRESSED_INTENSITY_ARB: | ||||
|       case GL_COMPRESSED_RGB_ARB: | ||||
|       case GL_COMPRESSED_RGBA_ARB: | ||||
|          gl_error(ctx, GL_INVALID_ENUM, "glCompressedTexImage3DARB"); | ||||
|          return; | ||||
|       default: | ||||
|          /* silence compiler warning */ | ||||
|          ; | ||||
|    } | ||||
|  | ||||
|    if (target == GL_TEXTURE_3D) { | ||||
|       struct gl_texture_unit *texUnit; | ||||
|       struct gl_texture_object *texObj; | ||||
|       struct gl_texture_image *texImage; | ||||
|       GLsizei computedImageSize; | ||||
|  | ||||
|       if (texture_error_check(ctx, target, level, internalFormat, | ||||
|                           GL_NONE, GL_NONE, 1, width, height, depth, border)) { | ||||
| @@ -2736,23 +3026,34 @@ _mesa_CompressedTexImage3DARB(GLenum target, GLint level, | ||||
|       } | ||||
|  | ||||
|       /* setup the teximage struct's fields */ | ||||
|       init_texture_image(texImage, width, height, depth, border, internalFormat); | ||||
|       init_texture_image(ctx, texImage, width, height, depth, | ||||
|                          border, internalFormat); | ||||
|  | ||||
|       /* process the texture image */ | ||||
|       if (data) { | ||||
|          GLboolean retain = GL_TRUE; | ||||
|          GLboolean success = GL_FALSE; | ||||
|          if (ctx->Driver.CompressedTexImage3D) { | ||||
|             success = (*ctx->Driver.CompressedTexImage3D)( ctx, target, level, | ||||
|                                               data, texObj, texImage, &retain); | ||||
|             success = (*ctx->Driver.CompressedTexImage3D)(ctx, target, level, | ||||
|                                                           imageSize, data, | ||||
|                                                           texObj, texImage, | ||||
|                                                           &retain); | ||||
|          } | ||||
|          if (retain || !success) { | ||||
|             /* make internal copy of the texture image */ | ||||
|             GLuint imageSize = _mesa_compressed_image_size(internalFormat, | ||||
|                                                          width, height, depth); | ||||
|             texImage->Data = MALLOC(imageSize); | ||||
|             computedImageSize = _mesa_compressed_image_size(ctx, | ||||
|                                                             internalFormat, | ||||
|                                                             3,  /* num dims */ | ||||
|                                                             width, | ||||
|                                                             height, | ||||
|                                                             depth); | ||||
|             if (computedImageSize != imageSize) { | ||||
|                 gl_error(ctx, GL_INVALID_VALUE, "glCompressedTexImage3DARB(imageSize)"); | ||||
|                 return; | ||||
|             } | ||||
|             texImage->Data = MALLOC(computedImageSize); | ||||
|             if (texImage->Data) { | ||||
|                MEMCPY(texImage->Data, data, imageSize); | ||||
|                MEMCPY(texImage->Data, data, computedImageSize); | ||||
|             } | ||||
|          } | ||||
|          if (!retain && texImage->Data) { | ||||
| @@ -2764,8 +3065,9 @@ _mesa_CompressedTexImage3DARB(GLenum target, GLint level, | ||||
|          make_null_texture(texImage); | ||||
|          if (ctx->Driver.CompressedTexImage3D) { | ||||
|             GLboolean retain; | ||||
|             (*ctx->Driver.CompressedTexImage3D)( ctx, target, level, | ||||
|                                     texImage->Data, texObj, texImage, &retain); | ||||
|             (*ctx->Driver.CompressedTexImage3D)( ctx, target, level, 0, | ||||
|                                                  texImage->Data, texObj, | ||||
|                                                  texImage, &retain); | ||||
|          } | ||||
|       } | ||||
|  | ||||
| @@ -2775,17 +3077,22 @@ _mesa_CompressedTexImage3DARB(GLenum target, GLint level, | ||||
|    } | ||||
|    else if (target == GL_PROXY_TEXTURE_3D) { | ||||
|       /* Proxy texture: check for errors and update proxy state */ | ||||
|       if (texture_error_check(ctx, target, level, internalFormat, | ||||
|                           GL_NONE, GL_NONE, 1, width, height, depth, border)) { | ||||
|       GLenum error = texture_error_check(ctx, target, level, internalFormat, | ||||
|                             GL_NONE, GL_NONE, 1, width, height, depth, border); | ||||
|       if (!error && ctx->Driver.TestProxyTexImage) { | ||||
|          error = !(*ctx->Driver.TestProxyTexImage)(ctx, target, level, | ||||
|                                              internalFormat, GL_NONE, GL_NONE, | ||||
|                                              width, height, depth, border); | ||||
|       } | ||||
|       if (error) { | ||||
|          /* if error, clear all proxy texture image parameters */ | ||||
|          if (level>=0 && level<ctx->Const.MaxTextureLevels) { | ||||
|             MEMSET( ctx->Texture.Proxy3D->Image[level], 0, | ||||
|                     sizeof(struct gl_texture_image) ); | ||||
|             clear_proxy_teximage(ctx->Texture.Proxy3D->Image[level]); | ||||
|          } | ||||
|       } | ||||
|       else { | ||||
|          /* if no error, update proxy texture image parameters */ | ||||
|          init_texture_image(ctx->Texture.Proxy3D->Image[level], | ||||
|          init_texture_image(ctx, ctx->Texture.Proxy3D->Image[level], | ||||
|                             width, 1, 1, border, internalFormat); | ||||
|       } | ||||
|    } | ||||
| @@ -2829,7 +3136,6 @@ _mesa_CompressedTexSubImage1DARB(GLenum target, GLint level, GLint xoffset, | ||||
|       gl_problem(ctx, "glCompressedTexSubImage1DARB failed!"); | ||||
|       return; | ||||
|    } | ||||
|  | ||||
| } | ||||
|  | ||||
|  | ||||
|   | ||||
| @@ -1,8 +1,8 @@ | ||||
| /* $Id: teximage.h,v 1.11 2000/06/05 07:28:49 joukj Exp $ */ | ||||
| /* $Id: teximage.h,v 1.11.4.2 2000/10/16 23:37:16 brianp Exp $ */ | ||||
|  | ||||
| /* | ||||
|  * Mesa 3-D graphics library | ||||
|  * Version:  3.3 | ||||
|  * Version:  3.4 | ||||
|  *  | ||||
|  * Copyright (C) 1999-2000  Brian Paul   All Rights Reserved. | ||||
|  *  | ||||
| @@ -48,7 +48,9 @@ _mesa_free_texture_image( struct gl_texture_image *teximage ); | ||||
|  | ||||
|  | ||||
| extern GLuint | ||||
| _mesa_compressed_image_size(GLenum internalFormat, | ||||
| _mesa_compressed_image_size(GLcontext *ctx, | ||||
|                             GLenum internalFormat, | ||||
|                             GLint numDimensions, | ||||
|                             GLint width, GLint height, GLint depth); | ||||
|  | ||||
|  | ||||
| @@ -63,8 +65,14 @@ _mesa_select_tex_image(GLcontext *ctx, const struct gl_texture_unit *texUnit, | ||||
|  | ||||
|  | ||||
| extern void | ||||
| _mesa_get_teximage_from_driver( GLcontext *ctx, GLenum target, GLint level, | ||||
|                                 const struct gl_texture_object *texObj ); | ||||
| _mesa_get_teximage_from_driver(GLcontext *ctx, GLenum target, GLint level, | ||||
|                                const struct gl_texture_object *texObj); | ||||
|  | ||||
|  | ||||
| extern GLboolean | ||||
| _mesa_get_teximages_from_driver(GLcontext *ctx, | ||||
|                                 struct gl_texture_object *texObj); | ||||
|  | ||||
|  | ||||
|  | ||||
| /*** API entry point functions ***/ | ||||
|   | ||||
| @@ -1,7 +1,8 @@ | ||||
| /* $Id: texobj.c,v 1.23.4.6 2000/10/24 02:52:36 brianp Exp $ */ | ||||
|  | ||||
| /* | ||||
|  * Mesa 3-D graphics library | ||||
|  * Version:  3.3 | ||||
|  * Version:  3.4 | ||||
|  *  | ||||
|  * Copyright (C) 1999-2000  Brian Paul   All Rights Reserved. | ||||
|  *  | ||||
| @@ -62,9 +63,11 @@ gl_alloc_texture_object( struct gl_shared_state *shared, GLuint name, | ||||
|  | ||||
|    if (obj) { | ||||
|       /* init the non-zero fields */ | ||||
|       _glthread_INIT_MUTEX(obj->Mutex); | ||||
|       obj->RefCount = 1; | ||||
|       obj->Name = name; | ||||
|       obj->Dimensions = dimensions; | ||||
|       obj->Priority = 1.0F; | ||||
|       obj->WrapS = GL_REPEAT; | ||||
|       obj->WrapT = GL_REPEAT; | ||||
|       obj->MinFilter = GL_NEAREST_MIPMAP_LINEAR; | ||||
| @@ -155,6 +158,20 @@ void gl_free_texture_object( struct gl_shared_state *shared, | ||||
|  | ||||
|  | ||||
|  | ||||
| /* | ||||
|  * This is helpful to diagnose incomplete texture problems. | ||||
|  */ | ||||
| #if 0 | ||||
| static void | ||||
| incomplete(const struct gl_texture_object *t, const char *why) | ||||
| { | ||||
|    printf("Texture Obj %d incomplete because: %s\n", t->Name, why); | ||||
| } | ||||
| #else | ||||
| #define incomplete(a, b) | ||||
| #endif | ||||
|  | ||||
|  | ||||
| /* | ||||
|  * Examine a texture object to determine if it is complete or not. | ||||
|  * The t->Complete flag will be set to GL_TRUE or GL_FALSE accordingly. | ||||
| @@ -169,6 +186,7 @@ _mesa_test_texobj_completeness( const GLcontext *ctx, | ||||
|  | ||||
|    /* Always need level zero image */ | ||||
|    if (!t->Image[baseLevel]) { | ||||
|       incomplete(t, "Image[baseLevel] == NULL"); | ||||
|       t->Complete = GL_FALSE; | ||||
|       return; | ||||
|    } | ||||
| @@ -212,6 +230,7 @@ _mesa_test_texobj_completeness( const GLcontext *ctx, | ||||
|           t->NegZ[baseLevel]->Width2 != w || | ||||
|           t->NegZ[baseLevel]->Height2 != h) { | ||||
|          t->Complete = GL_FALSE; | ||||
|          incomplete(t, "Non-quare cubemap image"); | ||||
|          return; | ||||
|       } | ||||
|    } | ||||
| @@ -227,6 +246,7 @@ _mesa_test_texobj_completeness( const GLcontext *ctx, | ||||
|  | ||||
|       if (minLevel > maxLevel) { | ||||
|          t->Complete = GL_FALSE; | ||||
|          incomplete(t, "minLevel > maxLevel"); | ||||
|          return; | ||||
|       } | ||||
|  | ||||
| @@ -235,10 +255,12 @@ _mesa_test_texobj_completeness( const GLcontext *ctx, | ||||
|          if (t->Image[i]) { | ||||
|             if (t->Image[i]->Format != t->Image[baseLevel]->Format) { | ||||
|                t->Complete = GL_FALSE; | ||||
|                incomplete(t, "Format[i] != Format[baseLevel]"); | ||||
|                return; | ||||
|             } | ||||
|             if (t->Image[i]->Border != t->Image[baseLevel]->Border) { | ||||
|                t->Complete = GL_FALSE; | ||||
|                incomplete(t, "Border[i] != Border[baseLevel]"); | ||||
|                return; | ||||
|             } | ||||
|          } | ||||
| @@ -255,10 +277,12 @@ _mesa_test_texobj_completeness( const GLcontext *ctx, | ||||
|             if (i >= minLevel && i <= maxLevel) { | ||||
|                if (!t->Image[i]) { | ||||
|                   t->Complete = GL_FALSE; | ||||
|                   incomplete(t, "1D Image[i] == NULL"); | ||||
|                   return; | ||||
|                } | ||||
|                if (t->Image[i]->Width2 != width ) { | ||||
|                   t->Complete = GL_FALSE; | ||||
|                   incomplete(t, "1D Image[i] bad width"); | ||||
|                   return; | ||||
|                } | ||||
|             } | ||||
| @@ -281,14 +305,17 @@ _mesa_test_texobj_completeness( const GLcontext *ctx, | ||||
|             if (i >= minLevel && i <= maxLevel) { | ||||
|                if (!t->Image[i]) { | ||||
|                   t->Complete = GL_FALSE; | ||||
|                   incomplete(t, "2D Image[i] == NULL"); | ||||
|                   return; | ||||
|                } | ||||
|                if (t->Image[i]->Width2 != width) { | ||||
|                   t->Complete = GL_FALSE; | ||||
|                   incomplete(t, "2D Image[i] bad width"); | ||||
|                   return; | ||||
|                } | ||||
|                if (t->Image[i]->Height2 != height) { | ||||
|                   t->Complete = GL_FALSE; | ||||
|                   incomplete(t, "2D Image[i] bad height"); | ||||
|                   return; | ||||
|                } | ||||
|                if (width==1 && height==1) { | ||||
| @@ -314,19 +341,23 @@ _mesa_test_texobj_completeness( const GLcontext *ctx, | ||||
|             } | ||||
|             if (i >= minLevel && i <= maxLevel) { | ||||
|                if (!t->Image[i]) { | ||||
|                   incomplete(t, "3D Image[i] == NULL"); | ||||
|                   t->Complete = GL_FALSE; | ||||
|                   return; | ||||
|                } | ||||
|                if (t->Image[i]->Width2 != width) { | ||||
|                   t->Complete = GL_FALSE; | ||||
|                   incomplete(t, "3D Image[i] bad width"); | ||||
|                   return; | ||||
|                } | ||||
|                if (t->Image[i]->Height2 != height) { | ||||
|                   t->Complete = GL_FALSE; | ||||
|                   incomplete(t, "3D Image[i] bad height"); | ||||
|                   return; | ||||
|                } | ||||
|                if (t->Image[i]->Depth2 != depth) { | ||||
|                   t->Complete = GL_FALSE; | ||||
|                   incomplete(t, "3D Image[i] bad depth"); | ||||
|                   return; | ||||
|                } | ||||
|             } | ||||
| @@ -352,6 +383,7 @@ _mesa_test_texobj_completeness( const GLcontext *ctx, | ||||
|                    !t->PosY[i]  || !t->NegY[i] || | ||||
|                    !t->PosZ[i]  || !t->NegZ[i]) { | ||||
|                   t->Complete = GL_FALSE; | ||||
|                   incomplete(t, "CubeMap Image[i] == NULL"); | ||||
|                   return; | ||||
|                } | ||||
|                /* check that all six images have same size */ | ||||
| @@ -361,6 +393,7 @@ _mesa_test_texobj_completeness( const GLcontext *ctx, | ||||
|                    t->PosZ[i]->Width2!=width || t->PosZ[i]->Height2!=height || | ||||
|                    t->NegZ[i]->Width2!=width || t->NegZ[i]->Height2!=height) { | ||||
|                   t->Complete = GL_FALSE; | ||||
|                   incomplete(t, "CubeMap Image[i] bad size"); | ||||
|                   return; | ||||
|                } | ||||
|             } | ||||
| @@ -391,11 +424,13 @@ _mesa_GenTextures( GLsizei n, GLuint *texName ) | ||||
|    GLint i; | ||||
|  | ||||
|    ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glGenTextures"); | ||||
|    if (n<0) { | ||||
|    if (n < 0) { | ||||
|       gl_error( ctx, GL_INVALID_VALUE, "glGenTextures" ); | ||||
|       return; | ||||
|    } | ||||
|  | ||||
|    if (!texName) | ||||
|       return; | ||||
|  | ||||
|    /* | ||||
|     * This must be atomic (generation and allocation of texture IDs) | ||||
| @@ -432,6 +467,9 @@ _mesa_DeleteTextures( GLsizei n, const GLuint *texName) | ||||
|  | ||||
|    ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glDeleteTextures"); | ||||
|  | ||||
|    if (!texName) | ||||
|       return; | ||||
|  | ||||
|    for (i=0;i<n;i++) { | ||||
|       struct gl_texture_object *t; | ||||
|       if (texName[i]>0) { | ||||
| @@ -583,6 +621,8 @@ _mesa_BindTexture( GLenum target, GLuint texName ) | ||||
|    /* Pass BindTexture call to device driver */ | ||||
|    if (ctx->Driver.BindTexture) { | ||||
|       (*ctx->Driver.BindTexture)( ctx, target, newTexObj ); | ||||
|       /* Make sure the Driver.UpdateState() function gets called! */ | ||||
|       ctx->NewState |= NEW_TEXTURING; | ||||
|    } | ||||
|  | ||||
|    if (oldTexObj->Name > 0) { | ||||
| @@ -610,19 +650,20 @@ _mesa_PrioritizeTextures( GLsizei n, const GLuint *texName, | ||||
|    GLint i; | ||||
|  | ||||
|    ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glPrioritizeTextures"); | ||||
|    if (n<0) { | ||||
|    if (n < 0) { | ||||
|       gl_error( ctx, GL_INVALID_VALUE, "glPrioritizeTextures" ); | ||||
|       return; | ||||
|    } | ||||
|  | ||||
|    for (i=0;i<n;i++) { | ||||
|       struct gl_texture_object *t; | ||||
|       if (texName[i]>0) { | ||||
|          t = (struct gl_texture_object *) | ||||
|    if (!priorities) | ||||
|       return; | ||||
|  | ||||
|    for (i = 0; i < n; i++) { | ||||
|       if (texName[i] > 0) { | ||||
|          struct gl_texture_object *t = (struct gl_texture_object *) | ||||
|             _mesa_HashLookup(ctx->Shared->TexObjects, texName[i]); | ||||
|          if (t) { | ||||
|             t->Priority = CLAMP( priorities[i], 0.0F, 1.0F ); | ||||
|  | ||||
| 	    if (ctx->Driver.PrioritizeTexture) | ||||
| 	       ctx->Driver.PrioritizeTexture( ctx, t, t->Priority ); | ||||
|          } | ||||
| @@ -636,41 +677,47 @@ _mesa_PrioritizeTextures( GLsizei n, const GLuint *texName, | ||||
|  * Execute glAreTexturesResident  | ||||
|  */ | ||||
| GLboolean | ||||
| _mesa_AreTexturesResident( GLsizei n, const GLuint *texName, | ||||
|                            GLboolean *residences ) | ||||
| _mesa_AreTexturesResident(GLsizei n, const GLuint *texName, | ||||
|                           GLboolean *residences) | ||||
| { | ||||
|    GET_CURRENT_CONTEXT(ctx); | ||||
|    GLboolean resident = GL_TRUE; | ||||
|    GLboolean allResident = GL_TRUE; | ||||
|    GLint i; | ||||
|  | ||||
|    ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH_WITH_RETVAL(ctx,  | ||||
| 						  "glAreTexturesResident", | ||||
| 						  GL_FALSE); | ||||
|    if (n<0) { | ||||
|       gl_error( ctx, GL_INVALID_VALUE, "glAreTexturesResident(n)" ); | ||||
|                                             "glAreTexturesResident", GL_FALSE); | ||||
|    if (n < 0) { | ||||
|       gl_error(ctx, GL_INVALID_VALUE, "glAreTexturesResident(n)"); | ||||
|       return GL_FALSE; | ||||
|    } | ||||
|  | ||||
|    for (i=0;i<n;i++) { | ||||
|    if (!texName || !residences) | ||||
|       return GL_FALSE; | ||||
|  | ||||
|    for (i = 0; i < n; i++) { | ||||
|       struct gl_texture_object *t; | ||||
|       if (texName[i]==0) { | ||||
|          gl_error( ctx, GL_INVALID_VALUE, "glAreTexturesResident(textures)" ); | ||||
|       if (texName[i] == 0) { | ||||
|          gl_error(ctx, GL_INVALID_VALUE, "glAreTexturesResident(textures)"); | ||||
|          return GL_FALSE; | ||||
|       } | ||||
|       t = (struct gl_texture_object *) | ||||
|          _mesa_HashLookup(ctx->Shared->TexObjects, texName[i]); | ||||
|       if (t) { | ||||
| 	 if (ctx->Driver.IsTextureResident) | ||||
| 	    residences[i] = ctx->Driver.IsTextureResident( ctx, t ); | ||||
| 	 else  | ||||
| 	 if (ctx->Driver.IsTextureResident) { | ||||
| 	    residences[i] = ctx->Driver.IsTextureResident(ctx, t); | ||||
|             if (!residences[i]) | ||||
|                allResident = GL_FALSE; | ||||
|          } | ||||
| 	 else { | ||||
| 	    residences[i] = GL_TRUE; | ||||
|          } | ||||
|       } | ||||
|       else { | ||||
|          gl_error( ctx, GL_INVALID_VALUE, "glAreTexturesResident(textures)" ); | ||||
|          gl_error(ctx, GL_INVALID_VALUE, "glAreTexturesResident(textures)"); | ||||
|          return GL_FALSE; | ||||
|       } | ||||
|    } | ||||
|    return resident; | ||||
|    return allResident; | ||||
| } | ||||
|  | ||||
|  | ||||
| @@ -684,7 +731,7 @@ _mesa_IsTexture( GLuint texture ) | ||||
|    GET_CURRENT_CONTEXT(ctx); | ||||
|    ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH_WITH_RETVAL(ctx, "glIsTextures", | ||||
| 						  GL_FALSE); | ||||
|    if (texture>0 && _mesa_HashLookup(ctx->Shared->TexObjects, texture)) { | ||||
|    if (texture > 0 && _mesa_HashLookup(ctx->Shared->TexObjects, texture)) { | ||||
|       return GL_TRUE; | ||||
|    } | ||||
|    else { | ||||
|   | ||||
| @@ -1,8 +1,8 @@ | ||||
| /* $Id: texstate.c,v 1.15 2000/07/05 16:14:24 brianp Exp $ */ | ||||
| /* $Id: texstate.c,v 1.15.4.1 2000/08/01 17:33:51 brianp Exp $ */ | ||||
|  | ||||
| /* | ||||
|  * Mesa 3-D graphics library | ||||
|  * Version:  3.3 | ||||
|  * Version:  3.4 | ||||
|  *  | ||||
|  * Copyright (C) 1999-2000  Brian Paul   All Rights Reserved. | ||||
|  *  | ||||
| @@ -971,7 +971,14 @@ _mesa_GetTexParameterfv( GLenum target, GLenum pname, GLfloat *params ) | ||||
|          params[3] = obj->BorderColor[3] / 255.0F; | ||||
|          break; | ||||
|       case GL_TEXTURE_RESIDENT: | ||||
|          *params = ENUM_TO_FLOAT(GL_TRUE); | ||||
|          { | ||||
|             GLboolean resident; | ||||
|             if (ctx->Driver.IsTextureResident) | ||||
|                resident = ctx->Driver.IsTextureResident(ctx, obj); | ||||
|             else | ||||
|                resident = GL_TRUE; | ||||
|             *params = ENUM_TO_FLOAT(resident); | ||||
|          } | ||||
|          break; | ||||
|       case GL_TEXTURE_PRIORITY: | ||||
|          *params = obj->Priority; | ||||
| @@ -1039,7 +1046,14 @@ _mesa_GetTexParameteriv( GLenum target, GLenum pname, GLint *params ) | ||||
|          } | ||||
|          break; | ||||
|       case GL_TEXTURE_RESIDENT: | ||||
|          *params = (GLint) GL_TRUE; | ||||
|          { | ||||
|             GLboolean resident; | ||||
|             if (ctx->Driver.IsTextureResident) | ||||
|                resident = ctx->Driver.IsTextureResident(ctx, obj); | ||||
|             else | ||||
|                resident = GL_TRUE; | ||||
|             *params = (GLint) resident; | ||||
|          } | ||||
|          break; | ||||
|       case GL_TEXTURE_PRIORITY: | ||||
|          *params = (GLint) obj->Priority; | ||||
|   | ||||
| @@ -1,7 +1,8 @@ | ||||
| /* $Id: texutil.c,v 1.5.4.2 2000/09/13 22:06:36 brianp Exp $ */ | ||||
|  | ||||
| /* | ||||
|  * Mesa 3-D graphics library | ||||
|  * Version:  3.3 | ||||
|  * Version:  3.4 | ||||
|  *  | ||||
|  * Copyright (C) 1999-2000  Brian Paul   All Rights Reserved. | ||||
|  *  | ||||
| @@ -80,7 +81,10 @@ | ||||
|  *   GL_RGBA             GL_UNSIGNED_BYTE                 MESA_A4_R4_G4_B4 | ||||
|  *   GL_BGRA             GL_UNSIGNED_SHORT_4_4_4_4_REV    MESA_A4_R4_G4_B4 | ||||
|  *   GL_BGRA             GL_UNSIGHED_SHORT_1_5_5_5_REV    MESA_A1_R5_G5_B5 | ||||
|  *   GL_RGBA             GL_UNSIGNED_BYTE                 MESA_A1_R5_G5_B5 | ||||
|  *   GL_BGRA             GL_UNSIGNED_INT_8_8_8_8_REV      MESA_A8_R8_G8_B8 | ||||
|  *   GL_RGBA             GL_UNSIGNED_BYTE                 MESA_A8_R8_G8_B8 | ||||
|  *   GL_RGB              GL_UNSIGNED_BYTE                 MESA_A8_R8_G8_B8 | ||||
|  *   more to be added for new drivers... | ||||
|  * | ||||
|  * Notes: | ||||
| @@ -499,7 +503,7 @@ _mesa_convert_teximage(MesaIntTexFormat dstFormat, | ||||
|  | ||||
|       case MESA_A1_R5_G5_B5: | ||||
|          /* store as 16-bit texels (GR_TEXFMT_ARGB_1555) */ | ||||
|          if (srcFormat == GL_RGBA && srcType == GL_UNSIGNED_SHORT_1_5_5_5_REV){ | ||||
|          if (srcFormat == GL_BGRA && srcType == GL_UNSIGNED_SHORT_1_5_5_5_REV){ | ||||
|             /* special, optimized case */ | ||||
|             if (wScale == 1 && hScale == 1) { | ||||
|                const GLubyte *src = _mesa_image_address(packing, srcImage, | ||||
| @@ -586,6 +590,7 @@ _mesa_convert_teximage(MesaIntTexFormat dstFormat, | ||||
|          break; | ||||
|  | ||||
|       case MESA_A8_R8_G8_B8: | ||||
|       case MESA_FF_R8_G8_B8: | ||||
|          /* 32-bit texels */ | ||||
|          if (srcFormat == GL_BGRA && srcType == GL_UNSIGNED_INT_8_8_8_8_REV){ | ||||
|             /* special, optimized case */ | ||||
| @@ -661,13 +666,63 @@ _mesa_convert_teximage(MesaIntTexFormat dstFormat, | ||||
|                } | ||||
|             } | ||||
|          } | ||||
|          else if (srcFormat == GL_RGB && srcType == GL_UNSIGNED_BYTE) { | ||||
|             /* general case */ | ||||
|             if (wScale == 1 && hScale == 1) { | ||||
|                const GLubyte *src = _mesa_image_address(packing, srcImage, | ||||
|                              srcWidth, srcHeight, srcFormat, srcType, 0, 0, 0); | ||||
|                const GLint srcStride = _mesa_image_row_stride(packing, | ||||
|                                                  srcWidth, srcFormat, srcType); | ||||
|                GLuint *dst = dstImage; | ||||
|                GLint row; | ||||
|                for (row = 0; row < dstHeight; row++) { | ||||
|                   GLint col, col3; | ||||
|                   for (col = col3 = 0; col < dstWidth; col++, col3 += 3) { | ||||
|                      GLubyte r = src[col3 + 0]; | ||||
|                      GLubyte g = src[col3 + 1]; | ||||
|                      GLubyte b = src[col3 + 2]; | ||||
|                      GLubyte a = 255; | ||||
|                      dst[col] = (a << 24) | (r << 16) | (g << 8) | b; | ||||
|                   } | ||||
|                   src += srcStride; | ||||
|                   dst = (GLuint *) ((GLubyte *) dst + dstRowStride); | ||||
|                } | ||||
|             } | ||||
|             else { | ||||
|                /* must rescale image */ | ||||
|                GLuint *dst = dstImage; | ||||
|                GLint row; | ||||
|                for (row = 0; row < dstHeight; row++) { | ||||
|                   GLint srcRow = row / hScale; | ||||
|                   const GLubyte *src = _mesa_image_address(packing, srcImage, | ||||
|                         srcWidth, srcHeight, srcFormat, srcType, 0, srcRow, 0); | ||||
|                   GLint col; | ||||
|                   for (col = 0; col < dstWidth; col++) { | ||||
|                      GLint col3 = (col / wScale) * 3; | ||||
|                      GLubyte r = src[col3 + 0]; | ||||
|                      GLubyte g = src[col3 + 1]; | ||||
|                      GLubyte b = src[col3 + 2]; | ||||
|                      GLubyte a = 255; | ||||
|                      dst[col] = (a << 24) | (r << 16) | (g << 8) | b; | ||||
|                   } | ||||
|                   dst = (GLuint *) ((GLubyte *) dst + dstRowStride); | ||||
|                } | ||||
|             } | ||||
|          } | ||||
|          else { | ||||
|             /* can't handle this source format/type combination */ | ||||
|             return GL_FALSE; | ||||
|          } | ||||
|          if (dstFormat == MESA_FF_R8_G8_B8) { | ||||
|             /* set alpha bytes to 0xff */ | ||||
|             GLuint i; | ||||
|             GLubyte *dst = (GLubyte *) dstImage; | ||||
|             for (i = 0; i < dstWidth * dstHeight; i++) { | ||||
|                dst[i * 4 + 3] = 0xff; | ||||
|             } | ||||
|          } | ||||
|          break; | ||||
|  | ||||
|  | ||||
|       default: | ||||
|          /* unexpected internal format! */ | ||||
|          return GL_FALSE; | ||||
| @@ -1049,7 +1104,7 @@ _mesa_convert_texsubimage(MesaIntTexFormat dstFormat, | ||||
|  | ||||
|       case MESA_A1_R5_G5_B5: | ||||
|          /* store as 16-bit texels (GR_TEXFMT_ARGB_1555) */ | ||||
|          if (srcFormat == GL_RGBA && srcType == GL_UNSIGNED_SHORT_1_5_5_5_REV){ | ||||
|          if (srcFormat == GL_BGRA && srcType == GL_UNSIGNED_SHORT_1_5_5_5_REV){ | ||||
|             /* special, optimized case */ | ||||
|             if (wScale == 1 && hScale == 1) { | ||||
|                const GLubyte *src = _mesa_image_address(packing, srcImage, | ||||
| @@ -1140,6 +1195,7 @@ _mesa_convert_texsubimage(MesaIntTexFormat dstFormat, | ||||
|          break; | ||||
|  | ||||
|       case MESA_A8_R8_G8_B8: | ||||
|       case MESA_FF_R8_G8_B8: | ||||
|          /* 32-bit texels */ | ||||
|          if (srcFormat == GL_BGRA && srcType == GL_UNSIGNED_INT_8_8_8_8_REV){ | ||||
|             /* special, optimized case */ | ||||
| @@ -1223,6 +1279,18 @@ _mesa_convert_texsubimage(MesaIntTexFormat dstFormat, | ||||
|             /* can't handle this source format/type combination */ | ||||
|             return GL_FALSE; | ||||
|          } | ||||
|          if (dstFormat == MESA_FF_R8_G8_B8) { | ||||
|             /* set alpha bytes to 0xff */ | ||||
|             GLint row, col; | ||||
|             GLubyte *dst = (GLubyte *) dstImage | ||||
|                            + dstYoffset * dstRowStride + dstXoffset; | ||||
|             for (row = 0; row < height; row++) { | ||||
|                for (col = 0; col < width; col++) { | ||||
|                   dst[col * 4 + 3] = 0xff; | ||||
|                } | ||||
|                dst = dst + dstRowStride; | ||||
|             } | ||||
|          } | ||||
|          break; | ||||
|  | ||||
|  | ||||
| @@ -1491,6 +1559,7 @@ _mesa_unconvert_teximage(MesaIntTexFormat srcFormat, | ||||
|          } | ||||
|          break; | ||||
|       case MESA_A8_R8_G8_B8: | ||||
|       case MESA_FF_R8_G8_B8: | ||||
|          ASSERT(dstFormat == GL_RGBA); | ||||
|          if (wScale == 1 && hScale == 1) { | ||||
|             GLint i, n = dstWidth * dstHeight; | ||||
| @@ -1546,6 +1615,7 @@ _mesa_set_teximage_component_sizes(MesaIntTexFormat mesaFormat, | ||||
|       { MESA_A4_R4_G4_B4,  4, 4, 4, 4, 0, 0, 0 }, | ||||
|       { MESA_A1_R5_G5_B5,  5, 5, 5, 1, 0, 0, 0 }, | ||||
|       { MESA_A8_R8_G8_B8,  8, 8, 8, 8, 0, 0, 0 }, | ||||
|       { MESA_FF_R8_G8_B8,  8, 8, 8, 8, 0, 0, 0 }, | ||||
|       { -1,                0, 0, 0, 0, 0, 0, 0 } | ||||
|    }; | ||||
|    GLint i; | ||||
|   | ||||
| @@ -1,7 +1,8 @@ | ||||
| /* $Id: texutil.h,v 1.3.4.1 2000/08/29 22:58:33 brianp Exp $ */ | ||||
|  | ||||
| /* | ||||
|  * Mesa 3-D graphics library | ||||
|  * Version:  3.3 | ||||
|  * Version:  3.4 | ||||
|  *  | ||||
|  * Copyright (C) 1999-2000  Brian Paul   All Rights Reserved. | ||||
|  *  | ||||
| @@ -32,6 +33,9 @@ | ||||
|  | ||||
|  | ||||
|  | ||||
| /* | ||||
|  * NOTE: "FF" means fill with byte value 0xff | ||||
|  */ | ||||
|                            /* msb <------ TEXEL BITS -----------> lsb */ | ||||
| typedef enum {             /* ---- ---- ---- ---- ---- ---- ---- ---- */ | ||||
|    MESA_I8,                /*                               IIII IIII */ | ||||
| @@ -42,7 +46,8 @@ typedef enum {             /* ---- ---- ---- ---- ---- ---- ---- ---- */ | ||||
|    MESA_R5_G6_B5,          /*                     RRRR RGGG GGGB BBBB */ | ||||
|    MESA_A4_R4_G4_B4,       /*                     AAAA RRRR GGGG BBBB */ | ||||
|    MESA_A1_R5_G5_B5,       /*                     ARRR RRGG GGGB BBBB */ | ||||
|    MESA_A8_R8_G8_B8        /* AAAA AAAA RRRR RRRR GGGG GGGG BBBB BBBB */ | ||||
|    MESA_A8_R8_G8_B8,       /* AAAA AAAA RRRR RRRR GGGG GGGG BBBB BBBB */ | ||||
|    MESA_FF_R8_G8_B8        /* FFFF FFFF RRRR RRRR GGGG GGGG BBBB BBBB */ | ||||
| } MesaIntTexFormat; | ||||
|  | ||||
|  | ||||
|   | ||||
| @@ -1,21 +1,21 @@ | ||||
| /* $Id: 3dnow.c,v 1.5 2000/06/27 22:10:01 brianp Exp $ */ | ||||
| /* $Id: 3dnow.c,v 1.5.4.3 2000/10/22 23:10:51 gareth Exp $ */ | ||||
|  | ||||
| /* | ||||
|  * Mesa 3-D graphics library | ||||
|  * Version:  3.3 | ||||
|  *  | ||||
|  * Version:  3.4 | ||||
|  * | ||||
|  * Copyright (C) 1999-2000  Brian Paul   All Rights Reserved. | ||||
|  *  | ||||
|  * | ||||
|  * Permission is hereby granted, free of charge, to any person obtaining a | ||||
|  * copy of this software and associated documentation files (the "Software"), | ||||
|  * to deal in the Software without restriction, including without limitation | ||||
|  * the rights to use, copy, modify, merge, publish, distribute, sublicense, | ||||
|  * and/or sell copies of the Software, and to permit persons to whom the | ||||
|  * Software is furnished to do so, subject to the following conditions: | ||||
|  *  | ||||
|  * | ||||
|  * The above copyright notice and this permission notice shall be included | ||||
|  * in all copies or substantial portions of the Software. | ||||
|  *  | ||||
|  * | ||||
|  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS | ||||
|  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||||
|  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL | ||||
| @@ -24,175 +24,162 @@ | ||||
|  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||||
|  */ | ||||
|  | ||||
|  | ||||
| /* | ||||
|  * 3DNow! optimizations contributed by | ||||
|  * Holger Waechtler <holger@akaflieg.extern.tu-berlin.de> | ||||
|  */ | ||||
| #if defined(USE_3DNOW_ASM) && defined(USE_X86_ASM) | ||||
| #include "3dnow.h" | ||||
|  | ||||
| #include <limits.h> | ||||
| #include <stdio.h> | ||||
| #include <stdlib.h> | ||||
| #include <math.h> | ||||
|  | ||||
| #include "glheader.h" | ||||
| #include "context.h" | ||||
| #include "types.h" | ||||
| #include "xform.h" | ||||
| #include "vertices.h" | ||||
| #include "xform.h" | ||||
| #include "3dnow.h" | ||||
|  | ||||
| #ifdef DEBUG | ||||
| #include "debug_xform.h" | ||||
| #endif | ||||
|  | ||||
|  | ||||
| #define XFORM_ARGS	GLvector4f *to_vec,				\ | ||||
| 			const GLfloat m[16],				\ | ||||
| 			const GLvector4f *from_vec,			\ | ||||
| 			const GLubyte *mask,				\ | ||||
| 			const GLubyte flag | ||||
|  | ||||
|  | ||||
| #define XFORM_ARGS      GLvector4f *to_vec,             \ | ||||
|                         const GLfloat m[16],            \ | ||||
|                         const GLvector4f *from_vec,     \ | ||||
|                         const GLubyte *mask,            \ | ||||
|                         const GLubyte flag | ||||
| #define DECLARE_XFORM_GROUP( pfx, sz, masked ) \ | ||||
|  extern void _ASMAPI gl_##pfx##_transform_points##sz##_general_##masked( XFORM_ARGS );	    \ | ||||
|  extern void _ASMAPI gl_##pfx##_transform_points##sz##_identity_##masked( XFORM_ARGS );	    \ | ||||
|  extern void _ASMAPI gl_##pfx##_transform_points##sz##_3d_no_rot_##masked( XFORM_ARGS );    \ | ||||
|  extern void _ASMAPI gl_##pfx##_transform_points##sz##_perspective_##masked( XFORM_ARGS );  \ | ||||
|  extern void _ASMAPI gl_##pfx##_transform_points##sz##_2d_##masked( XFORM_ARGS );	    \ | ||||
|  extern void _ASMAPI gl_##pfx##_transform_points##sz##_2d_no_rot_##masked( XFORM_ARGS );    \ | ||||
|  extern void _ASMAPI gl_##pfx##_transform_points##sz##_3d_##masked( XFORM_ARGS ); | ||||
|  | ||||
|  | ||||
| #define ASSIGN_XFORM_GROUP( pfx, cma, sz, masked )			\ | ||||
|    gl_transform_tab[cma][sz][MATRIX_GENERAL] =				\ | ||||
|       gl_##pfx##_transform_points##sz##_general_##masked;		\ | ||||
|    gl_transform_tab[cma][sz][MATRIX_IDENTITY] =				\ | ||||
|       gl_##pfx##_transform_points##sz##_identity_##masked;		\ | ||||
|    gl_transform_tab[cma][sz][MATRIX_3D_NO_ROT] =			\ | ||||
|       gl_##pfx##_transform_points##sz##_3d_no_rot_##masked;		\ | ||||
|    gl_transform_tab[cma][sz][MATRIX_PERSPECTIVE] =			\ | ||||
|       gl_##pfx##_transform_points##sz##_perspective_##masked;		\ | ||||
|    gl_transform_tab[cma][sz][MATRIX_2D] =				\ | ||||
|       gl_##pfx##_transform_points##sz##_2d_##masked;			\ | ||||
|    gl_transform_tab[cma][sz][MATRIX_2D_NO_ROT] =			\ | ||||
|       gl_##pfx##_transform_points##sz##_2d_no_rot_##masked;		\ | ||||
|    gl_transform_tab[cma][sz][MATRIX_3D] =				\ | ||||
|       gl_##pfx##_transform_points##sz##_3d_##masked; | ||||
|  | ||||
|  | ||||
|  | ||||
| #define DECLARE_XFORM_GROUP(pfx, v, masked) \ | ||||
|  extern void _ASMAPI gl##pfx##_transform_points##v##_general_##masked(XFORM_ARGS);    \ | ||||
|  extern void _ASMAPI gl##pfx##_transform_points##v##_identity_##masked(XFORM_ARGS);   \ | ||||
|  extern void _ASMAPI gl##pfx##_transform_points##v##_3d_no_rot_##masked(XFORM_ARGS);  \ | ||||
|  extern void _ASMAPI gl##pfx##_transform_points##v##_perspective_##masked(XFORM_ARGS);\ | ||||
|  extern void _ASMAPI gl##pfx##_transform_points##v##_2d_##masked(XFORM_ARGS);         \ | ||||
|  extern void _ASMAPI gl##pfx##_transform_points##v##_2d_no_rot_##masked(XFORM_ARGS);  \ | ||||
|  extern void _ASMAPI gl##pfx##_transform_points##v##_3d_##masked(XFORM_ARGS); | ||||
| #define NORM_ARGS	const GLmatrix *mat,				\ | ||||
| 			GLfloat scale,					\ | ||||
| 			const GLvector3f *in,				\ | ||||
| 			const GLfloat *lengths,				\ | ||||
| 			const GLubyte mask[],				\ | ||||
| 			GLvector3f *dest | ||||
|  | ||||
|  | ||||
|  | ||||
| #define ASSIGN_XFORM_GROUP( pfx, cma, vsize, masked )           \ | ||||
|  gl_transform_tab[cma][vsize][MATRIX_GENERAL]                   \ | ||||
|   = gl##pfx##_transform_points##vsize##_general_##masked;      \ | ||||
|  gl_transform_tab[cma][vsize][MATRIX_IDENTITY]                  \ | ||||
|   = gl##pfx##_transform_points##vsize##_identity_##masked;     \ | ||||
|  gl_transform_tab[cma][vsize][MATRIX_3D_NO_ROT]                 \ | ||||
|   = gl##pfx##_transform_points##vsize##_3d_no_rot_##masked;    \ | ||||
|  gl_transform_tab[cma][vsize][MATRIX_PERSPECTIVE]               \ | ||||
|   = gl##pfx##_transform_points##vsize##_perspective_##masked;  \ | ||||
|  gl_transform_tab[cma][vsize][MATRIX_2D]                        \ | ||||
|   = gl##pfx##_transform_points##vsize##_2d_##masked;           \ | ||||
|  gl_transform_tab[cma][vsize][MATRIX_2D_NO_ROT]                 \ | ||||
|   = gl##pfx##_transform_points##vsize##_2d_no_rot_##masked;    \ | ||||
|  gl_transform_tab[cma][vsize][MATRIX_3D]                        \ | ||||
|   = gl##pfx##_transform_points##vsize##_3d_##masked; | ||||
| #define DECLARE_NORM_GROUP( pfx, masked ) \ | ||||
|  extern void _ASMAPI gl_##pfx##_rescale_normals_##masked( NORM_ARGS );			    \ | ||||
|  extern void _ASMAPI gl_##pfx##_normalize_normals_##masked( NORM_ARGS );		    \ | ||||
|  extern void _ASMAPI gl_##pfx##_transform_normals_##masked( NORM_ARGS );		    \ | ||||
|  extern void _ASMAPI gl_##pfx##_transform_normals_no_rot_##masked( NORM_ARGS );		    \ | ||||
|  extern void _ASMAPI gl_##pfx##_transform_rescale_normals_##masked( NORM_ARGS );	    \ | ||||
|  extern void _ASMAPI gl_##pfx##_transform_rescale_normals_no_rot_##masked( NORM_ARGS );	    \ | ||||
|  extern void _ASMAPI gl_##pfx##_transform_normalize_normals_##masked( NORM_ARGS );	    \ | ||||
|  extern void _ASMAPI gl_##pfx##_transform_normalize_normals_no_rot_##masked( NORM_ARGS ); | ||||
|  | ||||
|  | ||||
| #define ASSIGN_NORM_GROUP( pfx, cma, masked )				\ | ||||
|    gl_normal_tab[NORM_RESCALE][cma] =					\ | ||||
|       gl_##pfx##_rescale_normals_##masked;				\ | ||||
|    gl_normal_tab[NORM_NORMALIZE][cma] =					\ | ||||
|       gl_##pfx##_normalize_normals_##masked;				\ | ||||
|    gl_normal_tab[NORM_TRANSFORM][cma] =					\ | ||||
|       gl_##pfx##_transform_normals_##masked;				\ | ||||
|    gl_normal_tab[NORM_TRANSFORM_NO_ROT][cma] =				\ | ||||
|       gl_##pfx##_transform_normals_no_rot_##masked;			\ | ||||
|    gl_normal_tab[NORM_TRANSFORM | NORM_RESCALE][cma] =			\ | ||||
|       gl_##pfx##_transform_rescale_normals_##masked;			\ | ||||
|    gl_normal_tab[NORM_TRANSFORM_NO_ROT | NORM_RESCALE][cma] =		\ | ||||
|       gl_##pfx##_transform_rescale_normals_no_rot_##masked;		\ | ||||
|    gl_normal_tab[NORM_TRANSFORM | NORM_NORMALIZE][cma] =		\ | ||||
|       gl_##pfx##_transform_normalize_normals_##masked;			\ | ||||
|    gl_normal_tab[NORM_TRANSFORM_NO_ROT | NORM_NORMALIZE][cma] =		\ | ||||
|       gl_##pfx##_transform_normalize_normals_no_rot_##masked; | ||||
|  | ||||
|  | ||||
| #define NORM_ARGS       const GLmatrix *mat,        \ | ||||
|                         GLfloat scale,              \ | ||||
|                         const GLvector3f *in,       \ | ||||
|                         const GLfloat *lengths,     \ | ||||
|                         const GLubyte mask[],       \ | ||||
|                         GLvector3f *dest  | ||||
| #ifdef USE_3DNOW_ASM | ||||
| DECLARE_XFORM_GROUP( 3dnow, 1, raw ) | ||||
| DECLARE_XFORM_GROUP( 3dnow, 2, raw ) | ||||
| DECLARE_XFORM_GROUP( 3dnow, 3, raw ) | ||||
| DECLARE_XFORM_GROUP( 3dnow, 4, raw ) | ||||
|  | ||||
| DECLARE_XFORM_GROUP( 3dnow, 1, masked ) | ||||
| DECLARE_XFORM_GROUP( 3dnow, 2, masked ) | ||||
| DECLARE_XFORM_GROUP( 3dnow, 3, masked ) | ||||
| DECLARE_XFORM_GROUP( 3dnow, 4, masked ) | ||||
|  | ||||
| DECLARE_NORM_GROUP( 3dnow, raw ) | ||||
| /*DECLARE_NORM_GROUP( 3dnow, masked )*/ | ||||
|  | ||||
| #define DECLARE_NORM_GROUP(pfx, masked)                                        \ | ||||
|  extern void _ASMAPI gl##pfx##_rescale_normals_##masked## (NORM_ARGS);                \ | ||||
|  extern void _ASMAPI gl##pfx##_normalize_normals_##masked## (NORM_ARGS);              \ | ||||
|  extern void _ASMAPI gl##pfx##_transform_normals_##masked## (NORM_ARGS);              \ | ||||
|  extern void _ASMAPI gl##pfx##_transform_normals_no_rot_##masked## (NORM_ARGS);       \ | ||||
|  extern void _ASMAPI gl##pfx##_transform_rescale_normals_##masked## (NORM_ARGS);      \ | ||||
|  extern void _ASMAPI gl##pfx##_transform_rescale_normals_no_rot_##masked## (NORM_ARGS); \ | ||||
|  extern void _ASMAPI gl##pfx##_transform_normalize_normals_##masked## (NORM_ARGS);    \ | ||||
|  extern void _ASMAPI gl##pfx##_transform_normalize_normals_no_rot_##masked## (NORM_ARGS); | ||||
|  | ||||
|  | ||||
|  | ||||
| #define ASSIGN_NORM_GROUP( pfx, cma, masked )                                 \ | ||||
|    gl_normal_tab[NORM_RESCALE][cma]   =                                       \ | ||||
|       gl##pfx##_rescale_normals_##masked##;                                  \ | ||||
|    gl_normal_tab[NORM_NORMALIZE][cma] =                                       \ | ||||
|       gl##pfx##_normalize_normals_##masked##;                                \ | ||||
|    gl_normal_tab[NORM_TRANSFORM][cma] =                                       \ | ||||
|       gl##pfx##_transform_normals_##masked##;                                \ | ||||
|    gl_normal_tab[NORM_TRANSFORM_NO_ROT][cma] =                                \ | ||||
|       gl##pfx##_transform_normals_no_rot_##masked##;                         \ | ||||
|    gl_normal_tab[NORM_TRANSFORM | NORM_RESCALE][cma] =                        \ | ||||
|       gl##pfx##_transform_rescale_normals_##masked##;                        \ | ||||
|    gl_normal_tab[NORM_TRANSFORM_NO_ROT | NORM_RESCALE][cma] =                 \ | ||||
|       gl##pfx##_transform_rescale_normals_no_rot_##masked##;                 \ | ||||
|    gl_normal_tab[NORM_TRANSFORM | NORM_NORMALIZE][cma] =                      \ | ||||
|       gl##pfx##_transform_normalize_normals_##masked##;                      \ | ||||
|    gl_normal_tab[NORM_TRANSFORM_NO_ROT | NORM_NORMALIZE][cma] =               \ | ||||
| 	  gl##pfx##_transform_normalize_normals_no_rot_##masked##; | ||||
|  | ||||
|  | ||||
| extern void _ASMAPI gl_3dnow_project_vertices( GLfloat *first, | ||||
| 				       GLfloat *last, | ||||
| 				       const GLfloat *m, | ||||
| 				       GLuint stride ); | ||||
|  | ||||
| extern void _ASMAPI gl_3dnow_project_clipped_vertices( GLfloat *first, | ||||
| 					       GLfloat *last, | ||||
| 					       const GLfloat *m, | ||||
| 					       GLuint stride, | ||||
| 					       const GLubyte *clipmask ); | ||||
|  | ||||
| extern void _ASMAPI gl_v16_3dnow_general_xform( GLfloat *first_vert, | ||||
| 					const GLfloat *m, | ||||
| 					const GLfloat *src, | ||||
| 					GLuint src_stride, | ||||
| 					GLuint count ); | ||||
| 						const GLfloat *m, | ||||
| 						const GLfloat *src, | ||||
| 						GLuint src_stride, | ||||
| 						GLuint count ); | ||||
|  | ||||
| void gl_init_3dnow_asm_transforms (void) | ||||
| extern void _ASMAPI gl_3dnow_project_vertices( GLfloat *first, | ||||
| 					       GLfloat *last, | ||||
| 					       const GLfloat *m, | ||||
| 					       GLuint stride ); | ||||
|  | ||||
| extern void _ASMAPI gl_3dnow_project_clipped_vertices( GLfloat *first, | ||||
| 						       GLfloat *last, | ||||
| 						       const GLfloat *m, | ||||
| 						       GLuint stride, | ||||
| 						       const GLubyte *clipmask ); | ||||
| #endif | ||||
|  | ||||
|  | ||||
| void gl_init_3dnow_transform_asm( void ) | ||||
| { | ||||
|    DECLARE_XFORM_GROUP( _3dnow, 1, raw ) | ||||
|    DECLARE_XFORM_GROUP( _3dnow, 2, raw ) | ||||
|    DECLARE_XFORM_GROUP( _3dnow, 3, raw ) | ||||
|    DECLARE_XFORM_GROUP( _3dnow, 4, raw ) | ||||
| #ifdef USE_3DNOW_ASM | ||||
|    ASSIGN_XFORM_GROUP( 3dnow, 0, 1, raw ); | ||||
|    ASSIGN_XFORM_GROUP( 3dnow, 0, 2, raw ); | ||||
|    ASSIGN_XFORM_GROUP( 3dnow, 0, 3, raw ); | ||||
|    ASSIGN_XFORM_GROUP( 3dnow, 0, 4, raw ); | ||||
|  | ||||
|    DECLARE_XFORM_GROUP( _3dnow, 1, masked ) | ||||
|    DECLARE_XFORM_GROUP( _3dnow, 2, masked ) | ||||
|    DECLARE_XFORM_GROUP( _3dnow, 3, masked ) | ||||
|    DECLARE_XFORM_GROUP( _3dnow, 4, masked ) | ||||
|    ASSIGN_XFORM_GROUP( 3dnow, CULL_MASK_ACTIVE, 1, masked ); | ||||
|    ASSIGN_XFORM_GROUP( 3dnow, CULL_MASK_ACTIVE, 2, masked ); | ||||
|    ASSIGN_XFORM_GROUP( 3dnow, CULL_MASK_ACTIVE, 3, masked ); | ||||
|    ASSIGN_XFORM_GROUP( 3dnow, CULL_MASK_ACTIVE, 4, masked ); | ||||
|  | ||||
|    DECLARE_NORM_GROUP( _3dnow, raw ) | ||||
| /* DECLARE_NORM_GROUP( _3dnow, masked ) | ||||
| */ | ||||
|  | ||||
|    ASSIGN_XFORM_GROUP( _3dnow, 0, 1, raw ) | ||||
|    ASSIGN_XFORM_GROUP( _3dnow, 0, 2, raw ) | ||||
|    ASSIGN_XFORM_GROUP( _3dnow, 0, 3, raw ) | ||||
|    ASSIGN_XFORM_GROUP( _3dnow, 0, 4, raw ) | ||||
|  | ||||
|    ASSIGN_XFORM_GROUP( _3dnow, CULL_MASK_ACTIVE, 1, masked ) | ||||
|    ASSIGN_XFORM_GROUP( _3dnow, CULL_MASK_ACTIVE, 2, masked ) | ||||
|    ASSIGN_XFORM_GROUP( _3dnow, CULL_MASK_ACTIVE, 3, masked ) | ||||
|    ASSIGN_XFORM_GROUP( _3dnow, CULL_MASK_ACTIVE, 4, masked ) | ||||
|  | ||||
|    ASSIGN_NORM_GROUP( _3dnow, 0, raw ) | ||||
| /* ASSIGN_NORM_GROUP( _3dnow, CULL_MASK_ACTIVE, masked ) | ||||
| */ | ||||
|    ASSIGN_NORM_GROUP( 3dnow, 0, raw ); | ||||
| /* ASSIGN_NORM_GROUP( 3dnow, CULL_MASK_ACTIVE, masked ); */ | ||||
|  | ||||
| #ifdef DEBUG | ||||
|    gl_test_all_transform_functions("3Dnow!"); | ||||
|    gl_test_all_normal_transform_functions("3Dnow!"); | ||||
|    gl_test_all_transform_functions( "3DNow!" ); | ||||
|    gl_test_all_normal_transform_functions( "3DNow!" ); | ||||
| #endif | ||||
| #endif | ||||
|  | ||||
|    /* Hook in some stuff for vertices.c. | ||||
|     */ | ||||
|    gl_xform_points3_v16_general = gl_v16_3dnow_general_xform; | ||||
|    gl_project_v16 = gl_3dnow_project_vertices; | ||||
|    gl_project_clipped_v16 = gl_3dnow_project_clipped_vertices; | ||||
| }  | ||||
|  | ||||
| #else | ||||
|  | ||||
|  | ||||
| /* silence compiler warning */ | ||||
| extern void _mesa_3dnow_dummy_function(void); | ||||
| void _mesa_3dnow_dummy_function(void) | ||||
| { | ||||
| } | ||||
|  | ||||
| void gl_init_3dnow_vertex_asm( void ) | ||||
| { | ||||
| #ifdef USE_3DNOW_ASM | ||||
|    gl_xform_points3_v16_general	= gl_v16_3dnow_general_xform; | ||||
|    gl_project_v16		= gl_3dnow_project_vertices; | ||||
|    gl_project_clipped_v16	= gl_3dnow_project_clipped_vertices; | ||||
|  | ||||
| #if 0 | ||||
|    gl_test_all_vertex_functions( "3DNow!" ); | ||||
| #endif | ||||
| #endif | ||||
| } | ||||
|   | ||||
| @@ -1,21 +1,21 @@ | ||||
| /* $Id: 3dnow.h,v 1.1 1999/08/19 00:55:42 jtg Exp $ */ | ||||
| /* $Id: 3dnow.h,v 1.1.1.1.6.1 2000/10/22 23:10:51 gareth Exp $ */ | ||||
|  | ||||
| /* | ||||
|  * Mesa 3-D graphics library | ||||
|  * Version:  3.1 | ||||
|  *  | ||||
|  * Version:  3.4 | ||||
|  * | ||||
|  * Copyright (C) 1999  Brian Paul   All Rights Reserved. | ||||
|  *  | ||||
|  * | ||||
|  * Permission is hereby granted, free of charge, to any person obtaining a | ||||
|  * copy of this software and associated documentation files (the "Software"), | ||||
|  * to deal in the Software without restriction, including without limitation | ||||
|  * the rights to use, copy, modify, merge, publish, distribute, sublicense, | ||||
|  * and/or sell copies of the Software, and to permit persons to whom the | ||||
|  * Software is furnished to do so, subject to the following conditions: | ||||
|  *  | ||||
|  * | ||||
|  * The above copyright notice and this permission notice shall be included | ||||
|  * in all copies or substantial portions of the Software. | ||||
|  *  | ||||
|  * | ||||
|  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS | ||||
|  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||||
|  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL | ||||
| @@ -24,72 +24,17 @@ | ||||
|  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||||
|  */ | ||||
|  | ||||
|  | ||||
| /* | ||||
|  * 3DNow! optimizations contributed by | ||||
|  * Holger Waechtler <holger@akaflieg.extern.tu-berlin.de> | ||||
|  */ | ||||
|  | ||||
|  | ||||
| #ifndef _3dnow_h | ||||
| #define _3dnow_h | ||||
|  | ||||
|  | ||||
| #ifndef __3DNOW_H__ | ||||
| #define __3DNOW_H__ | ||||
|  | ||||
| #include "xform.h" | ||||
|  | ||||
|  | ||||
| void gl_init_3dnow_asm_transforms (void); | ||||
|  | ||||
|  | ||||
|  | ||||
|  | ||||
| #if 0 | ||||
| GLvector4f *gl_project_points( GLvector4f *proj_vec, | ||||
|                                const GLvector4f *clip_vec ) | ||||
| { | ||||
|    __asm__ ( | ||||
|    "   femms                                                              \n" | ||||
|    "                                                                      \n" | ||||
|    "   movq       (%0),     %%mm0      # x1             | x0              \n" | ||||
|    "   movq       8(%0),    %%mm1      # oow            | x2              \n" | ||||
|    "                                                                      \n" | ||||
|    "1: movq       %%mm1,    %%mm2      # oow            | x2              \n" | ||||
|    "   addl       %2,       %0         # next point                       \n" | ||||
|    "                                                                      \n" | ||||
|    "   punpckhdq  %%mm2,    %%mm2      # oow            | oow             \n" | ||||
|    "   addl       $16,      %1         # next point                       \n" | ||||
|    "                                                                      \n" | ||||
|    "   pfrcp      %%mm2,    %%mm3      # 1/oow          | 1/oow           \n" | ||||
|    "   decl       %3                                                      \n" | ||||
|    "                                                                      \n" | ||||
|    "   pfmul      %%mm3,    %%mm0      # x1/oow         | x0/oow          \n" | ||||
|    "   movq       %%mm0,    -16(%1)    # write r0, r1                     \n" | ||||
|    "                                                                      \n" | ||||
|    "   pfmul      %%mm3,    %%mm1      # 1              | x2/oow          \n" | ||||
|    "   movq       (%0),     %%mm0      # x1             | x0              \n" | ||||
|    "                                                                      \n" | ||||
|    "   movd       %%mm1,    8(%1)      # write r2                         \n" | ||||
|    "   movd       %%mm3,    12(%1)     # write r3                         \n" | ||||
|    "                                                                      \n" | ||||
|    "   movq       8(%0),    %%mm1      # oow            | x2              \n" | ||||
|    "   ja         1b                                                      \n" | ||||
|    "                                                                      \n" | ||||
|    "   femms                                                              \n" | ||||
|    "                                                                        " | ||||
|    ::"a" (clip_vec->start), | ||||
|    "c" (proj_vec->start), | ||||
|    "g" (clip_vec->stride), | ||||
|    "d" (clip_vec->count) | ||||
|    ); | ||||
|  | ||||
|    proj_vec->flags |= VEC_SIZE_4; | ||||
|    proj_vec->size = 3; | ||||
|    proj_vec->count = clip_vec->count; | ||||
|    return proj_vec; | ||||
| } | ||||
| #endif | ||||
|  | ||||
|  | ||||
| void gl_init_3dnow_transform_asm( void ); | ||||
| void gl_init_3dnow_vertex_asm( void ); | ||||
|  | ||||
| #endif | ||||
|   | ||||
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
							
								
								
									
										76
									
								
								src/mesa/x86/clip_args.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										76
									
								
								src/mesa/x86/clip_args.h
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,76 @@ | ||||
| /* $Id: clip_args.h,v 1.1.2.1 2000/10/22 23:10:51 gareth Exp $ */ | ||||
|  | ||||
| /* | ||||
|  * Mesa 3-D graphics library | ||||
|  * Version:  3.4 | ||||
|  * | ||||
|  * Copyright (C) 1999-2000  Brian Paul   All Rights Reserved. | ||||
|  * | ||||
|  * Permission is hereby granted, free of charge, to any person obtaining a | ||||
|  * copy of this software and associated documentation files (the "Software"), | ||||
|  * to deal in the Software without restriction, including without limitation | ||||
|  * the rights to use, copy, modify, merge, publish, distribute, sublicense, | ||||
|  * and/or sell copies of the Software, and to permit persons to whom the | ||||
|  * Software is furnished to do so, subject to the following conditions: | ||||
|  * | ||||
|  * The above copyright notice and this permission notice shall be included | ||||
|  * in all copies or substantial portions of the Software. | ||||
|  * | ||||
|  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS | ||||
|  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||||
|  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL | ||||
|  * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN | ||||
|  * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN | ||||
|  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||||
|  */ | ||||
|  | ||||
| /* | ||||
|  * Clip test function interface for assembly code.  Simply define | ||||
|  * FRAME_OFFSET to the number of bytes pushed onto the stack before | ||||
|  * using the ARG_* argument macros. | ||||
|  * | ||||
|  * Gareth Hughes <gareth@valinux.com> | ||||
|  */ | ||||
|  | ||||
| #ifndef __CLIP_ARGS_H__ | ||||
| #define __CLIP_ARGS_H__ | ||||
|  | ||||
| /* Offsets into GLvector4f | ||||
|  */ | ||||
| #define V4F_DATA	0 | ||||
| #define V4F_START	4 | ||||
| #define V4F_COUNT	8 | ||||
| #define V4F_STRIDE	12 | ||||
| #define V4F_SIZE	16 | ||||
| #define V4F_FLAGS	20 | ||||
|  | ||||
| /* GLvector4f flags | ||||
|  */ | ||||
| #define VEC_SIZE_1	1 | ||||
| #define VEC_SIZE_2	3 | ||||
| #define VEC_SIZE_3	7 | ||||
| #define VEC_SIZE_4	15 | ||||
|  | ||||
| /* | ||||
|  * Offsets for clip_func arguments | ||||
|  * | ||||
|  * typedef GLvector4f *(*clip_func)( GLvector4f *vClip, | ||||
|  *	                             GLvector4f *vProj, | ||||
|  *	                             GLubyte clipMask[], | ||||
|  *	                             GLubyte *orMask, | ||||
|  *	                             GLubyte *andMask ); | ||||
|  */ | ||||
|  | ||||
| #define OFFSET_SOURCE	4 | ||||
| #define OFFSET_DEST	8 | ||||
| #define OFFSET_CLIP	12 | ||||
| #define OFFSET_OR	16 | ||||
| #define OFFSET_AND	20 | ||||
|  | ||||
| #define ARG_SOURCE	REGOFF(FRAME_OFFSET+OFFSET_SOURCE, ESP) | ||||
| #define ARG_DEST	REGOFF(FRAME_OFFSET+OFFSET_DEST, ESP) | ||||
| #define ARG_CLIP	REGOFF(FRAME_OFFSET+OFFSET_CLIP, ESP) | ||||
| #define ARG_OR		REGOFF(FRAME_OFFSET+OFFSET_OR, ESP) | ||||
| #define ARG_AND		REGOFF(FRAME_OFFSET+OFFSET_AND, ESP) | ||||
|  | ||||
| #endif | ||||
| @@ -1,21 +1,21 @@ | ||||
| /* $Id: common_x86.c,v 1.6 2000/01/25 17:04:47 brianp Exp $ */ | ||||
| /* $Id: common_x86.c,v 1.6.4.2 2000/10/22 23:10:51 gareth Exp $ */ | ||||
|  | ||||
| /* | ||||
|  * Mesa 3-D graphics library | ||||
|  * Version:  3.3 | ||||
|  *  | ||||
|  * Version:  3.4 | ||||
|  * | ||||
|  * Copyright (C) 1999-2000  Brian Paul   All Rights Reserved. | ||||
|  *  | ||||
|  * | ||||
|  * Permission is hereby granted, free of charge, to any person obtaining a | ||||
|  * copy of this software and associated documentation files (the "Software"), | ||||
|  * to deal in the Software without restriction, including without limitation | ||||
|  * the rights to use, copy, modify, merge, publish, distribute, sublicense, | ||||
|  * and/or sell copies of the Software, and to permit persons to whom the | ||||
|  * Software is furnished to do so, subject to the following conditions: | ||||
|  *  | ||||
|  * | ||||
|  * The above copyright notice and this permission notice shall be included | ||||
|  * in all copies or substantial portions of the Software. | ||||
|  *  | ||||
|  * | ||||
|  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS | ||||
|  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||||
|  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL | ||||
| @@ -26,81 +26,102 @@ | ||||
|  | ||||
|  | ||||
| /* | ||||
|  *  Check CPU capabilities & initialize optimized funtions for this particular | ||||
|  *   processor. | ||||
|  * Check CPU capabilities & initialize optimized funtions for this particular | ||||
|  * processor. | ||||
|  * | ||||
|  *  Written by Holger Waechtler <holger@akaflieg.extern.tu-berlin.de> | ||||
|  *  Changed by Andre Werthmann <wertmann@cs.uni-potsdam.de> for using the | ||||
|  *  new Katmai functions | ||||
|  * Written by Holger Waechtler <holger@akaflieg.extern.tu-berlin.de> | ||||
|  * Changed by Andre Werthmann <wertmann@cs.uni-potsdam.de> for using the | ||||
|  * new Katmai functions. | ||||
|  */ | ||||
|  | ||||
| #include <stdlib.h> | ||||
| #include <stdio.h> | ||||
| #include "common_x86asm.h" | ||||
|  | ||||
| #include "common_x86_asm.h" | ||||
|  | ||||
|  | ||||
| int gl_x86_cpu_features = 0; | ||||
|  | ||||
| static void message(const char *msg) | ||||
| /* No reason for this to be public. | ||||
|  */ | ||||
| extern int gl_identify_x86_cpu_features( void ); | ||||
|  | ||||
|  | ||||
| static void message( const char *msg ) | ||||
| { | ||||
|    if (getenv("MESA_DEBUG")) | ||||
|       fprintf(stderr, "%s\n", msg); | ||||
|    if ( getenv( "MESA_DEBUG" ) ) { | ||||
|       fprintf( stderr, "%s\n", msg ); | ||||
|    } | ||||
| } | ||||
|  | ||||
|  | ||||
| void gl_init_all_x86_asm (void) | ||||
| void gl_init_all_x86_transform_asm( void ) | ||||
| { | ||||
| #ifdef USE_X86_ASM | ||||
|    gl_x86_cpu_features = gl_identify_x86_cpu_features (); | ||||
|    gl_x86_cpu_features |= GL_CPU_AnyX86; | ||||
|    gl_x86_cpu_features = gl_identify_x86_cpu_features(); | ||||
|  | ||||
|    if (getenv("MESA_NO_ASM") != 0) | ||||
|    if ( getenv( "MESA_NO_ASM" ) ) { | ||||
|       gl_x86_cpu_features = 0; | ||||
|  | ||||
|    if (gl_x86_cpu_features & GL_CPU_GenuineIntel) { | ||||
|       message("GenuineIntel cpu detected."); | ||||
|    } | ||||
|  | ||||
|    if (gl_x86_cpu_features) { | ||||
|       gl_init_x86_asm_transforms (); | ||||
|    if ( gl_x86_cpu_features ) { | ||||
|       gl_init_x86_transform_asm(); | ||||
|    } | ||||
|  | ||||
| #ifdef USE_MMX_ASM | ||||
|    if (gl_x86_cpu_features & GL_CPU_MMX) { | ||||
|       char *s = getenv( "MESA_NO_MMX" ); | ||||
|       if (s == NULL) {  | ||||
|          message("MMX cpu detected."); | ||||
|    if ( cpu_has_mmx ) { | ||||
|       if ( getenv( "MESA_NO_MMX" ) == 0 ) { | ||||
|          message( "MMX cpu detected." ); | ||||
|       } else { | ||||
|          gl_x86_cpu_features &= (~GL_CPU_MMX);  | ||||
|          gl_x86_cpu_features &= ~(X86_FEATURE_MMX); | ||||
|       } | ||||
|    } | ||||
| #endif | ||||
|  | ||||
|  | ||||
| #ifdef USE_3DNOW_ASM | ||||
|    if (gl_x86_cpu_features & GL_CPU_3Dnow) { | ||||
|       char *s = getenv( "MESA_NO_3DNOW" ); | ||||
|       if (s == NULL) { | ||||
|          message("3Dnow cpu detected."); | ||||
|          gl_init_3dnow_asm_transforms (); | ||||
|    if ( cpu_has_3dnow ) { | ||||
|       if ( getenv( "MESA_NO_3DNOW" ) == 0 ) { | ||||
|          message( "3Dnow cpu detected." ); | ||||
|          gl_init_3dnow_transform_asm(); | ||||
|       } else { | ||||
|          gl_x86_cpu_features &= (~GL_CPU_3Dnow);  | ||||
|          gl_x86_cpu_features &= ~(X86_FEATURE_3DNOW); | ||||
|       } | ||||
|    } | ||||
| #endif | ||||
|  | ||||
|  | ||||
| #ifdef USE_KATMAI_ASM | ||||
|    if (gl_x86_cpu_features & GL_CPU_Katmai) { | ||||
|       char *s = getenv( "MESA_NO_KATMAI" ); | ||||
|       if (s == NULL) { | ||||
|          message("Katmai cpu detected."); | ||||
|          gl_init_katmai_asm_transforms (); | ||||
|    if ( cpu_has_xmm ) { | ||||
|       if ( getenv( "MESA_NO_KATMAI" ) == 0 ) { | ||||
|          message( "Katmai cpu detected." ); | ||||
|          gl_init_katmai_transform_asm(); | ||||
|       } else { | ||||
|          gl_x86_cpu_features &= (~GL_CPU_Katmai);  | ||||
|          gl_x86_cpu_features &= ~(X86_FEATURE_XMM); | ||||
|       } | ||||
|    } | ||||
| #endif | ||||
|  | ||||
| #endif | ||||
| } | ||||
|  | ||||
| /* Note: the above function must be called before this one, so that | ||||
|  * gl_x86_cpu_features gets correctly initialized. | ||||
|  */ | ||||
| void gl_init_all_x86_vertex_asm( void ) | ||||
| { | ||||
| #ifdef USE_X86_ASM | ||||
|    if ( gl_x86_cpu_features ) { | ||||
|       gl_init_x86_vertex_asm(); | ||||
|    } | ||||
|  | ||||
| #ifdef USE_3DNOW_ASM | ||||
|    if ( cpu_has_3dnow && getenv( "MESA_NO_3DNOW" ) == 0 ) { | ||||
|       gl_init_3dnow_vertex_asm(); | ||||
|    } | ||||
| #endif | ||||
|  | ||||
| #ifdef USE_KATMAI_ASM | ||||
|    if ( cpu_has_xmm && getenv( "MESA_NO_KATMAI" ) == 0 ) { | ||||
|       gl_init_katmai_vertex_asm(); | ||||
|    } | ||||
| #endif | ||||
| #endif | ||||
| } | ||||
|   | ||||
							
								
								
									
										152
									
								
								src/mesa/x86/common_x86_asm.S
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										152
									
								
								src/mesa/x86/common_x86_asm.S
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,152 @@ | ||||
| /* $Id: common_x86_asm.S,v 1.1.2.1 2000/10/22 23:10:51 gareth Exp $ */ | ||||
|  | ||||
| /* | ||||
|  * Mesa 3-D graphics library | ||||
|  * Version:  3.4 | ||||
|  * | ||||
|  * Copyright (C) 1999-2000  Brian Paul   All Rights Reserved. | ||||
|  * | ||||
|  * Permission is hereby granted, free of charge, to any person obtaining a | ||||
|  * copy of this software and associated documentation files (the "Software"), | ||||
|  * to deal in the Software without restriction, including without limitation | ||||
|  * the rights to use, copy, modify, merge, publish, distribute, sublicense, | ||||
|  * and/or sell copies of the Software, and to permit persons to whom the | ||||
|  * Software is furnished to do so, subject to the following conditions: | ||||
|  * | ||||
|  * The above copyright notice and this permission notice shall be included | ||||
|  * in all copies or substantial portions of the Software. | ||||
|  * | ||||
|  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS | ||||
|  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||||
|  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL | ||||
|  * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN | ||||
|  * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN | ||||
|  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||||
|  */ | ||||
|  | ||||
| /* | ||||
|  * Check extended CPU capabilities.  Now justs returns the raw CPUID | ||||
|  * feature information, allowing the higher level code to interpret the | ||||
|  * results. | ||||
|  * | ||||
|  * Written by Holger Waechtler <holger@akaflieg.extern.tu-berlin.de> | ||||
|  * | ||||
|  * Cleaned up and simplified by Gareth Hughes <gareth@valinux.com> | ||||
|  */ | ||||
|  | ||||
| #include "assyntax.h" | ||||
| #include "common_x86_features.h" | ||||
|  | ||||
|  | ||||
| /* Intel vendor string | ||||
|  */ | ||||
| #define GENU	0x756e6547	/* "Genu" */ | ||||
| #define INEI	0x49656e69	/* "ineI" */ | ||||
| #define NTEL	0x6c65746e	/* "ntel" */ | ||||
|  | ||||
| /* AMD vendor string | ||||
|  */ | ||||
| #define AUTH	0x68747541	/* "Auth" */ | ||||
| #define ENTI	0x69746e65	/* "enti" */ | ||||
| #define CAMD	0x444d4163	/* "cAMD" */ | ||||
|  | ||||
|  | ||||
| 	SEG_DATA | ||||
|  | ||||
| /* We might want to print out some useful messages. | ||||
|  */ | ||||
| LLBL( found_intel ):	STRING( "Genuine Intel processor found\n\0" ) | ||||
| LLBL( found_amd ):	STRING( "Authentic AMD processor found\n\0" ) | ||||
|  | ||||
|  | ||||
| 	SEG_TEXT | ||||
|  | ||||
| ALIGNTEXT4 | ||||
| GLOBL GLNAME( gl_identify_x86_cpu_features ) | ||||
| GLNAME( gl_identify_x86_cpu_features ): | ||||
|  | ||||
| 	PUSH_L	( EBX ) | ||||
|  | ||||
| 	/* Test for the CPUID command.  If the ID Flag bit in EFLAGS | ||||
| 	 * (bit 21) is writable, the CPUID command is present. | ||||
| 	 */ | ||||
| 	PUSHF_L | ||||
| 	POP_L	( EAX ) | ||||
| 	MOV_L	( EAX, ECX ) | ||||
| 	XOR_L	( CONST(0x00200000), EAX ) | ||||
| 	PUSH_L	( EAX ) | ||||
| 	POPF_L | ||||
| 	PUSHF_L | ||||
| 	POP_L	( EAX ) | ||||
|  | ||||
| 	/* Verify the ID Flag bit has been written. | ||||
| 	 */ | ||||
| 	CMP_L	( ECX, EAX ) | ||||
| 	JZ	( LLBL ( cpuid_done ) ) | ||||
|  | ||||
| 	/* Get the CPU vendor info. | ||||
| 	 */ | ||||
| 	XOR_L	( EAX, EAX ) | ||||
| 	CPUID | ||||
|  | ||||
| 	/* Test for Intel processors.  We must look for the | ||||
| 	 * "GenuineIntel" string in EBX, ECX and EDX. | ||||
| 	 */ | ||||
| 	CMP_L	( CONST(GENU), EBX ) | ||||
| 	JNE	( LLBL( cpuid_amd ) ) | ||||
| 	CMP_L	( CONST(INEI), EDX ) | ||||
| 	JNE	( LLBL( cpuid_amd ) ) | ||||
| 	CMP_L	( CONST(NTEL), ECX ) | ||||
| 	JNE	( LLBL( cpuid_amd ) ) | ||||
|  | ||||
| 	/* We have an Intel processor, so we can get the feature | ||||
| 	 * information with an CPUID input value of 1. | ||||
| 	 */ | ||||
| 	MOV_L	( CONST(0x1), EAX ) | ||||
| 	CPUID | ||||
| 	MOV_L	( EDX, EAX ) | ||||
| 	JMP	( LLBL( cpuid_done ) ) | ||||
|  | ||||
| LLBL( cpuid_amd ): | ||||
|  | ||||
| 	/* Test for AMD processors.  We must look for the | ||||
| 	 * "AuthenticAMD" string in EBX, ECX and EDX. | ||||
| 	 */ | ||||
| 	CMP_L	( CONST(AUTH), EBX ) | ||||
| 	JNE	( LLBL( cpuid_other ) ) | ||||
| 	CMP_L	( CONST(ENTI), EDX ) | ||||
| 	JNE	( LLBL( cpuid_other ) ) | ||||
| 	CMP_L	( CONST(CAMD), ECX ) | ||||
| 	JNE	( LLBL( cpuid_other ) ) | ||||
|  | ||||
| 	/* We have an AMD processor, so we can get the feature | ||||
| 	 * information after we verify that the extended functions are | ||||
| 	 * supported. | ||||
| 	 */ | ||||
| 	MOV_L	( CONST(0x80000000), EAX ) | ||||
| 	CPUID | ||||
| 	TEST_L	( EAX, EAX ) | ||||
| 	JZ	( LLBL ( cpuid_failed ) ) | ||||
|  | ||||
| 	MOV_L	( CONST(0x80000001), EAX ) | ||||
| 	CPUID | ||||
| 	MOV_L	( EDX, EAX ) | ||||
| 	JMP	( LLBL ( cpuid_done ) ) | ||||
|  | ||||
| LLBL( cpuid_other ): | ||||
|  | ||||
| 	/* Test for other processors here when required. | ||||
| 	 */ | ||||
|  | ||||
| LLBL( cpuid_failed ): | ||||
|  | ||||
| 	/* If we can't determine the feature information, we must | ||||
| 	 * return zero to indicate that no platform-specific | ||||
| 	 * optimizations can be used. | ||||
| 	 */ | ||||
| 	MOV_L	( CONST(0), EAX ) | ||||
|  | ||||
| LLBL ( cpuid_done ): | ||||
|  | ||||
| 	POP_L	( EBX ) | ||||
| 	RET | ||||
							
								
								
									
										63
									
								
								src/mesa/x86/common_x86_asm.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										63
									
								
								src/mesa/x86/common_x86_asm.h
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,63 @@ | ||||
| /* $Id: common_x86_asm.h,v 1.1.2.1 2000/10/22 23:10:51 gareth Exp $ */ | ||||
|  | ||||
| /* | ||||
|  * Mesa 3-D graphics library | ||||
|  * Version:  3.4 | ||||
|  * | ||||
|  * Copyright (C) 1999  Brian Paul   All Rights Reserved. | ||||
|  * | ||||
|  * Permission is hereby granted, free of charge, to any person obtaining a | ||||
|  * copy of this software and associated documentation files (the "Software"), | ||||
|  * to deal in the Software without restriction, including without limitation | ||||
|  * the rights to use, copy, modify, merge, publish, distribute, sublicense, | ||||
|  * and/or sell copies of the Software, and to permit persons to whom the | ||||
|  * Software is furnished to do so, subject to the following conditions: | ||||
|  * | ||||
|  * The above copyright notice and this permission notice shall be included | ||||
|  * in all copies or substantial portions of the Software. | ||||
|  * | ||||
|  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS | ||||
|  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||||
|  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL | ||||
|  * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN | ||||
|  * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN | ||||
|  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||||
|  */ | ||||
|  | ||||
| /* | ||||
|  * Check CPU capabilities & initialize optimized funtions for this particular | ||||
|  * processor. | ||||
|  * | ||||
|  * Written by Holger Waechtler <holger@akaflieg.extern.tu-berlin.de> | ||||
|  * Changed by Andre Werthmann <wertmann@cs.uni-potsdam.de> for using the | ||||
|  * new Katmai functions | ||||
|  * | ||||
|  * Reimplemented by Gareth Hughes <gareth@valinux.com> in a more | ||||
|  * future-proof manner, based on code in the Linux kernel. | ||||
|  */ | ||||
|  | ||||
| #ifndef __COMMON_X86_ASM_H__ | ||||
| #define __COMMON_X86_ASM_H__ | ||||
|  | ||||
| #include "common_x86_features.h" | ||||
|  | ||||
| #ifdef HAVE_CONFIG_H | ||||
| #include "conf.h" | ||||
| #endif | ||||
|  | ||||
| #ifdef USE_X86_ASM | ||||
| #include "x86.h" | ||||
| #ifdef USE_3DNOW_ASM | ||||
| #include "3dnow.h" | ||||
| #endif | ||||
| #ifdef USE_KATMAI_ASM | ||||
| #include "katmai.h" | ||||
| #endif | ||||
| #endif | ||||
|  | ||||
| extern int gl_x86_cpu_features; | ||||
|  | ||||
| extern void gl_init_all_x86_transform_asm( void ); | ||||
| extern void gl_init_all_x86_vertex_asm( void ); | ||||
|  | ||||
| #endif | ||||
							
								
								
									
										77
									
								
								src/mesa/x86/common_x86_features.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										77
									
								
								src/mesa/x86/common_x86_features.h
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,77 @@ | ||||
| /* $Id: common_x86_features.h,v 1.1.2.1 2000/10/22 23:10:51 gareth Exp $ */ | ||||
|  | ||||
| /* | ||||
|  * Mesa 3-D graphics library | ||||
|  * Version:  3.4 | ||||
|  * | ||||
|  * Copyright (C) 1999  Brian Paul   All Rights Reserved. | ||||
|  * | ||||
|  * Permission is hereby granted, free of charge, to any person obtaining a | ||||
|  * copy of this software and associated documentation files (the "Software"), | ||||
|  * to deal in the Software without restriction, including without limitation | ||||
|  * the rights to use, copy, modify, merge, publish, distribute, sublicense, | ||||
|  * and/or sell copies of the Software, and to permit persons to whom the | ||||
|  * Software is furnished to do so, subject to the following conditions: | ||||
|  * | ||||
|  * The above copyright notice and this permission notice shall be included | ||||
|  * in all copies or substantial portions of the Software. | ||||
|  * | ||||
|  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS | ||||
|  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||||
|  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL | ||||
|  * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN | ||||
|  * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN | ||||
|  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||||
|  */ | ||||
|  | ||||
| /* | ||||
|  * x86 CPUID feature information.  The raw data is returned by | ||||
|  * gl_identify_x86_cpu_features() and interpreted with the cpu_has_* | ||||
|  * helper macros. | ||||
|  * | ||||
|  * Gareth Hughes <gareth@valinux.com> | ||||
|  */ | ||||
|  | ||||
| #ifndef __COMMON_X86_FEATURES_H__ | ||||
| #define __COMMON_X86_FEATURES_H__ | ||||
|  | ||||
| /* Capabilities of CPUs | ||||
|  */ | ||||
| #define X86_FEATURE_FPU		0x00000001 | ||||
| #define X86_FEATURE_VME		0x00000002 | ||||
| #define X86_FEATURE_DE		0x00000004 | ||||
| #define X86_FEATURE_PSE		0x00000008 | ||||
| #define X86_FEATURE_TSC		0x00000010 | ||||
| #define X86_FEATURE_MSR		0x00000020 | ||||
| #define X86_FEATURE_PAE		0x00000040 | ||||
| #define X86_FEATURE_MCE		0x00000080 | ||||
| #define X86_FEATURE_CX8		0x00000100 | ||||
| #define X86_FEATURE_APIC	0x00000200 | ||||
| #define X86_FEATURE_10		0x00000400 | ||||
| #define X86_FEATURE_SEP		0x00000800 | ||||
| #define X86_FEATURE_MTRR	0x00001000 | ||||
| #define X86_FEATURE_PGE		0x00002000 | ||||
| #define X86_FEATURE_MCA		0x00004000 | ||||
| #define X86_FEATURE_CMOV	0x00008000 | ||||
| #define X86_FEATURE_PAT		0x00010000 | ||||
| #define X86_FEATURE_PSE36	0x00020000 | ||||
| #define X86_FEATURE_18		0x00040000 | ||||
| #define X86_FEATURE_19		0x00080000 | ||||
| #define X86_FEATURE_20		0x00100000 | ||||
| #define X86_FEATURE_21		0x00200000 | ||||
| #define X86_FEATURE_MMXEXT	0x00400000 | ||||
| #define X86_FEATURE_MMX		0x00800000 | ||||
| #define X86_FEATURE_FXSR	0x01000000 | ||||
| #define X86_FEATURE_XMM		0x02000000 | ||||
| #define X86_FEATURE_26		0x04000000 | ||||
| #define X86_FEATURE_27		0x08000000 | ||||
| #define X86_FEATURE_28		0x10000000 | ||||
| #define X86_FEATURE_29		0x20000000 | ||||
| #define X86_FEATURE_3DNOWEXT	0x40000000 | ||||
| #define X86_FEATURE_3DNOW	0x80000000 | ||||
|  | ||||
| #define cpu_has_mmx		(gl_x86_cpu_features & X86_FEATURE_MMX) | ||||
| #define cpu_has_xmm		(gl_x86_cpu_features & X86_FEATURE_XMM) | ||||
| #define cpu_has_3dnow		(gl_x86_cpu_features & X86_FEATURE_3DNOW) | ||||
|  | ||||
| #endif | ||||
| @@ -5,9 +5,9 @@ | ||||
| #ifndef __WIN32__ | ||||
|  | ||||
| #if defined(USE_MGL_NAMESPACE) | ||||
| #define GL_PREFIX(n) GLNAME(mgl ## n) | ||||
| #define GL_PREFIX(n) GLNAME(CONCAT(mgl,n)) | ||||
| #else | ||||
| #define GL_PREFIX(n) GLNAME(gl ## n) | ||||
| #define GL_PREFIX(n) GLNAME(CONCAT(gl,n)) | ||||
| #endif | ||||
|  | ||||
| #define GL_OFFSET(x) CODEPTR(REGOFF(4 * x, EAX)) | ||||
|   | ||||
| @@ -1,20 +1,20 @@ | ||||
|  | ||||
| /* | ||||
|  * Mesa 3-D graphics library | ||||
|  * Version:  3.1 | ||||
|  *  | ||||
|  * Version:  3.4 | ||||
|  * | ||||
|  * Copyright (C) 1999  Brian Paul   All Rights Reserved. | ||||
|  *  | ||||
|  * | ||||
|  * Permission is hereby granted, free of charge, to any person obtaining a | ||||
|  * copy of this software and associated documentation files (the "Software"), | ||||
|  * to deal in the Software without restriction, including without limitation | ||||
|  * the rights to use, copy, modify, merge, publish, distribute, sublicense, | ||||
|  * and/or sell copies of the Software, and to permit persons to whom the | ||||
|  * Software is furnished to do so, subject to the following conditions: | ||||
|  *  | ||||
|  * | ||||
|  * The above copyright notice and this permission notice shall be included | ||||
|  * in all copies or substantial portions of the Software. | ||||
|  *  | ||||
|  * | ||||
|  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS | ||||
|  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||||
|  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL | ||||
|   | ||||
| @@ -350,7 +350,3 @@ LLBL(GMBT_1): | ||||
|     MOV_L     ( EBP, ESP ) | ||||
|     POP_L     ( EBP ) | ||||
|     RET | ||||
|  | ||||
|  | ||||
|  | ||||
|  | ||||
|   | ||||
| @@ -1,21 +1,21 @@ | ||||
| /* $Id: x86.c,v 1.8 2000/06/27 22:10:01 brianp Exp $ */ | ||||
| /* $Id: x86.c,v 1.8.4.1 2000/10/22 23:10:51 gareth Exp $ */ | ||||
|  | ||||
| /* | ||||
|  * Mesa 3-D graphics library | ||||
|  * Version:  3.1 | ||||
|  *  | ||||
|  * Version:  3.4 | ||||
|  * | ||||
|  * Copyright (C) 1999  Brian Paul   All Rights Reserved. | ||||
|  *  | ||||
|  * | ||||
|  * Permission is hereby granted, free of charge, to any person obtaining a | ||||
|  * copy of this software and associated documentation files (the "Software"), | ||||
|  * to deal in the Software without restriction, including without limitation | ||||
|  * the rights to use, copy, modify, merge, publish, distribute, sublicense, | ||||
|  * and/or sell copies of the Software, and to permit persons to whom the | ||||
|  * Software is furnished to do so, subject to the following conditions: | ||||
|  *  | ||||
|  * | ||||
|  * The above copyright notice and this permission notice shall be included | ||||
|  * in all copies or substantial portions of the Software. | ||||
|  *  | ||||
|  * | ||||
|  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS | ||||
|  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||||
|  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL | ||||
| @@ -28,7 +28,6 @@ | ||||
|  * Intel x86 assembly code by Josh Vanderhoof | ||||
|  */ | ||||
|  | ||||
|  | ||||
| #include "glheader.h" | ||||
| #include "context.h" | ||||
| #include "types.h" | ||||
| @@ -36,89 +35,104 @@ | ||||
| #include "xform.h" | ||||
| #include "x86.h" | ||||
|  | ||||
| #ifdef USE_X86_ASM | ||||
| extern void _ASMAPI gl_v16_x86_cliptest_points4( GLfloat *first_vert, | ||||
| 					GLfloat *last_vert, | ||||
| 					GLubyte *or_mask, | ||||
| 					GLubyte *and_mask, | ||||
| 					GLubyte *clip_mask ); | ||||
| #ifdef DEBUG | ||||
| #include "debug_xform.h" | ||||
| #endif | ||||
|  | ||||
|  | ||||
| #define XFORM_ARGS 	GLvector4f *to_vec, 				\ | ||||
| 			const GLfloat m[16], 				\ | ||||
| 			const GLvector4f *from_vec, 			\ | ||||
| 			const GLubyte *mask, 				\ | ||||
| 			const GLubyte flag | ||||
|  | ||||
|  | ||||
| #define DECLARE_XFORM_GROUP( pfx, sz, masked ) \ | ||||
|  extern void _ASMAPI gl_##pfx##_transform_points##sz##_general_##masked( XFORM_ARGS );	    \ | ||||
|  extern void _ASMAPI gl_##pfx##_transform_points##sz##_identity_##masked( XFORM_ARGS );	    \ | ||||
|  extern void _ASMAPI gl_##pfx##_transform_points##sz##_3d_no_rot_##masked( XFORM_ARGS );    \ | ||||
|  extern void _ASMAPI gl_##pfx##_transform_points##sz##_perspective_##masked( XFORM_ARGS );  \ | ||||
|  extern void _ASMAPI gl_##pfx##_transform_points##sz##_2d_##masked( XFORM_ARGS );	    \ | ||||
|  extern void _ASMAPI gl_##pfx##_transform_points##sz##_2d_no_rot_##masked( XFORM_ARGS );    \ | ||||
|  extern void _ASMAPI gl_##pfx##_transform_points##sz##_3d_##masked( XFORM_ARGS ); | ||||
|  | ||||
|  | ||||
| #define ASSIGN_XFORM_GROUP( pfx, cma, sz, masked )			\ | ||||
|    gl_transform_tab[cma][sz][MATRIX_GENERAL] =				\ | ||||
|       gl_##pfx##_transform_points##sz##_general_##masked;		\ | ||||
|    gl_transform_tab[cma][sz][MATRIX_IDENTITY] =				\ | ||||
|       gl_##pfx##_transform_points##sz##_identity_##masked;		\ | ||||
|    gl_transform_tab[cma][sz][MATRIX_3D_NO_ROT] =			\ | ||||
|       gl_##pfx##_transform_points##sz##_3d_no_rot_##masked;		\ | ||||
|    gl_transform_tab[cma][sz][MATRIX_PERSPECTIVE] =			\ | ||||
|       gl_##pfx##_transform_points##sz##_perspective_##masked;		\ | ||||
|    gl_transform_tab[cma][sz][MATRIX_2D] =				\ | ||||
|       gl_##pfx##_transform_points##sz##_2d_##masked;			\ | ||||
|    gl_transform_tab[cma][sz][MATRIX_2D_NO_ROT] =			\ | ||||
|       gl_##pfx##_transform_points##sz##_2d_no_rot_##masked;		\ | ||||
|    gl_transform_tab[cma][sz][MATRIX_3D] =				\ | ||||
|       gl_##pfx##_transform_points##sz##_3d_##masked; | ||||
|  | ||||
|  | ||||
| #ifdef USE_X86_ASM | ||||
| DECLARE_XFORM_GROUP( x86, 2, raw ) | ||||
| DECLARE_XFORM_GROUP( x86, 3, raw ) | ||||
| DECLARE_XFORM_GROUP( x86, 4, raw ) | ||||
| DECLARE_XFORM_GROUP( x86, 2, masked ) | ||||
| DECLARE_XFORM_GROUP( x86, 3, masked ) | ||||
| DECLARE_XFORM_GROUP( x86, 4, masked ) | ||||
|  | ||||
|  | ||||
| extern GLvector4f * _ASMAPI gl_x86_cliptest_points4( GLvector4f *clip_vec, | ||||
| 						     GLvector4f *proj_vec, | ||||
| 						     GLubyte clipMask[], | ||||
| 						     GLubyte *orMask, | ||||
| 						     GLubyte *andMask ); | ||||
|  | ||||
|  | ||||
| extern void _ASMAPI gl_v16_x86_cliptest_points4( GLfloat *first_vert, | ||||
| 						 GLfloat *last_vert, | ||||
| 						 GLubyte *or_mask, | ||||
| 						 GLubyte *and_mask, | ||||
| 						 GLubyte *clip_mask ); | ||||
|  | ||||
|  | ||||
|    | ||||
| extern void _ASMAPI gl_v16_x86_general_xform( GLfloat *dest, | ||||
| 				     const GLfloat *m, | ||||
| 				     const GLfloat *src, | ||||
| 				     GLuint src_stride, | ||||
| 					      const GLfloat *m, | ||||
| 					      const GLfloat *src, | ||||
| 					      GLuint src_stride, | ||||
| 					      GLuint count ); | ||||
| #endif | ||||
|  | ||||
|  | ||||
| #define XFORM_ARGS 	GLvector4f *to_vec, 		\ | ||||
| 			const GLfloat m[16], 		\ | ||||
| 			const GLvector4f *from_vec, 	\ | ||||
| 			const GLubyte *mask, 		\ | ||||
| 			const GLubyte flag | ||||
|  | ||||
| #define DECLARE_XFORM_GROUP(pfx, vsize, masked) \ | ||||
|  extern void _ASMAPI gl_##pfx##_transform_points##vsize##_general_##masked(XFORM_ARGS);     \ | ||||
|  extern void _ASMAPI gl_##pfx##_transform_points##vsize##_identity_##masked(XFORM_ARGS);    \ | ||||
|  extern void _ASMAPI gl_##pfx##_transform_points##vsize##_3d_no_rot_##masked(XFORM_ARGS);   \ | ||||
|  extern void _ASMAPI gl_##pfx##_transform_points##vsize##_perspective_##masked(XFORM_ARGS);     \ | ||||
|  extern void _ASMAPI gl_##pfx##_transform_points##vsize##_2d_##masked(XFORM_ARGS);      \ | ||||
|  extern void _ASMAPI gl_##pfx##_transform_points##vsize##_2d_no_rot_##masked(XFORM_ARGS);   \ | ||||
|  extern void _ASMAPI gl_##pfx##_transform_points##vsize##_3d_##masked(XFORM_ARGS); | ||||
|  | ||||
| #define ASSIGN_XFORM_GROUP( pfx, cma, vsize, masked ) 		\ | ||||
|  gl_transform_tab[cma][vsize][MATRIX_GENERAL] 			\ | ||||
|   = gl_##pfx##_transform_points##vsize##_general_##masked; 	\ | ||||
|  gl_transform_tab[cma][vsize][MATRIX_IDENTITY] 			\ | ||||
|   = gl_##pfx##_transform_points##vsize##_identity_##masked; 	\ | ||||
|  gl_transform_tab[cma][vsize][MATRIX_3D_NO_ROT] 		\ | ||||
|   = gl_##pfx##_transform_points##vsize##_3d_no_rot_##masked; 	\ | ||||
|  gl_transform_tab[cma][vsize][MATRIX_PERSPECTIVE] 		\ | ||||
|   = gl_##pfx##_transform_points##vsize##_perspective_##masked; 	\ | ||||
|  gl_transform_tab[cma][vsize][MATRIX_2D] 			\ | ||||
|   = gl_##pfx##_transform_points##vsize##_2d_##masked; 		\ | ||||
|  gl_transform_tab[cma][vsize][MATRIX_2D_NO_ROT] 		\ | ||||
|   = gl_##pfx##_transform_points##vsize##_2d_no_rot_##masked; 	\ | ||||
|  gl_transform_tab[cma][vsize][MATRIX_3D] 			\ | ||||
|   = gl_##pfx##_transform_points##vsize##_3d_##masked; | ||||
|  | ||||
|  | ||||
| #ifdef USE_X86_ASM | ||||
|    DECLARE_XFORM_GROUP( x86, 2, raw ) | ||||
|    DECLARE_XFORM_GROUP( x86, 3, raw ) | ||||
|    DECLARE_XFORM_GROUP( x86, 4, raw ) | ||||
|    DECLARE_XFORM_GROUP( x86, 2, masked ) | ||||
|    DECLARE_XFORM_GROUP( x86, 3, masked ) | ||||
|    DECLARE_XFORM_GROUP( x86, 4, masked ) | ||||
|  | ||||
|    extern GLvector4f  * _ASMAPI gl_x86_cliptest_points4( GLvector4f *clip_vec,  | ||||
|                                                GLvector4f *proj_vec,  | ||||
|                                                GLubyte clipMask[], | ||||
|                                                GLubyte *orMask,  | ||||
|                                                GLubyte *andMask ); | ||||
| #endif | ||||
|  | ||||
|  | ||||
| void gl_init_x86_asm_transforms( void ) | ||||
| void gl_init_x86_transform_asm( void ) | ||||
| { | ||||
| #ifdef USE_X86_ASM | ||||
|    ASSIGN_XFORM_GROUP( x86, 0, 2, raw ) | ||||
|    ASSIGN_XFORM_GROUP( x86, 0, 3, raw ) | ||||
|    ASSIGN_XFORM_GROUP( x86, 0, 4, raw ) | ||||
|    ASSIGN_XFORM_GROUP( x86, 0, 2, raw ); | ||||
|    ASSIGN_XFORM_GROUP( x86, 0, 3, raw ); | ||||
|    ASSIGN_XFORM_GROUP( x86, 0, 4, raw ); | ||||
|  | ||||
|    ASSIGN_XFORM_GROUP( x86, CULL_MASK_ACTIVE, 2, masked ) | ||||
|    ASSIGN_XFORM_GROUP( x86, CULL_MASK_ACTIVE, 3, masked ) | ||||
|    ASSIGN_XFORM_GROUP( x86, CULL_MASK_ACTIVE, 4, masked ) | ||||
|    ASSIGN_XFORM_GROUP( x86, CULL_MASK_ACTIVE, 2, masked ); | ||||
|    ASSIGN_XFORM_GROUP( x86, CULL_MASK_ACTIVE, 3, masked ); | ||||
|    ASSIGN_XFORM_GROUP( x86, CULL_MASK_ACTIVE, 4, masked ); | ||||
|  | ||||
|    /* XXX this function has been found to cause FP overflow exceptions */ | ||||
|    gl_clip_tab[4] = gl_x86_cliptest_points4; | ||||
|  | ||||
| #ifdef DEBUG | ||||
|    gl_test_all_transform_functions("x86"); | ||||
|    gl_test_all_transform_functions( "x86" ); | ||||
| #endif | ||||
| #endif | ||||
| } | ||||
|  | ||||
| void gl_init_x86_vertex_asm( void ) | ||||
| { | ||||
| #ifdef USE_X86_ASM | ||||
|    gl_xform_points3_v16_general	= gl_v16_x86_general_xform; | ||||
|    gl_cliptest_points4_v16	= gl_v16_x86_cliptest_points4; | ||||
|  | ||||
| #if 0 | ||||
|    gl_test_all_vertex_functions( "x86" ); | ||||
| #endif | ||||
|  | ||||
|    gl_cliptest_points4_v16 = gl_v16_x86_cliptest_points4; | ||||
|    gl_xform_points3_v16_general = gl_v16_x86_general_xform; | ||||
| #endif | ||||
| } | ||||
|   | ||||
| @@ -1,21 +1,21 @@ | ||||
| /* $Id: x86.h,v 1.1 1999/08/19 00:55:42 jtg Exp $ */ | ||||
| /* $Id: x86.h,v 1.1.1.1.6.1 2000/10/22 23:10:51 gareth Exp $ */ | ||||
|  | ||||
| /* | ||||
|  * Mesa 3-D graphics library | ||||
|  * Version:  3.1 | ||||
|  *  | ||||
|  * Version:  3.4 | ||||
|  * | ||||
|  * Copyright (C) 1999  Brian Paul   All Rights Reserved. | ||||
|  *  | ||||
|  * | ||||
|  * Permission is hereby granted, free of charge, to any person obtaining a | ||||
|  * copy of this software and associated documentation files (the "Software"), | ||||
|  * to deal in the Software without restriction, including without limitation | ||||
|  * the rights to use, copy, modify, merge, publish, distribute, sublicense, | ||||
|  * and/or sell copies of the Software, and to permit persons to whom the | ||||
|  * Software is furnished to do so, subject to the following conditions: | ||||
|  *  | ||||
|  * | ||||
|  * The above copyright notice and this permission notice shall be included | ||||
|  * in all copies or substantial portions of the Software. | ||||
|  *  | ||||
|  * | ||||
|  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS | ||||
|  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||||
|  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL | ||||
| @@ -28,10 +28,10 @@ | ||||
|  * Intel x86 assembly code by Josh Vanderhoof | ||||
|  */ | ||||
|  | ||||
| #ifndef __X86_H__ | ||||
| #define __X86_H__ | ||||
|  | ||||
| #ifndef X86_H | ||||
| #define X86_H | ||||
|  | ||||
| extern void gl_init_x86_asm_transforms(void); | ||||
| extern void gl_init_x86_transform_asm( void ); | ||||
| extern void gl_init_x86_vertex_asm( void ); | ||||
|  | ||||
| #endif | ||||
|   | ||||
							
								
								
									
										248
									
								
								src/mesa/x86/x86_cliptest.S
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										248
									
								
								src/mesa/x86/x86_cliptest.S
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,248 @@ | ||||
| /* $Id: x86_cliptest.S,v 1.1.2.1 2000/10/22 23:10:51 gareth Exp $ */ | ||||
|  | ||||
| /* | ||||
|  * Mesa 3-D graphics library | ||||
|  * Version:  3.4 | ||||
|  * | ||||
|  * Copyright (C) 1999-2000  Brian Paul   All Rights Reserved. | ||||
|  * | ||||
|  * Permission is hereby granted, free of charge, to any person obtaining a | ||||
|  * copy of this software and associated documentation files (the "Software"), | ||||
|  * to deal in the Software without restriction, including without limitation | ||||
|  * the rights to use, copy, modify, merge, publish, distribute, sublicense, | ||||
|  * and/or sell copies of the Software, and to permit persons to whom the | ||||
|  * Software is furnished to do so, subject to the following conditions: | ||||
|  * | ||||
|  * The above copyright notice and this permission notice shall be included | ||||
|  * in all copies or substantial portions of the Software. | ||||
|  * | ||||
|  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS | ||||
|  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||||
|  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL | ||||
|  * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN | ||||
|  * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN | ||||
|  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||||
|  */ | ||||
|  | ||||
| #include "assyntax.h" | ||||
| #include "clip_args.h" | ||||
|  | ||||
| #define FP_ONE		1065353216 | ||||
| #define FP_ZERO		0 | ||||
|  | ||||
| #define SRC(i)		REGOFF(i * 4, ESI) | ||||
| #define DST(i)		REGOFF(i * 4, EDI) | ||||
| #define MAT(i)		REGOFF(i * 4, EDX) | ||||
|  | ||||
|  | ||||
| /* | ||||
|  * Table for clip test. | ||||
|  * | ||||
|  * 	bit6 = SRC(3) < 0 | ||||
|  * 	bit5 = SRC(2) < 0 | ||||
|  * 	bit4 = abs(S(2)) > abs(S(3)) | ||||
|  * 	bit3 = SRC(1) < 0 | ||||
|  * 	bit2 = abs(S(1)) > abs(S(3)) | ||||
|  * 	bit1 = SRC(0) < 0 | ||||
|  * 	bit0 = abs(S(0)) > abs(S(3)) | ||||
|  */ | ||||
|  | ||||
| 	SEG_DATA | ||||
|  | ||||
| clip_table: | ||||
| 	D_BYTE 0, 1, 0, 2, 4, 5, 4, 6 | ||||
| 	D_BYTE 0, 1, 0, 2, 8, 9, 8, 10 | ||||
| 	D_BYTE 32, 33, 32, 34, 36, 37, 36, 38 | ||||
| 	D_BYTE 32, 33, 32, 34, 40, 41, 40, 42 | ||||
| 	D_BYTE 0, 1, 0, 2, 4, 5, 4, 6 | ||||
| 	D_BYTE 0, 1, 0, 2, 8, 9, 8, 10 | ||||
| 	D_BYTE 16, 17, 16, 18, 20, 21, 20, 22 | ||||
| 	D_BYTE 16, 17, 16, 18, 24, 25, 24, 26 | ||||
| 	D_BYTE 63, 61, 63, 62, 55, 53, 55, 54 | ||||
| 	D_BYTE 63, 61, 63, 62, 59, 57, 59, 58 | ||||
| 	D_BYTE 47, 45, 47, 46, 39, 37, 39, 38 | ||||
| 	D_BYTE 47, 45, 47, 46, 43, 41, 43, 42 | ||||
| 	D_BYTE 63, 61, 63, 62, 55, 53, 55, 54 | ||||
| 	D_BYTE 63, 61, 63, 62, 59, 57, 59, 58 | ||||
| 	D_BYTE 31, 29, 31, 30, 23, 21, 23, 22 | ||||
| 	D_BYTE 31, 29, 31, 30, 27, 25, 27, 26 | ||||
|  | ||||
|  | ||||
| 	SEG_TEXT | ||||
|  | ||||
| /* | ||||
|  * gl_x86_cliptest_points4 | ||||
|  * | ||||
|  *   AL:  ormask | ||||
|  *   AH:  andmask | ||||
|  *   EBX: temp0 | ||||
|  *   ECX: temp1 | ||||
|  *   EDX: clipmask[] | ||||
|  *   ESI: clip[] | ||||
|  *   EDI: proj[] | ||||
|  *   EBP: temp2 | ||||
|  */ | ||||
|  | ||||
| #if defined(__ELF__) && defined(__PIC__) && !defined(ELFPIC) | ||||
| #define ELFPIC | ||||
| #endif | ||||
|  | ||||
| ALIGNTEXT16 | ||||
| GLOBL GLNAME( gl_x86_cliptest_points4 ) | ||||
| GLNAME( gl_x86_cliptest_points4 ): | ||||
|  | ||||
| #ifdef ELFPIC | ||||
| #define FRAME_OFFSET 20 | ||||
| #else | ||||
| #define FRAME_OFFSET 16 | ||||
| #endif | ||||
| 	PUSH_L( ESI ) | ||||
| 	PUSH_L( EDI ) | ||||
| 	PUSH_L( EBP ) | ||||
| 	PUSH_L( EBX ) | ||||
|  | ||||
| #ifdef ELFPIC | ||||
| 	/* store pointer to clip_table on stack */ | ||||
| 	CALL( LLBL( ctp4_get_eip ) ) | ||||
| 	ADD_L( CONST(_GLOBAL_OFFSET_TABLE_), EBX ) | ||||
| 	MOV_L( REGOFF(clip_table@GOT, EBX), EBX ) | ||||
| 	PUSH_L( EBX ) | ||||
| 	JMP( LLBL( ctp4_clip_table_ready ) ) | ||||
|  | ||||
| LLBL( ctp4_get_eip ): | ||||
| 	/* store eip in ebx */ | ||||
| 	MOV_L( REGIND(ESP), EBX ) | ||||
| 	RET | ||||
|  | ||||
| LLBL( ctp4_clip_table_ready ): | ||||
| #endif | ||||
|  | ||||
| 	MOV_L( ARG_SOURCE, ESI ) | ||||
| 	MOV_L( ARG_DEST, EDI ) | ||||
|  | ||||
| 	MOV_L( ARG_CLIP, EDX ) | ||||
| 	MOV_L( ARG_OR, EBX ) | ||||
|  | ||||
| 	MOV_L( ARG_AND, EBP ) | ||||
| 	MOV_L( REGOFF(V4F_STRIDE, ESI), EAX ) | ||||
|  | ||||
| 	MOV_L( REGOFF(V4F_COUNT, ESI), ECX ) | ||||
| 	MOV_L( REGOFF(V4F_START, ESI), ESI ) | ||||
|  | ||||
| 	OR_L( CONST(VEC_SIZE_4), REGOFF(V4F_FLAGS, EDI) ) | ||||
| 	MOV_L( EAX, ARG_SOURCE )	/* put stride in ARG_SOURCE */ | ||||
|  | ||||
| 	MOV_L( CONST(3), REGOFF(V4F_SIZE, EDI) ) | ||||
| 	MOV_L( ECX, REGOFF(V4F_COUNT, EDI) ) | ||||
|  | ||||
| 	MOV_L( REGOFF(V4F_START, EDI), EDI ) | ||||
| 	ADD_L( EDX, ECX ) | ||||
|  | ||||
| 	MOV_L( ECX, ARG_CLIP )		/* put clipmask + count in ARG_CLIP */ | ||||
| 	CMP_L( ECX, EDX ) | ||||
|  | ||||
| 	MOV_B( REGIND(EBX), AL ) | ||||
| 	MOV_B( REGIND(EBP), AH ) | ||||
|  | ||||
| 	JZ( LLBL( ctp4_finish ) ) | ||||
|  | ||||
| ALIGNTEXT16 | ||||
| LLBL( ctp4_top ): | ||||
|  | ||||
| 	FLD1			/* F3 */ | ||||
| 	FDIV_S( SRC(3) ) | ||||
|  | ||||
| 	MOV_L( SRC(3), EBP ) | ||||
| 	MOV_L( SRC(2), EBX ) | ||||
|  | ||||
| 	XOR_L( ECX, ECX ) | ||||
| 	ADD_L( EBP, EBP )	/* ebp = abs(S(3))*2 ; carry = sign of S(3) */ | ||||
|  | ||||
| 	ADC_L( ECX, ECX ) | ||||
| 	ADD_L( EBX, EBX )	/* ebx = abs(S(2))*2 ; carry = sign of S(2) */ | ||||
|  | ||||
| 	ADC_L( ECX, ECX ) | ||||
| 	CMP_L( EBX, EBP )	/* carry = abs(S(2))*2 > abs(S(3))*2 */ | ||||
|  | ||||
| 	ADC_L( ECX, ECX ) | ||||
| 	MOV_L( SRC(1), EBX ) | ||||
|  | ||||
| 	ADD_L( EBX, EBX )	/* ebx = abs(S(1))*2 ; carry = sign of S(1) */ | ||||
|  | ||||
| 	ADC_L( ECX, ECX ) | ||||
| 	CMP_L( EBX, EBP )	/* carry = abs(S(1))*2 > abs(S(3))*2 */ | ||||
|  | ||||
| 	ADC_L( ECX, ECX ) | ||||
| 	MOV_L( SRC(0), EBX ) | ||||
|  | ||||
| 	ADD_L( EBX, EBX )	/* ebx = abs(S(0))*2 ; carry = sign of S(0) */ | ||||
|  | ||||
| 	ADC_L( ECX, ECX ) | ||||
| 	CMP_L( EBX, EBP )	/* carry = abs(S(0))*2 > abs(S(3))*2 */ | ||||
|  | ||||
| 	ADC_L( ECX, ECX ) | ||||
|  | ||||
| #ifdef ELFPIC | ||||
| 	MOV_L( REGIND(ESP), EBP )	/* clip_table */ | ||||
|  | ||||
| 	MOV_B( REGBI(EBP, ECX), CL ) | ||||
| #else | ||||
| 	MOV_B( REGOFF(clip_table,ECX), CL ) | ||||
| #endif | ||||
|  | ||||
| 	OR_B( CL, AL ) | ||||
| 	AND_B( CL, AH ) | ||||
|  | ||||
| 	TEST_B( CL, CL ) | ||||
| 	MOV_B( CL, REGIND(EDX) ) | ||||
|  | ||||
| 	JZ( LLBL( ctp4_proj ) ) | ||||
|  | ||||
| 	FSTP( ST(0) )			/* */ | ||||
| 	JMP( LLBL( ctp4_next ) ) | ||||
|  | ||||
| LLBL( ctp4_proj ): | ||||
|  | ||||
| 	FLD_S( SRC(0) )			/* F0 F3 */ | ||||
| 	FMUL2( ST(1), ST(0) ) | ||||
|  | ||||
| 	FLD_S( SRC(1) )			/* F1 F0 F3 */ | ||||
| 	FMUL2( ST(2), ST(0) ) | ||||
|  | ||||
| 	FLD_S( SRC(2) )			/* F2 F1 F0 F3 */ | ||||
| 	FMUL2( ST(3), ST(0) ) | ||||
|  | ||||
| 	FXCH( ST(2) )			/* F0 F1 F2 F3 */ | ||||
| 	FSTP_S( DST(0) )		/* F1 F2 F3 */ | ||||
| 	FSTP_S( DST(1) )		/* F2 F3 */ | ||||
| 	FSTP_S( DST(2) )		/* F3 */ | ||||
| 	FSTP_S( DST(3) )		/* */ | ||||
|  | ||||
| LLBL( ctp4_next ): | ||||
|  | ||||
| 	INC_L( EDX ) | ||||
| 	ADD_L( CONST(16), EDI ) | ||||
|  | ||||
| 	ADD_L( ARG_SOURCE, ESI ) | ||||
| 	CMP_L( EDX, ARG_CLIP ) | ||||
|  | ||||
| 	JNZ( LLBL( ctp4_top ) ) | ||||
|  | ||||
| 	MOV_L( ARG_OR, ECX ) | ||||
| 	MOV_L( ARG_AND, EDX ) | ||||
|  | ||||
| 	MOV_B( AL, REGIND(ECX) ) | ||||
| 	MOV_B( AH, REGIND(EDX) ) | ||||
|  | ||||
| LLBL( ctp4_finish ): | ||||
|  | ||||
| 	MOV_L( ARG_DEST, EAX ) | ||||
| #ifdef ELFPIC | ||||
| 	POP_L( ESI )			/* discard ptr to clip_table */ | ||||
| #endif | ||||
| 	POP_L( EBX ) | ||||
| 	POP_L( EBP ) | ||||
| 	POP_L( EDI ) | ||||
| 	POP_L( ESI ) | ||||
|  | ||||
| 	RET | ||||
							
								
								
									
										74
									
								
								src/mesa/x86/xform_args.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										74
									
								
								src/mesa/x86/xform_args.h
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,74 @@ | ||||
| /* $Id: xform_args.h,v 1.1.2.1 2000/10/22 23:10:51 gareth Exp $ */ | ||||
|  | ||||
| /* | ||||
|  * Mesa 3-D graphics library | ||||
|  * Version:  3.4 | ||||
|  * | ||||
|  * Copyright (C) 1999-2000  Brian Paul   All Rights Reserved. | ||||
|  * | ||||
|  * Permission is hereby granted, free of charge, to any person obtaining a | ||||
|  * copy of this software and associated documentation files (the "Software"), | ||||
|  * to deal in the Software without restriction, including without limitation | ||||
|  * the rights to use, copy, modify, merge, publish, distribute, sublicense, | ||||
|  * and/or sell copies of the Software, and to permit persons to whom the | ||||
|  * Software is furnished to do so, subject to the following conditions: | ||||
|  * | ||||
|  * The above copyright notice and this permission notice shall be included | ||||
|  * in all copies or substantial portions of the Software. | ||||
|  * | ||||
|  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS | ||||
|  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||||
|  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL | ||||
|  * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN | ||||
|  * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN | ||||
|  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||||
|  */ | ||||
|  | ||||
| /* | ||||
|  * Transform function interface for assembly code.  Simply define | ||||
|  * FRAME_OFFSET to the number of bytes pushed onto the stack before | ||||
|  * using the ARG_* argument macros. | ||||
|  * | ||||
|  * Gareth Hughes <gareth@valinux.com> | ||||
|  */ | ||||
|  | ||||
| #ifndef __XFORM_ARGS_H__ | ||||
| #define __XFORM_ARGS_H__ | ||||
|  | ||||
| /* Offsets into GLvector4f | ||||
|  */ | ||||
| #define V4F_DATA	0 | ||||
| #define V4F_START	4 | ||||
| #define V4F_COUNT	8 | ||||
| #define V4F_STRIDE	12 | ||||
| #define V4F_SIZE	16 | ||||
| #define V4F_FLAGS	20 | ||||
|  | ||||
| /* GLvector4f flags | ||||
|  */ | ||||
| #define VEC_SIZE_1	1 | ||||
| #define VEC_SIZE_2	3 | ||||
| #define VEC_SIZE_3	7 | ||||
| #define VEC_SIZE_4	15 | ||||
|  | ||||
| /* Offsets for transform_func arguments | ||||
|  * | ||||
|  * typedef void (*transform_func)( GLvector4f *to_vec, | ||||
|  *				   const GLfloat m[16], | ||||
|  *				   const GLvector4f *from_vec, | ||||
|  *				   const GLubyte *clipmask, | ||||
|  *				   const GLubyte flag ); | ||||
|  */ | ||||
| #define OFFSET_DEST	4 | ||||
| #define OFFSET_MATRIX	8 | ||||
| #define OFFSET_SOURCE	12 | ||||
| #define OFFSET_CLIP	16 | ||||
| #define OFFSET_FLAG	20 | ||||
|  | ||||
| #define ARG_DEST	REGOFF(FRAME_OFFSET+OFFSET_DEST, ESP) | ||||
| #define ARG_MATRIX 	REGOFF(FRAME_OFFSET+OFFSET_MATRIX, ESP) | ||||
| #define ARG_SOURCE 	REGOFF(FRAME_OFFSET+OFFSET_SOURCE, ESP) | ||||
| #define ARG_CLIP 	REGOFF(FRAME_OFFSET+OFFSET_CLIP, ESP) | ||||
| #define ARG_FLAG 	REGOFF(FRAME_OFFSET+OFFSET_FLAG, ESP) | ||||
|  | ||||
| #endif | ||||
		Reference in New Issue
	
	Block a user