Compare commits
	
		
			129 Commits
		
	
	
		
			mesa-19.1.
			...
			mesa_6_4
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
|  | 7cd7a78d72 | ||
|  | 5c57efd6b4 | ||
|  | ea9ed5849f | ||
|  | 1ef0939a64 | ||
|  | d0f9c2887c | ||
|  | ed75287003 | ||
|  | c01c2fb542 | ||
|  | e1d7297812 | ||
|  | b4227f0d98 | ||
|  | c868c1ee14 | ||
|  | a1dcb43658 | ||
|  | cc7b6810e2 | ||
|  | 7b9fecee10 | ||
|  | 8856180e4f | ||
|  | df51dfbdc3 | ||
|  | 2fd1ed1b45 | ||
|  | 66b928e95e | ||
|  | d5e9cca0b2 | ||
|  | c072c17a8c | ||
|  | 8367420be9 | ||
|  | e2a2ed06b2 | ||
|  | 0cc3703188 | ||
|  | fb6c1492fb | ||
|  | 89ad797f9a | ||
|  | fa67028ae7 | ||
|  | 8e1724dfe9 | ||
|  | fbdb5c9b14 | ||
|  | 4b2728f95c | ||
|  | 3a7437399f | ||
|  | 3338f04be7 | ||
|  | 047f7bb11c | ||
|  | 5b25acdac7 | ||
|  | cb16208ec0 | ||
|  | 88107bea56 | ||
|  | b4d25157f2 | ||
|  | c6d1f32ebe | ||
|  | 281f388e03 | ||
|  | c0a0dfeb96 | ||
|  | ab07593563 | ||
|  | 5b08058604 | ||
|  | 3bf13d3c4b | ||
|  | 2b05784084 | ||
|  | 2292262de4 | ||
|  | a9358bb3b0 | ||
|  | b9d111f202 | ||
|  | 20fd105e2a | ||
|  | 1faaa0090a | ||
|  | 23803bd5fb | ||
|  | c000250504 | ||
|  | b854297bab | ||
|  | 3c1b44ad55 | ||
|  | bdab2cc216 | ||
|  | 91ade9ad68 | ||
|  | 7355bbce55 | ||
|  | 1d2671e6cb | ||
|  | 0a405dcc5f | ||
|  | b210ffaadf | ||
|  | b1e8471898 | ||
|  | aefe0dabec | ||
|  | 758c5b9a7e | ||
|  | 44db6d7cb8 | ||
|  | 04f1fdc755 | ||
|  | b181773d02 | ||
|  | 4218cddfb1 | ||
|  | a4e35c21d2 | ||
|  | 5d63323d34 | ||
|  | 419a350499 | ||
|  | db78ec7018 | ||
|  | 291911aeb5 | ||
|  | e15a7d4883 | ||
|  | 2e95fdc5d8 | ||
|  | 6e03f6ed43 | ||
|  | 97790948f6 | ||
|  | a882648023 | ||
|  | b7f8d69bb3 | ||
|  | 5bad790e56 | ||
|  | 382b00f483 | ||
|  | 718bd385ed | ||
|  | 402ca8903f | ||
|  | 25a9c9f370 | ||
|  | d73a838f01 | ||
|  | c72b2fb2db | ||
|  | 5a6ce051ef | ||
|  | e7c2fa9cff | ||
|  | 5919aec5c3 | ||
|  | f5a6175d83 | ||
|  | e41ea35fee | ||
|  | 38cf2b14f4 | ||
|  | 66725dca81 | ||
|  | 59ad040754 | ||
|  | 5e16f314d6 | ||
|  | 2376438410 | ||
|  | 1be13df2c3 | ||
|  | 1f6892527b | ||
|  | e5f6f26c87 | ||
|  | e14b3baca0 | ||
|  | 5eb129de76 | ||
|  | 3f27b6ffeb | ||
|  | 270572e543 | ||
|  | 7b56e1a443 | ||
|  | cfaac5dc4f | ||
|  | 1e5c3e977f | ||
|  | 831b4143f7 | ||
|  | b26b565f91 | ||
|  | f4d1dafc18 | ||
|  | db70c3f9b6 | ||
|  | 384b1d03e4 | ||
|  | e3c1b594ae | ||
|  | 453eb90128 | ||
|  | cb505bf744 | ||
|  | 133112c71a | ||
|  | a66eebc579 | ||
|  | 89ea47182d | ||
|  | 2efe639f26 | ||
|  | 39e4095560 | ||
|  | b19ec5009f | ||
|  | afed3e55ba | ||
|  | 46cf4fa1bd | ||
|  | b4198e821a | ||
|  | 5a1fb7db0e | ||
|  | f16fbf03bd | ||
|  | ec0c42a3be | ||
|  | a4c1895d07 | ||
|  | b2971358ad | ||
|  | 24a36c26fa | ||
|  | 247e27d0b8 | ||
|  | 912bcb2386 | ||
|  | cee416863f | ||
|  | 8e946792dc | 
							
								
								
									
										45
									
								
								Makefile
									
									
									
									
									
								
							
							
						
						
									
										45
									
								
								Makefile
									
									
									
									
									
								
							| @@ -134,9 +134,10 @@ ultrix-gcc: | ||||
|  | ||||
| # Rules for making release tarballs | ||||
|  | ||||
| DIRECTORY = Mesa-6.5 | ||||
| LIB_NAME = MesaLib-6.5 | ||||
| DEMO_NAME = MesaDemos-6.5 | ||||
| DIRECTORY = Mesa-6.4 | ||||
| LIB_NAME = MesaLib-6.4 | ||||
| DEMO_NAME = MesaDemos-6.4 | ||||
| GLUT_NAME = MesaGLUT-6.4 | ||||
|  | ||||
| MAIN_FILES = \ | ||||
| 	$(DIRECTORY)/Makefile*						\ | ||||
| @@ -213,7 +214,6 @@ MAIN_FILES = \ | ||||
| 	$(DIRECTORY)/src/mesa/drivers/directfb/*.[ch]			\ | ||||
| 	$(DIRECTORY)/src/mesa/drivers/directfb/Makefile			\ | ||||
| 	$(DIRECTORY)/src/mesa/drivers/dos/*.[chS]			\ | ||||
| 	$(DIRECTORY)/src/mesa/drivers/dri/common/*.[ch]			\ | ||||
| 	$(DIRECTORY)/src/mesa/drivers/fbdev/glfbdev.c			\ | ||||
| 	$(DIRECTORY)/src/mesa/drivers/glide/*.[ch]			\ | ||||
| 	$(DIRECTORY)/src/mesa/drivers/ggi/*.[ch]			\ | ||||
| @@ -260,13 +260,13 @@ MAIN_FILES = \ | ||||
| 	$(DIRECTORY)/windows/VC7/mesa/osmesa/osmesa.vcproj | ||||
|  | ||||
| DRI_FILES = \ | ||||
| 	$(DIRECTORY)/include/GL/internal/*.h				\ | ||||
| 	$(DIRECTORY)/include/GL/internal/dri_interface.h		\ | ||||
| 	$(DIRECTORY)/include/GL/internal/sarea.h			\ | ||||
| 	$(DIRECTORY)/src/glx/Makefile					\ | ||||
| 	$(DIRECTORY)/src/glx/x11/Makefile				\ | ||||
| 	$(DIRECTORY)/src/glx/x11/*.[ch]					\ | ||||
| 	$(DIRECTORY)/src/mesa/drivers/dri/Makefile			\ | ||||
| 	$(DIRECTORY)/src/mesa/drivers/dri/Makefile.template		\ | ||||
| 	$(DIRECTORY)/src/mesa/drivers/dri/common/*.[ch]			\ | ||||
| 	$(DIRECTORY)/src/mesa/drivers/dri/common/xmlpool/*.[ch]		\ | ||||
| 	$(DIRECTORY)/src/mesa/drivers/dri/common/xmlpool/*.po		\ | ||||
| 	$(DIRECTORY)/src/mesa/drivers/dri/dri_client/imports/*.h	\ | ||||
| @@ -312,7 +312,7 @@ GLW_FILES = \ | ||||
| 	$(DIRECTORY)/src/glw/README			\ | ||||
| 	$(DIRECTORY)/src/glw/depend | ||||
|  | ||||
| PROG_FILES = \ | ||||
| DEMO_FILES = \ | ||||
| 	$(DIRECTORY)/progs/beos/*.cpp			\ | ||||
| 	$(DIRECTORY)/progs/beos/Makefile		\ | ||||
| 	$(DIRECTORY)/progs/images/*.rgb			\ | ||||
| @@ -337,10 +337,8 @@ PROG_FILES = \ | ||||
| 	$(DIRECTORY)/progs/windml/*.bmp			\ | ||||
| 	$(DIRECTORY)/progs/ggi/*.c			\ | ||||
| 	$(DIRECTORY)/windows/VC6/progs/demos/*.dsp	\ | ||||
| 	$(DIRECTORY)/windows/VC6/progs/glut/glut.dsp	\ | ||||
| 	$(DIRECTORY)/windows/VC6/progs/progs.dsw	\ | ||||
| 	$(DIRECTORY)/windows/VC7/progs/demos/*.vcproj	\ | ||||
| 	$(DIRECTORY)/windows/VC7/progs/glut/glut.vcproj	\ | ||||
| 	$(DIRECTORY)/windows/VC7/progs/progs.sln | ||||
|  | ||||
| GLUT_FILES = \ | ||||
| @@ -359,7 +357,9 @@ GLUT_FILES = \ | ||||
| 	$(DIRECTORY)/src/glut/dos/Makefile.DJ		\ | ||||
| 	$(DIRECTORY)/src/glut/dos/PC_HW/*.[chS]		\ | ||||
| 	$(DIRECTORY)/src/glut/ggi/*.[ch]		\ | ||||
| 	$(DIRECTORY)/src/glut/ggi/Makefile | ||||
| 	$(DIRECTORY)/src/glut/ggi/Makefile		\ | ||||
| 	$(DIRECTORY)/windows/VC6/progs/glut/glut.dsp	\ | ||||
| 	$(DIRECTORY)/windows/VC7/progs/glut/glut.vcproj | ||||
|  | ||||
| DEPEND_FILES = \ | ||||
| 	$(TOP)/src/mesa/depend		\ | ||||
| @@ -370,11 +370,9 @@ DEPEND_FILES = \ | ||||
|  | ||||
| LIB_FILES = $(MAIN_FILES) $(DRI_FILES) $(SGI_GLU_FILES) $(GLW_FILES) | ||||
|  | ||||
| DEMO_FILES = $(PROG_FILES) $(GLUT_FILES) | ||||
|  | ||||
|  | ||||
| # Everything for new a Mesa release: | ||||
| tarballs: rm_depend lib_gz demo_gz lib_bz2 demo_bz2 lib_zip demo_zip md5 | ||||
| tarballs: rm_depend lib_gz demo_gz glut_gz lib_bz2 demo_bz2 glut_bz2 lib_zip demo_zip glut_zip md5 | ||||
|  | ||||
|  | ||||
| rm_depend: | ||||
| @@ -396,6 +394,12 @@ demo_gz: | ||||
| 	gzip $(DEMO_NAME).tar ; \ | ||||
| 	mv $(DEMO_NAME).tar.gz $(DIRECTORY) | ||||
|  | ||||
| glut_gz: | ||||
| 	cd .. ; \ | ||||
| 	tar -cf $(GLUT_NAME).tar $(GLUT_FILES) ; \ | ||||
| 	gzip $(GLUT_NAME).tar ; \ | ||||
| 	mv $(GLUT_NAME).tar.gz $(DIRECTORY) | ||||
|  | ||||
| lib_bz2: | ||||
| 	rm -f configs/current ; \ | ||||
| 	cd .. ; \ | ||||
| @@ -409,6 +413,12 @@ demo_bz2: | ||||
| 	bzip2 $(DEMO_NAME).tar ; \ | ||||
| 	mv $(DEMO_NAME).tar.bz2 $(DIRECTORY) | ||||
|  | ||||
| glut_bz2: | ||||
| 	cd .. ; \ | ||||
| 	tar -cf $(GLUT_NAME).tar $(GLUT_FILES) ; \ | ||||
| 	bzip2 $(GLUT_NAME).tar ; \ | ||||
| 	mv $(GLUT_NAME).tar.bz2 $(DIRECTORY) | ||||
|  | ||||
| lib_zip: | ||||
| 	rm -f configs/current ; \ | ||||
| 	rm -f $(LIB_NAME).zip ; \ | ||||
| @@ -422,6 +432,12 @@ demo_zip: | ||||
| 	zip -qr $(DEMO_NAME).zip $(DEMO_FILES) ; \ | ||||
| 	mv $(DEMO_NAME).zip $(DIRECTORY) | ||||
|  | ||||
| glut_zip: | ||||
| 	rm -f $(GLUT_NAME).zip ; \ | ||||
| 	cd .. ; \ | ||||
| 	zip -qr $(GLUT_NAME).zip $(GLUT_FILES) ; \ | ||||
| 	mv $(GLUT_NAME).zip $(DIRECTORY) | ||||
|  | ||||
| md5: | ||||
| 	@-md5sum $(LIB_NAME).tar.gz | ||||
| 	@-md5sum $(LIB_NAME).tar.bz2 | ||||
| @@ -429,3 +445,6 @@ md5: | ||||
| 	@-md5sum $(DEMO_NAME).tar.gz | ||||
| 	@-md5sum $(DEMO_NAME).tar.bz2 | ||||
| 	@-md5sum $(DEMO_NAME).zip | ||||
| 	@-md5sum $(GLUT_NAME).tar.gz | ||||
| 	@-md5sum $(GLUT_NAME).tar.bz2 | ||||
| 	@-md5sum $(GLUT_NAME).zip | ||||
|   | ||||
| @@ -12,7 +12,7 @@ TOP=. | ||||
| INCLUDE_DIR="/usr/local/include" | ||||
| LIB_DIR="/usr/local/lib" | ||||
|  | ||||
| if [ x$# == "x0" ] ; then | ||||
| if [ "x$#" = "x0" ] ; then | ||||
| echo | ||||
| echo "***** Mesa installation - You may need root privileges to do this *****" | ||||
| echo | ||||
| @@ -20,7 +20,7 @@ echo "Default directory for header files is:" ${INCLUDE_DIR} | ||||
| echo "Enter new directory or press <Enter> to accept this default." | ||||
|  | ||||
| read INPUT | ||||
| if [ x${INPUT} != "x" ] ; then | ||||
| if [ "x${INPUT}" != "x" ] ; then | ||||
| 	INCLUDE_DIR=${INPUT} | ||||
| fi | ||||
|  | ||||
| @@ -29,7 +29,7 @@ echo "Default directory for library files is:" ${LIB_DIR} | ||||
| echo "Enter new directory or press <Enter> to accept this default." | ||||
|  | ||||
| read INPUT | ||||
| if [ x${INPUT} != "x" ] ; then | ||||
| if [ "x${INPUT}" != "x" ] ; then | ||||
| 	LIB_DIR=${INPUT} | ||||
| fi | ||||
|  | ||||
| @@ -47,7 +47,14 @@ fi | ||||
|  | ||||
| # flags: | ||||
| #  -f = force | ||||
| #  -d = preserve symlinks | ||||
| #  -d = preserve symlinks (does not work on BSD) | ||||
|  | ||||
| if [ `uname` = "FreeBSD" ] ; then | ||||
| 	CP_FLAGS="-f" | ||||
| else | ||||
| 	CP_FLAGS="-fd" | ||||
| fi | ||||
|  | ||||
|  | ||||
| set -v | ||||
|  | ||||
| @@ -56,7 +63,7 @@ mkdir ${INCLUDE_DIR}/GL | ||||
| mkdir ${INCLUDE_DIR}/GLES | ||||
| mkdir ${LIB_DIR} | ||||
| cp -f ${TOP}/include/GL/*.h ${INCLUDE_DIR}/GL | ||||
| cp -f ${TOP}/include/GLES/*.h ${INCLUDE_DIR}/GLES | ||||
| cp -fd ${TOP}/lib*/lib* ${LIB_DIR} | ||||
| # NOT YET: cp -f ${TOP}/include/GLES/*.h ${INCLUDE_DIR}/GLES | ||||
| cp ${CP_FLAGS} ${TOP}/lib*/lib* ${LIB_DIR} | ||||
|  | ||||
| echo "Done." | ||||
|   | ||||
							
								
								
									
										25
									
								
								bin/mklib
									
									
									
									
									
								
							
							
						
						
									
										25
									
								
								bin/mklib
									
									
									
									
									
								
							| @@ -309,11 +309,23 @@ case $ARCH in | ||||
| 	;; | ||||
|  | ||||
|     'FreeBSD') | ||||
| 	# we assume gcc | ||||
|  | ||||
| 	if [ "x$LINK" = "x" ] ; then | ||||
| 	    # -linker was not specified so set default link command now | ||||
|             if [ $CPLUSPLUS = 1 ] ; then | ||||
|                 LINK=g++ | ||||
|             else | ||||
|                 LINK=gcc | ||||
|             fi | ||||
| 	fi | ||||
|  | ||||
| 	if [ $NOPREFIX = 1 ] ; then | ||||
| 	    # No "lib" or ".so" part | ||||
| 	    echo "mklib: Making FreeBSD shared library: " ${LIBNAME} | ||||
| 	    OPTS="-shared" | ||||
| 	    rm -f ${LIBNAME} | ||||
| 	    ld -Bshareable -o ${LIBNAME} ${OBJECTS} | ||||
| 	    ${LINK} ${OPTS} -o ${LIBNAME} ${OBJECTS} ${DEPS} | ||||
| 	    FINAL_LIBS=${LIBNAME} | ||||
|         elif [ $STATIC = 1 ] ; then | ||||
| 	    STLIB="lib${LIBNAME}.a" | ||||
| @@ -323,12 +335,13 @@ case $ARCH in | ||||
| 	    ranlib ${STLIB} | ||||
| 	    FINAL_LIBS=${STLIB} | ||||
| 	else | ||||
| 	    SHLIB="lib${LIBNAME}.so.${MAJOR}.${MINOR}" | ||||
| 	    SHLIB="lib${LIBNAME}.so.${MAJOR}" | ||||
| 	    OPTS="-shared -Wl,-soname,${SHLIB}" | ||||
| 	    echo "mklib: Making FreeBSD shared library: " ${SHLIB} | ||||
| 	    rm -f ${SHLIB} | ||||
| 	    ld -Bshareable -o ${SHLIB} ${OBJECTS} | ||||
| 	    # XXX make lib${LIBNAME}.so.${MAJOR} symlink? | ||||
| 	    FINAL_LIBS=${SHLIB} | ||||
| 	    ${LINK} ${OPTS} -o ${SHLIB} ${OBJECTS} ${DEPS} | ||||
| 	    ln -sf ${SHLIB} "lib${LIBNAME}.so" | ||||
| 	    FINAL_LIBS="${SHLIB} lib${LIBNAME}.so" | ||||
| 	fi | ||||
| 	;; | ||||
|  | ||||
| @@ -492,7 +505,7 @@ case $ARCH in | ||||
|         else | ||||
|             LIBNAME="lib${LIBNAME}.dylib" | ||||
|             echo "mklib: Making Darwin shared library: " ${LIBNAME} | ||||
|             FLAGS="-dynamiclib -multiply_defined suppress" | ||||
|             FLAGS="-dynamiclib -multiply_defined suppress -current_version ${MAJOR}.${MINOR}.0 -compatibility_version ${MAJOR}.${MINOR}.0" | ||||
| 	    if [ $CPLUSPLUS = 1 ] ; then | ||||
| 		LINK="g++" | ||||
| 	    else | ||||
|   | ||||
| @@ -7,8 +7,8 @@ CONFIG_NAME = default | ||||
|  | ||||
| # Version info | ||||
| MESA_MAJOR=6 | ||||
| MESA_MINOR=3 | ||||
| MESA_TINY=2 | ||||
| MESA_MINOR=4 | ||||
| MESA_TINY=0 | ||||
|  | ||||
| # external projects.  This should be useless now that we use libdrm. | ||||
| DRM_SOURCE_PATH=$(TOP)/../drm | ||||
|   | ||||
| @@ -13,5 +13,4 @@ CFLAGS = -O2 -fPIC -pedantic -I/usr/X11R6/include -DUSE_XSHM -DHZ=100 | ||||
| CXXFLAGS = -O2 -fPIC -pedantic | ||||
| GLUT_CFLAGS = -fexceptions | ||||
|  | ||||
| APP_LIB_DEPS = -L$(LIB_DIR) -L/usr/X11R6/lib -lXext -lXmu -lXi -lX11 -lm | ||||
|  | ||||
| APP_LIB_DEPS = -L$(LIB_DIR) -L/usr/X11R6/lib -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -lXext -lXmu -lXi -lX11 -lm | ||||
|   | ||||
| @@ -31,7 +31,7 @@ GLW_LIB_DEPS = -L$(LIB_DIR) -L/usr/X11R6/lib -lGL -lXt -lXm -lX11 | ||||
|  | ||||
|  | ||||
| # Directories | ||||
| SRC_DIRS = mesa glu glut/glx glw glx/x11 | ||||
| SRC_DIRS = glx/x11 mesa glu glut/glx glw | ||||
| DRIVER_DIRS = dri | ||||
| PROGRAM_DIRS =  | ||||
| WINDOW_SYSTEM=dri | ||||
|   | ||||
| @@ -26,3 +26,7 @@ On Alpha platforms at default a sharable images for the libraries are created. | ||||
| To get a static library make it by typing MMS/MACRO=(NOSHARE=1). | ||||
| On VAX platforms only static libraries can be build. | ||||
|  | ||||
|  | ||||
| You may want to compile Mesa to use IEEE floating point arithmetic, instead | ||||
| of VAX floating point by specifying the /float=IEEE flag to the compiler. | ||||
| For more information see https://bugs.freedesktop.org/show_bug.cgi?id=4270 | ||||
|   | ||||
							
								
								
									
										50
									
								
								docs/RELNOTES-6.4
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										50
									
								
								docs/RELNOTES-6.4
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,50 @@ | ||||
|  | ||||
| 		        Mesa 6.4 Release Notes | ||||
|  | ||||
| 			   October 24, 2005 | ||||
|  | ||||
|  | ||||
|  | ||||
| Introduction | ||||
| ------------ | ||||
|  | ||||
| Mesa uses an even/odd version number scheme like the Linux kernel. | ||||
| Odd numbered versions (such as 6.3) designate new developmental releases. | ||||
| Even numbered versions (such as 6.4) designate stable releases. | ||||
|  | ||||
|  | ||||
| 6.4 is a bug-fix release.  See the VERSIONS file for details. | ||||
|  | ||||
|  | ||||
|  | ||||
| GLUT tarball | ||||
| ------------ | ||||
|  | ||||
| Starting with 6.4, the GLUT library sources are distributed in a separate | ||||
| tarball.  This was done at the request of Linux distro vendors who prefer | ||||
| to use freeglut. | ||||
|  | ||||
|  | ||||
|  | ||||
|  | ||||
| Driver			Status | ||||
| ----------------------	---------------------- | ||||
| DRI drivers		varies with the driver | ||||
| XMesa (Xlib)		implements OpenGL 1.5 | ||||
| OSMesa (off-screen)	implements OpenGL 1.5 | ||||
| Windows/Win32		implements OpenGL 1.5 | ||||
| Glide (3dfx Voodoo1/2)  requires updates	 | ||||
| SVGA			requires updates | ||||
| DJGPP			requires updates | ||||
| GGI			requires updates | ||||
| BeOS			requires updates | ||||
| Allegro			requires updates | ||||
| D3D			requires updates | ||||
|  | ||||
| The drivers which require updates mostly need to be updated to work | ||||
| with the new gl_renderbuffer / gl_framebuffer infrastructure introduced | ||||
| in Mesa 6.3. | ||||
|  | ||||
|  | ||||
| ---------------------------------------------------------------------- | ||||
| $Id: RELNOTES-6.4,v 1.1.2.5 2005/10/24 23:12:29 brianp Exp $ | ||||
| @@ -1372,3 +1372,36 @@ Mesa Version History | ||||
| 	- wglGetProcAddress() didn't handle wgl-functions | ||||
| 	- fixed glxext.h cross-compile issue (Colin Harrison) | ||||
| 	- assorted DRI driver fixes | ||||
|  | ||||
|  | ||||
| 6.4  October 24, 2005 | ||||
|     New: | ||||
| 	- Added a fast XOR line drawing function in Xlib driver | ||||
| 	- Added support for GL_ARB_texture_mirrored_repeat to savage | ||||
| 	  driver (supported only on Savage4 hardware). | ||||
|     Changes: | ||||
| 	- Mesa now packaged in three parts: Library, Demos and GLUT | ||||
|     Bug fixes: | ||||
| 	- GLX_X_RENDERABLE token wasn't accepted by glXChooseFBConfig | ||||
| 	- Some files were present multiple times in the 6.3.2 tarballs | ||||
| 	- r200_vtxtmp_x86.S file was missing from 6.3.2 tarball (bug 4207) | ||||
| 	- glxgears_fbconfig demo didn't work (bug 4237) | ||||
| 	- fixed bug when bilinear sampling 2d textures with borders | ||||
| 	- glXCreatePbuffer() could segfault instead of returning 0 (bug 4235) | ||||
| 	- fixed undefined frexp and rand in X.org libGLcore.a (bug 4242) | ||||
| 	- fixed a few problems with proxy color tables (bug 4270) | ||||
| 	- fixed precision problem in Z clearing (bug 4395) | ||||
| 	- glBitmap, glDraw/CopyPixels mistakenly generated selection hits | ||||
| 	- fixed potential segfault caused by reading pixels outside | ||||
| 	  of renderbuffer bounds | ||||
| 	- glGetTexLevelParameter didn't accept GL_TEXTURE_DEPTH_SIZE_ARB | ||||
| 	- fixed memory corruption bug involving software alpha buffers | ||||
| 	- glReadPixels clipped by window bounds was sometimes broken | ||||
| 	- glDraw/CopyPixels of stencil data ignored the stencil write mask | ||||
| 	- glReadPixels from a texture bound to a framebuffer object didn't work | ||||
| 	- glIsRender/FramebufferEXT weren't totally correct | ||||
| 	- fixed a number of point size attenuation/fade bugs | ||||
| 	- fixed glFogCoord bug 4729 | ||||
| 	- GLX encoding for transpose matrix functions was broken | ||||
| 	- fixed broken fragment program KIL and SWZ instructions | ||||
| 	- fragment programs that wrote result.depth.z didn't work | ||||
|   | ||||
| @@ -37,8 +37,6 @@ a:visited { | ||||
|  | ||||
| <b>Download / Install</b> | ||||
| <ul> | ||||
| <li><a href="http://www.sourceforge.net/projects/mesa3d" target="_parent">Stable Release (6.2.1)</a> | ||||
| <li><a href="http://www.sourceforge.net/projects/mesa3d" target="_parent">Devel Release (6.3.2)</a> | ||||
| <li><a href="download.html" target="MainFrame">Downloading/Unpacking</a> | ||||
| <li><a href="install.html" target="MainFrame">Compilation/Installation</a> | ||||
| <li><a href="glu.html" target="MainFrame">SGI's GLU</a> | ||||
| @@ -91,9 +89,13 @@ a:visited { | ||||
| <li><a href="demos.html" target="MainFrame">Demos / other</a> | ||||
| </ul> | ||||
|  | ||||
| <b>Hosted by:</b> | ||||
| <br> | ||||
| <blockquote> | ||||
| <A HREF="http://sourceforge.net" | ||||
| target="_parent"><IMG SRC="http://sourceforge.net/sflogo.php?group_id=3&type=1" | ||||
| WIDTH="88" HEIGHT="31" ALIGN="BOTTOM" ALT="Sourceforge.net" BORDER="0"></A> | ||||
| </blockquote> | ||||
|  | ||||
| </body> | ||||
| </html> | ||||
| @@ -6,101 +6,125 @@ | ||||
|  | ||||
| <BODY> | ||||
|  | ||||
| <H1>Downloading / Unpacking</H1> | ||||
| <H1>Downloading</H1> | ||||
|  | ||||
| <p> | ||||
| Mesa can be downloaded from the | ||||
| <a href="http://www.sourceforge.net/projects/mesa3d" target="_parent"> | ||||
| SourceForge download area</A>. | ||||
| Current stable release: <b>6.4</b> | ||||
| </p> | ||||
|  | ||||
| <p> | ||||
| Since version 2.3, Mesa is distributed in two pieces:  main library code | ||||
| and demos.  If you're upgrading from a previous version of Mesa or you're not | ||||
| interested in the demos you can just download the core Mesa archive file. | ||||
| Primary download site: | ||||
| <a href="http://sourceforge.net/project/showfiles.php?group_id=3" | ||||
| target="_parent">SourceForge</a> | ||||
| </p> | ||||
|  | ||||
|  | ||||
| <p> | ||||
| Mesa is distributed in several parts: | ||||
| </p> | ||||
| <ul> | ||||
| <li><b>MesaLib-x.y.z</b> - the main Mesa library source code, drivers | ||||
|     and documentation. | ||||
| </li> | ||||
| <li><b>MesaDemos-x.y.z</b> - OpenGL demonstration and test programs. | ||||
|     Most of the programs require GLUT (either the | ||||
|     <a href="http://www.opengl.org/resources/libraries/glut.html" | ||||
|     target="_parent">original GLUT by Mark Kilgard</a> or | ||||
|     <a href="http://freeglut.sourceforge.net" target="_parent">freeglut</a> or | ||||
|     <a href="http://freeglut.sourceforge.net" target="_parent">OpenGLUT</a>). | ||||
| </li> | ||||
| <li><b>MesaGLUT-x.y.z</b> - Mark Kilgard's GLUT, easily compiled and used | ||||
|     with Mesa.  Plus, other implementation of GLUT for DOS, OS/2, BeOS, etc. | ||||
| </li> | ||||
| </ul> | ||||
|  | ||||
| <p> | ||||
| If you're not interested in running the demos, you'll only need the first | ||||
| package. | ||||
| </p> | ||||
|  | ||||
| <p> | ||||
| Mesa is available in at least three archive formats: | ||||
| The packages are available in .tar.gz, .tar.bz2 and .zip formats. | ||||
| Other organizations might offer additional package formats. | ||||
| </p> | ||||
|  | ||||
| <H1>Unpacking</H1> | ||||
|  | ||||
| <p> | ||||
| All the packages should be in the same directory prior to unpacking. | ||||
| </p> | ||||
|  | ||||
| <ul> | ||||
| <li>To unpack .tar.gz files: | ||||
| <pre> | ||||
| 1. GNU zip/tar | ||||
|  | ||||
| 	Download MesaLib-X.Y.tar.gz and optionally MesaDemos-X.Y.tar.gz | ||||
| 	Unpack with: | ||||
| 		gzcat MesaLib-X.Y.tar.gz | tar xf - | ||||
| 		gzcat MesaDemos-X.Y.tar.gz | tar xf - | ||||
| 	or | ||||
| 		gunzip MesaLib-X.Y.tar.gz ; tar xf MesaLib-X.Y.tar | ||||
| 		gunzip MesaDemos-X.Y.tar.gz ; tar xf MesaLib-X.Y.tar | ||||
| 	or | ||||
| 		tar zxf MesaLib-X.Y.tar.gz | ||||
| 		tar zxf MesaDemos-X.Y.tar.gz | ||||
|  | ||||
| 	If you don't have gzcat try zcat instead. | ||||
|  | ||||
| 2. Unix compressed/tar | ||||
|  | ||||
| 	Download MesaLib-X.Y.tar.Z and optionally MesaDemos-X.Y.tar.Z | ||||
| 	Unpack with: | ||||
| 		zcat MesaLib-X.Y.tar.Z | tar xf - | ||||
| 		zcat MesaDemos-X.Y.tar.Z | tar xf - | ||||
|  | ||||
| 3. ZIP format | ||||
|  | ||||
| 	Download MesaLib-X.Y.zip and optionally MesaDemos-X.Y.zip | ||||
| 	Unpack with: | ||||
| 		unzip MesaLib-X.Y.zip | ||||
| 		unzip MesaDemos-X.Y.zip | ||||
| 	tar zxf MesaLib-X.Y.tar.gz | ||||
| 	tar zxf MesaDemos-X.Y.tar.gz | ||||
| 	tar zxf MesaGLUT-X.Y.tar.gz | ||||
| </pre> | ||||
| or | ||||
| <pre> | ||||
| 	gzcat MesaLib-X.Y.tar.gz | tar xf - | ||||
| 	gzcat MesaDemos-X.Y.tar.gz | tar xf - | ||||
| 	gzcat MesaGLUT-X.Y.tar.gz | tar xf - | ||||
| </pre> | ||||
| or | ||||
| <pre> | ||||
| 	gunzip MesaLib-X.Y.tar.gz ; tar xf MesaLib-X.Y.tar | ||||
| 	gunzip MesaDemos-X.Y.tar.gz ; tar xf MesaDemos-X.Y.tar | ||||
| 	gunzip MesaGLUT-X.Y.tar.gz ; tar xf MesaGLUT-X.Y.tar | ||||
| </pre> | ||||
| <li>To unpack .tar.bz2 files: | ||||
| <pre> | ||||
| 	bunzip2 -c MesaLib-X.Y.tar.gz | tar xf - | ||||
| 	bunzip2 -c MesaDemos-X.Y.tar.gz | tar xf - | ||||
| 	bunzip2 -c MesaGLUT-X.Y.tar.gz | tar xf - | ||||
| </pre> | ||||
| <li>To unpack .zip files: | ||||
| <pre> | ||||
| 	unzip MesaLib-X.Y.zip | ||||
| 	unzip MesaDemos-X.Y.zip | ||||
| 	unzip MesaGLUT-X.Y.zip | ||||
| </pre> | ||||
| </ul> | ||||
|  | ||||
|  | ||||
| <h1>Contents</h1> | ||||
|  | ||||
| <p> | ||||
| After unpacking you'll have these directories (and more): | ||||
| After unpacking you'll have these directories: | ||||
| </p> | ||||
| <pre> | ||||
| Makefile.X11	- top-level Makefile for X11-based systems | ||||
| Make-config	- system configurations used by the Makefile.X11 | ||||
| Makefile	- top-level Makefile for most systems | ||||
| configs/	- makefile parameter files for various systems | ||||
| include/	- GL header (include) files | ||||
| bin/		- shell scripts for making shared libraries, etc | ||||
| lib/		- final client libraries, created during compilation | ||||
| docs/		- documentation | ||||
| src/		- source code for libraries | ||||
| src/mesa	- sources for the main Mesa library and device drivers | ||||
| src/glu		- libGLU source code | ||||
| src/glw		- Xt/Motif/OpenGL widget code | ||||
| </pre> | ||||
|  | ||||
| If you downloaded and unpacked the MesaDemos.X.Y package: | ||||
|  | ||||
| and if you downloaded and unpacked the MesaDemos.X.Y archive: | ||||
|  | ||||
| src/glut	- GLUT source code | ||||
| progs/		- OpenGL programs | ||||
| <pre> | ||||
| progs/demos	- original Mesa demos | ||||
| progs/xdemos	- GLX OpenGL/Mesa demos | ||||
| progs/redbook	- examples from the OpenGL Programming Guide | ||||
| progs/samples	- examples from SGI | ||||
| progs/images/	- image files | ||||
| </pre> | ||||
|  | ||||
| If you downloaded and unpacked the MesaGLUT.X.Y package: | ||||
| <pre> | ||||
| src/glut	- GLUT library source code | ||||
| </pre> | ||||
|  | ||||
| <p> | ||||
| Proceed to <a href="install.html">compilation and installation | ||||
| Proceed to the <a href="install.html">compilation and installation | ||||
| instructions</a>. | ||||
| </p> | ||||
|  | ||||
| <H1>GLUT</H1> | ||||
|  | ||||
| <p> | ||||
| Mesa 2.5 and later includes Mark Kilgard's GLUT library (GL Utility Toolkit). | ||||
| GLUT is built automatically on systems which support it. | ||||
| </p> | ||||
| <p> | ||||
| The GLUT tests, demos, examples, etc are not included, just the main library. | ||||
| To obtain the latest complete release of GLUT please visit the | ||||
| <a href="http://www.opengl.org/resources/libraries/glut.html" | ||||
| target ="_parent">GLUT page</a> on www.opengl.org. | ||||
| </p> | ||||
|  | ||||
|  | ||||
| </BODY> | ||||
| </HTML> | ||||
|   | ||||
| @@ -9,7 +9,7 @@ | ||||
|  | ||||
| <center> | ||||
| <h1>Mesa Frequently Asked Questions</h1> | ||||
| Last updated: 17 November 2004 | ||||
| Last updated: 21 October 2004 | ||||
| </center> | ||||
|  | ||||
| <br> | ||||
| @@ -39,14 +39,14 @@ See the </a><a href="http://www.opengl.org/">OpenGL website</a> for more | ||||
| information. | ||||
| </p> | ||||
| <p> | ||||
| Mesa 5.x supports the OpenGL 1.4 specification. | ||||
| Mesa 6.x supports the OpenGL 1.5 specification. | ||||
| </p> | ||||
|  | ||||
|  | ||||
| <h2>1.2 Does Mesa support/use graphics hardware?</h2> | ||||
| <p> | ||||
| Yes.  Specifically, Mesa serves as the OpenGL core for the open-source | ||||
| XFree86/DRI OpenGL drivers.  See the <a href="http://dri.sf.net/">DRI | ||||
| Yes.  Specifically, Mesa serves as the OpenGL core for the open-source DRI | ||||
| drivers for XFree86/X.org.  See the <a href="http://dri.sf.net/">DRI | ||||
| website</a> for more information. | ||||
| </p> | ||||
| <p> | ||||
| @@ -62,7 +62,8 @@ operating systems today. | ||||
| Still, Mesa serves at least these purposes: | ||||
| </p> | ||||
| <ul> | ||||
| <li>Mesa is used as the core of the open-source XFree86/DRI hardware drivers. | ||||
| <li>Mesa is used as the core of the open-source XFree86/X.org DRI | ||||
|     hardware drivers. | ||||
| </li> | ||||
| <li>Mesa is quite portable and allows OpenGL to be used on systems | ||||
|     that have no other OpenGL solution. | ||||
| @@ -86,8 +87,8 @@ Still, Mesa serves at least these purposes: | ||||
| <h2>1.4 What's the difference between"Stand-Alone" Mesa and the DRI drivers?</h2> | ||||
| <p> | ||||
| <em>Stand-alone Mesa</em> is the original incarnation of Mesa. | ||||
| On systems running the X Window System, it does all its rendering through | ||||
| the Xlib API. | ||||
| On systems running the X Window System it does all its rendering through | ||||
| the Xlib API: | ||||
| <ul> | ||||
| <li>The GLX API is supported, but it's really just an emulation of the | ||||
|      real thing. | ||||
| @@ -116,21 +117,10 @@ within the DRI (Direct Rendering Infrastructure): | ||||
|  | ||||
| <h2>1.5 How do I upgrade my DRI installation to use a new Mesa release?</h2> | ||||
| <p> | ||||
| You don't!  A copy of the Mesa source code lives inside the XFree86/DRI source | ||||
| tree and gets compiled into the individual DRI driver modules. | ||||
| If you try to install Mesa over an XFree86/DRI installation, you'll lose | ||||
| hardware rendering (because stand-alone Mesa's libGL.so is different than | ||||
| the XFree86 libGL.so). | ||||
| </p> | ||||
| <p> | ||||
| The DRI developers will incorporate the latest release of Mesa into the | ||||
| DRI drivers when the time is right. | ||||
| </p> | ||||
| <p> | ||||
| To upgrade, either look for a new release of <a href="http://www.xfree86.org" | ||||
| target="_parent">XFree86</a> or visit the | ||||
| <a href="http://dri.sf.net" target="_parent">DRI website</a> to see | ||||
| if there's newer drivers. | ||||
| This wasn't easy in the past. | ||||
| Now, the DRI drivers are included in the Mesa tree and can be compiled | ||||
| separately from the X server. | ||||
| Just follow the Mesa <a href="install.html">compilation instructions</a>. | ||||
| </p> | ||||
|  | ||||
|  | ||||
| @@ -201,7 +191,7 @@ Mesa no longer supports GNU autoconf/automake.  Why? | ||||
| </ul> | ||||
|  | ||||
| <p> | ||||
| Now, Mesa again uses a conventional Makefile system (as it did originally). | ||||
| Now Mesa again uses a conventional Makefile system (as it did originally). | ||||
| Basically, each Makefile in the tree includes one of the configuration | ||||
| files from the config/ directory. | ||||
| The config files specify all the variables for a variety of popular systems. | ||||
| @@ -219,9 +209,9 @@ Mesa's not the solution. | ||||
|  | ||||
| <h2><a name="part2">2.4 Where is the GLUT library?</a></h2> | ||||
| <p> | ||||
| <a name="part2">GLUT (OpenGL Utility Toolkit) is in the separate MesaDemos-x.y.z.tar.gz file. | ||||
| If you don't already have GLUT installed, you should grab the MesaDemos | ||||
| package and unpack it before compiling Mesa. | ||||
| <a name="part2">GLUT (OpenGL Utility Toolkit) is in the separate MesaGLUT-x.y.z.tar.gz file. | ||||
| If you don't already have GLUT installed, you should grab the MesaGLUT | ||||
| package and compile it with the rest of Mesa. | ||||
| </a></p> | ||||
|  | ||||
|  | ||||
| @@ -250,7 +240,7 @@ Mesa version number. | ||||
| version number. | ||||
| </li></ul> | ||||
| <p> | ||||
| After installing XFree86 and the DRI drivers, some of these files | ||||
| After installing XFree86/X.org and the DRI drivers, some of these files | ||||
| may be symlinks into the /usr/X11R6/ tree. | ||||
| </p> | ||||
| <p> | ||||
|   | ||||
| @@ -32,7 +32,7 @@ | ||||
| 	- VRML viewer | ||||
| 	</li><li><a href="http://aig.cs.man.ac.uk/systems/Maverik/" target="_parent">Maverik</a> | ||||
| 	- VR graphics and interaction system | ||||
| 	</li><li><a href="http://www.swissquake.ch/chumb.alum-soft" target="_parent">MD2 Viewer</a> | ||||
| 	</li><li><a href="http://www.swissquake.ch/chumbalum-soft/md2v" target="_parent">MD2 Viewer</a> | ||||
| 	- View .MD2 files | ||||
| 	</li><li><a href="http://www.megacads.dlr.de/" target="_parent">MegaCads</a> | ||||
| 	- Multiblock-Elliptic-Grid-Generation-And-CAD-System | ||||
|   | ||||
| @@ -11,6 +11,49 @@ | ||||
| <H1>News</H1> | ||||
|  | ||||
|  | ||||
| <h2>October 24, 2005</h2> | ||||
| <p> | ||||
| Mesa 6.4 has been released.  This is stable, bug-fix release. | ||||
| </p> | ||||
| <pre> | ||||
|     New: | ||||
| 	- Added a fast XOR line drawing function in Xlib driver | ||||
| 	- Added support for GL_ARB_texture_mirrored_repeat to savage | ||||
| 	  driver (supported only on Savage4 hardware). | ||||
|     Changes: | ||||
| 	- Mesa now packaged in three parts: Library, Demos and GLUT | ||||
|     Bug fixes: | ||||
| 	- GLX_X_RENDERABLE token wasn't accepted by glXChooseFBConfig | ||||
| 	- Some files were present multiple times in the 6.3.2 tarballs | ||||
| 	- r200_vtxtmp_x86.S file was missing from 6.3.2 tarball (bug 4207) | ||||
| 	- glxgears_fbconfig demo didn't work (bug 4237) | ||||
| 	- fixed bug when bilinear sampling 2d textures with borders | ||||
| 	- glXCreatePbuffer() could segfault instead of returning 0 (bug 4235) | ||||
| 	- fixed undefined frexp and rand in X.org libGLcore.a (bug 4242) | ||||
| 	- fixed a few problems with proxy color tables (bug 4270) | ||||
| 	- fixed precision problem in Z clearing (bug 4395) | ||||
| 	- glBitmap, glDraw/CopyPixels mistakenly generated selection hits | ||||
| 	- fixed potential segfault caused by reading pixels outside | ||||
| 	  of renderbuffer bounds | ||||
| 	- glGetTexLevelParameter didn't accept GL_TEXTURE_DEPTH_SIZE_ARB | ||||
| 	- fixed memory corruption bug involving software alpha buffers | ||||
| 	- glReadPixels clipped by window bounds was sometimes broken | ||||
| 	- glDraw/CopyPixels of stencil data ignored the stencil write mask | ||||
| 	- glReadPixels from a texture bound to a framebuffer object didn't work | ||||
| 	- glIsRender/FramebufferEXT weren't totally correct | ||||
| 	- fixed a number of point size attenuation/fade bugs | ||||
| 	- fixed glFogCoord bug 4729 | ||||
| 	- GLX encoding for transpose matrix functions was broken | ||||
| 	- fixed broken fragment program KIL and SWZ instructions | ||||
| </pre> | ||||
| <p> | ||||
| The MD5 checksums are: | ||||
| </p> | ||||
| <pre> | ||||
| TBD | ||||
| </pre> | ||||
|  | ||||
|  | ||||
| <h2>August 19, 2005</h2> | ||||
| <p> | ||||
| Mesa 6.3.2 has been released. | ||||
| @@ -1051,6 +1094,6 @@ source code</a>.</p> | ||||
|  | ||||
|  | ||||
| <hr> | ||||
| $Id: news.html,v 3.24 2005/08/19 23:42:29 brianp Exp $ | ||||
| $Id: news.html,v 3.24.2.2 2005/10/24 23:12:29 brianp Exp $ | ||||
| </body> | ||||
| </html> | ||||
|   | ||||
| @@ -13,6 +13,7 @@ The release notes summarize what's new or changed in each Mesa release. | ||||
| </p> | ||||
|  | ||||
| <UL> | ||||
| <LI><A HREF="RELNOTES-6.4">RELNOTES-6.4</A> | ||||
| <LI><A HREF="RELNOTES-6.3.2">RELNOTES-6.3.2</A> | ||||
| <LI><A HREF="RELNOTES-6.3">RELNOTES-6.3</A> | ||||
| <LI><A HREF="RELNOTES-6.2.1">RELNOTES-6.2.1</A> | ||||
|   | ||||
| @@ -71,7 +71,9 @@ static void Display( void ) | ||||
|    glDisable(GL_SCISSOR_TEST); | ||||
|    glDisable(GL_FOG); | ||||
|  | ||||
|    if (!DrawFront) | ||||
|    if (DrawFront) | ||||
|       glFinish(); | ||||
|    else | ||||
|       glutSwapBuffers(); | ||||
| } | ||||
|  | ||||
|   | ||||
| @@ -234,7 +234,9 @@ idle(void) | ||||
|   dt = t - t0; | ||||
|   t0 = t; | ||||
|  | ||||
|   angle += 70.0 * dt;  /* 90 degrees per second */ | ||||
|   angle += 70.0 * dt;  /* 70 degrees per second */ | ||||
|   angle = fmod(angle, 360.0); /* prevents eventual overflow */ | ||||
|  | ||||
|   glutPostRedisplay(); | ||||
| } | ||||
|  | ||||
|   | ||||
| @@ -186,11 +186,12 @@ Display( void ) | ||||
|    else { | ||||
|       /* clear the temporary image to white (helpful for debugging */ | ||||
|       memset(TempImage, 255, ImgWidth * ImgHeight * 4); | ||||
| #if 0 | ||||
|       /* you might use this when debugging */ | ||||
| #if 1 | ||||
|       glReadPixels(APosX, APosY, ImgWidth, ImgHeight, | ||||
|                    ReadFormat, ReadType, TempImage); | ||||
|       (void) ComplexReadPixels; | ||||
| #else | ||||
|       /* you might use this when debugging */ | ||||
|       ComplexReadPixels(APosX, APosY, ImgWidth, ImgHeight, | ||||
|                         ReadFormat, ReadType, TempImage); | ||||
| #endif | ||||
|   | ||||
| @@ -71,7 +71,9 @@ Display( void ) | ||||
| static void | ||||
| Reshape( int width, int height ) | ||||
| { | ||||
| #if 0 | ||||
|    float ar = (float) width / (float) height; | ||||
| #endif | ||||
|    glViewport( 0, 0, width, height ); | ||||
|    glMatrixMode( GL_PROJECTION ); | ||||
|    glLoadIdentity(); | ||||
| @@ -117,14 +119,14 @@ Init( void ) | ||||
|  | ||||
|    glGenFramebuffersEXT(1, &MyFB); | ||||
|    assert(MyFB); | ||||
|    assert(glIsFramebufferEXT(MyFB)); | ||||
|    assert(!glIsFramebufferEXT(MyFB)); | ||||
|    glDeleteFramebuffersEXT(1, &MyFB); | ||||
|    assert(!glIsFramebufferEXT(MyFB)); | ||||
|    /* Note, continue to use MyFB below */ | ||||
|  | ||||
|    glGenRenderbuffersEXT(1, &rb); | ||||
|    assert(rb); | ||||
|    assert(glIsRenderbufferEXT(rb)); | ||||
|    assert(!glIsRenderbufferEXT(rb)); | ||||
|    glDeleteRenderbuffersEXT(1, &rb); | ||||
|    assert(!glIsRenderbufferEXT(rb)); | ||||
|    rb = 42; /* an arbitrary ID */ | ||||
| @@ -156,6 +158,12 @@ Init( void ) | ||||
|       glGetRenderbufferParameterivEXT(GL_RENDERBUFFER_EXT, | ||||
|                                       GL_RENDERBUFFER_ALPHA_SIZE_EXT, &a); | ||||
|       printf("renderbuffer RGBA sizes = %d %d %d %d\n", r, g, b, a); | ||||
|  | ||||
|       glGetIntegerv(GL_RED_BITS, &r); | ||||
|       glGetIntegerv(GL_GREEN_BITS, &g); | ||||
|       glGetIntegerv(GL_BLUE_BITS, &b); | ||||
|       glGetIntegerv(GL_ALPHA_BITS, &a); | ||||
|       printf("Visual RGBA sizes = %d %d %d %d\n", r, g, b, a); | ||||
|    } | ||||
|  | ||||
|    CheckError(__LINE__); | ||||
|   | ||||
| @@ -56,7 +56,8 @@ RenderTexture(void) | ||||
|    glLoadIdentity(); | ||||
|    glTranslatef(0.0, 0.0, -15.0); | ||||
|  | ||||
|    /* draw to texture */ | ||||
|    /* draw to texture image */ | ||||
|    glBindTexture(GL_TEXTURE_2D, 0); | ||||
|    glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, MyFB); | ||||
|    glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, | ||||
|                              GL_TEXTURE_2D, TexObj, level); | ||||
| @@ -142,6 +143,7 @@ Display(void) | ||||
|    glPushMatrix(); | ||||
|    glRotatef(Rot, 0, 1, 0); | ||||
|    glEnable(GL_TEXTURE_2D); | ||||
|    glBindTexture(GL_TEXTURE_2D, TexObj); | ||||
|    glBegin(GL_POLYGON); | ||||
|    glColor3f(0.25, 0.25, 0.25); | ||||
|    glTexCoord2f(0, 0); | ||||
| @@ -203,10 +205,10 @@ Init(void) | ||||
|    } | ||||
|    printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER)); | ||||
|  | ||||
|    /* make framebuffer */ | ||||
|    /* gen framebuffer id, delete it, do some assertions, just for testing */ | ||||
|    glGenFramebuffersEXT(1, &MyFB); | ||||
|    assert(MyFB); | ||||
|    assert(glIsFramebufferEXT(MyFB)); | ||||
|    assert(!glIsFramebufferEXT(MyFB)); | ||||
|    glDeleteFramebuffersEXT(1, &MyFB); | ||||
|    assert(!glIsFramebufferEXT(MyFB)); | ||||
|    /* Note, continue to use MyFB below */ | ||||
| @@ -219,8 +221,9 @@ Init(void) | ||||
|    /* make depth renderbuffer */ | ||||
|    glGenRenderbuffersEXT(1, &DepthRB); | ||||
|    assert(DepthRB); | ||||
|    assert(glIsRenderbufferEXT(DepthRB)); | ||||
|    assert(!glIsRenderbufferEXT(DepthRB)); | ||||
|    glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, DepthRB); | ||||
|    assert(glIsRenderbufferEXT(DepthRB)); | ||||
|    glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_DEPTH_COMPONENT, | ||||
|                             TexWidth, TexHeight); | ||||
|    glGetRenderbufferParameterivEXT(GL_RENDERBUFFER_EXT, | ||||
| @@ -231,8 +234,9 @@ Init(void) | ||||
|    /* make stencil renderbuffer */ | ||||
|    glGenRenderbuffersEXT(1, &StencilRB); | ||||
|    assert(StencilRB); | ||||
|    assert(glIsRenderbufferEXT(StencilRB)); | ||||
|    assert(!glIsRenderbufferEXT(StencilRB)); | ||||
|    glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, StencilRB); | ||||
|    assert(glIsRenderbufferEXT(StencilRB)); | ||||
|    glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_STENCIL_INDEX, | ||||
|                             TexWidth, TexHeight); | ||||
|    glGetRenderbufferParameterivEXT(GL_RENDERBUFFER_EXT, | ||||
|   | ||||
| @@ -467,7 +467,7 @@ make_window( Display *dpy, const char *name, | ||||
|                               None, (char **)NULL, 0, &sizehints); | ||||
|    } | ||||
|  | ||||
|    ctx = (*create_new_context)(dpy, fbconfig[0], GLX_RGBA_BIT, NULL, GL_TRUE); | ||||
|    ctx = (*create_new_context)(dpy, fbconfig[0], GLX_RGBA_TYPE, NULL, GL_TRUE); | ||||
|    if (!ctx) { | ||||
|       printf("Error: glXCreateNewContext failed\n"); | ||||
|       exit(1); | ||||
|   | ||||
| @@ -31,8 +31,8 @@ | ||||
| ** published by SGI, but has not been independently verified as being | ||||
| ** compliant with the OpenGL(R) version 1.2.1 Specification. | ||||
| ** | ||||
| ** $Date: 2001/03/17 00:25:41 $ $Revision: 1.1 $ | ||||
| ** $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libutil/error.c,v 1.1 2001/03/17 00:25:41 brianp Exp $ | ||||
| ** $Date: 2005/10/05 02:08:30 $ $Revision: 1.1.30.1 $ | ||||
| ** $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libutil/error.c,v 1.1.30.1 2005/10/05 02:08:30 brianp Exp $ | ||||
| */ | ||||
|  | ||||
| #include "gluos.h" | ||||
| @@ -81,6 +81,11 @@ gluErrorString(GLenum errorCode) | ||||
|     if ((errorCode >= GLU_TESS_ERROR1) && (errorCode <= GLU_TESS_ERROR8)) { | ||||
| 	return (const unsigned char *) __gluTessErrorString(errorCode - (GLU_TESS_ERROR1 - 1)); | ||||
|     } | ||||
| #ifdef GL_EXT_framebuffer_object | ||||
|     if (errorCode == GL_INVALID_FRAMEBUFFER_OPERATION_EXT) { | ||||
|        return (const unsigned char *) "invalid framebuffer operation"; | ||||
|     } | ||||
| #endif | ||||
|  | ||||
|     return 0; | ||||
| } | ||||
|   | ||||
| @@ -182,9 +182,9 @@ extern void GLwDrawingAreaSwapBuffers(Widget w); | ||||
|  | ||||
| #ifdef __GLX_MOTIF | ||||
| #ifdef _NO_PROTO | ||||
| GLAPI extern Widget GLwCreateMDrawingArea(); | ||||
| GLAPI Widget GLwCreateMDrawingArea(); | ||||
| #else | ||||
| GLAPI extern Widget GLwCreateMDrawingArea(Widget parent,char *name,ArgList arglist,Cardinal argcount); | ||||
| GLAPI Widget GLwCreateMDrawingArea(Widget parent,char *name,ArgList arglist,Cardinal argcount); | ||||
| #endif | ||||
| #endif  | ||||
|  | ||||
|   | ||||
| @@ -59,7 +59,7 @@ typedef struct _GLwMDrawingAreaClassRec { | ||||
|   } GLwMDrawingAreaClassRec; | ||||
|  | ||||
|  | ||||
| GLAPI extern GLwMDrawingAreaClassRec glwMDrawingAreaClassRec; | ||||
| extern GLwMDrawingAreaClassRec glwMDrawingAreaClassRec; | ||||
|  | ||||
|  | ||||
| /* XT */ | ||||
|   | ||||
| @@ -1,451 +0,0 @@ | ||||
| /* | ||||
|  | ||||
|                                 BOILERPLATE | ||||
|  | ||||
|    To get started with mixed model programming with Motif and OpenGL, this | ||||
|    boilerplate `application' might help get you started. | ||||
|  | ||||
|    This program honors two environment variables: | ||||
|  | ||||
|       SETVISUAL <id>    Makes the application use the indicated visual, | ||||
|                         instead of the one chosen by glxChooseVisual. | ||||
|  | ||||
|       SAMEVISUAL        Make the application use the same visual for the | ||||
|                         GUI as for the 3D GL Widget. | ||||
|  | ||||
|    The basic idea is to minimize colormap `flash' on systems with only one | ||||
|    hardware colormap, especially when focus shifts between several | ||||
|    of the application's windows, e.g. the about box. | ||||
|  | ||||
|    If you have suggestions for improvements, please mail to: | ||||
|  | ||||
|  | ||||
|       Jeroen van der Zijp  <jvz@cyberia.cfdrc.com> | ||||
|  | ||||
|  | ||||
|    Feel free to turn this into a useful program!! | ||||
|  | ||||
| */ | ||||
|  | ||||
|  | ||||
| /* | ||||
|  | ||||
|     This code is hereby placed under GNU GENERAL PUBLIC LICENSE. | ||||
|     Copyright (C) 1996 Jeroen van der Zijp <jvz@cyberia.cfdrc.com> | ||||
|  | ||||
|     This program is free software; you can redistribute it and/or modify | ||||
|     it under the terms of the GNU General Public License as published by | ||||
|     the Free Software Foundation; either version 2 of the License, or | ||||
|     (at your option) any later version. | ||||
|  | ||||
|     This program is distributed in the hope that it will be useful, | ||||
|     but WITHOUT ANY WARRANTY; without even the implied warranty of | ||||
|     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | ||||
|     GNU General Public License for more details. | ||||
|  | ||||
|     You should have received a copy of the GNU General Public License | ||||
|     along with this program; if not, write to the Free Software | ||||
|     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||||
| */ | ||||
|  | ||||
|  | ||||
| /* Include the kitchen sink */ | ||||
| #include <stdio.h> | ||||
| #include <stdlib.h> | ||||
| #include <X11/Intrinsic.h> | ||||
| #include <X11/StringDefs.h> | ||||
| #include <X11/cursorfont.h> | ||||
| #include <X11/keysym.h> | ||||
| #include <Xm/Xm.h> | ||||
| #include <Xm/MainW.h> | ||||
| #include <Xm/RowColumn.h> | ||||
| #include <Xm/PushB.h> | ||||
| #include <Xm/CascadeB.h> | ||||
| #include <Xm/BulletinB.h> | ||||
| #include <Xm/DialogS.h> | ||||
| #include <Xm/Frame.h> | ||||
| #include <Xm/MessageB.h> | ||||
| #include <Xm/Form.h> | ||||
| #include <Xm/Separator.h> | ||||
| #include <Xm/MwmUtil.h> | ||||
|  | ||||
| /* Now some good stuff */ | ||||
| #include <GLwMDrawA.h> | ||||
| #include <GL/gl.h> | ||||
| #include <GL/glu.h> | ||||
| #include <GL/glx.h> | ||||
|  | ||||
|  | ||||
| /* Stuff */ | ||||
| Display      *display; | ||||
| Visual       *gui_visual; | ||||
| Colormap      gui_colormap; | ||||
| Colormap      gl_colormap; | ||||
| XVisualInfo  *gl_visualinfo; | ||||
| XtAppContext  app_context; | ||||
| Widget        toplevel; | ||||
| Widget        mainwindow; | ||||
| Widget        menubar; | ||||
| Widget        mainform; | ||||
| Widget        mainframe; | ||||
| Widget        glwidget; | ||||
| Widget        button; | ||||
| Widget        separator; | ||||
| GLXContext    glx_context; | ||||
|  | ||||
| #ifndef __cplusplus | ||||
| #define c_class class | ||||
| #endif | ||||
|  | ||||
| /* Requested attributes; fix as you see fit */ | ||||
| static int glxConfig[]={ | ||||
|   GLX_RGBA, | ||||
|   GLX_DOUBLEBUFFER, | ||||
|   GLX_DEPTH_SIZE,   16, | ||||
|   GLX_RED_SIZE,     1, | ||||
|   GLX_GREEN_SIZE,   1, | ||||
|   GLX_BLUE_SIZE,    1, | ||||
|   None | ||||
|   }; | ||||
|  | ||||
|  | ||||
| /* Forwards */ | ||||
| static void exposeCB(Widget w,XtPointer client_data,GLwDrawingAreaCallbackStruct *cbs); | ||||
| static void initCB(Widget w,XtPointer client_data,GLwDrawingAreaCallbackStruct *cbs); | ||||
| static void resizeCB(Widget w,XtPointer client_data,GLwDrawingAreaCallbackStruct *cbs); | ||||
| static void inputCB(Widget w,XtPointer client_data,GLwDrawingAreaCallbackStruct *cbs); | ||||
| static void byeCB(Widget w,XtPointer client_data,XtPointer call_data); | ||||
| static void aboutCB(Widget w,XtPointer client_data,XtPointer call_data); | ||||
| static char* showvisualclass(int cls); | ||||
|  | ||||
|  | ||||
|  | ||||
| /* Sample application */ | ||||
| int main(int argc, char *argv[]){ | ||||
|   char *thevisual; | ||||
|   XVisualInfo vi; | ||||
|   int nvisinfos,visid,n; | ||||
|   Arg args[30]; | ||||
|   Widget pane,cascade,but; | ||||
|  | ||||
|   /* | ||||
|   ** Initialize toolkit | ||||
|   ** We do *not* use XtAppInitialize as we want to figure visual and | ||||
|   ** colormap BEFORE we create the top level shell!!! | ||||
|   */ | ||||
|   XtToolkitInitialize(); | ||||
|  | ||||
|   /* Make application context */ | ||||
|   app_context=XtCreateApplicationContext(); | ||||
|  | ||||
|   /* Try open display */ | ||||
|   display=XtOpenDisplay(app_context,NULL,"boilerPlate","BoilerPlate",NULL,0,&argc,argv); | ||||
|  | ||||
|   /* Report failure */ | ||||
|   if(!display){ | ||||
|     fprintf(stderr,"Unable to open the specified display.\n"); | ||||
|     fprintf(stderr,"Set your `DISPLAY' environment variable properly or\n"); | ||||
|     fprintf(stderr,"use the `xhost' command to authorize access to the display.\n"); | ||||
|     exit(1); | ||||
|     } | ||||
|  | ||||
|   /* Check for extension; for Mesa, this is always cool */ | ||||
|   if(!glXQueryExtension(display,NULL,NULL)){ | ||||
|     fprintf(stderr,"The specified display does not support the OpenGL extension\n"); | ||||
|     exit(1); | ||||
|     } | ||||
|  | ||||
|   /* Init with default visual and colormap */ | ||||
|   gui_visual=DefaultVisual(display,0); | ||||
|   gui_colormap=DefaultColormap(display,0); | ||||
|   gl_colormap=DefaultColormap(display,0); | ||||
|  | ||||
|   /* User insists on a specific visual */ | ||||
|   if((thevisual=getenv("SETVISUAL"))!=NULL){ | ||||
|     if(sscanf(thevisual,"%x",&visid)==1){ | ||||
|       vi.visualid=visid; | ||||
|       gl_visualinfo=XGetVisualInfo(display,VisualIDMask,&vi,&nvisinfos); | ||||
|       } | ||||
|     else{ | ||||
|       fprintf(stderr,"Please set the `SETVISUAL' variable in hexadecimal\n"); | ||||
|       fprintf(stderr,"Use one of the Visual ID's reported by `xdpyinfo'\n"); | ||||
|       exit(1); | ||||
|       } | ||||
|     } | ||||
|  | ||||
|   /* Find visual the regular way */ | ||||
|   else{ | ||||
|     gl_visualinfo=glXChooseVisual(display,DefaultScreen(display),glxConfig); | ||||
|     } | ||||
|  | ||||
|   /* Make sure we have a visual */ | ||||
|   if(!gl_visualinfo){ | ||||
|     fprintf(stderr,"Unable to obtain visual for graphics\n"); | ||||
|     exit(1); | ||||
|     } | ||||
|  | ||||
|   /* Show what visual is being used */ | ||||
|   fprintf(stderr,"Using the following visual:\n"); | ||||
|   fprintf(stderr,"  visualid: %lx\n",gl_visualinfo->visualid); | ||||
|   fprintf(stderr,"     depth: %d\n",gl_visualinfo->depth); | ||||
|   fprintf(stderr,"    screen: %d\n",gl_visualinfo->screen); | ||||
|   fprintf(stderr,"  bits/rgb: %d\n",gl_visualinfo->bits_per_rgb); | ||||
|   fprintf(stderr,"     class: %s\n",showvisualclass(gl_visualinfo->c_class)); | ||||
|  | ||||
|   /* | ||||
|   ** If not using default visual, we need a colormap for this visual. | ||||
|   ** Yes, the GL widget can allocate one itself, but we want to make | ||||
|   ** sure the GUI and the 3D have the same one (if hardware does not | ||||
|   ** allow more than one simultaneously). | ||||
|   ** This prevents nasty flashing when the window with the 3D widget | ||||
|   ** looses the focus. | ||||
|   */ | ||||
|   if(gl_visualinfo->visual!=DefaultVisual(display,0)){ | ||||
|     fprintf(stderr,"Making another colormap\n"); | ||||
|     gl_colormap=XCreateColormap(display, | ||||
|                                 RootWindow(display,0), | ||||
|                                 gl_visualinfo->visual, | ||||
|                                 AllocNone); | ||||
|     if(!gl_colormap){ | ||||
|       fprintf(stderr,"Unable to create private colormap\n"); | ||||
|       exit(1); | ||||
|       } | ||||
|     } | ||||
|  | ||||
|   /* | ||||
|   ** Use common visual for GUI and GL? | ||||
|   ** Maybe you can invoke some hardware interrogation function and | ||||
|   ** see if more than one hardware map is supported.  For the purpose | ||||
|   ** of this demo, we'll use an environment variable instead. | ||||
|   */ | ||||
|   if(getenv("SAMEVISUAL")!=NULL){ | ||||
|     gui_visual=gl_visualinfo->visual; | ||||
|     gui_colormap=gl_colormap; | ||||
|     } | ||||
|  | ||||
|   fprintf(stderr,"GUI uses visual: %lx\n",XVisualIDFromVisual(gui_visual)); | ||||
|  | ||||
|   /* Create application shell, finally */ | ||||
|   n=0; | ||||
|   XtSetArg(args[n],XmNvisual,gui_visual); n++;  	/* Plug in that visual */ | ||||
|   XtSetArg(args[n],XmNcolormap,gui_colormap); n++;	/* And that colormap */ | ||||
|   toplevel=XtAppCreateShell("boilerPlate","BoilerPlate", | ||||
|                             applicationShellWidgetClass,display,args,n); | ||||
|  | ||||
|  | ||||
|   /* Main window */ | ||||
|   n=0; | ||||
|   mainwindow=XmCreateMainWindow(toplevel,"window",args,n); | ||||
|   XtManageChild(mainwindow); | ||||
|  | ||||
|   /* Make a menu */ | ||||
|   n=0; | ||||
|   XtSetArg(args[n],XmNmarginWidth,0); n++; | ||||
|   XtSetArg(args[n],XmNmarginHeight,0); n++; | ||||
|   menubar=XmCreateMenuBar(mainwindow,"menubar",args,2); | ||||
|   XtManageChild(menubar); | ||||
|  | ||||
|   n=0; | ||||
|   pane=XmCreatePulldownMenu(menubar,"pane",args,n); | ||||
|   n=0; | ||||
|   but=XmCreatePushButton(pane,"Open",args,n); | ||||
|   XtManageChild(but); | ||||
|   but=XmCreatePushButton(pane,"Save",args,n); | ||||
|   XtManageChild(but); | ||||
|   but=XmCreatePushButton(pane,"Save As",args,n); | ||||
|   XtManageChild(but); | ||||
|   but=XmCreatePushButton(pane,"Quit",args,n); | ||||
|   XtAddCallback(but,XmNactivateCallback,byeCB,(XtPointer)NULL); | ||||
|   XtManageChild(but); | ||||
|   XtSetArg(args[0],XmNsubMenuId,pane); | ||||
|   cascade=XmCreateCascadeButton(menubar,"File",args,1); | ||||
|   XtManageChild(cascade); | ||||
|  | ||||
|   n=0; | ||||
|   pane=XmCreatePulldownMenu(menubar,"pane",args,n); | ||||
|   n=0; | ||||
|   but=XmCreatePushButton(pane,"About",args,n); | ||||
|   XtAddCallback(but,XmNactivateCallback,aboutCB,(XtPointer)NULL); | ||||
|   XtManageChild(but); | ||||
|   XtSetArg(args[0],XmNsubMenuId,pane); | ||||
|   cascade=XmCreateCascadeButton(menubar,"Help",args,1); | ||||
|   XtManageChild(cascade); | ||||
|   XtVaSetValues(menubar,XmNmenuHelpWidget,cascade,NULL); | ||||
|  | ||||
|   /* Main window form */ | ||||
|   n=0; | ||||
|   XtSetArg(args[n],XmNmarginWidth,5); n++; | ||||
|   XtSetArg(args[n],XmNmarginHeight,5); n++; | ||||
|   mainform=XmCreateForm(mainwindow,"mainForm",args,n); | ||||
|   XtManageChild(mainform); | ||||
|  | ||||
|   /* Some nice button */ | ||||
|   n=0; | ||||
|   XtSetArg(args[n],XmNbottomAttachment,XmATTACH_FORM); n++; | ||||
|   XtSetArg(args[n],XmNrightAttachment,XmATTACH_FORM); n++; | ||||
|   button=XmCreatePushButton(mainform,"Bye",args,n); | ||||
|   XtAddCallback(button,XmNactivateCallback,byeCB,(XtPointer)NULL); | ||||
|   XtManageChild(button); | ||||
|  | ||||
|   n=0; | ||||
|   XtSetArg(args[n],XmNleftAttachment,XmATTACH_FORM); n++; | ||||
|   XtSetArg(args[n],XmNrightAttachment,XmATTACH_FORM); n++; | ||||
|   XtSetArg(args[n],XmNbottomAttachment,XmATTACH_WIDGET); n++; | ||||
|   XtSetArg(args[n],XmNbottomWidget,button); n++; | ||||
|   XtSetArg(args[n],XmNshadowType,XmSHADOW_ETCHED_IN); n++; | ||||
|   separator=XmCreateSeparator(mainform,"separator",args,n); | ||||
|   XtManageChild(separator); | ||||
|  | ||||
|   /* Main window frame */ | ||||
|   n = 0; | ||||
|   XtSetArg(args[n],XmNleftAttachment,XmATTACH_FORM); n++; | ||||
|   XtSetArg(args[n],XmNrightAttachment,XmATTACH_FORM); n++; | ||||
|   XtSetArg(args[n],XmNtopAttachment,XmATTACH_FORM); n++; | ||||
|   XtSetArg(args[n],XmNbottomAttachment,XmATTACH_WIDGET); n++; | ||||
|   XtSetArg(args[n],XmNbottomWidget,separator); n++; | ||||
|   XtSetArg(args[n],XmNshadowType,XmSHADOW_IN); n++; | ||||
|   mainframe = XmCreateFrame(mainform,"mainFrame",args,n); | ||||
|   XtManageChild(mainframe); | ||||
|  | ||||
|   /* GL drawing area */ | ||||
|   n = 0; | ||||
|   XtSetArg(args[n],XmNcolormap,gl_colormap); n++; | ||||
|   XtSetArg(args[n],GLwNvisualInfo,gl_visualinfo); n++; | ||||
|   XtSetArg(args[n],GLwNinstallColormap,True); n++; | ||||
|   XtSetArg(args[n],XmNtraversalOn,True); n++; | ||||
|   XtSetArg(args[n],XmNwidth,400); n++; | ||||
|   XtSetArg(args[n],XmNheight,300); n++; | ||||
|   glwidget = GLwCreateMDrawingArea(mainframe,"glWidget",args,n); | ||||
|   XtAddCallback(glwidget,GLwNexposeCallback,(XtCallbackProc)exposeCB,(XtPointer)NULL); | ||||
|   XtAddCallback(glwidget,GLwNresizeCallback,(XtCallbackProc)resizeCB,(XtPointer)NULL); | ||||
|   XtAddCallback(glwidget,GLwNginitCallback,(XtCallbackProc)initCB,(XtPointer)NULL); | ||||
|   XtAddCallback(glwidget,GLwNinputCallback,(XtCallbackProc)inputCB,(XtPointer)NULL); | ||||
|   XtManageChild(glwidget); | ||||
|  | ||||
|   /* Set into main window */ | ||||
|   XmMainWindowSetAreas(mainwindow,menubar,NULL,NULL,NULL,mainform); | ||||
|   XtRealizeWidget(toplevel); | ||||
|  | ||||
|   /* Loop until were done */ | ||||
|   XtAppMainLoop(app_context); | ||||
|   return 0; | ||||
|   } | ||||
|  | ||||
|  | ||||
| /* Show visual class */ | ||||
| static char* showvisualclass(int cls){ | ||||
|   if(cls==TrueColor) return "TrueColor"; | ||||
|   if(cls==DirectColor) return "DirectColor"; | ||||
|   if(cls==PseudoColor) return "PseudoColor"; | ||||
|   if(cls==StaticColor) return "StaticColor"; | ||||
|   if(cls==GrayScale) return "GrayScale"; | ||||
|   if(cls==StaticGray) return "StaticGray"; | ||||
|   return "Unknown"; | ||||
|   } | ||||
|  | ||||
|  | ||||
| static void exposeCB(Widget w,XtPointer client_data,GLwDrawingAreaCallbackStruct *cbs){ | ||||
|   GLwDrawingAreaMakeCurrent(glwidget,glx_context); | ||||
|  | ||||
|   glClear(GL_DEPTH_BUFFER_BIT|GL_COLOR_BUFFER_BIT); | ||||
|   glMatrixMode(GL_PROJECTION); | ||||
|  | ||||
|   glLoadIdentity(); | ||||
|   glOrtho(-1.0,1.0,-1.0,1.0,0.0,1.0); | ||||
|  | ||||
|   glMatrixMode(GL_MODELVIEW); | ||||
|  | ||||
|   glLoadIdentity(); | ||||
|  | ||||
|   glColor3f(1.0,0.0,0.0); | ||||
|   glBegin(GL_LINE_STRIP); | ||||
|   glVertex3f(-1.0,-1.0,0.0); | ||||
|   glVertex3f( 1.0, 1.0,0.0); | ||||
|   glEnd(); | ||||
|   glXSwapBuffers(display,XtWindow(glwidget)); | ||||
|   } | ||||
|  | ||||
|  | ||||
| /* Initialize widget */ | ||||
| static void initCB(Widget w,XtPointer client_data,GLwDrawingAreaCallbackStruct *cbs){ | ||||
|  | ||||
|   /* First, create context. We prefer direct rendering */ | ||||
|   glx_context=glXCreateContext(display,gl_visualinfo,0,TRUE); | ||||
|   if(!glx_context){ | ||||
|     fprintf(stderr,"Unable to create gl context\n"); | ||||
|     exit(1); | ||||
|     } | ||||
|  | ||||
|   /* Make it current */ | ||||
|   GLwDrawingAreaMakeCurrent(glwidget,glx_context); | ||||
|  | ||||
|   /* Set a viewport */ | ||||
|   glViewport(0,0,cbs->width,cbs->height); | ||||
|  | ||||
|   /* You might want to do a lot more here ... */ | ||||
|   glEnable(GL_DEPTH_TEST); | ||||
|   glDepthFunc(GL_LEQUAL); | ||||
|   glClearColor(1.0,1.0,1.0,1.0); | ||||
|   glClearDepth(1.0); | ||||
|  | ||||
|  | ||||
|   } | ||||
|  | ||||
|  | ||||
| /* Widget changed size, so adjust txform */ | ||||
| static void resizeCB(Widget w,XtPointer client_data,GLwDrawingAreaCallbackStruct *cbs){ | ||||
|   GLwDrawingAreaMakeCurrent(glwidget,glx_context); | ||||
|   glViewport(0,0,cbs->width,cbs->height); | ||||
|  | ||||
|   /* blablabla */ | ||||
|   } | ||||
|  | ||||
|  | ||||
| /* Boilerplate event handling */ | ||||
| static void inputCB(Widget w,XtPointer client_data,GLwDrawingAreaCallbackStruct *cbs){ | ||||
|   switch(cbs->event->type){ | ||||
|     case ButtonPress: | ||||
|       switch(cbs->event->xbutton.button){ | ||||
|         case Button1: fprintf(stderr,"Pressed 1\n"); break; | ||||
|         case Button2: fprintf(stderr,"Pressed 2\n"); break; | ||||
|         case Button3: fprintf(stderr,"Pressed 3\n"); break; | ||||
|         } | ||||
|       break; | ||||
|     case ButtonRelease: | ||||
|       switch(cbs->event->xbutton.button){ | ||||
|         case Button1: fprintf(stderr,"Released 1\n"); break; | ||||
|         case Button2: fprintf(stderr,"Released 2\n"); break; | ||||
|         case Button3: fprintf(stderr,"Released 3\n"); break; | ||||
|         } | ||||
|       break; | ||||
|     case MotionNotify: | ||||
|       fprintf(stderr,"Moved mouse to (%d %d)\n", | ||||
|               cbs->event->xbutton.x, | ||||
|               cbs->event->xbutton.y); | ||||
|       break; | ||||
|     } | ||||
|   } | ||||
|  | ||||
|  | ||||
| /* Hasta la vista, baby */ | ||||
| static void byeCB(Widget w,XtPointer client_data,XtPointer call_data){ | ||||
|   exit(0); | ||||
|   } | ||||
|  | ||||
|  | ||||
| /* Pop informative panel */ | ||||
| static void aboutCB(Widget w,XtPointer client_data,XtPointer call_data){ | ||||
|   Arg args[10]; | ||||
|   XmString str; | ||||
|   Widget box; | ||||
|   str=XmStringCreateLtoR("Boilerplate Mixed Model Programming Example\n\n   (C) 1996 Jeroen van der Zijp \n\n    jvz@cyberia.cfdrc.com",XmSTRING_DEFAULT_CHARSET); | ||||
|   XtSetArg(args[0],XmNnoResize,True); | ||||
|   XtSetArg(args[1],XmNautoUnmanage,True); | ||||
|   XtSetArg(args[2],XmNmessageString,str); | ||||
|   XtSetArg(args[3],XmNdefaultPosition,False); | ||||
|   box=XmCreateInformationDialog(toplevel,"About Boilerplate",args,4); | ||||
|   XtManageChild(box); | ||||
|   XtUnmanageChild(XmMessageBoxGetChild(box,XmDIALOG_HELP_BUTTON)); | ||||
|   XtUnmanageChild(XmMessageBoxGetChild(box,XmDIALOG_CANCEL_BUTTON)); | ||||
|   XmStringFree(str); | ||||
|   } | ||||
| @@ -38,7 +38,7 @@ | ||||
|  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||||
|  */ | ||||
|  | ||||
| /* $Id: miniglx_events.c,v 1.4 2004/07/16 04:27:00 jonsmirl Exp $ */ | ||||
| /* $Id: miniglx_events.c,v 1.4.8.2 2005/08/31 01:25:24 airlied Exp $ */ | ||||
|  | ||||
|  | ||||
| #include <assert.h> | ||||
| @@ -258,6 +258,7 @@ static int welcome_message_part( Display *dpy, int i, void **msg, int sz ) | ||||
|       if (!*msg) *msg = malloc(sz); | ||||
|       if (!*msg) return False; | ||||
|       if (!blocking_read( dpy, i, *msg, sz )) return False; | ||||
|       return sz; | ||||
|    } | ||||
|    else { | ||||
|       if (!send_msg( dpy, i, &sz, sizeof(sz))) return False; | ||||
| @@ -283,18 +284,21 @@ static int welcome_message( Display *dpy, int i ) | ||||
| { | ||||
|    void *tmp = &dpy->driverContext.shared; | ||||
|    int *clientid = dpy->IsClient ? &dpy->clientID : &i; | ||||
|     | ||||
|    int size; | ||||
|    if (!welcome_message_part( dpy, i, (void **)&clientid, sizeof(*clientid))) | ||||
|       return False; | ||||
|  | ||||
|    if (!welcome_message_part( dpy, i, &tmp, sizeof(dpy->driverContext.shared))) | ||||
|       return False; | ||||
|        | ||||
|    if (!welcome_message_part( dpy, i, | ||||
|    size=welcome_message_part( dpy, i, | ||||
|                               (void **)&dpy->driverContext.driverClientMsg,  | ||||
| 			      dpy->driverContext.driverClientMsgSize )) | ||||
| 			      dpy->driverContext.driverClientMsgSize ); | ||||
|    if (!size) | ||||
|       return False; | ||||
|  | ||||
|    if (dpy->IsClient) { | ||||
|       dpy->driverContext.driverClientMsgSize = size; | ||||
|    } | ||||
|    return True; | ||||
| } | ||||
|  | ||||
|   | ||||
| @@ -39,7 +39,7 @@ | ||||
|  | ||||
| #define __GLX_PAD(n) (((n) + 3) & ~3) | ||||
|  | ||||
| #  if defined(__i386__) && defined(__GNUC__) | ||||
| #  if defined(__i386__) && defined(__GNUC__) && !defined(__CYGWIN__) && !defined(__MINGW32__) | ||||
| #    define FASTCALL __attribute__((fastcall)) | ||||
| #  else | ||||
| #    define FASTCALL | ||||
|   | ||||
| @@ -37,12 +37,12 @@ | ||||
|  * \author Ian Romanick <idr@us.ibm.com> | ||||
|  */ | ||||
|  | ||||
| #  if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) | ||||
| #  if (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3)) && defined(__ELF__) | ||||
| #    define HIDDEN  __attribute__((visibility("hidden"))) | ||||
| #  else | ||||
| #    define HIDDEN | ||||
| #  endif | ||||
| #  if defined(__i386__) && defined(__GNUC__) | ||||
| #  if defined(__i386__) && defined(__GNUC__) && !defined(__CYGWIN__) && !defined(__MINGW32__) | ||||
| #    define FASTCALL __attribute__((fastcall)) | ||||
| #  else | ||||
| #    define FASTCALL | ||||
|   | ||||
| @@ -613,7 +613,7 @@ __GLapi * __glXNewIndirectAPI( void ) | ||||
|     glAPI->PointParameterfEXT = __indirect_glPointParameterfEXT; | ||||
|     glAPI->PointParameterfvEXT = __indirect_glPointParameterfvEXT; | ||||
|  | ||||
|     /*  145. GL_EXT_secondary_color */ | ||||
|     /* 145. GL_EXT_secondary_color */ | ||||
|  | ||||
|     glAPI->SecondaryColor3usvEXT = __indirect_glSecondaryColor3usvEXT; | ||||
|     glAPI->SecondaryColorPointerEXT = __indirect_glSecondaryColorPointerEXT; | ||||
| @@ -633,12 +633,12 @@ __GLapi * __glXNewIndirectAPI( void ) | ||||
|     glAPI->SecondaryColor3uivEXT = __indirect_glSecondaryColor3uivEXT; | ||||
|     glAPI->SecondaryColor3usEXT = __indirect_glSecondaryColor3usEXT; | ||||
|  | ||||
|     /*  148. GL_EXT_multi_draw_arrays */ | ||||
|     /* 148. GL_EXT_multi_draw_arrays */ | ||||
|  | ||||
|     glAPI->MultiDrawArraysEXT = __indirect_glMultiDrawArraysEXT; | ||||
|     glAPI->MultiDrawElementsEXT = __indirect_glMultiDrawElementsEXT; | ||||
|  | ||||
|     /*  149. GL_EXT_fog_coord */ | ||||
|     /* 149. GL_EXT_fog_coord */ | ||||
|  | ||||
|     glAPI->FogCoordfEXT = __indirect_glFogCoordfEXT; | ||||
|     glAPI->FogCoordfvEXT = __indirect_glFogCoordfvEXT; | ||||
| @@ -646,11 +646,11 @@ __GLapi * __glXNewIndirectAPI( void ) | ||||
|     glAPI->FogCoorddvEXT = __indirect_glFogCoorddvEXT; | ||||
|     glAPI->FogCoordPointerEXT = __indirect_glFogCoordPointerEXT; | ||||
|  | ||||
|     /*  173. GL_EXT_blend_func_separate */ | ||||
|     /* 173. GL_EXT_blend_func_separate */ | ||||
|  | ||||
|     glAPI->BlendFuncSeparateEXT = __indirect_glBlendFuncSeparateEXT; | ||||
|  | ||||
|     /*  197. GL_MESA_window_pos */ | ||||
|     /* 197. GL_MESA_window_pos */ | ||||
|  | ||||
|     glAPI->WindowPos2dMESA = __indirect_glWindowPos2dMESA; | ||||
|     glAPI->WindowPos2dvMESA = __indirect_glWindowPos2dvMESA; | ||||
| @@ -669,7 +669,7 @@ __GLapi * __glXNewIndirectAPI( void ) | ||||
|     glAPI->WindowPos3sMESA = __indirect_glWindowPos3sMESA; | ||||
|     glAPI->WindowPos3svMESA = __indirect_glWindowPos3svMESA; | ||||
|  | ||||
|     /*  233. GL_NV_vertex_program */ | ||||
|     /* 233. GL_NV_vertex_program */ | ||||
|  | ||||
|     glAPI->VertexAttribs4svNV = __indirect_glVertexAttribs4svNV; | ||||
|     glAPI->VertexAttribs4ubvNV = __indirect_glVertexAttribs4ubvNV; | ||||
| @@ -736,16 +736,16 @@ __GLapi * __glXNewIndirectAPI( void ) | ||||
|     glAPI->VertexAttribs4dvNV = __indirect_glVertexAttribs4dvNV; | ||||
|     glAPI->VertexAttribs4fvNV = __indirect_glVertexAttribs4fvNV; | ||||
|  | ||||
|     /*  262. GL_NV_point_sprite */ | ||||
|     /* 262. GL_NV_point_sprite */ | ||||
|  | ||||
|     glAPI->PointParameteriNV = __indirect_glPointParameteriNV; | ||||
|     glAPI->PointParameterivNV = __indirect_glPointParameterivNV; | ||||
|  | ||||
|     /*  268. GL_EXT_stencil_two_side */ | ||||
|     /* 268. GL_EXT_stencil_two_side */ | ||||
|  | ||||
|     glAPI->ActiveStencilFaceEXT = __indirect_glActiveStencilFaceEXT; | ||||
|  | ||||
|     /*  282. GL_NV_fragment_program */ | ||||
|     /* 282. GL_NV_fragment_program */ | ||||
|  | ||||
|     glAPI->ProgramNamedParameter4fNV = __indirect_glProgramNamedParameter4fNV; | ||||
|     glAPI->ProgramNamedParameter4dNV = __indirect_glProgramNamedParameter4dNV; | ||||
| @@ -754,7 +754,7 @@ __GLapi * __glXNewIndirectAPI( void ) | ||||
|     glAPI->GetProgramNamedParameterfvNV = __indirect_glGetProgramNamedParameterfvNV; | ||||
|     glAPI->GetProgramNamedParameterdvNV = __indirect_glGetProgramNamedParameterdvNV; | ||||
|  | ||||
|     /*  310. GL_EXT_framebuffer_object */ | ||||
|     /* 310. GL_EXT_framebuffer_object */ | ||||
|  | ||||
|     glAPI->RenderbufferStorageEXT = __indirect_glRenderbufferStorageEXT; | ||||
|     glAPI->GetRenderbufferParameterivEXT = __indirect_glGetRenderbufferParameterivEXT; | ||||
|   | ||||
| @@ -35,19 +35,22 @@ | ||||
| #    define PURE | ||||
| #  endif | ||||
|  | ||||
| #  if defined(__i386__) && defined(__GNUC__) | ||||
| #  if defined(__i386__) && defined(__GNUC__) && !defined(__CYGWIN__) && !defined(__MINGW32__) | ||||
| #    define FASTCALL __attribute__((fastcall)) | ||||
| #  else | ||||
| #    define FASTCALL | ||||
| #  endif | ||||
|  | ||||
| #  if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) | ||||
| #  if (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3)) && defined(__ELF__) | ||||
| #    define INTERNAL  __attribute__((visibility("internal"))) | ||||
| #  else | ||||
| #    define INTERNAL | ||||
| #  endif | ||||
|  | ||||
|  | ||||
| #if defined(__CYGWIN__) || defined(__MINGW32__) || defined(__APPLE__) | ||||
| #  undef HAVE_ALIAS | ||||
| #endif | ||||
| #ifdef HAVE_ALIAS | ||||
| #  define ALIAS2(from,to) \ | ||||
|     INTERNAL PURE FASTCALL GLint __gl ## from ## _size( GLenum e ) \ | ||||
|   | ||||
| @@ -42,13 +42,13 @@ | ||||
| #    define PURE | ||||
| #  endif | ||||
|  | ||||
| #  if defined(__i386__) && defined(__GNUC__) | ||||
| #  if defined(__i386__) && defined(__GNUC__) && !defined(__CYGWIN__) && !defined(__MINGW32__) | ||||
| #    define FASTCALL __attribute__((fastcall)) | ||||
| #  else | ||||
| #    define FASTCALL | ||||
| #  endif | ||||
|  | ||||
| #  if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) | ||||
| #  if (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3)) && defined(__ELF__) | ||||
| #    define INTERNAL  __attribute__((visibility("internal"))) | ||||
| #  else | ||||
| #    define INTERNAL | ||||
|   | ||||
| @@ -29,7 +29,7 @@ static void TransposeMatrixf(const GLfloat s[16], GLfloat d[16]) | ||||
| { | ||||
|     int i, j; | ||||
|     for (i = 0; i < 4; i++) { | ||||
|         for (j = 0; j < i; j++) { | ||||
|         for (j = 0; j < 4; j++) { | ||||
|             d[i*4+j] = s[j*4+i]; | ||||
|         } | ||||
|     } | ||||
| @@ -39,7 +39,7 @@ static void TransposeMatrixd(const GLdouble s[16], GLdouble d[16]) | ||||
| { | ||||
|     int i, j; | ||||
|     for (i = 0; i < 4; i++) { | ||||
|         for (j = 0; j < i; j++) { | ||||
|         for (j = 0; j < 4; j++) { | ||||
|             d[i*4+j] = s[j*4+i]; | ||||
|         } | ||||
|     } | ||||
|   | ||||
| @@ -4,7 +4,6 @@ MESA_MODULES = $(TOP)/src/mesa/mesa.a | ||||
|  | ||||
| COMMON_SOURCES = \ | ||||
|         ../../common/driverfuncs.c \ | ||||
|         ../common/mm.c \ | ||||
|         ../common/utils.c \ | ||||
|         ../common/texmem.c \ | ||||
|         ../common/vblank.c \ | ||||
|   | ||||
| @@ -206,6 +206,7 @@ static const struct tnl_pipeline_stage *intel_pipeline[] = { | ||||
|    &_tnl_texgen_stage, | ||||
|    &_tnl_texture_transform_stage, | ||||
|    &_tnl_point_attenuation_stage, | ||||
|    &_tnl_arb_vertex_program_stage, | ||||
|    &_tnl_vertex_program_stage, | ||||
| #if 1 | ||||
|    &_intel_render_stage,     /* ADD: unclipped rastersetup-to-dma */ | ||||
|   | ||||
| @@ -79,7 +79,7 @@ static const struct dri_debug_control debug_control[] = | ||||
|     { NULL,    0 } | ||||
| }; | ||||
|  | ||||
| static const struct dri_extension card_extensions[] = | ||||
| const struct dri_extension card_extensions[] = | ||||
| { | ||||
|     { "GL_ARB_multisample",                GL_ARB_multisample_functions }, | ||||
|     { "GL_ARB_multitexture",               NULL }, | ||||
|   | ||||
| @@ -39,7 +39,7 @@ | ||||
| #include "utils.h" | ||||
| #include "framebuffer.h" | ||||
|  | ||||
| #define DRIVER_DATE	"20030502" | ||||
| #define DRIVER_DATE	"20051019" | ||||
|  | ||||
| /* Return the current color buffer size. | ||||
|  */ | ||||
|   | ||||
| @@ -67,6 +67,7 @@ static const GLuint __driNConfigOptions = 3; | ||||
| static const GLuint __driNConfigOptions = 2; | ||||
| #endif | ||||
|  | ||||
| extern const struct dri_extension card_extensions[]; | ||||
|  | ||||
| static __GLcontextModes * fill_in_modes( __GLcontextModes * modes, | ||||
| 					 unsigned pixel_bits,  | ||||
| @@ -536,6 +537,16 @@ void * __driCreateNewScreen_20050727( __DRInativeDisplay *dpy, int scrn, __DRIsc | ||||
| 					 16, | ||||
| 					 0, | ||||
| 					 1); | ||||
|  | ||||
|       /* Calling driInitExtensions here, with a NULL context pointer, does not actually | ||||
|        * enable the extensions.  It just makes sure that all the dispatch offsets for all | ||||
|        * the extensions that *might* be enables are known.  This is needed because the | ||||
|        * dispatch offsets need to be known when _mesa_context_create is called, but we can't | ||||
|        * enable the extensions until we have a context pointer. | ||||
|        * | ||||
|        * Hello chicken.  Hello egg.  How are you two today? | ||||
|        */ | ||||
|       driInitExtensions( NULL, card_extensions, GL_FALSE ); | ||||
|    } | ||||
|  | ||||
|    return (void *) psp; | ||||
|   | ||||
| @@ -370,6 +370,7 @@ static const struct tnl_pipeline_stage *mga_pipeline[] = { | ||||
|    &_tnl_fog_coordinate_stage, | ||||
|    &_tnl_texgen_stage,  | ||||
|    &_tnl_texture_transform_stage,  | ||||
|    &_tnl_arb_vertex_program_stage, | ||||
|    &_tnl_vertex_program_stage, | ||||
|  | ||||
| 				/* REMOVE: point attenuation stage */ | ||||
|   | ||||
| @@ -193,6 +193,7 @@ static const struct tnl_pipeline_stage *r200_pipeline[] = { | ||||
|    &_tnl_fog_coordinate_stage, | ||||
|    &_tnl_texgen_stage, | ||||
|    &_tnl_texture_transform_stage, | ||||
|    &_tnl_arb_vertex_program_stage, | ||||
|    &_tnl_vertex_program_stage, | ||||
|  | ||||
|    /* Try again to go to tcl?  | ||||
|   | ||||
| @@ -84,7 +84,7 @@ DRI_CONF_BEGIN | ||||
|         DRI_CONF_NO_RAST(false) | ||||
|     DRI_CONF_SECTION_END | ||||
|     DRI_CONF_SECTION_SOFTWARE | ||||
|         DRI_CONF_ARB_VERTEX_PROGRAM(true) | ||||
|         DRI_CONF_ARB_VERTEX_PROGRAM(false) | ||||
|         DRI_CONF_NV_VERTEX_PROGRAM(false) | ||||
|     DRI_CONF_SECTION_END | ||||
| DRI_CONF_END; | ||||
|   | ||||
| @@ -2092,7 +2092,7 @@ static void r200Enable( GLcontext *ctx, GLenum cap, GLboolean state ) | ||||
|       break; | ||||
|  | ||||
|    case GL_VERTEX_PROGRAM_ARB: | ||||
|       TCL_FALLBACK(rmesa->glCtx, R200_TCL_FALLBACK_TCL_DISABLE, state); | ||||
|       TCL_FALLBACK(rmesa->glCtx, R200_TCL_FALLBACK_VERTEX_PROGRAM, state); | ||||
|       break; | ||||
|  | ||||
|    default: | ||||
|   | ||||
| @@ -540,7 +540,8 @@ static char *fallbackStrings[] = { | ||||
|    "Texgen unit 4", | ||||
|    "Texgen unit 5", | ||||
|    "User disable", | ||||
|    "Bitmap as points" | ||||
|    "Bitmap as points", | ||||
|    "Vertex program" | ||||
| }; | ||||
|  | ||||
|  | ||||
|   | ||||
| @@ -1171,8 +1171,8 @@ static void free_funcs( struct dynfn *l ) | ||||
|    struct dynfn *f, *tmp; | ||||
|    foreach_s (f, tmp, l) { | ||||
|       remove_from_list( f ); | ||||
|       ALIGN_FREE( f->code ); | ||||
|       FREE( f ); | ||||
|       _mesa_exec_free( f->code ); | ||||
|       _mesa_free( f ); | ||||
|    } | ||||
| } | ||||
|  | ||||
|   | ||||
| @@ -57,10 +57,10 @@ do {							\ | ||||
|    char *start = (char *)&FUNC;				\ | ||||
|    char *end = (char *)&FUNC##_end;			\ | ||||
|    insert_at_head( &CACHE, dfn );			\ | ||||
|    dfn->key[0] = key[0];					\ | ||||
|    dfn->key[1] = key[1];					\ | ||||
|    dfn->code = ALIGN_MALLOC( end - start, 16 );		\ | ||||
|    memcpy (dfn->code, start, end - start);		\ | ||||
|    dfn->key[0] = key[0];				\ | ||||
|    dfn->key[1] = key[1];				\ | ||||
|    dfn->code = _mesa_exec_malloc(end - start);		\ | ||||
|    _mesa_memcpy(dfn->code, start, end - start);		\ | ||||
| }							\ | ||||
| while ( 0 ) | ||||
|  | ||||
|   | ||||
| @@ -135,6 +135,7 @@ static const struct tnl_pipeline_stage *r300_pipeline[] = { | ||||
| 	&_tnl_fog_coordinate_stage, | ||||
| 	&_tnl_texgen_stage, | ||||
| 	&_tnl_texture_transform_stage, | ||||
| 	&_tnl_arb_vertex_program_stage, | ||||
| 	&_tnl_vertex_program_stage, | ||||
|  | ||||
| 	/* Try again to go to tcl? | ||||
|   | ||||
| @@ -1046,8 +1046,8 @@ static void free_funcs( struct dynfn *l ) | ||||
|    struct dynfn *f, *tmp; | ||||
|    foreach_s (f, tmp, l) { | ||||
|       remove_from_list( f ); | ||||
|       ALIGN_FREE( f->code ); | ||||
|       FREE( f ); | ||||
|       _mesa_exec_free( f->code ); | ||||
|       _mesa_free( f ); | ||||
|    } | ||||
| } | ||||
|  | ||||
|   | ||||
| @@ -56,8 +56,8 @@ do {							\ | ||||
|    char *end = (char *)&FUNC##_end;			\ | ||||
|    insert_at_head( &CACHE, dfn );			\ | ||||
|    dfn->key = key;					\ | ||||
|    dfn->code = ALIGN_MALLOC( end - start, 16 );		\ | ||||
|    memcpy (dfn->code, start, end - start);		\ | ||||
|    dfn->code = _mesa_exec_malloc( end - start );	\ | ||||
|    _mesa_memcpy(dfn->code, start, end - start);		\ | ||||
| }							\ | ||||
| while ( 0 ) | ||||
|  | ||||
|   | ||||
| @@ -141,6 +141,7 @@ static const struct dri_extension card_extensions[] = | ||||
| static const struct dri_extension s4_extensions[] = | ||||
| { | ||||
|     { "GL_ARB_texture_env_add",            NULL }, | ||||
|     { "GL_ARB_texture_mirrored_repeat",    NULL }, | ||||
|     { NULL,                                NULL } | ||||
| }; | ||||
|  | ||||
|   | ||||
| @@ -42,7 +42,7 @@ | ||||
| #include "utils.h" | ||||
|  | ||||
|  | ||||
| #define DRIVER_DATE "20050501" | ||||
| #define DRIVER_DATE "20050829" | ||||
|  | ||||
| /*************************************** | ||||
|  * Mesa's Driver Functions | ||||
|   | ||||
| @@ -1086,6 +1086,78 @@ static void savageUploadTexImages( savageContextPtr imesa, savageTexObjPtr t ) | ||||
| } | ||||
|  | ||||
|  | ||||
| static void | ||||
| savage4_set_wrap_mode( savageContextPtr imesa, unsigned unit, | ||||
| 		      GLenum s_mode, GLenum t_mode ) | ||||
| { | ||||
|     switch( s_mode ) { | ||||
|     case GL_REPEAT: | ||||
| 	imesa->regs.s4.texCtrl[ unit ].ni.uMode = TAM_Wrap; | ||||
| 	break; | ||||
|     case GL_CLAMP: | ||||
|     case GL_CLAMP_TO_EDGE: | ||||
| 	imesa->regs.s4.texCtrl[ unit ].ni.uMode = TAM_Clamp; | ||||
| 	break; | ||||
|     case GL_MIRRORED_REPEAT: | ||||
| 	imesa->regs.s4.texCtrl[ unit ].ni.uMode = TAM_Mirror; | ||||
| 	break; | ||||
|     } | ||||
|  | ||||
|     switch( t_mode ) { | ||||
|     case GL_REPEAT: | ||||
| 	imesa->regs.s4.texCtrl[ unit ].ni.vMode = TAM_Wrap; | ||||
| 	break; | ||||
|     case GL_CLAMP: | ||||
|     case GL_CLAMP_TO_EDGE: | ||||
| 	imesa->regs.s4.texCtrl[ unit ].ni.vMode = TAM_Clamp; | ||||
| 	break; | ||||
|     case GL_MIRRORED_REPEAT: | ||||
| 	imesa->regs.s4.texCtrl[ unit ].ni.vMode = TAM_Mirror; | ||||
| 	break; | ||||
|     } | ||||
| } | ||||
|  | ||||
|  | ||||
| /** | ||||
|  * Sets the hardware bits for the specified GL texture filter modes. | ||||
|  *  | ||||
|  * \todo | ||||
|  * Does the Savage4 have the ability to select the magnification filter? | ||||
|  */ | ||||
| static void | ||||
| savage4_set_filter_mode( savageContextPtr imesa, unsigned unit, | ||||
| 			 GLenum minFilter, GLenum magFilter ) | ||||
| { | ||||
|     (void) magFilter; | ||||
|  | ||||
|     switch (minFilter) { | ||||
|     case GL_NEAREST: | ||||
| 	imesa->regs.s4.texCtrl[ unit ].ni.filterMode   = TFM_Point; | ||||
| 	imesa->regs.s4.texCtrl[ unit ].ni.mipmapEnable = GL_FALSE; | ||||
| 	break; | ||||
|  | ||||
|     case GL_LINEAR: | ||||
| 	imesa->regs.s4.texCtrl[ unit ].ni.filterMode   = TFM_Bilin; | ||||
| 	imesa->regs.s4.texCtrl[ unit ].ni.mipmapEnable = GL_FALSE; | ||||
| 	break; | ||||
|  | ||||
|     case GL_NEAREST_MIPMAP_NEAREST: | ||||
| 	imesa->regs.s4.texCtrl[ unit ].ni.filterMode   = TFM_Point; | ||||
| 	imesa->regs.s4.texCtrl[ unit ].ni.mipmapEnable = GL_TRUE; | ||||
| 	break; | ||||
|  | ||||
|     case GL_LINEAR_MIPMAP_NEAREST: | ||||
| 	imesa->regs.s4.texCtrl[ unit ].ni.filterMode   = TFM_Bilin; | ||||
| 	imesa->regs.s4.texCtrl[ unit ].ni.mipmapEnable = GL_TRUE; | ||||
| 	break; | ||||
|  | ||||
|     case GL_NEAREST_MIPMAP_LINEAR: | ||||
|     case GL_LINEAR_MIPMAP_LINEAR: | ||||
| 	imesa->regs.s4.texCtrl[ unit ].ni.filterMode   = TFM_Trilin; | ||||
| 	imesa->regs.s4.texCtrl[ unit ].ni.mipmapEnable = GL_TRUE; | ||||
| 	break; | ||||
|     } | ||||
| } | ||||
|  | ||||
|  | ||||
| static void savageUpdateTex0State_s4( GLcontext *ctx ) | ||||
| @@ -1301,39 +1373,8 @@ static void savageUpdateTex0State_s4( GLcontext *ctx ) | ||||
|       break;			 | ||||
|    } | ||||
|  | ||||
|     imesa->regs.s4.texCtrl[0].ni.uMode = | ||||
| 	t->setup.sWrapMode == GL_REPEAT ? 0 : 1; | ||||
|     imesa->regs.s4.texCtrl[0].ni.vMode =  | ||||
| 	t->setup.tWrapMode == GL_REPEAT ? 0 : 1; | ||||
|  | ||||
|     switch (t->setup.minFilter) | ||||
|     { | ||||
|         case GL_NEAREST: | ||||
|             imesa->regs.s4.texCtrl[0].ni.filterMode   = TFM_Point; | ||||
|             imesa->regs.s4.texCtrl[0].ni.mipmapEnable = GL_FALSE; | ||||
|             break; | ||||
|  | ||||
|         case GL_LINEAR: | ||||
|             imesa->regs.s4.texCtrl[0].ni.filterMode   = TFM_Bilin; | ||||
|             imesa->regs.s4.texCtrl[0].ni.mipmapEnable = GL_FALSE; | ||||
|             break; | ||||
|  | ||||
|         case GL_NEAREST_MIPMAP_NEAREST: | ||||
|             imesa->regs.s4.texCtrl[0].ni.filterMode   = TFM_Point; | ||||
|             imesa->regs.s4.texCtrl[0].ni.mipmapEnable = GL_TRUE; | ||||
|             break; | ||||
|  | ||||
|         case GL_LINEAR_MIPMAP_NEAREST: | ||||
|             imesa->regs.s4.texCtrl[0].ni.filterMode   = TFM_Bilin; | ||||
|             imesa->regs.s4.texCtrl[0].ni.mipmapEnable = GL_TRUE; | ||||
|             break; | ||||
|  | ||||
|         case GL_NEAREST_MIPMAP_LINEAR: | ||||
|         case GL_LINEAR_MIPMAP_LINEAR: | ||||
|             imesa->regs.s4.texCtrl[0].ni.filterMode   = TFM_Trilin; | ||||
|             imesa->regs.s4.texCtrl[0].ni.mipmapEnable = GL_TRUE; | ||||
|             break; | ||||
|     } | ||||
|     savage4_set_wrap_mode( imesa, 0, t->setup.sWrapMode, t->setup.tWrapMode ); | ||||
|     savage4_set_filter_mode( imesa, 0, t->setup.minFilter, t->setup.magFilter ); | ||||
|  | ||||
|     if((ctx->Texture.Unit[0].LodBias !=0.0F) || | ||||
|        (imesa->regs.s4.texCtrl[0].ni.dBias != 0)) | ||||
| @@ -1514,45 +1555,14 @@ static void savageUpdateTex1State_s4( GLcontext *ctx ) | ||||
|       break; | ||||
|  | ||||
|    default: | ||||
|       fprintf(stderr, "unkown tex 1 env mode\n"); | ||||
|       fprintf(stderr, "unknown tex 1 env mode\n"); | ||||
|       exit(1); | ||||
|       break;			 | ||||
|    } | ||||
|  | ||||
|     imesa->regs.s4.texCtrl[1].ni.uMode = | ||||
| 	t->setup.sWrapMode == GL_REPEAT ? 0 : 1; | ||||
|     imesa->regs.s4.texCtrl[1].ni.vMode = | ||||
| 	t->setup.tWrapMode == GL_REPEAT ? 0 : 1; | ||||
|     savage4_set_wrap_mode( imesa, 1, t->setup.sWrapMode, t->setup.tWrapMode ); | ||||
|     savage4_set_filter_mode( imesa, 1, t->setup.minFilter, t->setup.magFilter ); | ||||
|  | ||||
|     switch (t->setup.minFilter) | ||||
|     { | ||||
|         case GL_NEAREST: | ||||
|             imesa->regs.s4.texCtrl[1].ni.filterMode   = TFM_Point; | ||||
|             imesa->regs.s4.texCtrl[1].ni.mipmapEnable = GL_FALSE; | ||||
|             break; | ||||
|  | ||||
|         case GL_LINEAR: | ||||
|             imesa->regs.s4.texCtrl[1].ni.filterMode   = TFM_Bilin; | ||||
|             imesa->regs.s4.texCtrl[1].ni.mipmapEnable = GL_FALSE; | ||||
|             break; | ||||
|  | ||||
|         case GL_NEAREST_MIPMAP_NEAREST: | ||||
|             imesa->regs.s4.texCtrl[1].ni.filterMode   = TFM_Point; | ||||
|             imesa->regs.s4.texCtrl[1].ni.mipmapEnable = GL_TRUE; | ||||
|             break; | ||||
|  | ||||
|         case GL_LINEAR_MIPMAP_NEAREST: | ||||
|             imesa->regs.s4.texCtrl[1].ni.filterMode   = TFM_Bilin; | ||||
|             imesa->regs.s4.texCtrl[1].ni.mipmapEnable = GL_TRUE; | ||||
|             break; | ||||
|  | ||||
|         case GL_NEAREST_MIPMAP_LINEAR: | ||||
|         case GL_LINEAR_MIPMAP_LINEAR: | ||||
|             imesa->regs.s4.texCtrl[1].ni.filterMode   = TFM_Trilin; | ||||
|             imesa->regs.s4.texCtrl[1].ni.mipmapEnable = GL_TRUE; | ||||
|             break; | ||||
|     } | ||||
|      | ||||
|     if((ctx->Texture.Unit[1].LodBias !=0.0F) || | ||||
|        (imesa->regs.s4.texCtrl[1].ni.dBias != 0)) | ||||
|     { | ||||
| @@ -1650,7 +1660,7 @@ static void savageUpdateTexState_s3d( GLcontext *ctx ) | ||||
| 	imesa->regs.s3d.drawCtrl.ni.texBlendCtrl = SAVAGETBC_MODULATEALPHA_S3D; | ||||
| 	break; | ||||
|     default: | ||||
| 	fprintf(stderr, "unkown tex env mode\n"); | ||||
| 	fprintf(stderr, "unknown tex env mode\n"); | ||||
| 	/*exit(1);*/ | ||||
| 	break;			 | ||||
|     } | ||||
|   | ||||
| @@ -64,7 +64,7 @@ int GlobalCurrentHwcx = -1; | ||||
| int GlobalHwcxCountBase = 1; | ||||
| int GlobalCmdQueueLen = 0; | ||||
|  | ||||
| const struct dri_extension card_extensions[] = | ||||
| struct dri_extension card_extensions[] = | ||||
| { | ||||
|     { "GL_ARB_multisample",                GL_ARB_multisample_functions }, | ||||
|     { "GL_ARB_multitexture",               NULL }, | ||||
|   | ||||
| @@ -45,7 +45,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. | ||||
|  | ||||
| #include "utils.h" | ||||
|  | ||||
| #define DRIVER_DATE	"20041008" | ||||
| #define DRIVER_DATE	"20051019" | ||||
|  | ||||
| /* Return the width and height of the given buffer. | ||||
|  */ | ||||
|   | ||||
| @@ -59,6 +59,7 @@ DRI_CONF_BEGIN | ||||
| DRI_CONF_END; | ||||
| static const GLuint __driNConfigOptions = 2; | ||||
|  | ||||
| extern const struct dri_extension card_extensions[]; | ||||
|  | ||||
| static __GLcontextModes * | ||||
| sisFillInModes(int bpp) | ||||
| @@ -450,6 +451,16 @@ void * __driCreateNewScreen_20050727( __DRInativeDisplay *dpy, int scrn, | ||||
|    if (psp != NULL) { | ||||
|       SISDRIPtr dri_priv = (SISDRIPtr)psp->pDevPriv; | ||||
|       *driver_modes = sisFillInModes(dri_priv->bytesPerPixel * 8); | ||||
|  | ||||
|       /* Calling driInitExtensions here, with a NULL context pointer, does not actually | ||||
|        * enable the extensions.  It just makes sure that all the dispatch offsets for all | ||||
|        * the extensions that *might* be enables are known.  This is needed because the | ||||
|        * dispatch offsets need to be known when _mesa_context_create is called, but we can't | ||||
|        * enable the extensions until we have a context pointer. | ||||
|        * | ||||
|        * Hello chicken.  Hello egg.  How are you two today? | ||||
|        */ | ||||
|       driInitExtensions( NULL, card_extensions, GL_FALSE ); | ||||
|    } | ||||
|  | ||||
|    return (void *)psp; | ||||
|   | ||||
| @@ -170,6 +170,7 @@ static const struct tnl_pipeline_stage *tdfx_pipeline[] = { | ||||
|    &_tnl_point_attenuation_stage, | ||||
| #if 0 | ||||
| #if defined(FEATURE_NV_vertex_program) || defined(FEATURE_ARB_vertex_program) | ||||
|    &_tnl_arb_vertex_program_stage, | ||||
|    &_tnl_vertex_program_stage, | ||||
| #endif | ||||
| #endif | ||||
|   | ||||
| @@ -22,19 +22,6 @@ | ||||
|  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | ||||
|  * DEALINGS IN THE SOFTWARE. | ||||
|  */ | ||||
| #if 0 | ||||
| #include "xf86.h" | ||||
| #include "xf86_OSproc.h" | ||||
| #include "xf86_ansic.h" | ||||
| #include "xf86Priv.h" | ||||
|  | ||||
| #include "xf86PciInfo.h" | ||||
| #include "xf86Pci.h" | ||||
|  | ||||
| #define _XF86DRI_SERVER_ | ||||
| #include "GL/glxtokens.h" | ||||
|  | ||||
| #else | ||||
|  | ||||
| #include <stdio.h> | ||||
| #include <stdlib.h> | ||||
| @@ -45,7 +32,6 @@ | ||||
| #include "driver.h" | ||||
| #include "drm.h" | ||||
| #include "imports.h" | ||||
| #endif | ||||
|  | ||||
| #include "dri_util.h" | ||||
|  | ||||
| @@ -396,7 +382,6 @@ static int VIADRIScreenInit(DRIDriverContext * ctx) | ||||
|     } | ||||
|  | ||||
|     pVIADRI->regs.size = VIA_MMIO_REGSIZE; | ||||
|     pVIADRI->regs.map = 0; | ||||
|     pVIADRI->regs.handle = pVia->registerHandle; | ||||
|     xf86DrvMsg(pScreen->myNum, X_INFO, "[drm] mmio Registers = 0x%08lx\n", | ||||
| 	pVIADRI->regs.handle); | ||||
|   | ||||
							
								
								
									
										78
									
								
								src/mesa/drivers/dri/unichrome/server/via_dri.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										78
									
								
								src/mesa/drivers/dri/unichrome/server/via_dri.h
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,78 @@ | ||||
| /* | ||||
|  * Copyright 1998-2003 VIA Technologies, Inc. All Rights Reserved. | ||||
|  * Copyright 2001-2003 S3 Graphics, Inc. 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, sub license, | ||||
|  * 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 (including the | ||||
|  * next paragraph) 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 NON-INFRINGEMENT. IN NO EVENT SHALL | ||||
|  * THE AUTHORS OR COPYRIGHT HOLDERS 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. | ||||
|  */ | ||||
| /* | ||||
|  * Keep this file in perfect sync between the ddx and dri drivers. | ||||
|  * At least bump the VIA_DRIDDX_VERSION defines appropriately. | ||||
|  * | ||||
|  */ | ||||
| #ifndef _VIA_DRI_H_ | ||||
| #define _VIA_DRI_H_ 1 | ||||
|  | ||||
| #define VIA_MAX_DRAWABLES 256 | ||||
|  | ||||
| #define VIA_DRIDDX_VERSION_MAJOR  5 | ||||
| #define VIA_DRIDDX_VERSION_MINOR  0 | ||||
| #define VIA_DRIDDX_VERSION_PATCH  0 | ||||
|  | ||||
| #ifndef XFree86Server | ||||
| typedef int Bool; | ||||
| #endif | ||||
|  | ||||
| typedef struct { | ||||
|     drm_handle_t handle; | ||||
|     drmSize size; | ||||
| } viaRegion, *viaRegionPtr; | ||||
|  | ||||
| typedef struct { | ||||
|     viaRegion regs, agp; | ||||
|     int deviceID; | ||||
|     int width; | ||||
|     int height; | ||||
|     int mem; | ||||
|     int bytesPerPixel; | ||||
|     int priv1; | ||||
|     int priv2; | ||||
|     int fbOffset; | ||||
|     int fbSize; | ||||
|     Bool drixinerama; | ||||
|     int backOffset; | ||||
|     int depthOffset; | ||||
|     int textureOffset; | ||||
|     int textureSize; | ||||
|     int irqEnabled; | ||||
|     unsigned int scrnX, scrnY; | ||||
|     int sarea_priv_offset; | ||||
|     int ringBufActive; | ||||
|     unsigned int reg_pause_addr; | ||||
| } VIADRIRec, *VIADRIPtr; | ||||
|  | ||||
| typedef struct { | ||||
|     int dummy; | ||||
| } VIAConfigPrivRec, *VIAConfigPrivPtr; | ||||
|  | ||||
| typedef struct { | ||||
|     int dummy; | ||||
| } VIADRIContextRec, *VIADRIContextPtr; | ||||
|  | ||||
| #endif /* _VIA_DRI_H_ */ | ||||
| @@ -1,226 +0,0 @@ | ||||
| /* | ||||
|  * Copyright 1998-2003 VIA Technologies, Inc. All Rights Reserved. | ||||
|  * Copyright 2001-2003 S3 Graphics, Inc. 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, sub license, | ||||
|  * 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 (including the | ||||
|  * next paragraph) 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 NON-INFRINGEMENT. IN NO EVENT SHALL | ||||
|  * VIA, S3 GRAPHICS, AND/OR ITS SUPPLIERS 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. | ||||
|  */ | ||||
| #ifndef _VIA_DRM_H_ | ||||
| #define _VIA_DRM_H_ | ||||
|  | ||||
| /* WARNING: These defines must be the same as what the Xserver uses. | ||||
|  * if you change them, you must change the defines in the Xserver. | ||||
|  */ | ||||
|  | ||||
| #ifndef _VIA_DEFINES_ | ||||
| #define _VIA_DEFINES_ | ||||
|  | ||||
| #define VIA_DMA_BUF_ORDER		12 | ||||
| #define VIA_DMA_BUF_SZ 		        (1 << VIA_DMA_BUF_ORDER) | ||||
| #define VIA_DMA_BUF_NR 			256 | ||||
| #define VIA_NR_SAREA_CLIPRECTS 		8 | ||||
| #define VIA_NR_XVMC_PORTS               10 | ||||
| #define VIA_NR_XVMC_LOCKS               5 | ||||
| #define VIA_MAX_CACHELINE_SIZE          64 | ||||
| #define XVMCLOCKPTR(saPriv,lockNo)					\ | ||||
|         ((volatile int *)(((((unsigned long) (saPriv)->XvMCLockArea) +	\ | ||||
|                             (VIA_MAX_CACHELINE_SIZE - 1)) &             \ | ||||
|                            ~(VIA_MAX_CACHELINE_SIZE - 1)) +             \ | ||||
|                           VIA_MAX_CACHELINE_SIZE*(lockNo))) | ||||
|  | ||||
| /* Each region is a minimum of 64k, and there are at most 64 of them. | ||||
|  */ | ||||
| #define VIA_NR_TEX_REGIONS 64 | ||||
| #define VIA_LOG_MIN_TEX_REGION_SIZE 16 | ||||
| #endif | ||||
|  | ||||
| #define VIA_UPLOAD_TEX0IMAGE  0x1	/* handled clientside */ | ||||
| #define VIA_UPLOAD_TEX1IMAGE  0x2	/* handled clientside */ | ||||
| #define VIA_UPLOAD_CTX        0x4 | ||||
| #define VIA_UPLOAD_BUFFERS    0x8 | ||||
| #define VIA_UPLOAD_TEX0       0x10 | ||||
| #define VIA_UPLOAD_TEX1       0x20 | ||||
| #define VIA_UPLOAD_CLIPRECTS  0x40 | ||||
| #define VIA_UPLOAD_ALL        0xff | ||||
|  | ||||
| /* VIA specific ioctls */ | ||||
| #define DRM_VIA_ALLOCMEM	0x00 | ||||
| #define DRM_VIA_FREEMEM	        0x01 | ||||
| #define DRM_VIA_AGP_INIT	0x02 | ||||
| #define DRM_VIA_FB_INIT	        0x03 | ||||
| #define DRM_VIA_MAP_INIT	0x04 | ||||
| #define DRM_VIA_DEC_FUTEX       0x05 | ||||
| #define NOT_USED | ||||
| #define DRM_VIA_DMA_INIT	0x07 | ||||
| #define DRM_VIA_CMDBUFFER	0x08 | ||||
| #define DRM_VIA_FLUSH	        0x09 | ||||
| #define DRM_VIA_PCICMD	        0x0a | ||||
| #define DRM_VIA_CMDBUF_SIZE	0x0b | ||||
|  | ||||
| #define DRM_IOCTL_VIA_ALLOCMEM	  DRM_IOWR(DRM_COMMAND_BASE + DRM_VIA_ALLOCMEM, drm_via_mem_t) | ||||
| #define DRM_IOCTL_VIA_FREEMEM	  DRM_IOW( DRM_COMMAND_BASE + DRM_VIA_FREEMEM, drm_via_mem_t) | ||||
| #define DRM_IOCTL_VIA_AGP_INIT	  DRM_IOWR(DRM_COMMAND_BASE + DRM_VIA_AGP_INIT, drm_via_agp_t) | ||||
| #define DRM_IOCTL_VIA_FB_INIT	  DRM_IOWR(DRM_COMMAND_BASE + DRM_VIA_FB_INIT, drm_via_fb_t) | ||||
| #define DRM_IOCTL_VIA_MAP_INIT	  DRM_IOWR(DRM_COMMAND_BASE + DRM_VIA_MAP_INIT, drm_via_init_t) | ||||
| #define DRM_IOCTL_VIA_DEC_FUTEX   DRM_IOW( DRM_COMMAND_BASE + DRM_VIA_DEC_FUTEX, drm_via_futex_t) | ||||
| #define DRM_IOCTL_VIA_DMA_INIT	  DRM_IOWR(DRM_COMMAND_BASE + DRM_VIA_DMA_INIT, drm_via_dma_init_t) | ||||
| #define DRM_IOCTL_VIA_CMDBUFFER	  DRM_IOW( DRM_COMMAND_BASE + DRM_VIA_CMDBUFFER, drm_via_cmdbuffer_t) | ||||
| #define DRM_IOCTL_VIA_FLUSH	  DRM_IO(  DRM_COMMAND_BASE + DRM_VIA_FLUSH) | ||||
| #define DRM_IOCTL_VIA_PCICMD	  DRM_IOW( DRM_COMMAND_BASE + DRM_VIA_PCICMD, drm_via_cmdbuffer_t) | ||||
| #define DRM_IOCTL_VIA_CMDBUF_SIZE DRM_IOWR( DRM_COMMAND_BASE + DRM_VIA_CMDBUF_SIZE, \ | ||||
| 					    drm_via_cmdbuf_size_t) | ||||
|  | ||||
| /* Indices into buf.Setup where various bits of state are mirrored per | ||||
|  * context and per buffer.  These can be fired at the card as a unit, | ||||
|  * or in a piecewise fashion as required. | ||||
|  */ | ||||
|  | ||||
| #define VIA_TEX_SETUP_SIZE 8 | ||||
|  | ||||
| /* Flags for clear ioctl | ||||
|  */ | ||||
| #define VIA_FRONT   0x1 | ||||
| #define VIA_BACK    0x2 | ||||
| #define VIA_DEPTH   0x4 | ||||
| #define VIA_STENCIL 0x8 | ||||
|  | ||||
| #define VIA_MEM_VIDEO   0	/* matches drm constant */ | ||||
| #define VIA_MEM_AGP     1	/* matches drm constant */ | ||||
| #define VIA_MEM_SYSTEM  2		 | ||||
| #define VIA_MEM_MIXED   3 | ||||
| #define VIA_MEM_UNKNOWN 4 | ||||
|  | ||||
| typedef struct { | ||||
| 	u_int32_t offset; | ||||
| 	u_int32_t size; | ||||
| } drm_via_agp_t; | ||||
|  | ||||
| typedef struct { | ||||
| 	u_int32_t offset; | ||||
| 	u_int32_t size; | ||||
| } drm_via_fb_t; | ||||
|  | ||||
| typedef struct { | ||||
| 	u_int32_t context; | ||||
| 	u_int32_t type; | ||||
| 	u_int32_t size; | ||||
| 	unsigned long index; | ||||
| 	unsigned long offset; | ||||
| } drm_via_mem_t; | ||||
|  | ||||
| typedef struct _drm_via_init { | ||||
| 	enum { | ||||
| 		VIA_INIT_MAP = 0x01, | ||||
| 		VIA_CLEANUP_MAP = 0x02 | ||||
| 	} func; | ||||
|  | ||||
| 	unsigned long sarea_priv_offset; | ||||
| 	unsigned long fb_offset; | ||||
| 	unsigned long mmio_offset; | ||||
| 	unsigned long agpAddr; | ||||
| } drm_via_init_t; | ||||
|  | ||||
| typedef struct _drm_via_futex { | ||||
| 	enum { | ||||
| 		VIA_FUTEX_WAIT = 0x00, | ||||
| 		VIA_FUTEX_WAKE = 0X01 | ||||
| 	} func; | ||||
| 	u_int32_t ms; | ||||
| 	u_int32_t lock; | ||||
| 	u_int32_t val; | ||||
| } drm_via_futex_t; | ||||
|  | ||||
| typedef struct _drm_via_dma_init { | ||||
| 	enum { | ||||
| 		VIA_INIT_DMA = 0x01, | ||||
| 		VIA_CLEANUP_DMA = 0x02, | ||||
|                 VIA_DMA_INITIALIZED = 0x03 | ||||
| 	} func; | ||||
|  | ||||
| 	unsigned long offset; | ||||
| 	unsigned long size; | ||||
| 	unsigned long reg_pause_addr; | ||||
| } drm_via_dma_init_t; | ||||
|  | ||||
| typedef struct _drm_via_cmdbuffer { | ||||
| 	char *buf; | ||||
| 	unsigned long size; | ||||
| } drm_via_cmdbuffer_t; | ||||
|  | ||||
| /* Warning: If you change the SAREA structure you must change the Xserver | ||||
|  * structure as well */ | ||||
|  | ||||
| typedef struct _drm_via_tex_region { | ||||
| 	unsigned char next, prev;	/* indices to form a circular LRU  */ | ||||
| 	unsigned char inUse;	/* owned by a client, or free? */ | ||||
| 	int age;		/* tracked by clients to update local LRU's */ | ||||
| } drm_via_tex_region_t; | ||||
|  | ||||
| typedef struct _drm_via_sarea { | ||||
| 	unsigned int dirty; | ||||
| 	unsigned int nbox; | ||||
| 	drm_clip_rect_t boxes[VIA_NR_SAREA_CLIPRECTS]; | ||||
| 	drm_via_tex_region_t texList[VIA_NR_TEX_REGIONS + 1]; | ||||
| 	int ctxOwner;		/* last context to upload state */ | ||||
| 	int vertexPrim; | ||||
|  | ||||
| 	/* | ||||
| 	 * Below is for XvMC. | ||||
| 	 * We want the lock integers alone on, and aligned to, a cache line. | ||||
| 	 * Therefore this somewhat strange construct. | ||||
| 	 */ | ||||
|  | ||||
| 	char XvMCLockArea[VIA_MAX_CACHELINE_SIZE * (VIA_NR_XVMC_LOCKS + 1)]; | ||||
|  | ||||
| 	unsigned int XvMCDisplaying[VIA_NR_XVMC_PORTS]; | ||||
| 	unsigned int XvMCSubPicOn[VIA_NR_XVMC_PORTS]; | ||||
| 	unsigned int XvMCCtxNoGrabbed;	/* Last context to hold decoder */ | ||||
|  | ||||
| 	/* Used by the 3d driver only at this point, for pageflipping: | ||||
| 	 */ | ||||
| 	unsigned int pfCurrentOffset; | ||||
|  | ||||
| } drm_via_sarea_t; | ||||
|  | ||||
| typedef struct _drm_via_cmdbuf_size { | ||||
| 	enum { | ||||
| 		VIA_CMDBUF_SPACE = 0x01, | ||||
| 		VIA_CMDBUF_LAG = 0x02 | ||||
| 	} func; | ||||
| 	int wait; | ||||
| 	u_int32_t size; | ||||
| } drm_via_cmdbuf_size_t; | ||||
|  | ||||
|  | ||||
| #ifdef __KERNEL__ | ||||
|  | ||||
| int via_fb_init(DRM_IOCTL_ARGS); | ||||
| int via_mem_alloc(DRM_IOCTL_ARGS); | ||||
| int via_mem_free(DRM_IOCTL_ARGS); | ||||
| int via_agp_init(DRM_IOCTL_ARGS); | ||||
| int via_map_init(DRM_IOCTL_ARGS); | ||||
| int via_decoder_futex(DRM_IOCTL_ARGS); | ||||
| int via_dma_init(DRM_IOCTL_ARGS); | ||||
| int via_cmdbuffer(DRM_IOCTL_ARGS); | ||||
| int via_flush_ioctl(DRM_IOCTL_ARGS); | ||||
| int via_pci_cmdbuffer(DRM_IOCTL_ARGS); | ||||
| int via_cmdbuf_size(DRM_IOCTL_ARGS); | ||||
|  | ||||
| #endif | ||||
| #endif				/* _VIA_DRM_H_ */ | ||||
| @@ -587,7 +587,7 @@ viaDestroyContext(__DRIcontextPrivate *driContextPriv) | ||||
|     } | ||||
|  | ||||
|     if (vmesa) { | ||||
|         viaWaitIdle(vmesa); | ||||
|         viaWaitIdle(vmesa, GL_FALSE); | ||||
| 	if (vmesa->doPageFlip) { | ||||
| 	   LOCK_HARDWARE(vmesa); | ||||
| 	   if (vmesa->pfCurrentOffset != 0) { | ||||
|   | ||||
| @@ -35,7 +35,7 @@ | ||||
|  | ||||
| #include "via_screen.h" | ||||
| #include "via_tex.h" | ||||
| #include "via_common.h" | ||||
| #include "via_drm.h" | ||||
|  | ||||
| struct via_context; | ||||
|  | ||||
|   | ||||
| @@ -1,48 +0,0 @@ | ||||
| #ifndef _VIA_DRI_ | ||||
| #define _VIA_DRI_ | ||||
|  | ||||
| #include "xf86drm.h" | ||||
|  | ||||
| #define VIA_MAX_DRAWABLES 256 | ||||
|  | ||||
| #define VIA_VERSION_MAJOR		4 | ||||
| #define VIA_VERSION_MINOR		1 | ||||
|  | ||||
| typedef struct { | ||||
|     drm_handle_t handle; | ||||
|     drmSize size; | ||||
|     drmAddress map; | ||||
| } viaRegion, *viaRegionPtr; | ||||
|  | ||||
| typedef struct { | ||||
|     viaRegion regs, agp; | ||||
|     int deviceID; | ||||
|     int width; | ||||
|     int height; | ||||
|     int mem; | ||||
|     int bytesPerPixel; | ||||
|     int priv1; | ||||
|     int priv2; | ||||
|     int fbOffset; | ||||
|     int fbSize; | ||||
|     char drixinerama; | ||||
|     int backOffset; | ||||
|     int depthOffset; | ||||
|     int textureOffset; | ||||
|     int textureSize; | ||||
|     int irqEnabled; | ||||
|     unsigned int scrnX, scrnY; | ||||
|     int sarea_priv_offset; | ||||
|     int ringBufActive; | ||||
|     unsigned int reg_pause_addr; | ||||
| } VIADRIRec, *VIADRIPtr; | ||||
|  | ||||
| typedef struct { | ||||
|     int dummy; | ||||
| } VIAConfigPrivRec, *VIAConfigPrivPtr; | ||||
|  | ||||
| typedef struct { | ||||
|     int dummy; | ||||
| } VIADRIContextRec, *VIADRIContextPtr; | ||||
|  | ||||
| #endif | ||||
							
								
								
									
										29
									
								
								src/mesa/drivers/dri/unichrome/via_drmclient.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										29
									
								
								src/mesa/drivers/dri/unichrome/via_drmclient.h
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,29 @@ | ||||
| /* | ||||
|  * | ||||
|  * 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, sub license, | ||||
|  * 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 (including the | ||||
|  * next paragraph) 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 NON-INFRINGEMENT. IN NO EVENT SHALL | ||||
|  * THE AUTHOR(S) AND/OR THE COPYRIGHT HOLDER(S) 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. | ||||
|  */ | ||||
| #ifndef _VIA_DRMCLIENT_H_ | ||||
| #define _VIA_DRMCLIENT_H_ | ||||
|  | ||||
| #define VIA_DMA_BUF_ORDER		12 | ||||
| #define VIA_DMA_BUF_SZ 		        (1 << VIA_DMA_BUF_ORDER) | ||||
| #define VIA_DMA_BUF_NR                  256 | ||||
|  | ||||
| #endif				/* _VIA_DRMCLIENT_H_ */ | ||||
| @@ -206,7 +206,7 @@ via_release_pending_textures( struct via_context *vmesa ) | ||||
|    struct via_tex_buffer *s, *tmp; | ||||
|     | ||||
|    foreach_s( s, tmp, &vmesa->freed_tex_buffers ) { | ||||
|       if (s->lastUsed < vmesa->lastBreadcrumbRead) { | ||||
|       if (!VIA_GEQ_WRAP(s->lastUsed, vmesa->lastBreadcrumbRead)) { | ||||
| 	 if (VIA_DEBUG & DEBUG_TEXTURE) | ||||
| 	    fprintf(stderr, "%s: release tex sz %d lastUsed %x\n", | ||||
| 		    __FUNCTION__, s->size, s->lastUsed);  | ||||
|   | ||||
| @@ -90,7 +90,6 @@ static void dump_dma( struct via_context *vmesa ) | ||||
| } | ||||
|  | ||||
|  | ||||
|  | ||||
| void viaCheckDma(struct via_context *vmesa, GLuint bytes) | ||||
| { | ||||
|     VIA_FINISH_PRIM( vmesa ); | ||||
| @@ -412,9 +411,9 @@ GLboolean viaCheckBreadcrumb( struct via_context *vmesa, GLuint value ) | ||||
|    if (VIA_DEBUG & DEBUG_IOCTL)  | ||||
|       fprintf(stderr, "%s %d < %d: %d\n", __FUNCTION__, value,  | ||||
| 	      vmesa->lastBreadcrumbRead, | ||||
| 	      value < vmesa->lastBreadcrumbRead); | ||||
| 	      !VIA_GEQ_WRAP(value, vmesa->lastBreadcrumbRead)); | ||||
|  | ||||
|    return value < vmesa->lastBreadcrumbRead; | ||||
|    return !VIA_GEQ_WRAP(value, vmesa->lastBreadcrumbRead); | ||||
| } | ||||
|  | ||||
| static void viaWaitBreadcrumb( struct via_context *vmesa, GLuint value ) | ||||
| @@ -422,7 +421,7 @@ static void viaWaitBreadcrumb( struct via_context *vmesa, GLuint value ) | ||||
|    if (VIA_DEBUG & DEBUG_IOCTL)  | ||||
|       fprintf(stderr, "%s %d\n", __FUNCTION__, value); | ||||
|  | ||||
|    assert(value < vmesa->lastBreadcrumbWrite); | ||||
|    assert(!VIA_GEQ_WRAP(value, vmesa->lastBreadcrumbWrite)); | ||||
|  | ||||
|    while (!viaCheckBreadcrumb( vmesa, value )) { | ||||
|       viaSwapOutWork( vmesa ); | ||||
| @@ -431,7 +430,7 @@ static void viaWaitBreadcrumb( struct via_context *vmesa, GLuint value ) | ||||
| } | ||||
|  | ||||
|  | ||||
| void viaWaitIdle( struct via_context *vmesa ) | ||||
| void viaWaitIdle( struct via_context *vmesa, GLboolean light ) | ||||
| { | ||||
|    VIA_FLUSH_DMA(vmesa); | ||||
|  | ||||
| @@ -449,17 +448,20 @@ void viaWaitIdle( struct via_context *vmesa ) | ||||
|  | ||||
|    /* Need to wait? | ||||
|     */ | ||||
|    if (vmesa->lastDma >= vmesa->lastBreadcrumbRead)  | ||||
|    if (VIA_GEQ_WRAP(vmesa->lastDma, vmesa->lastBreadcrumbRead))  | ||||
|       viaWaitBreadcrumb( vmesa, vmesa->lastDma ); | ||||
|  | ||||
|    if (light) return; | ||||
|  | ||||
|    LOCK_HARDWARE(vmesa); | ||||
|    while(!viaCheckIdle(vmesa)) | ||||
|       ; | ||||
|  | ||||
|    UNLOCK_HARDWARE(vmesa); | ||||
|    via_release_pending_textures(vmesa); | ||||
| } | ||||
|  | ||||
|  | ||||
| void viaWaitIdleLocked( struct via_context *vmesa ) | ||||
| void viaWaitIdleLocked( struct via_context *vmesa, GLboolean light ) | ||||
| { | ||||
|    if (vmesa->dmaLow)  | ||||
|       viaFlushDmaLocked(vmesa, 0); | ||||
| @@ -479,6 +481,8 @@ void viaWaitIdleLocked( struct via_context *vmesa ) | ||||
|    if (vmesa->lastDma >= vmesa->lastBreadcrumbRead)  | ||||
|       viaWaitBreadcrumb( vmesa, vmesa->lastDma ); | ||||
|  | ||||
|    if (light) return; | ||||
|  | ||||
|    while(!viaCheckIdle(vmesa)) | ||||
|       ; | ||||
|  | ||||
| @@ -702,7 +706,7 @@ static int fire_buffer(struct via_context *vmesa) | ||||
|  | ||||
|       /* Fall through to PCI handling?!? | ||||
|        */ | ||||
|       viaWaitIdleLocked(vmesa); | ||||
|       viaWaitIdleLocked(vmesa, GL_FALSE); | ||||
|    } | ||||
| 	     | ||||
|    ret = drmCommandWrite(vmesa->driFd, DRM_VIA_PCICMD, &bufI, sizeof(bufI)); | ||||
| @@ -946,7 +950,7 @@ static void viaFinish(GLcontext *ctx) | ||||
| { | ||||
|     struct via_context *vmesa = VIA_CONTEXT(ctx); | ||||
|     VIA_FLUSH_DMA(vmesa); | ||||
|     viaWaitIdle(vmesa); | ||||
|     viaWaitIdle(vmesa, GL_FALSE); | ||||
| } | ||||
|  | ||||
| static void viaClearStencil(GLcontext *ctx,  int s) | ||||
|   | ||||
| @@ -37,8 +37,8 @@ void viaCopyBuffer(const __DRIdrawablePrivate *dpriv); | ||||
| void viaPageFlip(const __DRIdrawablePrivate *dpriv); | ||||
| void viaCheckDma(struct via_context *vmesa, GLuint bytes); | ||||
| void viaResetPageFlippingLocked(struct via_context *vmesa); | ||||
| void viaWaitIdle(struct via_context *vmesa); | ||||
| void viaWaitIdleLocked(struct via_context *vmesa); | ||||
| void viaWaitIdle(struct via_context *vmesa, GLboolean light); | ||||
| void viaWaitIdleLocked(struct via_context *vmesa, GLboolean light); | ||||
|  | ||||
| GLboolean viaCheckBreadcrumb( struct via_context *vmesa, GLuint value ); | ||||
| void viaEmitBreadcrumb( struct via_context *vmesa ); | ||||
| @@ -127,7 +127,9 @@ static GLuint __inline__ *viaExtendPrimitive(struct via_context *vmesa, int byte | ||||
|    }						\ | ||||
| } while (0) | ||||
|  | ||||
|  | ||||
| #define VIA_GEQ_WRAP(left, right) \ | ||||
|   (((left) - (right)) < ( 1 << 23)) | ||||
|      | ||||
|  | ||||
|  | ||||
| #endif | ||||
|   | ||||
| @@ -162,8 +162,8 @@ viaInitDriver(__DRIscreenPrivate *sPriv) | ||||
|                    gDRIPriv->agp.handle, | ||||
|                    gDRIPriv->agp.size, | ||||
| 	           (drmAddress *)&viaScreen->agpLinearStart) != 0) { | ||||
| 	    drmUnmap(viaScreen->reg, gDRIPriv->regs.size); | ||||
| 	    FREE(viaScreen); | ||||
| 	    drmUnmap(viaScreen->reg, gDRIPriv->agp.size); | ||||
| 	    sPriv->private = NULL; | ||||
| 	    __driUtilMessage("viaInitDriver: drmMap agp failed"); | ||||
| 	    return GL_FALSE; | ||||
| @@ -418,7 +418,9 @@ void * __driCreateNewScreen_20050727( __DRInativeDisplay *dpy, int scrn, | ||||
| 			      | ||||
| { | ||||
|    __DRIscreenPrivate *psp; | ||||
|    static const __DRIversion ddx_expected = { 4, 0, 0 }; | ||||
|    static const __DRIversion ddx_expected = { VIA_DRIDDX_VERSION_MAJOR, | ||||
|                                               VIA_DRIDDX_VERSION_MINOR, | ||||
|                                               VIA_DRIDDX_VERSION_PATCH }; | ||||
|    static const __DRIversion dri_expected = { 4, 0, 0 }; | ||||
|    static const __DRIversion drm_expected = { 2, 3, 0 }; | ||||
|  | ||||
|   | ||||
| @@ -165,7 +165,7 @@ static void viaSetBuffer(GLcontext *ctx, GLframebuffer *colorBuffer, | ||||
| void viaSpanRenderStart( GLcontext *ctx ) | ||||
| { | ||||
|    struct via_context *vmesa = VIA_CONTEXT(ctx);      | ||||
|    viaWaitIdle(vmesa); | ||||
|    viaWaitIdle(vmesa, GL_FALSE); | ||||
|    LOCK_HARDWARE(vmesa); | ||||
| } | ||||
|  | ||||
|   | ||||
| @@ -837,8 +837,8 @@ static void viaTexSubImage2D(GLcontext *ctx, | ||||
|                              struct gl_texture_image *texImage) | ||||
| { | ||||
|    struct via_context *vmesa = VIA_CONTEXT(ctx); | ||||
|    | ||||
|    VIA_FLUSH_DMA(vmesa); | ||||
|  | ||||
|    viaWaitIdle(vmesa, GL_TRUE); | ||||
|    vmesa->clearTexCache = 1; | ||||
|  | ||||
|    _mesa_store_texsubimage2d(ctx, target, level, xoffset, yoffset, width, | ||||
| @@ -874,7 +874,7 @@ static void viaTexSubImage1D(GLcontext *ctx, | ||||
| { | ||||
|    struct via_context *vmesa = VIA_CONTEXT(ctx); | ||||
|  | ||||
|    VIA_FLUSH_DMA(vmesa); | ||||
|    viaWaitIdle(vmesa, GL_TRUE); | ||||
|    vmesa->clearTexCache = 1; | ||||
|  | ||||
|    _mesa_store_texsubimage1d(ctx, target, level, xoffset, width, | ||||
|   | ||||
| @@ -111,7 +111,7 @@ viaTexCombineState( struct via_context *vmesa, | ||||
|    unsigned constant_alpha[3]; | ||||
|    unsigned bias_alpha = 0; | ||||
|    unsigned abc_alpha = 0; | ||||
|    const struct gl_texture_unit const * texUnit =  | ||||
|    const struct gl_texture_unit * texUnit =  | ||||
|       &vmesa->glCtx->Texture.Unit[unit]; | ||||
|    unsigned env_color[4]; | ||||
|  | ||||
|   | ||||
| @@ -1658,6 +1658,7 @@ static const struct tnl_pipeline_stage *fx_pipeline[] = { | ||||
|    &_tnl_texture_transform_stage, | ||||
|    &_tnl_point_attenuation_stage, | ||||
| #if defined(FEATURE_NV_vertex_program) || defined(FEATURE_ARB_vertex_program) | ||||
|    &_tnl_arb_vertex_program_stage, | ||||
|    &_tnl_vertex_program_stage, | ||||
| #endif | ||||
|    &_tnl_render_stage, | ||||
|   | ||||
| @@ -2099,7 +2099,10 @@ Fake_glXCreatePbuffer( Display *dpy, GLXFBConfig config, | ||||
|    /* A GLXPbuffer handle must be an X Drawable because that's what | ||||
|     * glXMakeCurrent takes. | ||||
|     */ | ||||
|    return (GLXPbuffer) xmbuf->frontxrb->pixmap; | ||||
|    if (xmbuf) | ||||
|       return (GLXPbuffer) xmbuf->frontxrb->pixmap; | ||||
|    else | ||||
|       return 0; | ||||
| } | ||||
|  | ||||
|  | ||||
|   | ||||
| @@ -340,6 +340,8 @@ alloc_xmesa_buffer(XMesaVisual vis, BufferType type, XMesaColormap cmap) | ||||
| { | ||||
|    XMesaBuffer b = (XMesaBuffer) CALLOC_STRUCT(xmesa_buffer); | ||||
|    if (b) { | ||||
|       GLboolean swAlpha; | ||||
|  | ||||
|       b->display = vis->display; | ||||
|       b->xm_visual = vis; | ||||
|       b->type = type; | ||||
| @@ -376,12 +378,25 @@ alloc_xmesa_buffer(XMesaVisual vis, BufferType type, XMesaColormap cmap) | ||||
|                                 &b->backxrb->Base); | ||||
|       } | ||||
|  | ||||
|       /* determine if we need software alpha planes */ | ||||
|       if (vis->mesa_visual.alphaBits > 0 | ||||
|           && vis->undithered_pf != PF_8A8B8G8R | ||||
|           && vis->undithered_pf != PF_8A8R8G8B) { | ||||
|          /* Visual has alpha, but pixel format doesn't support it. | ||||
|           * We'll use an alpha renderbuffer wrapper. | ||||
|           */ | ||||
|          swAlpha = GL_TRUE; | ||||
|       } | ||||
|       else { | ||||
|          swAlpha = GL_FALSE; | ||||
|       } | ||||
|  | ||||
|       _mesa_add_soft_renderbuffers(&b->mesa_buffer, | ||||
|                                    GL_FALSE,  /* color */ | ||||
|                                    vis->mesa_visual.haveDepthBuffer, | ||||
|                                    vis->mesa_visual.haveStencilBuffer, | ||||
|                                    vis->mesa_visual.haveAccumBuffer, | ||||
|                                    vis->mesa_visual.alphaBits > 0, | ||||
|                                    swAlpha, | ||||
|                                    vis->mesa_visual.numAuxBuffers > 0 ); | ||||
|  | ||||
|       /* insert into linked list */ | ||||
| @@ -568,8 +583,8 @@ alloc_shm_back_buffer(XMesaBuffer b, GLuint width, GLuint height) | ||||
|    shmctl( b->shminfo.shmid, IPC_RMID, 0 ); /* nobody else needs it */ | ||||
|  | ||||
|    /* Finally, try an XShmPutImage to be really sure the extension works */ | ||||
|    gc = XCreateGC( b->xm_visual->display, b->frontxrb->pixmap, 0, NULL ); | ||||
|    XShmPutImage( b->xm_visual->display, b->frontxrb->pixmap, gc, | ||||
|    gc = XCreateGC( b->xm_visual->display, b->frontxrb->drawable, 0, NULL ); | ||||
|    XShmPutImage( b->xm_visual->display, b->frontxrb->drawable, gc, | ||||
| 		 b->backxrb->ximage, 0, 0, 0, 0, 1, 1 /*one pixel*/, False ); | ||||
|    XSync( b->xm_visual->display, False ); | ||||
|    XFreeGC( b->xm_visual->display, gc ); | ||||
| @@ -595,6 +610,7 @@ alloc_shm_back_buffer(XMesaBuffer b, GLuint width, GLuint height) | ||||
|  | ||||
|  | ||||
|  | ||||
|  | ||||
| /* | ||||
|  * Setup an off-screen pixmap or Ximage to use as the back buffer. | ||||
|  * Input:  b - the X/Mesa buffer | ||||
| @@ -647,9 +663,13 @@ xmesa_alloc_back_buffer( XMesaBuffer b, GLuint width, GLuint height ) | ||||
|             XMesaDestroyImage( b->backxrb->ximage ); | ||||
|             b->backxrb->ximage = NULL; | ||||
|          } | ||||
|          /* this call just updates the width/origin fields in the xrb */ | ||||
|          b->backxrb->Base.AllocStorage(NULL, &b->backxrb->Base,  | ||||
|                                        b->backxrb->Base.InternalFormat, | ||||
|                                        b->backxrb->ximage->width, | ||||
|                                        b->backxrb->ximage->height); | ||||
|       } | ||||
|       b->backxrb->pixmap = None; | ||||
|       b->backxrb->ximage = b->backxrb->ximage; | ||||
|    } | ||||
|    else if (b->db_state==BACK_PIXMAP) { | ||||
|       if (!width) | ||||
| @@ -662,9 +682,10 @@ xmesa_alloc_back_buffer( XMesaBuffer b, GLuint width, GLuint height ) | ||||
| 	 XMesaFreePixmap( b->xm_visual->display, b->backxrb->pixmap ); | ||||
|       } | ||||
|       /* Allocate new back pixmap */ | ||||
|       b->backxrb->pixmap = XMesaCreatePixmap( b->xm_visual->display, b->frontxrb->pixmap, | ||||
| 					 width, height, | ||||
| 					 GET_VISUAL_DEPTH(b->xm_visual) ); | ||||
|       b->backxrb->pixmap = XMesaCreatePixmap( b->xm_visual->display, | ||||
|                                               b->frontxrb->drawable, | ||||
|                                               width, height, | ||||
|                                               GET_VISUAL_DEPTH(b->xm_visual) ); | ||||
|       b->backxrb->ximage = NULL; | ||||
|    } | ||||
| } | ||||
| @@ -1281,7 +1302,8 @@ static GLboolean initialize_visual_and_buffer( int client, | ||||
|    if (b && window) { | ||||
|       /* Do window-specific initializations */ | ||||
|  | ||||
|       b->frontxrb->pixmap = window; | ||||
|       b->frontxrb->drawable = window; | ||||
|       b->frontxrb->pixmap = (XMesaPixmap) window; | ||||
|  | ||||
|       /* Setup for single/double buffering */ | ||||
|       if (v->mesa_visual.doubleBufferMode) { | ||||
| @@ -1983,8 +2005,8 @@ void XMesaDestroyBuffer( XMesaBuffer b ) | ||||
|    int client = 0; | ||||
|  | ||||
| #ifdef XFree86Server | ||||
|    if (b->frontxrb->pixmap) | ||||
|        client = CLIENT_ID(b->frontxrb->pixmap->id); | ||||
|    if (b->frontxrb->drawable) | ||||
|        client = CLIENT_ID(b->frontxrb->drawable->id); | ||||
| #endif | ||||
|  | ||||
|    if (b->gc)  XMesaFreeGC( b->xm_visual->display, b->gc ); | ||||
| @@ -1993,25 +2015,26 @@ void XMesaDestroyBuffer( XMesaBuffer b ) | ||||
|  | ||||
|    if (b->xm_visual->mesa_visual.doubleBufferMode) | ||||
|    { | ||||
|        if (b->backxrb->ximage) { | ||||
|       if (b->backxrb->ximage) { | ||||
| #if defined(USE_XSHM) && !defined(XFree86Server) | ||||
| 	   if (b->shm) { | ||||
| 	       XShmDetach( b->xm_visual->display, &b->shminfo ); | ||||
| 	       XDestroyImage( b->backxrb->ximage ); | ||||
| 	       shmdt( b->shminfo.shmaddr ); | ||||
| 	   } | ||||
| 	   else | ||||
|          if (b->shm) { | ||||
|             XShmDetach( b->xm_visual->display, &b->shminfo ); | ||||
|             XDestroyImage( b->backxrb->ximage ); | ||||
|             shmdt( b->shminfo.shmaddr ); | ||||
|          } | ||||
|          else | ||||
| #endif | ||||
| 	       XMesaDestroyImage( b->backxrb->ximage ); | ||||
|        } | ||||
|        if (b->backxrb->pixmap) { | ||||
| 	   XMesaFreePixmap( b->xm_visual->display, b->backxrb->pixmap ); | ||||
| 	   if (b->xm_visual->hpcr_clear_flag) { | ||||
| 	       XMesaFreePixmap( b->xm_visual->display, | ||||
| 				b->xm_visual->hpcr_clear_pixmap ); | ||||
| 	       XMesaDestroyImage( b->xm_visual->hpcr_clear_ximage ); | ||||
| 	   } | ||||
|             XMesaDestroyImage( b->backxrb->ximage ); | ||||
|        } | ||||
|       if (b->backxrb->pixmap) { | ||||
|          XMesaFreePixmap( b->xm_visual->display, | ||||
|                           (XMesaPixmap) b->backxrb->pixmap ); | ||||
|          if (b->xm_visual->hpcr_clear_flag) { | ||||
|             XMesaFreePixmap( b->xm_visual->display, | ||||
|                              b->xm_visual->hpcr_clear_pixmap ); | ||||
|             XMesaDestroyImage( b->xm_visual->hpcr_clear_ximage ); | ||||
|          } | ||||
|       } | ||||
|    } | ||||
|    if (b->rowimage) { | ||||
|       _mesa_free( b->rowimage->data ); | ||||
| @@ -2335,7 +2358,7 @@ void XMesaSwapBuffers( XMesaBuffer b ) | ||||
| #if defined(USE_XSHM) && !defined(XFree86Server) | ||||
| 	 if (b->shm) { | ||||
|             /*_glthread_LOCK_MUTEX(_xmesa_lock);*/ | ||||
| 	    XShmPutImage( b->xm_visual->display, b->frontxrb->pixmap, | ||||
| 	    XShmPutImage( b->xm_visual->display, b->frontxrb->drawable, | ||||
| 			  b->swapgc, | ||||
| 			  b->backxrb->ximage, 0, 0, | ||||
| 			  0, 0, b->mesa_buffer.Width, b->mesa_buffer.Height, | ||||
| @@ -2346,7 +2369,7 @@ void XMesaSwapBuffers( XMesaBuffer b ) | ||||
| #endif | ||||
|          { | ||||
|             /*_glthread_LOCK_MUTEX(_xmesa_lock);*/ | ||||
|             XMesaPutImage( b->xm_visual->display, b->frontxrb->pixmap, | ||||
|             XMesaPutImage( b->xm_visual->display, b->frontxrb->drawable, | ||||
| 			   b->swapgc, | ||||
| 			   b->backxrb->ximage, 0, 0, | ||||
| 			   0, 0, b->mesa_buffer.Width, b->mesa_buffer.Height ); | ||||
| @@ -2358,7 +2381,7 @@ void XMesaSwapBuffers( XMesaBuffer b ) | ||||
|          /*_glthread_LOCK_MUTEX(_xmesa_lock);*/ | ||||
| 	 XMesaCopyArea( b->xm_visual->display, | ||||
| 			b->backxrb->pixmap,   /* source drawable */ | ||||
| 			b->frontxrb->pixmap,  /* dest. drawable */ | ||||
| 			b->frontxrb->drawable,  /* dest. drawable */ | ||||
| 			b->swapgc, | ||||
| 			0, 0, b->mesa_buffer.Width, b->mesa_buffer.Height, | ||||
| 			0, 0                 /* dest region */ | ||||
| @@ -2402,7 +2425,7 @@ void XMesaCopySubBuffer( XMesaBuffer b, int x, int y, int width, int height ) | ||||
| #if defined(USE_XSHM) && !defined(XFree86Server) | ||||
|          if (b->shm) { | ||||
|             /* XXX assuming width and height aren't too large! */ | ||||
|             XShmPutImage( b->xm_visual->display, b->frontxrb->pixmap, | ||||
|             XShmPutImage( b->xm_visual->display, b->frontxrb->drawable, | ||||
|                           b->swapgc, | ||||
|                           b->backxrb->ximage, x, yTop, | ||||
|                           x, yTop, width, height, False ); | ||||
| @@ -2412,7 +2435,7 @@ void XMesaCopySubBuffer( XMesaBuffer b, int x, int y, int width, int height ) | ||||
| #endif | ||||
|          { | ||||
|             /* XXX assuming width and height aren't too large! */ | ||||
|             XMesaPutImage( b->xm_visual->display, b->frontxrb->pixmap, | ||||
|             XMesaPutImage( b->xm_visual->display, b->frontxrb->drawable, | ||||
| 			   b->swapgc, | ||||
| 			   b->backxrb->ximage, x, yTop, | ||||
| 			   x, yTop, width, height ); | ||||
| @@ -2422,7 +2445,7 @@ void XMesaCopySubBuffer( XMesaBuffer b, int x, int y, int width, int height ) | ||||
|          /* Copy pixmap to window on server */ | ||||
|          XMesaCopyArea( b->xm_visual->display, | ||||
| 			b->backxrb->pixmap,           /* source drawable */ | ||||
| 			b->frontxrb->pixmap,          /* dest. drawable */ | ||||
| 			b->frontxrb->drawable,        /* dest. drawable */ | ||||
| 			b->swapgc, | ||||
| 			x, yTop, width, height,  /* source region */ | ||||
| 			x, yTop                  /* dest region */ | ||||
| @@ -2441,6 +2464,7 @@ void XMesaCopySubBuffer( XMesaBuffer b, int x, int y, int width, int height ) | ||||
|  * Return:  GL_TRUE = context is double buffered | ||||
|  *          GL_FALSE = context is single buffered | ||||
|  */ | ||||
| #ifndef XFree86Server | ||||
| GLboolean XMesaGetBackBuffer( XMesaBuffer b, | ||||
|                               XMesaPixmap *pixmap, | ||||
|                               XMesaImage **ximage ) | ||||
| @@ -2456,6 +2480,7 @@ GLboolean XMesaGetBackBuffer( XMesaBuffer b, | ||||
|       return GL_FALSE; | ||||
|    } | ||||
| } | ||||
| #endif /* XFree86Server */ | ||||
|  | ||||
|  | ||||
| /* | ||||
| @@ -2522,7 +2547,7 @@ XMesaBuffer XMesaFindBuffer( XMesaDisplay *dpy, XMesaDrawable d ) | ||||
| { | ||||
|    XMesaBuffer b; | ||||
|    for (b=XMesaBufferList; b; b=b->Next) { | ||||
|       if (b->frontxrb->pixmap==d && b->display==dpy) { | ||||
|       if (b->frontxrb->drawable == d && b->display == dpy) { | ||||
|          return b; | ||||
|       } | ||||
|    } | ||||
| @@ -2540,12 +2565,12 @@ void XMesaGarbageCollect( void ) | ||||
|    XMesaBuffer b, next; | ||||
|    for (b=XMesaBufferList; b; b=next) { | ||||
|       next = b->Next; | ||||
|       if (b->display && b->frontxrb->pixmap && b->type == WINDOW) { | ||||
|       if (b->display && b->frontxrb->drawable && b->type == WINDOW) { | ||||
| #ifdef XFree86Server | ||||
| 	 /* NOT_NEEDED */ | ||||
| #else | ||||
|          XSync(b->display, False); | ||||
|          if (!window_exists( b->display, b->frontxrb->pixmap )) { | ||||
|          if (!window_exists( b->display, b->frontxrb->drawable )) { | ||||
|             /* found a dead window, free the ancillary info */ | ||||
|             XMesaDestroyBuffer( b ); | ||||
|          } | ||||
| @@ -2630,8 +2655,13 @@ unsigned long XMesaDitherColor( XMesaContext xmesa, GLint x, GLint y, | ||||
| void XMesaResizeBuffers( XMesaBuffer b ) | ||||
| { | ||||
| #ifdef XFree86Server | ||||
|    GLuint winwidth, winheight; | ||||
|    GET_CURRENT_CONTEXT(ctx); | ||||
|    xmesa_resize_buffers(ctx, &(b->mesa_buffer), 0, 0); | ||||
|  | ||||
|    winwidth = MIN2(b->frontxrb->drawable->width, MAX_WIDTH); | ||||
|    winheight = MIN2(b->frontxrb->drawable->height, MAX_HEIGHT); | ||||
|  | ||||
|    xmesa_resize_buffers(ctx, &(b->mesa_buffer), winwidth, winheight); | ||||
| #else | ||||
|    Window root; | ||||
|    int xpos, ypos; | ||||
|   | ||||
| @@ -105,8 +105,8 @@ get_buffer_size( GLframebuffer *buffer, GLuint *width, GLuint *height ) | ||||
|    unsigned int winwidth, winheight; | ||||
| #ifdef XFree86Server | ||||
|    /* XFree86 GLX renderer */ | ||||
|    winwidth = MIN2(xmBuffer->frontxrb->pixmap->width, MAX_WIDTH); | ||||
|    winheight = MIN2(xmBuffer->frontxrb->pixmap->height, MAX_HEIGHT); | ||||
|    winwidth = MIN2(xmBuffer->frontxrb->drawable->width, MAX_WIDTH); | ||||
|    winheight = MIN2(xmBuffer->frontxrb->drawable->height, MAX_HEIGHT); | ||||
| #else | ||||
|    Window root; | ||||
|    int winx, winy; | ||||
| @@ -564,6 +564,8 @@ xmesa_resize_buffers(GLcontext *ctx, GLframebuffer *buffer, | ||||
|    xmesa_alloc_back_buffer(xmBuffer, width, height); | ||||
|  | ||||
|    _mesa_resize_framebuffer(ctx, buffer, width, height); | ||||
|  | ||||
|    ctx->NewState |= _NEW_BUFFERS;  /* to update scissor / window bounds */ | ||||
| } | ||||
|  | ||||
|  | ||||
| @@ -1111,18 +1113,10 @@ xmesa_viewport(GLcontext *ctx, GLint x, GLint y, GLsizei w, GLsizei h) | ||||
|    struct gl_framebuffer *fb = ctx->WinSysDrawBuffer; | ||||
|    GLuint newWidth, newHeight; | ||||
|  | ||||
|    /* | ||||
|    printf("%s before %d x %d\n", __FUNCTION__, fb->Width, fb->Height); | ||||
|    */ | ||||
|  | ||||
|    get_buffer_size(fb, &newWidth, &newHeight); | ||||
|    if (newWidth != fb->Width || newHeight != fb->Height) { | ||||
|       xmesa_resize_buffers(ctx, fb, newWidth, newHeight); | ||||
|       ctx->NewState |= _NEW_BUFFERS;  /* to update scissor / window bounds */ | ||||
|    } | ||||
|    /* | ||||
|    printf("%s after %d x %d\n", __FUNCTION__, fb->Width, fb->Height); | ||||
|    */ | ||||
| #else | ||||
|    /* This also works: */ | ||||
|    _mesa_ResizeBuffersMESA(); | ||||
|   | ||||
| @@ -1,8 +1,8 @@ | ||||
| /* | ||||
|  * Mesa 3-D graphics library | ||||
|  * Version:  6.3 | ||||
|  * Version:  6.4 | ||||
|  * | ||||
|  * Copyright (C) 1999-2004  Brian Paul   All Rights Reserved. | ||||
|  * Copyright (C) 1999-2005  Brian Paul   All Rights Reserved. | ||||
|  * | ||||
|  * Permission is hereby granted, free of charge, to any person obtaining a | ||||
|  * copy of this software and associated documentation files (the "Software"), | ||||
| @@ -118,7 +118,7 @@ void xmesa_choose_point( GLcontext *ctx ) | ||||
|  | ||||
|  | ||||
| #define GET_XRB(XRB)  struct xmesa_renderbuffer *XRB = \ | ||||
|    (struct xmesa_renderbuffer *) ctx->DrawBuffer->_ColorDrawBuffers[0][0] | ||||
|    (struct xmesa_renderbuffer *) ctx->DrawBuffer->_ColorDrawBuffers[0][0]->Wrapped | ||||
|  | ||||
|  | ||||
| /* | ||||
| @@ -533,13 +533,46 @@ void xmesa_choose_point( GLcontext *ctx ) | ||||
|  | ||||
|  | ||||
|  | ||||
| #ifndef XFree86Server | ||||
| /** | ||||
|  * Draw fast, XOR line with XDrawLine in front color buffer. | ||||
|  * WARNING: this isn't fully OpenGL conformant because different pixels | ||||
|  * will be hit versus using the other line functions. | ||||
|  * Don't use the code in X server GLcore module since we need a wrapper | ||||
|  * for the XSetLineAttributes() function call. | ||||
|  */ | ||||
| static void | ||||
| xor_line(GLcontext *ctx, const SWvertex *vert0, const SWvertex *vert1) | ||||
| { | ||||
|    XMesaContext xmesa = XMESA_CONTEXT(ctx); | ||||
|    XMesaDisplay *dpy = xmesa->xm_visual->display; | ||||
|    XMesaGC gc = xmesa->xm_buffer->gc; | ||||
|    struct xmesa_renderbuffer *xrb = (struct xmesa_renderbuffer *) | ||||
|       ctx->DrawBuffer->_ColorDrawBuffers[0][0]; | ||||
|    unsigned long pixel = xmesa_color_to_pixel(ctx, | ||||
|                                               vert1->color[0], vert1->color[1], | ||||
|                                               vert1->color[2], vert1->color[3], | ||||
|                                               xmesa->pixelformat); | ||||
|    int x0 = (int) vert0->win[0]; | ||||
|    int y0 = YFLIP(xrb, (GLint) vert0->win[1]); | ||||
|    int x1 = (int) vert1->win[0]; | ||||
|    int y1 = YFLIP(xrb, (GLint) vert1->win[1]); | ||||
|    XMesaSetForeground(dpy, gc, pixel); | ||||
|    XMesaSetFunction(dpy, gc, GXxor); | ||||
|    XSetLineAttributes(dpy, gc, (int) ctx->Line.Width, | ||||
|                       LineSolid, CapButt, JoinMiter); | ||||
|    XDrawLine(dpy, xrb->pixmap, gc, x0, y0, x1, y1); | ||||
|    XMesaSetFunction(dpy, gc, GXcopy);  /* this gc is used elsewhere */ | ||||
| } | ||||
| #endif /* XFree86Server */ | ||||
|  | ||||
|  | ||||
| static swrast_line_func get_line_func( GLcontext *ctx ) | ||||
| { | ||||
|    XMesaContext xmesa = XMESA_CONTEXT(ctx); | ||||
|    SWcontext *swrast = SWRAST_CONTEXT(ctx); | ||||
|    int depth = GET_VISUAL_DEPTH(xmesa->xm_visual); | ||||
|    struct xmesa_renderbuffer *xrb = (struct xmesa_renderbuffer *) | ||||
|       ctx->DrawBuffer->_ColorDrawBuffers[0][0]; | ||||
|    GET_XRB(xrb); | ||||
|  | ||||
|    if ((ctx->DrawBuffer->_ColorDrawBufferMask[0] | ||||
|         & (BUFFER_BIT_FRONT_LEFT | BUFFER_BIT_BACK_LEFT)) == 0) | ||||
| @@ -611,14 +644,28 @@ static swrast_line_func get_line_func( GLcontext *ctx ) | ||||
|       } | ||||
|    } | ||||
|  | ||||
| #ifndef XFree86Server | ||||
|    if (ctx->DrawBuffer->_NumColorDrawBuffers[0] == 1 | ||||
|        && ctx->DrawBuffer->_ColorDrawBufferMask[0] == BUFFER_BIT_FRONT_LEFT | ||||
|        && swrast->_RasterMask == LOGIC_OP_BIT | ||||
|        && ctx->Color.LogicOp == GL_XOR | ||||
|        && !ctx->Line.StippleFlag | ||||
|        && !ctx->Line.SmoothFlag) { | ||||
|       return xor_line; | ||||
|    } | ||||
| #endif /* XFree86Server */ | ||||
|  | ||||
|    return (swrast_line_func) NULL; | ||||
| } | ||||
|  | ||||
| /* Override for the swrast line-selection function.  Try to use one | ||||
|  | ||||
| /** | ||||
|  * Override for the swrast line-selection function.  Try to use one | ||||
|  * of our internal line functions, otherwise fall back to the | ||||
|  * standard swrast functions. | ||||
|  */ | ||||
| void xmesa_choose_line( GLcontext *ctx ) | ||||
| void | ||||
| xmesa_choose_line(GLcontext *ctx) | ||||
| { | ||||
|    SWcontext *swrast = SWRAST_CONTEXT(ctx); | ||||
|  | ||||
|   | ||||
| @@ -188,7 +188,7 @@ static void put_row_TRUECOLOR_pixmap( PUT_ROW_ARGS ) | ||||
|    const XMesaContext xmesa = XMESA_CONTEXT(ctx); | ||||
|    struct xmesa_renderbuffer *xrb = (struct xmesa_renderbuffer *) rb; | ||||
|    XMesaDisplay *dpy = XMESA_BUFFER(ctx->DrawBuffer)->display; | ||||
|    XMesaDrawable buffer = xrb->pixmap; | ||||
|    XMesaDrawable buffer = xrb->drawable; | ||||
|    XMesaGC gc = XMESA_BUFFER(ctx->DrawBuffer)->gc; | ||||
|    register GLuint i; | ||||
|  | ||||
| @@ -225,7 +225,7 @@ static void put_row_rgb_TRUECOLOR_pixmap( RGB_SPAN_ARGS ) | ||||
|    const XMesaContext xmesa = XMESA_CONTEXT(ctx); | ||||
|    struct xmesa_renderbuffer *xrb = (struct xmesa_renderbuffer *) rb; | ||||
|    XMesaDisplay *dpy = xmesa->xm_visual->display; | ||||
|    XMesaDrawable buffer = xrb->pixmap; | ||||
|    XMesaDrawable buffer = xrb->drawable; | ||||
|    XMesaGC gc = XMESA_BUFFER(ctx->DrawBuffer)->gc; | ||||
|    register GLuint i; | ||||
|    y = YFLIP(xrb, y); | ||||
| @@ -260,7 +260,7 @@ static void put_row_TRUEDITHER_pixmap( PUT_ROW_ARGS ) | ||||
|    const XMesaContext xmesa = XMESA_CONTEXT(ctx); | ||||
|    struct xmesa_renderbuffer *xrb = (struct xmesa_renderbuffer *) rb; | ||||
|    XMesaDisplay *dpy = xmesa->xm_visual->display; | ||||
|    XMesaDrawable buffer = xrb->pixmap; | ||||
|    XMesaDrawable buffer = xrb->drawable; | ||||
|    XMesaGC gc = XMESA_BUFFER(ctx->DrawBuffer)->gc; | ||||
|    register GLuint i; | ||||
|    y = YFLIP(xrb, y); | ||||
| @@ -295,7 +295,7 @@ static void put_row_rgb_TRUEDITHER_pixmap( RGB_SPAN_ARGS ) | ||||
|    const XMesaContext xmesa = XMESA_CONTEXT(ctx); | ||||
|    struct xmesa_renderbuffer *xrb = (struct xmesa_renderbuffer *) rb; | ||||
|    XMesaDisplay *dpy = xmesa->xm_visual->display; | ||||
|    XMesaDrawable buffer = xrb->pixmap; | ||||
|    XMesaDrawable buffer = xrb->drawable; | ||||
|    XMesaGC gc = XMESA_BUFFER(ctx->DrawBuffer)->gc; | ||||
|    register GLuint i; | ||||
|    y = YFLIP(xrb, y); | ||||
| @@ -330,7 +330,7 @@ static void put_row_8A8B8G8R_pixmap( PUT_ROW_ARGS ) | ||||
|    const XMesaContext xmesa = XMESA_CONTEXT(ctx); | ||||
|    struct xmesa_renderbuffer *xrb = (struct xmesa_renderbuffer *) rb; | ||||
|    XMesaDisplay *dpy = xmesa->xm_visual->display; | ||||
|    XMesaDrawable buffer = xrb->pixmap; | ||||
|    XMesaDrawable buffer = xrb->drawable; | ||||
|    XMesaGC gc = XMESA_BUFFER(ctx->DrawBuffer)->gc; | ||||
|    register GLuint i; | ||||
|    y = YFLIP(xrb, y); | ||||
| @@ -364,7 +364,7 @@ static void put_row_rgb_8A8B8G8R_pixmap( RGB_SPAN_ARGS ) | ||||
|    const XMesaContext xmesa = XMESA_CONTEXT(ctx); | ||||
|    struct xmesa_renderbuffer *xrb = (struct xmesa_renderbuffer *) rb; | ||||
|    XMesaDisplay *dpy = xmesa->xm_visual->display; | ||||
|    XMesaDrawable buffer = xrb->pixmap; | ||||
|    XMesaDrawable buffer = xrb->drawable; | ||||
|    XMesaGC gc = XMESA_BUFFER(ctx->DrawBuffer)->gc; | ||||
|    register GLuint i; | ||||
|    y = YFLIP(xrb, y); | ||||
| @@ -397,7 +397,7 @@ static void put_row_8A8R8G8B_pixmap( PUT_ROW_ARGS ) | ||||
|    const XMesaContext xmesa = XMESA_CONTEXT(ctx); | ||||
|    struct xmesa_renderbuffer *xrb = (struct xmesa_renderbuffer *) rb; | ||||
|    XMesaDisplay *dpy = xmesa->xm_visual->display; | ||||
|    XMesaDrawable buffer = xrb->pixmap; | ||||
|    XMesaDrawable buffer = xrb->drawable; | ||||
|    XMesaGC gc = XMESA_BUFFER(ctx->DrawBuffer)->gc; | ||||
|    register GLuint i; | ||||
|    y = YFLIP(xrb, y); | ||||
| @@ -431,7 +431,7 @@ static void put_row_rgb_8A8R8G8B_pixmap( RGB_SPAN_ARGS ) | ||||
|    const XMesaContext xmesa = XMESA_CONTEXT(ctx); | ||||
|    struct xmesa_renderbuffer *xrb = (struct xmesa_renderbuffer *) rb; | ||||
|    XMesaDisplay *dpy = xmesa->xm_visual->display; | ||||
|    XMesaDrawable buffer = xrb->pixmap; | ||||
|    XMesaDrawable buffer = xrb->drawable; | ||||
|    XMesaGC gc = XMESA_BUFFER(ctx->DrawBuffer)->gc; | ||||
|    register GLuint i; | ||||
|    y = YFLIP(xrb, y); | ||||
| @@ -464,7 +464,7 @@ static void put_row_8R8G8B_pixmap( PUT_ROW_ARGS ) | ||||
|    const XMesaContext xmesa = XMESA_CONTEXT(ctx); | ||||
|    struct xmesa_renderbuffer *xrb = (struct xmesa_renderbuffer *) rb; | ||||
|    XMesaDisplay *dpy = xmesa->xm_visual->display; | ||||
|    XMesaDrawable buffer = xrb->pixmap; | ||||
|    XMesaDrawable buffer = xrb->drawable; | ||||
|    XMesaGC gc = XMESA_BUFFER(ctx->DrawBuffer)->gc; | ||||
|    register GLuint i; | ||||
|    y = YFLIP(xrb, y); | ||||
| @@ -497,7 +497,7 @@ static void put_row_8R8G8B24_pixmap( PUT_ROW_ARGS ) | ||||
|    const XMesaContext xmesa = XMESA_CONTEXT(ctx); | ||||
|    struct xmesa_renderbuffer *xrb = (struct xmesa_renderbuffer *) rb; | ||||
|    XMesaDisplay *dpy = xmesa->xm_visual->display; | ||||
|    XMesaDrawable buffer = xrb->pixmap; | ||||
|    XMesaDrawable buffer = xrb->drawable; | ||||
|    XMesaGC gc = XMESA_BUFFER(ctx->DrawBuffer)->gc; | ||||
|    y = YFLIP(xrb, y); | ||||
|    if (mask) { | ||||
| @@ -593,7 +593,7 @@ static void put_row_rgb_8R8G8B_pixmap( RGB_SPAN_ARGS ) | ||||
|    const XMesaContext xmesa = XMESA_CONTEXT(ctx); | ||||
|    struct xmesa_renderbuffer *xrb = (struct xmesa_renderbuffer *) rb; | ||||
|    XMesaDisplay *dpy = xmesa->xm_visual->display; | ||||
|    XMesaDrawable buffer = xrb->pixmap; | ||||
|    XMesaDrawable buffer = xrb->drawable; | ||||
|    XMesaGC gc = XMESA_BUFFER(ctx->DrawBuffer)->gc; | ||||
|    register GLuint i; | ||||
|    y = YFLIP(xrb, y); | ||||
| @@ -625,7 +625,7 @@ static void put_row_rgb_8R8G8B24_pixmap( RGB_SPAN_ARGS ) | ||||
|    const XMesaContext xmesa = XMESA_CONTEXT(ctx); | ||||
|    struct xmesa_renderbuffer *xrb = (struct xmesa_renderbuffer *) rb; | ||||
|    XMesaDisplay *dpy = xmesa->xm_visual->display; | ||||
|    XMesaDrawable buffer = xrb->pixmap; | ||||
|    XMesaDrawable buffer = xrb->drawable; | ||||
|    XMesaGC gc = XMESA_BUFFER(ctx->DrawBuffer)->gc; | ||||
|    y = YFLIP(xrb, y); | ||||
|    if (mask) { | ||||
| @@ -726,7 +726,7 @@ static void put_row_5R6G5B_pixmap( PUT_ROW_ARGS ) | ||||
|    const XMesaContext xmesa = XMESA_CONTEXT(ctx); | ||||
|    struct xmesa_renderbuffer *xrb = (struct xmesa_renderbuffer *) rb; | ||||
|    XMesaDisplay *dpy = xmesa->xm_visual->display; | ||||
|    XMesaDrawable buffer = xrb->pixmap; | ||||
|    XMesaDrawable buffer = xrb->drawable; | ||||
|    XMesaGC gc = XMESA_BUFFER(ctx->DrawBuffer)->gc; | ||||
|    register GLuint i; | ||||
|    y = YFLIP(xrb, y); | ||||
| @@ -759,7 +759,7 @@ static void put_row_DITHER_5R6G5B_pixmap( PUT_ROW_ARGS ) | ||||
|    const XMesaContext xmesa = XMESA_CONTEXT(ctx); | ||||
|    struct xmesa_renderbuffer *xrb = (struct xmesa_renderbuffer *) rb; | ||||
|    XMesaDisplay *dpy = xmesa->xm_visual->display; | ||||
|    XMesaDrawable buffer = xrb->pixmap; | ||||
|    XMesaDrawable buffer = xrb->drawable; | ||||
|    XMesaGC gc = XMESA_BUFFER(ctx->DrawBuffer)->gc; | ||||
|    register GLuint i; | ||||
|    y = YFLIP(xrb, y); | ||||
| @@ -794,7 +794,7 @@ static void put_row_rgb_5R6G5B_pixmap( RGB_SPAN_ARGS ) | ||||
|    const XMesaContext xmesa = XMESA_CONTEXT(ctx); | ||||
|    struct xmesa_renderbuffer *xrb = (struct xmesa_renderbuffer *) rb; | ||||
|    XMesaDisplay *dpy = xmesa->xm_visual->display; | ||||
|    XMesaDrawable buffer = xrb->pixmap; | ||||
|    XMesaDrawable buffer = xrb->drawable; | ||||
|    XMesaGC gc = XMESA_BUFFER(ctx->DrawBuffer)->gc; | ||||
|    register GLuint i; | ||||
|    y = YFLIP(xrb, y); | ||||
| @@ -827,7 +827,7 @@ static void put_row_rgb_DITHER_5R6G5B_pixmap( RGB_SPAN_ARGS ) | ||||
|    const XMesaContext xmesa = XMESA_CONTEXT(ctx); | ||||
|    struct xmesa_renderbuffer *xrb = (struct xmesa_renderbuffer *) rb; | ||||
|    XMesaDisplay *dpy = xmesa->xm_visual->display; | ||||
|    XMesaDrawable buffer = xrb->pixmap; | ||||
|    XMesaDrawable buffer = xrb->drawable; | ||||
|    XMesaGC gc = XMESA_BUFFER(ctx->DrawBuffer)->gc; | ||||
|    register GLuint i; | ||||
|    y = YFLIP(xrb, y); | ||||
| @@ -862,7 +862,7 @@ static void put_row_DITHER_pixmap( PUT_ROW_ARGS ) | ||||
|    const XMesaContext xmesa = XMESA_CONTEXT(ctx); | ||||
|    struct xmesa_renderbuffer *xrb = (struct xmesa_renderbuffer *) rb; | ||||
|    XMesaDisplay *dpy = xmesa->xm_visual->display; | ||||
|    XMesaDrawable buffer = xrb->pixmap; | ||||
|    XMesaDrawable buffer = xrb->drawable; | ||||
|    XMesaGC gc = XMESA_BUFFER(ctx->DrawBuffer)->gc; | ||||
|    register GLuint i; | ||||
|    XDITHER_SETUP(y); | ||||
| @@ -895,7 +895,7 @@ static void put_row_rgb_DITHER_pixmap( RGB_SPAN_ARGS ) | ||||
|    const XMesaContext xmesa = XMESA_CONTEXT(ctx); | ||||
|    struct xmesa_renderbuffer *xrb = (struct xmesa_renderbuffer *) rb; | ||||
|    XMesaDisplay *dpy = xmesa->xm_visual->display; | ||||
|    XMesaDrawable buffer = xrb->pixmap; | ||||
|    XMesaDrawable buffer = xrb->drawable; | ||||
|    XMesaGC gc = XMESA_BUFFER(ctx->DrawBuffer)->gc; | ||||
|    register GLuint i; | ||||
|    XDITHER_SETUP(y); | ||||
| @@ -928,7 +928,7 @@ static void put_row_1BIT_pixmap( PUT_ROW_ARGS ) | ||||
|    const XMesaContext xmesa = XMESA_CONTEXT(ctx); | ||||
|    struct xmesa_renderbuffer *xrb = (struct xmesa_renderbuffer *) rb; | ||||
|    XMesaDisplay *dpy = xmesa->xm_visual->display; | ||||
|    XMesaDrawable buffer = xrb->pixmap; | ||||
|    XMesaDrawable buffer = xrb->drawable; | ||||
|    XMesaGC gc = XMESA_BUFFER(ctx->DrawBuffer)->gc; | ||||
|    register GLuint i; | ||||
|    SETUP_1BIT; | ||||
| @@ -963,7 +963,7 @@ static void put_row_rgb_1BIT_pixmap( RGB_SPAN_ARGS ) | ||||
|    const XMesaContext xmesa = XMESA_CONTEXT(ctx); | ||||
|    struct xmesa_renderbuffer *xrb = (struct xmesa_renderbuffer *) rb; | ||||
|    XMesaDisplay *dpy = xmesa->xm_visual->display; | ||||
|    XMesaDrawable buffer = xrb->pixmap; | ||||
|    XMesaDrawable buffer = xrb->drawable; | ||||
|    XMesaGC gc = XMESA_BUFFER(ctx->DrawBuffer)->gc; | ||||
|    register GLuint i; | ||||
|    SETUP_1BIT; | ||||
| @@ -998,7 +998,7 @@ static void put_row_HPCR_pixmap( PUT_ROW_ARGS ) | ||||
|    const XMesaContext xmesa = XMESA_CONTEXT(ctx); | ||||
|    struct xmesa_renderbuffer *xrb = (struct xmesa_renderbuffer *) rb; | ||||
|    XMesaDisplay *dpy = xmesa->xm_visual->display; | ||||
|    XMesaDrawable buffer = xrb->pixmap; | ||||
|    XMesaDrawable buffer = xrb->drawable; | ||||
|    XMesaGC gc = XMESA_BUFFER(ctx->DrawBuffer)->gc; | ||||
|    register GLuint i; | ||||
|    y = YFLIP(xrb, y); | ||||
| @@ -1031,7 +1031,7 @@ static void put_row_rgb_HPCR_pixmap( RGB_SPAN_ARGS ) | ||||
|    const XMesaContext xmesa = XMESA_CONTEXT(ctx); | ||||
|    struct xmesa_renderbuffer *xrb = (struct xmesa_renderbuffer *) rb; | ||||
|    XMesaDisplay *dpy = xmesa->xm_visual->display; | ||||
|    XMesaDrawable buffer = xrb->pixmap; | ||||
|    XMesaDrawable buffer = xrb->drawable; | ||||
|    XMesaGC gc = XMESA_BUFFER(ctx->DrawBuffer)->gc; | ||||
|    register GLuint i; | ||||
|    y = YFLIP(xrb, y); | ||||
| @@ -1063,7 +1063,7 @@ static void put_row_LOOKUP_pixmap( PUT_ROW_ARGS ) | ||||
|    const XMesaContext xmesa = XMESA_CONTEXT(ctx); | ||||
|    struct xmesa_renderbuffer *xrb = (struct xmesa_renderbuffer *) rb; | ||||
|    XMesaDisplay *dpy = xmesa->xm_visual->display; | ||||
|    XMesaDrawable buffer = xrb->pixmap; | ||||
|    XMesaDrawable buffer = xrb->drawable; | ||||
|    XMesaGC gc = XMESA_BUFFER(ctx->DrawBuffer)->gc; | ||||
|    register GLuint i; | ||||
|    LOOKUP_SETUP; | ||||
| @@ -1095,7 +1095,7 @@ static void put_row_rgb_LOOKUP_pixmap( RGB_SPAN_ARGS ) | ||||
|    const XMesaContext xmesa = XMESA_CONTEXT(ctx); | ||||
|    struct xmesa_renderbuffer *xrb = (struct xmesa_renderbuffer *) rb; | ||||
|    XMesaDisplay *dpy = xmesa->xm_visual->display; | ||||
|    XMesaDrawable buffer = xrb->pixmap; | ||||
|    XMesaDrawable buffer = xrb->drawable; | ||||
|    XMesaGC gc = XMESA_BUFFER(ctx->DrawBuffer)->gc; | ||||
|    register GLuint i; | ||||
|    LOOKUP_SETUP; | ||||
| @@ -1127,7 +1127,7 @@ static void put_row_GRAYSCALE_pixmap( PUT_ROW_ARGS ) | ||||
|    const XMesaContext xmesa = XMESA_CONTEXT(ctx); | ||||
|    struct xmesa_renderbuffer *xrb = (struct xmesa_renderbuffer *) rb; | ||||
|    XMesaDisplay *dpy = xmesa->xm_visual->display; | ||||
|    XMesaDrawable buffer = xrb->pixmap; | ||||
|    XMesaDrawable buffer = xrb->drawable; | ||||
|    XMesaGC gc = XMESA_BUFFER(ctx->DrawBuffer)->gc; | ||||
|    register GLuint i; | ||||
|    y = YFLIP(xrb, y); | ||||
| @@ -1158,7 +1158,7 @@ static void put_row_rgb_GRAYSCALE_pixmap( RGB_SPAN_ARGS ) | ||||
|    const XMesaContext xmesa = XMESA_CONTEXT(ctx); | ||||
|    struct xmesa_renderbuffer *xrb = (struct xmesa_renderbuffer *) rb; | ||||
|    XMesaDisplay *dpy = xmesa->xm_visual->display; | ||||
|    XMesaDrawable buffer = xrb->pixmap; | ||||
|    XMesaDrawable buffer = xrb->drawable; | ||||
|    XMesaGC gc = XMESA_BUFFER(ctx->DrawBuffer)->gc; | ||||
|    register GLuint i; | ||||
|    y = YFLIP(xrb, y); | ||||
| @@ -2237,7 +2237,7 @@ static void put_values_TRUECOLOR_pixmap( PUT_VALUES_ARGS ) | ||||
|    const XMesaContext xmesa = XMESA_CONTEXT(ctx); | ||||
|    struct xmesa_renderbuffer *xrb = (struct xmesa_renderbuffer *) rb; | ||||
|    XMesaDisplay *dpy = xmesa->xm_visual->display; | ||||
|    XMesaDrawable buffer = xrb->pixmap; | ||||
|    XMesaDrawable buffer = xrb->drawable; | ||||
|    XMesaGC gc = XMESA_BUFFER(ctx->DrawBuffer)->gc; | ||||
|    register GLuint i; | ||||
|    for (i=0;i<n;i++) { | ||||
| @@ -2260,7 +2260,7 @@ static void put_values_TRUEDITHER_pixmap( PUT_VALUES_ARGS ) | ||||
|    const XMesaContext xmesa = XMESA_CONTEXT(ctx); | ||||
|    struct xmesa_renderbuffer *xrb = (struct xmesa_renderbuffer *) rb; | ||||
|    XMesaDisplay *dpy = xmesa->xm_visual->display; | ||||
|    XMesaDrawable buffer = xrb->pixmap; | ||||
|    XMesaDrawable buffer = xrb->drawable; | ||||
|    XMesaGC gc = XMESA_BUFFER(ctx->DrawBuffer)->gc; | ||||
|    register GLuint i; | ||||
|    for (i=0;i<n;i++) { | ||||
| @@ -2283,7 +2283,7 @@ static void put_values_8A8B8G8R_pixmap( PUT_VALUES_ARGS ) | ||||
|    const XMesaContext xmesa = XMESA_CONTEXT(ctx); | ||||
|    struct xmesa_renderbuffer *xrb = (struct xmesa_renderbuffer *) rb; | ||||
|    XMesaDisplay *dpy = xmesa->xm_visual->display; | ||||
|    XMesaDrawable buffer = xrb->pixmap; | ||||
|    XMesaDrawable buffer = xrb->drawable; | ||||
|    XMesaGC gc = XMESA_BUFFER(ctx->DrawBuffer)->gc; | ||||
|    register GLuint i; | ||||
|    for (i=0;i<n;i++) { | ||||
| @@ -2304,7 +2304,7 @@ static void put_values_8A8R8G8B_pixmap( PUT_VALUES_ARGS ) | ||||
|    const XMesaContext xmesa = XMESA_CONTEXT(ctx); | ||||
|    struct xmesa_renderbuffer *xrb = (struct xmesa_renderbuffer *) rb; | ||||
|    XMesaDisplay *dpy = xmesa->xm_visual->display; | ||||
|    XMesaDrawable buffer = xrb->pixmap; | ||||
|    XMesaDrawable buffer = xrb->drawable; | ||||
|    XMesaGC gc = XMESA_BUFFER(ctx->DrawBuffer)->gc; | ||||
|    register GLuint i; | ||||
|    for (i=0;i<n;i++) { | ||||
| @@ -2325,7 +2325,7 @@ static void put_values_8R8G8B_pixmap( PUT_VALUES_ARGS ) | ||||
|    const XMesaContext xmesa = XMESA_CONTEXT(ctx); | ||||
|    struct xmesa_renderbuffer *xrb = (struct xmesa_renderbuffer *) rb; | ||||
|    XMesaDisplay *dpy = xmesa->xm_visual->display; | ||||
|    XMesaDrawable buffer = xrb->pixmap; | ||||
|    XMesaDrawable buffer = xrb->drawable; | ||||
|    XMesaGC gc = XMESA_BUFFER(ctx->DrawBuffer)->gc; | ||||
|    register GLuint i; | ||||
|    for (i=0;i<n;i++) { | ||||
| @@ -2346,7 +2346,7 @@ static void put_values_8R8G8B24_pixmap( PUT_VALUES_ARGS ) | ||||
|    const XMesaContext xmesa = XMESA_CONTEXT(ctx); | ||||
|    struct xmesa_renderbuffer *xrb = (struct xmesa_renderbuffer *) rb; | ||||
|    XMesaDisplay *dpy = xmesa->xm_visual->display; | ||||
|    XMesaDrawable buffer = xrb->pixmap; | ||||
|    XMesaDrawable buffer = xrb->drawable; | ||||
|    XMesaGC gc = XMESA_BUFFER(ctx->DrawBuffer)->gc; | ||||
|    register GLuint i; | ||||
|    for (i=0;i<n;i++) { | ||||
| @@ -2367,7 +2367,7 @@ static void put_values_5R6G5B_pixmap( PUT_VALUES_ARGS ) | ||||
|    const XMesaContext xmesa = XMESA_CONTEXT(ctx); | ||||
|    struct xmesa_renderbuffer *xrb = (struct xmesa_renderbuffer *) rb; | ||||
|    XMesaDisplay *dpy = xmesa->xm_visual->display; | ||||
|    XMesaDrawable buffer = xrb->pixmap; | ||||
|    XMesaDrawable buffer = xrb->drawable; | ||||
|    XMesaGC gc = XMESA_BUFFER(ctx->DrawBuffer)->gc; | ||||
|    register GLuint i; | ||||
|    for (i=0;i<n;i++) { | ||||
| @@ -2388,7 +2388,7 @@ static void put_values_DITHER_5R6G5B_pixmap( PUT_VALUES_ARGS ) | ||||
|    const XMesaContext xmesa = XMESA_CONTEXT(ctx); | ||||
|    struct xmesa_renderbuffer *xrb = (struct xmesa_renderbuffer *) rb; | ||||
|    XMesaDisplay *dpy = xmesa->xm_visual->display; | ||||
|    XMesaDrawable buffer = xrb->pixmap; | ||||
|    XMesaDrawable buffer = xrb->drawable; | ||||
|    XMesaGC gc = XMESA_BUFFER(ctx->DrawBuffer)->gc; | ||||
|    register GLuint i; | ||||
|    for (i=0;i<n;i++) { | ||||
| @@ -2411,7 +2411,7 @@ static void put_values_DITHER_pixmap( PUT_VALUES_ARGS ) | ||||
|    const XMesaContext xmesa = XMESA_CONTEXT(ctx); | ||||
|    struct xmesa_renderbuffer *xrb = (struct xmesa_renderbuffer *) rb; | ||||
|    XMesaDisplay *dpy = xmesa->xm_visual->display; | ||||
|    XMesaDrawable buffer = xrb->pixmap; | ||||
|    XMesaDrawable buffer = xrb->drawable; | ||||
|    XMesaGC gc = XMESA_BUFFER(ctx->DrawBuffer)->gc; | ||||
|    register GLuint i; | ||||
|    DITHER_SETUP; | ||||
| @@ -2434,7 +2434,7 @@ static void put_values_1BIT_pixmap( PUT_VALUES_ARGS ) | ||||
|    const XMesaContext xmesa = XMESA_CONTEXT(ctx); | ||||
|    struct xmesa_renderbuffer *xrb = (struct xmesa_renderbuffer *) rb; | ||||
|    XMesaDisplay *dpy = xmesa->xm_visual->display; | ||||
|    XMesaDrawable buffer = xrb->pixmap; | ||||
|    XMesaDrawable buffer = xrb->drawable; | ||||
|    XMesaGC gc = XMESA_BUFFER(ctx->DrawBuffer)->gc; | ||||
|    register GLuint i; | ||||
|    SETUP_1BIT; | ||||
| @@ -2457,7 +2457,7 @@ static void put_values_HPCR_pixmap( PUT_VALUES_ARGS ) | ||||
|    const XMesaContext xmesa = XMESA_CONTEXT(ctx); | ||||
|    struct xmesa_renderbuffer *xrb = (struct xmesa_renderbuffer *) rb; | ||||
|    XMesaDisplay *dpy = xmesa->xm_visual->display; | ||||
|    XMesaDrawable buffer = xrb->pixmap; | ||||
|    XMesaDrawable buffer = xrb->drawable; | ||||
|    XMesaGC gc = XMESA_BUFFER(ctx->DrawBuffer)->gc; | ||||
|    register GLuint i; | ||||
|    for (i=0;i<n;i++) { | ||||
| @@ -2479,7 +2479,7 @@ static void put_values_LOOKUP_pixmap( PUT_VALUES_ARGS ) | ||||
|    const XMesaContext xmesa = XMESA_CONTEXT(ctx); | ||||
|    struct xmesa_renderbuffer *xrb = (struct xmesa_renderbuffer *) rb; | ||||
|    XMesaDisplay *dpy = xmesa->xm_visual->display; | ||||
|    XMesaDrawable buffer = xrb->pixmap; | ||||
|    XMesaDrawable buffer = xrb->drawable; | ||||
|    XMesaGC gc = XMESA_BUFFER(ctx->DrawBuffer)->gc; | ||||
|    register GLuint i; | ||||
|    LOOKUP_SETUP; | ||||
| @@ -2501,7 +2501,7 @@ static void put_values_GRAYSCALE_pixmap( PUT_VALUES_ARGS ) | ||||
|    const XMesaContext xmesa = XMESA_CONTEXT(ctx); | ||||
|    struct xmesa_renderbuffer *xrb = (struct xmesa_renderbuffer *) rb; | ||||
|    XMesaDisplay *dpy = xmesa->xm_visual->display; | ||||
|    XMesaDrawable buffer = xrb->pixmap; | ||||
|    XMesaDrawable buffer = xrb->drawable; | ||||
|    XMesaGC gc = XMESA_BUFFER(ctx->DrawBuffer)->gc; | ||||
|    register GLuint i; | ||||
|    for (i=0;i<n;i++) { | ||||
| @@ -2825,7 +2825,7 @@ static void put_mono_row_pixmap( PUT_MONO_ROW_ARGS ) | ||||
|    struct xmesa_renderbuffer *xrb = (struct xmesa_renderbuffer *) rb; | ||||
|    XMesaContext xmesa = XMESA_CONTEXT(ctx); | ||||
|    XMesaDisplay *dpy = xmesa->xm_visual->display; | ||||
|    XMesaDrawable buffer = xrb->pixmap; | ||||
|    XMesaDrawable buffer = xrb->drawable; | ||||
|    XMesaGC gc = XMESA_BUFFER(ctx->DrawBuffer)->gc; | ||||
|    const unsigned long pixel = xmesa_color_to_pixel(ctx, color[RCOMP], | ||||
|                color[GCOMP], color[BCOMP], color[ACOMP], xmesa->pixelformat); | ||||
| @@ -2865,7 +2865,7 @@ put_mono_row_ci_pixmap( PUT_MONO_ROW_ARGS ) | ||||
|    XMesaContext xmesa = XMESA_CONTEXT(ctx); | ||||
|    struct xmesa_renderbuffer *xrb = (struct xmesa_renderbuffer *) rb; | ||||
|    XMesaDisplay *dpy = xmesa->xm_visual->display; | ||||
|    XMesaDrawable buffer = xrb->pixmap; | ||||
|    XMesaDrawable buffer = xrb->drawable; | ||||
|    XMesaGC gc = XMESA_BUFFER(ctx->DrawBuffer)->gc; | ||||
|    register GLuint i; | ||||
|    XMesaSetForeground( xmesa->display, gc, colorIndex ); | ||||
| @@ -2902,7 +2902,7 @@ static void put_mono_row_TRUEDITHER_pixmap( PUT_MONO_ROW_ARGS ) | ||||
|    struct xmesa_renderbuffer *xrb = (struct xmesa_renderbuffer *) rb; | ||||
|    XMesaContext xmesa = XMESA_CONTEXT(ctx); | ||||
|    XMesaDisplay *dpy = xmesa->xm_visual->display; | ||||
|    XMesaDrawable buffer = xrb->pixmap; | ||||
|    XMesaDrawable buffer = xrb->drawable; | ||||
|    XMesaGC gc = XMESA_BUFFER(ctx->DrawBuffer)->gc; | ||||
|    const GLubyte r = color[RCOMP], g = color[GCOMP], b = color[BCOMP]; | ||||
|    register GLuint i; | ||||
| @@ -2927,7 +2927,7 @@ static void put_mono_row_DITHER_pixmap( PUT_MONO_ROW_ARGS ) | ||||
|    struct xmesa_renderbuffer *xrb = (struct xmesa_renderbuffer *) rb; | ||||
|    XMesaContext xmesa = XMESA_CONTEXT(ctx); | ||||
|    XMesaDisplay *dpy = xmesa->xm_visual->display; | ||||
|    XMesaDrawable buffer = xrb->pixmap; | ||||
|    XMesaDrawable buffer = xrb->drawable; | ||||
|    XMesaGC gc = XMESA_BUFFER(ctx->DrawBuffer)->gc; | ||||
|    const GLubyte r = color[RCOMP], g = color[GCOMP], b = color[BCOMP]; | ||||
|    register GLuint i; | ||||
| @@ -2951,7 +2951,7 @@ static void put_mono_row_1BIT_pixmap( PUT_MONO_ROW_ARGS ) | ||||
|    struct xmesa_renderbuffer *xrb = (struct xmesa_renderbuffer *) rb; | ||||
|    XMesaContext xmesa = XMESA_CONTEXT(ctx); | ||||
|    XMesaDisplay *dpy = xmesa->xm_visual->display; | ||||
|    XMesaDrawable buffer = xrb->pixmap; | ||||
|    XMesaDrawable buffer = xrb->drawable; | ||||
|    XMesaGC gc = XMESA_BUFFER(ctx->DrawBuffer)->gc; | ||||
|    const GLubyte r = color[RCOMP], g = color[GCOMP], b = color[BCOMP]; | ||||
|    register GLuint i; | ||||
| @@ -3263,7 +3263,7 @@ static void put_mono_values_pixmap( PUT_MONO_VALUES_ARGS ) | ||||
|    const XMesaContext xmesa = XMESA_CONTEXT(ctx); | ||||
|    struct xmesa_renderbuffer *xrb = (struct xmesa_renderbuffer *) rb; | ||||
|    XMesaDisplay *dpy = xmesa->xm_visual->display; | ||||
|    XMesaDrawable buffer = xrb->pixmap; | ||||
|    XMesaDrawable buffer = xrb->drawable; | ||||
|    XMesaGC gc = XMESA_BUFFER(ctx->DrawBuffer)->gc; | ||||
|    register GLuint i; | ||||
|    const unsigned long pixel = xmesa_color_to_pixel(ctx, color[RCOMP], | ||||
| @@ -3285,7 +3285,7 @@ put_mono_values_ci_pixmap( PUT_MONO_VALUES_ARGS ) | ||||
|    const XMesaContext xmesa = XMESA_CONTEXT(ctx); | ||||
|    struct xmesa_renderbuffer *xrb = (struct xmesa_renderbuffer *) rb; | ||||
|    XMesaDisplay *dpy = xmesa->xm_visual->display; | ||||
|    XMesaDrawable buffer = xrb->pixmap; | ||||
|    XMesaDrawable buffer = xrb->drawable; | ||||
|    XMesaGC gc = XMESA_BUFFER(ctx->DrawBuffer)->gc; | ||||
|    register GLuint i; | ||||
|    XMesaSetForeground( xmesa->display, gc, colorIndex ); | ||||
| @@ -3307,7 +3307,7 @@ static void put_mono_values_TRUEDITHER_pixmap( PUT_MONO_VALUES_ARGS ) | ||||
|    const XMesaContext xmesa = XMESA_CONTEXT(ctx); | ||||
|    struct xmesa_renderbuffer *xrb = (struct xmesa_renderbuffer *) rb; | ||||
|    XMesaDisplay *dpy = xmesa->xm_visual->display; | ||||
|    XMesaDrawable buffer = xrb->pixmap; | ||||
|    XMesaDrawable buffer = xrb->drawable; | ||||
|    XMesaGC gc = XMESA_BUFFER(ctx->DrawBuffer)->gc; | ||||
|    register GLuint i; | ||||
|    const GLubyte r = color[RCOMP], g = color[GCOMP], b = color[BCOMP]; | ||||
| @@ -3332,7 +3332,7 @@ static void put_mono_values_DITHER_pixmap( PUT_MONO_VALUES_ARGS ) | ||||
|    const XMesaContext xmesa = XMESA_CONTEXT(ctx); | ||||
|    struct xmesa_renderbuffer *xrb = (struct xmesa_renderbuffer *) rb; | ||||
|    XMesaDisplay *dpy = xmesa->xm_visual->display; | ||||
|    XMesaDrawable buffer = xrb->pixmap; | ||||
|    XMesaDrawable buffer = xrb->drawable; | ||||
|    XMesaGC gc = XMESA_BUFFER(ctx->DrawBuffer)->gc; | ||||
|    register GLuint i; | ||||
|    const GLubyte r = color[RCOMP], g = color[GCOMP], b = color[BCOMP]; | ||||
| @@ -3355,7 +3355,7 @@ static void put_mono_values_1BIT_pixmap( PUT_MONO_VALUES_ARGS ) | ||||
|    const XMesaContext xmesa = XMESA_CONTEXT(ctx); | ||||
|    struct xmesa_renderbuffer *xrb = (struct xmesa_renderbuffer *) rb; | ||||
|    XMesaDisplay *dpy = xmesa->xm_visual->display; | ||||
|    XMesaDrawable buffer = xrb->pixmap; | ||||
|    XMesaDrawable buffer = xrb->drawable; | ||||
|    XMesaGC gc = XMESA_BUFFER(ctx->DrawBuffer)->gc; | ||||
|    register GLuint i; | ||||
|    const GLubyte r = color[RCOMP], g = color[GCOMP], b = color[BCOMP]; | ||||
| @@ -3650,7 +3650,7 @@ static void put_row_ci_pixmap( PUT_ROW_ARGS ) | ||||
|    const XMesaContext xmesa = XMESA_CONTEXT(ctx); | ||||
|    struct xmesa_renderbuffer *xrb = (struct xmesa_renderbuffer *) rb; | ||||
|    XMesaDisplay *dpy = xmesa->xm_visual->display; | ||||
|    XMesaDrawable buffer = xrb->pixmap; | ||||
|    XMesaDrawable buffer = xrb->drawable; | ||||
|    XMesaGC gc = XMESA_BUFFER(ctx->DrawBuffer)->gc; | ||||
|    register GLuint i; | ||||
|    y = YFLIP(xrb, y); | ||||
| @@ -3709,7 +3709,7 @@ static void put_values_ci_pixmap( PUT_VALUES_ARGS ) | ||||
|    const XMesaContext xmesa = XMESA_CONTEXT(ctx); | ||||
|    struct xmesa_renderbuffer *xrb = (struct xmesa_renderbuffer *) rb; | ||||
|    XMesaDisplay *dpy = xmesa->xm_visual->display; | ||||
|    XMesaDrawable buffer = xrb->pixmap; | ||||
|    XMesaDrawable buffer = xrb->drawable; | ||||
|    XMesaGC gc = XMESA_BUFFER(ctx->DrawBuffer)->gc; | ||||
|    register GLuint i; | ||||
|    for (i=0;i<n;i++) { | ||||
| @@ -3762,7 +3762,7 @@ clip_for_xgetimage(GLcontext *ctx, GLuint *n, GLint *x, GLint *y) | ||||
|    Window child; | ||||
|    GLint screenWidth = WidthOfScreen(DefaultScreenOfDisplay(xmesa->display)); | ||||
|    GLint dx, dy; | ||||
|    if (source->type == PBUFFER) | ||||
|    if (source->type == PBUFFER || source->type == PIXMAP) | ||||
|       return 0; | ||||
|    XTranslateCoordinates(xmesa->display, source->frontxrb->pixmap, rootWin, | ||||
|                          *x, *y, &dx, &dy, &child); | ||||
| @@ -3832,7 +3832,7 @@ get_row_ci(GLcontext *ctx, struct gl_renderbuffer *rb, | ||||
| 	 XMesaDestroyImage( span ); | ||||
|       } | ||||
| #else | ||||
|       (*xmesa->display->GetImage)(xrb->pixmap, | ||||
|       (*xmesa->display->GetImage)(xrb->drawable, | ||||
| 				  x, y, n, 1, ZPixmap, | ||||
| 				  ~0L, (pointer)index); | ||||
| #endif | ||||
| @@ -3867,7 +3867,7 @@ get_row_rgba(GLcontext *ctx, struct gl_renderbuffer *rb, | ||||
|       span = XMesaCreateImage(xmesa->xm_visual->BitsPerPixel, n, 1, NULL); | ||||
|       span->data = (char *)MALLOC(span->height * span->bytes_per_line); | ||||
|       error = (!span->data); | ||||
|       (*xmesa->display->GetImage)(xrb->pixmap, | ||||
|       (*xmesa->display->GetImage)(xrb->drawable, | ||||
| 				  x, YFLIP(xrb, y), n, 1, ZPixmap, | ||||
| 				  ~0L, (pointer)span->data); | ||||
| #else | ||||
| @@ -4262,7 +4262,7 @@ get_values_ci(GLcontext *ctx, struct gl_renderbuffer *rb, | ||||
|    GLuint i; | ||||
|    if (xrb->pixmap) { | ||||
|       for (i=0;i<n;i++) { | ||||
|          indx[i] = (GLuint) read_pixel( xmesa->display, xrb->pixmap, | ||||
|          indx[i] = (GLuint) read_pixel( xmesa->display, xrb->drawable, | ||||
|                                         x[i], YFLIP(xrb, y[i]) ); | ||||
|       } | ||||
|    } | ||||
| @@ -4288,7 +4288,7 @@ get_values_rgba(GLcontext *ctx, struct gl_renderbuffer *rb, | ||||
|    register GLuint i; | ||||
|  | ||||
|    if (xrb->pixmap) { | ||||
|       XMesaDrawable buffer = xrb->pixmap; | ||||
|       XMesaDrawable buffer = xrb->drawable; | ||||
|       switch (xmesa->pixelformat) { | ||||
| 	 case PF_Truecolor: | ||||
|          case PF_Dither_True: | ||||
|   | ||||
| @@ -45,7 +45,7 @@ | ||||
|  | ||||
|  | ||||
| #define GET_XRB(XRB)  struct xmesa_renderbuffer *XRB = \ | ||||
|    (struct xmesa_renderbuffer *) ctx->DrawBuffer->_ColorDrawBuffers[0][0] | ||||
|    (struct xmesa_renderbuffer *) ctx->DrawBuffer->_ColorDrawBuffers[0][0]->Wrapped | ||||
|  | ||||
|  | ||||
| /**********************************************************************/ | ||||
| @@ -1430,8 +1430,7 @@ static swrast_tri_func get_triangle_func( GLcontext *ctx ) | ||||
|    SWcontext *swrast = SWRAST_CONTEXT(ctx); | ||||
|    XMesaContext xmesa = XMESA_CONTEXT(ctx); | ||||
|    int depth = GET_VISUAL_DEPTH(xmesa->xm_visual); | ||||
|    struct xmesa_renderbuffer *xrb = (struct xmesa_renderbuffer *) | ||||
|       ctx->DrawBuffer->_ColorDrawBuffers[0][0]; | ||||
|    GET_XRB(xrb); | ||||
|  | ||||
| #ifdef DEBUG | ||||
|    triFuncName = NULL; | ||||
|   | ||||
| @@ -156,13 +156,23 @@ typedef enum { | ||||
| } BufferType; | ||||
|  | ||||
|  | ||||
| /** | ||||
|  * An xmesa_renderbuffer represents the back or front color buffer. | ||||
|  * For the front color buffer: | ||||
|  *    <drawable> is the X window | ||||
|  * For the back color buffer: | ||||
|  *    Either <ximage> or <pixmap> will be used, never both. | ||||
|  * In any case, <drawable> always equals <pixmap>. | ||||
|  * For stand-alone Mesa, we could merge <drawable> and <pixmap> into one | ||||
|  * field.  We don't do that for the server-side GLcore module because | ||||
|  * pixmaps and drawables are different and we'd need a bunch of casts. | ||||
|  */ | ||||
| struct xmesa_renderbuffer | ||||
| { | ||||
|    struct gl_renderbuffer Base;  /* Base class */ | ||||
|  | ||||
|    XMesaDrawable pixmap;	/* Either an X Window ID (front color buf) */ | ||||
|                                 /* or X Pixmap ID (back color buf) */ | ||||
|  | ||||
|    XMesaDrawable drawable;	/* Usually the X window ID */ | ||||
|    XMesaPixmap pixmap;	/* Back color buffer */ | ||||
|    XMesaImage *ximage;	/* The back buffer, if not using a Pixmap */ | ||||
|  | ||||
|    GLubyte *origin1;	/* used for PIXEL_ADDR1 macro */ | ||||
|   | ||||
| @@ -14,11 +14,21 @@ | ||||
|     <enum name="STENCIL_INDEX8_EXT"                       value="0x8D48"/> | ||||
|     <enum name="STENCIL_INDEX16_EXT"                      value="0x8D49"/> | ||||
|  | ||||
|     <enum name="FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT"   value="0x8CD0"/> | ||||
|     <enum name="FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT"   value="0x8CD1"/> | ||||
|     <enum name="FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT" value="0x8CD2"/> | ||||
|     <enum name="FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT" value="0x8CD3"/> | ||||
|     <enum name="FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT"    value="0x8CD4"/> | ||||
|     <enum name="FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT"   count="1" value="0x8CD0"> | ||||
|         <size name="GetFramebufferAttachmentParameterivEXT" mode="get"/> | ||||
|     </enum> | ||||
|     <enum name="FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT"   count="1" value="0x8CD1"> | ||||
|         <size name="GetFramebufferAttachmentParameterivEXT" mode="get"/> | ||||
|     </enum> | ||||
|     <enum name="FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT" count="1" value="0x8CD2"> | ||||
|         <size name="GetFramebufferAttachmentParameterivEXT" mode="get"/> | ||||
|     </enum> | ||||
|     <enum name="FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT" count="1" value="0x8CD3"> | ||||
|         <size name="GetFramebufferAttachmentParameterivEXT" mode="get"/> | ||||
|     </enum> | ||||
|     <enum name="FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT"    count="1" value="0x8CD4"> | ||||
|         <size name="GetFramebufferAttachmentParameterivEXT" mode="get"/> | ||||
|     </enum> | ||||
|  | ||||
|     <enum name="COLOR_ATTACHMENT0_EXT"                    value="0x8CE0"/> | ||||
|     <enum name="COLOR_ATTACHMENT1_EXT"                    value="0x8CE1"/> | ||||
|   | ||||
| @@ -59,6 +59,8 @@ class glx_enum(gl_XML.gl_enum): | ||||
| 				 | ||||
| 				if not c: | ||||
| 					c = self.default_count | ||||
| 				else: | ||||
| 					c = int(c) | ||||
|  | ||||
| 				if m == "get": | ||||
| 					mode = 0 | ||||
|   | ||||
| @@ -55,14 +55,21 @@ class glx_enum_function: | ||||
|  | ||||
|  | ||||
| 		# Fill self.count and self.enums using the dictionary of enums | ||||
| 		# that was passed in. | ||||
| 		# that was passed in.  The generic Get functions (e.g., | ||||
| 		# GetBooleanv and friends) are handled specially here.  In | ||||
| 		# the data the generic Get functions are refered to as "Get". | ||||
|  | ||||
| 		if func_name in ["GetIntegerv", "GetBooleanv", "GetFloatv", "GetDoublev"]: | ||||
| 			match_name = "Get" | ||||
| 		else: | ||||
| 			match_name = func_name | ||||
|  | ||||
| 		mode_set = 0 | ||||
| 		for enum_name in enum_dict: | ||||
| 			e = enum_dict[ enum_name ] | ||||
| 		 | ||||
| 			if e.functions.has_key( func_name ): | ||||
| 				[count, mode] = e.functions[ func_name ] | ||||
|  | ||||
| 			if e.functions.has_key( match_name ): | ||||
| 				[count, mode] = e.functions[ match_name ] | ||||
|  | ||||
| 				if mode_set and mode != self.mode: | ||||
| 					raise RuntimeError("Not all enums for %s have the same mode." % (func_name)) | ||||
| @@ -92,8 +99,8 @@ class glx_enum_function: | ||||
|  | ||||
| 				self.count[i].sort() | ||||
| 				for e in self.count[i]: | ||||
| 					self.sig += "%04x,%u," % (e, i) | ||||
| 	 | ||||
| 					self.sig += "%04x,%d," % (e, i) | ||||
|  | ||||
| 		return self.sig | ||||
|  | ||||
|  | ||||
| @@ -320,6 +327,9 @@ class PrintGlxSizeStubs_c(PrintGlxSizeStubs_common): | ||||
| 		self.printVisibility( "INTERNAL", "internal" ) | ||||
| 		print '' | ||||
| 		print '' | ||||
| 		print '#if defined(__CYGWIN__) || defined(__MINGW32__) || defined(__APPLE__)' | ||||
| 		print '#  undef HAVE_ALIAS' | ||||
| 		print '#endif' | ||||
| 		print '#ifdef HAVE_ALIAS' | ||||
| 		print '#  define ALIAS2(from,to) \\' | ||||
| 		print '    INTERNAL PURE FASTCALL GLint __gl ## from ## _size( GLenum e ) \\' | ||||
| @@ -419,6 +429,13 @@ class PrintGlxReqSize_h(PrintGlxReqSize_common): | ||||
|  | ||||
|  | ||||
| class PrintGlxReqSize_c(PrintGlxReqSize_common): | ||||
| 	"""Create the server-side 'request size' functions. | ||||
|  | ||||
| 	Create the server-side functions that are used to determine what the | ||||
| 	size of a varible length command should be.  The server then uses | ||||
| 	this value to determine if the incoming command packed it malformed. | ||||
| 	""" | ||||
|  | ||||
| 	def __init__(self): | ||||
| 		PrintGlxReqSize_common.__init__(self) | ||||
| 		self.counter_sigs = {} | ||||
| @@ -427,14 +444,24 @@ class PrintGlxReqSize_c(PrintGlxReqSize_common): | ||||
| 	def printRealHeader(self): | ||||
| 		print '' | ||||
| 		print '#include <GL/gl.h>' | ||||
| 		print '#include <byteswap.h>' | ||||
| 		print '#include "glxserver.h"' | ||||
| 		print '#include "indirect_size.h"' | ||||
| 		print '#include "indirect_reqsize.h"' | ||||
| 		print '' | ||||
| 		print '#if defined(linux)' | ||||
| 		print '#  include <byteswap.h>' | ||||
| 		print '#  define SWAP_32(v)  do { (v) = bswap_32(v); } while(0)' | ||||
| 		print '#else' | ||||
| 		print '#  include <X11/misc.h>' | ||||
| 		print '#  define SWAP_32(v)  do { char tmp; swapl(&v, tmp); } while(0)' | ||||
| 		print '#endif' | ||||
| 		 | ||||
| 		print '' | ||||
| 		print '#define __GLX_PAD(x)  (((x) + 3) & ~3)' | ||||
| 		print '' | ||||
| 		print '#if defined(__CYGWIN__) || defined(__MINGW32__)' | ||||
| 		print '#  undef HAVE_ALIAS' | ||||
| 		print '#endif' | ||||
| 		print '#ifdef HAVE_ALIAS' | ||||
| 		print '#  define ALIAS2(from,to) \\' | ||||
| 		print '    GLint __glX ## from ## ReqSize( const GLbyte * pc, Bool swap ) \\' | ||||
| @@ -509,7 +536,7 @@ class PrintGlxReqSize_c(PrintGlxReqSize_common): | ||||
| 		if fixup: | ||||
| 			print '    if (swap) {' | ||||
| 			for name in fixup: | ||||
| 				print '        %-14s = bswap_32( %s );' % (name, name) | ||||
| 				print '        SWAP_32( %s );' % (name) | ||||
| 			print '    }' | ||||
|  | ||||
| 		return | ||||
| @@ -533,7 +560,7 @@ class PrintGlxReqSize_c(PrintGlxReqSize_common): | ||||
| 		self.common_func_print_just_header(f) | ||||
| 		 | ||||
| 		f.offset_of( f.parameters[0].name ) | ||||
| 		[dim, w, h, d, junk] = f.dimensions() | ||||
| 		[dim, w, h, d, junk] = f.get_images()[0].get_dimensions() | ||||
|  | ||||
| 		print '    GLint row_length   = *  (GLint *)(pc +  4);' | ||||
|  | ||||
| @@ -630,8 +657,6 @@ def show_usage(): | ||||
| 	print "    -m output_mode   Output mode can be one of 'size_c' or 'size_h'." | ||||
| 	print "    --only-get       Only emit 'get'-type functions." | ||||
| 	print "    --only-set       Only emit 'set'-type functions." | ||||
| 	print "    --get-alias-set  When only 'get'-type functions are emitted, allow them" | ||||
| 	print "                     to be aliases to 'set'-type funcitons." | ||||
| 	print "" | ||||
| 	print "By default, both 'get' and 'set'-type functions are emitted." | ||||
| 	sys.exit(1) | ||||
|   | ||||
| @@ -4115,7 +4115,7 @@ | ||||
|     <enum name="NUM_COMPRESSED_TEXTURE_FORMATS" count="1" value="0x86A2"> | ||||
|         <size name="Get" mode="get"/> | ||||
|     </enum> | ||||
|     <enum name="COMPRESSED_TEXTURE_FORMATS"    count="?"  value="0x86A3"> | ||||
|     <enum name="COMPRESSED_TEXTURE_FORMATS"    count="-1"  value="0x86A3"> | ||||
|         <size name="Get" mode="get"/> | ||||
|     </enum> | ||||
|     <enum name="CLAMP_TO_BORDER"                          value="0x812D"/> | ||||
| @@ -4884,7 +4884,7 @@ | ||||
|     <enum name="DYNAMIC_READ"                             value="0x88E9"/> | ||||
|     <enum name="DYNAMIC_COPY"                             value="0x88EA"/> | ||||
|     <enum name="SAMPLES_PASSED"                count="1"  value="0x8914"/> | ||||
|     <enum name="FOG_COORD_SOURCE"                         value="0x8450"> | ||||
|     <enum name="FOG_COORD_SRC"                            value="0x8450"> | ||||
|         <size name="Get" mode="get"/> | ||||
|     </enum> | ||||
|     <enum name="FOG_COORD"                                value="0x8451"/> | ||||
|   | ||||
| @@ -194,7 +194,7 @@ class gl_print_base: | ||||
| 		""" | ||||
|  | ||||
| 		self.undef_list.append("FASTCALL") | ||||
| 		print """#  if defined(__i386__) && defined(__GNUC__) | ||||
| 		print """#  if defined(__i386__) && defined(__GNUC__) && !defined(__CYGWIN__) && !defined(__MINGW32__) | ||||
| #    define FASTCALL __attribute__((fastcall)) | ||||
| #  else | ||||
| #    define FASTCALL | ||||
| @@ -214,7 +214,7 @@ class gl_print_base: | ||||
| 		""" | ||||
|  | ||||
| 		self.undef_list.append(S) | ||||
| 		print """#  if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) | ||||
| 		print """#  if (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3)) && defined(__ELF__) | ||||
| #    define %s  __attribute__((visibility("%s"))) | ||||
| #  else | ||||
| #    define %s | ||||
|   | ||||
| @@ -343,7 +343,7 @@ _glapi_get_dispatch(void) | ||||
| } | ||||
|  | ||||
|  | ||||
| #if !defined( USE_X86_ASM ) | ||||
| #if !defined( USE_X86_ASM ) && !defined( XFree86Server ) | ||||
| #define NEED_FUNCTION_POINTER | ||||
| #endif | ||||
|  | ||||
| @@ -388,6 +388,7 @@ get_static_proc_offset(const char *funcName) | ||||
| } | ||||
|  | ||||
|  | ||||
| #if !defined( XFree86Server ) | ||||
| #ifdef USE_X86_ASM | ||||
|  | ||||
| #if defined( GLX_USE_TLS ) | ||||
| @@ -437,6 +438,7 @@ get_static_proc_address(const char *funcName) | ||||
| } | ||||
|  | ||||
| #endif /* USE_X86_ASM */ | ||||
| #endif /* !defined( XFree86Server ) */ | ||||
|  | ||||
|  | ||||
| /** | ||||
| @@ -890,12 +892,14 @@ _glapi_get_proc_address(const char *funcName) | ||||
|       } | ||||
|    } | ||||
|  | ||||
| #if !defined( XFree86Server ) | ||||
|    /* search static functions */ | ||||
|    { | ||||
|       const _glapi_proc func = get_static_proc_address(funcName); | ||||
|       if (func) | ||||
|          return func; | ||||
|    } | ||||
| #endif /* !defined( XFree86Server ) */ | ||||
|  | ||||
|    entry = add_function_name(funcName); | ||||
|    return (entry == NULL) ? NULL : entry->dispatch_stub; | ||||
|   | ||||
| @@ -1,6 +1,6 @@ | ||||
| /* | ||||
|  * Mesa 3-D graphics library | ||||
|  * Version:  6.3 | ||||
|  * Version:  6.5 | ||||
|  * | ||||
|  * Copyright (C) 1999-2005  Brian Paul   All Rights Reserved. | ||||
|  * | ||||
| @@ -55,14 +55,8 @@ void GLAPIENTRY | ||||
| _mesa_Accum( GLenum op, GLfloat value ) | ||||
| { | ||||
|    GET_CURRENT_CONTEXT(ctx); | ||||
|    GLuint xpos, ypos, width, height; | ||||
|    ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); | ||||
|  | ||||
|    if (ctx->Visual.accumRedBits == 0 || ctx->DrawBuffer != ctx->ReadBuffer) { | ||||
|       _mesa_error(ctx, GL_INVALID_OPERATION, "glAccum"); | ||||
|       return; | ||||
|    } | ||||
|  | ||||
|    switch (op) { | ||||
|    case GL_ADD: | ||||
|    case GL_MULT: | ||||
| @@ -76,30 +70,34 @@ _mesa_Accum( GLenum op, GLfloat value ) | ||||
|       return; | ||||
|    } | ||||
|  | ||||
|    if (ctx->NewState) | ||||
|       _mesa_update_state( ctx ); | ||||
|  | ||||
|    if (ctx->RenderMode != GL_RENDER) { | ||||
|       /* no-op */ | ||||
|    if (ctx->DrawBuffer->Visual.haveAccumBuffer == 0) { | ||||
|       _mesa_error(ctx, GL_INVALID_OPERATION, "glAccum(no accum buffer)"); | ||||
|       return; | ||||
|    } | ||||
|  | ||||
|    /* Determine region to operate upon. */ | ||||
|    if (ctx->Scissor.Enabled) { | ||||
|       xpos = ctx->Scissor.X; | ||||
|       ypos = ctx->Scissor.Y; | ||||
|       width = ctx->Scissor.Width; | ||||
|       height = ctx->Scissor.Height; | ||||
|    } | ||||
|    else { | ||||
|       /* whole window */ | ||||
|       xpos = 0; | ||||
|       ypos = 0; | ||||
|       width = ctx->DrawBuffer->Width; | ||||
|       height = ctx->DrawBuffer->Height; | ||||
|    if (ctx->DrawBuffer != ctx->ReadBuffer) { | ||||
|       /* See GLX_SGI_make_current_read or WGL_ARB_make_current_read */ | ||||
|       _mesa_error(ctx, GL_INVALID_OPERATION, | ||||
|                   "glAccum(different read/draw buffers)"); | ||||
|       return; | ||||
|    } | ||||
|  | ||||
|    ctx->Driver.Accum( ctx, op, value, xpos, ypos, width, height ); | ||||
|    if (ctx->NewState) | ||||
|       _mesa_update_state(ctx); | ||||
|  | ||||
|    if (ctx->DrawBuffer->_Status != GL_FRAMEBUFFER_COMPLETE_EXT) { | ||||
|       _mesa_error(ctx, GL_INVALID_FRAMEBUFFER_OPERATION_EXT, | ||||
|                   "glAccum(incomplete framebuffer)"); | ||||
|       return; | ||||
|    } | ||||
|  | ||||
|    if (ctx->RenderMode == GL_RENDER) { | ||||
|       GLint x = ctx->DrawBuffer->_Xmin; | ||||
|       GLint y = ctx->DrawBuffer->_Ymin; | ||||
|       GLint width =  ctx->DrawBuffer->_Xmax - ctx->DrawBuffer->_Xmin; | ||||
|       GLint height = ctx->DrawBuffer->_Ymax - ctx->DrawBuffer->_Ymin; | ||||
|       ctx->Driver.Accum(ctx, op, value, x, y, width, height); | ||||
|    } | ||||
| } | ||||
|  | ||||
|  | ||||
|   | ||||
| @@ -1,8 +1,8 @@ | ||||
| /* | ||||
|  * Mesa 3-D graphics library | ||||
|  * Version:  6.3 | ||||
|  * Version:  6.5 | ||||
|  * | ||||
|  * Copyright (C) 1999-2004  Brian Paul   All Rights Reserved. | ||||
|  * Copyright (C) 1999-2005  Brian Paul   All Rights Reserved. | ||||
|  * | ||||
|  * Permission is hereby granted, free of charge, to any person obtaining a | ||||
|  * copy of this software and associated documentation files (the "Software"), | ||||
| @@ -102,13 +102,17 @@ set_component_sizes( struct gl_color_table *table ) | ||||
|  | ||||
|    switch (table->Type) { | ||||
|    case GL_UNSIGNED_BYTE: | ||||
|       sz = sizeof(GLubyte); | ||||
|       sz = 8 * sizeof(GLubyte); | ||||
|       break; | ||||
|    case GL_UNSIGNED_SHORT: | ||||
|       sz = sizeof(GLushort); | ||||
|       sz = 8 * sizeof(GLushort); | ||||
|       break; | ||||
|    case GL_FLOAT: | ||||
|       sz = sizeof(GLfloat); | ||||
|       /* Don't actually return 32 here since that causes the conformance | ||||
|        * tests to blow up.  Conform thinks the component is an integer, | ||||
|        * not a float. | ||||
|        */ | ||||
|       sz = 8;  /** 8 * sizeof(GLfloat); **/ | ||||
|       break; | ||||
|    default: | ||||
|       _mesa_problem(NULL, "bad color table type in set_component_sizes 0x%x", table->Type); | ||||
| @@ -363,6 +367,7 @@ _mesa_ColorTable( GLenum target, GLenum internalFormat, | ||||
|          break; | ||||
|       case GL_SHARED_TEXTURE_PALETTE_EXT: | ||||
|          table = &ctx->Texture.Palette; | ||||
| 	 tableType = GL_FLOAT; | ||||
|          break; | ||||
|       case GL_COLOR_TABLE: | ||||
|          table = &ctx->ColorTable; | ||||
| @@ -402,6 +407,7 @@ _mesa_ColorTable( GLenum target, GLenum internalFormat, | ||||
|             return; | ||||
|          } | ||||
|          table = &(texUnit->ProxyColorTable); | ||||
| 	 tableType = GL_FLOAT; | ||||
|          proxy = GL_TRUE; | ||||
|          break; | ||||
|       case GL_POST_CONVOLUTION_COLOR_TABLE: | ||||
| @@ -418,6 +424,7 @@ _mesa_ColorTable( GLenum target, GLenum internalFormat, | ||||
|          break; | ||||
|       case GL_PROXY_POST_CONVOLUTION_COLOR_TABLE: | ||||
|          table = &ctx->ProxyPostConvolutionColorTable; | ||||
| 	 tableType = GL_FLOAT; | ||||
|          proxy = GL_TRUE; | ||||
|          break; | ||||
|       case GL_POST_COLOR_MATRIX_COLOR_TABLE: | ||||
| @@ -434,6 +441,7 @@ _mesa_ColorTable( GLenum target, GLenum internalFormat, | ||||
|          break; | ||||
|       case GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE: | ||||
|          table = &ctx->ProxyPostColorMatrixColorTable; | ||||
| 	 tableType = GL_FLOAT; | ||||
|          proxy = GL_TRUE; | ||||
|          break; | ||||
|       default: | ||||
| @@ -483,6 +491,7 @@ _mesa_ColorTable( GLenum target, GLenum internalFormat, | ||||
|    table->Size = width; | ||||
|    table->IntFormat = internalFormat; | ||||
|    table->Format = (GLenum) baseFormat; | ||||
|    table->Type = (tableType == GL_FLOAT) ? GL_FLOAT : CHAN_TYPE; | ||||
|  | ||||
|    comps = _mesa_components_in_format(table->Format); | ||||
|    assert(comps > 0);  /* error should have been caught sooner */ | ||||
| @@ -495,12 +504,10 @@ _mesa_ColorTable( GLenum target, GLenum internalFormat, | ||||
|       } | ||||
|  | ||||
|       if (width > 0) { | ||||
|          if (tableType == GL_FLOAT) { | ||||
| 	    table->Type = GL_FLOAT; | ||||
|          if (table->Type == GL_FLOAT) { | ||||
| 	    table->Table = MALLOC(comps * width * sizeof(GLfloat)); | ||||
| 	 } | ||||
| 	 else { | ||||
| 	    table->Type = CHAN_TYPE; | ||||
|             table->Table = MALLOC(comps * width * sizeof(GLchan)); | ||||
| 	 } | ||||
|  | ||||
|   | ||||
| @@ -6,7 +6,7 @@ | ||||
|  | ||||
| /* | ||||
|  * Mesa 3-D graphics library | ||||
|  * Version:  6.3 | ||||
|  * Version:  6.4 | ||||
|  * | ||||
|  * Copyright (C) 1999-2005  Brian Paul   All Rights Reserved. | ||||
|  * | ||||
| @@ -121,6 +121,7 @@ | ||||
| #include "texstate.h" | ||||
| #include "mtypes.h" | ||||
| #include "varray.h" | ||||
| #include "version.h" | ||||
| #include "vtxfmt.h" | ||||
| #if _HAVE_FULL_GL | ||||
| #include "math/m_translate.h" | ||||
| @@ -652,7 +653,8 @@ one_time_init( GLcontext *ctx ) | ||||
|       } | ||||
|  | ||||
| #if defined(DEBUG) && defined(__DATE__) && defined(__TIME__) | ||||
|       _mesa_debug(ctx, "Mesa DEBUG build %s %s\n", __DATE__, __TIME__); | ||||
|       _mesa_debug(ctx, "Mesa %s DEBUG build %s %s\n", | ||||
|                   MESA_VERSION_STRING, __DATE__, __TIME__); | ||||
| #endif | ||||
|  | ||||
|       alreadyCalled = GL_TRUE; | ||||
|   | ||||
| @@ -38,6 +38,7 @@ SOURCES =accum.c \ | ||||
| 	enable.c \ | ||||
| 	enums.c \ | ||||
| 	eval.c \ | ||||
| 	execmem.c \ | ||||
| 	extensions.c \ | ||||
| 	fbobject.c \ | ||||
| 	feedback.c \ | ||||
| @@ -53,6 +54,7 @@ SOURCES =accum.c \ | ||||
| 	light.c \ | ||||
| 	lines.c \ | ||||
| 	matrix.c \ | ||||
| 	mm.c \ | ||||
| 	occlude.c \ | ||||
| 	pixel.c \ | ||||
| 	points.c \ | ||||
| @@ -95,6 +97,7 @@ drawpix.obj,\ | ||||
| enable.obj,\ | ||||
| enums.obj,\ | ||||
| eval.obj,\ | ||||
| execmem.obj,\ | ||||
| extensions.obj,\ | ||||
| fbobject.obj,\ | ||||
| feedback.obj,\ | ||||
| @@ -110,6 +113,7 @@ imports.obj,\ | ||||
| light.obj,\ | ||||
| lines.obj,\ | ||||
| matrix.obj,\ | ||||
| mm.obj,\ | ||||
| occlude.obj,\ | ||||
| pixel.obj,\ | ||||
| points.obj,\ | ||||
| @@ -166,6 +170,7 @@ drawpix.obj : drawpix.c | ||||
| enable.obj : enable.c | ||||
| enums.obj : enums.c | ||||
| eval.obj : eval.c | ||||
| execmem.obj : execmem.c | ||||
| extensions.obj : extensions.c | ||||
| fbobject.obj : fbobject.c | ||||
| feedback.obj : feedback.c | ||||
| @@ -181,6 +186,7 @@ imports.obj : imports.c vsnprintf.c | ||||
| light.obj : light.c | ||||
| lines.obj : lines.c | ||||
| matrix.obj : matrix.c | ||||
| mm.obj: mm.c | ||||
| occlude.obj : occlude.c | ||||
| pixel.obj : pixel.c | ||||
| points.obj : points.c | ||||
|   | ||||
| @@ -1,8 +1,8 @@ | ||||
| /* | ||||
|  * Mesa 3-D graphics library | ||||
|  * Version:  6.1 | ||||
|  * Version:  6.4 | ||||
|  * | ||||
|  * Copyright (C) 1999-2004  Brian Paul   All Rights Reserved. | ||||
|  * Copyright (C) 1999-2005  Brian Paul   All Rights Reserved. | ||||
|  * | ||||
|  * Permission is hereby granted, free of charge, to any person obtaining a | ||||
|  * copy of this software and associated documentation files (the "Software"), | ||||
| @@ -56,40 +56,41 @@ _mesa_DrawPixels( GLsizei width, GLsizei height, | ||||
|       return; | ||||
|    } | ||||
|  | ||||
|    if (ctx->RenderMode==GL_RENDER) { | ||||
|       GLint x, y; | ||||
|       if (!ctx->Current.RasterPosValid) { | ||||
| 	 return; | ||||
|       } | ||||
|    if (ctx->NewState) { | ||||
|       _mesa_update_state(ctx); | ||||
|    } | ||||
|  | ||||
|       if (ctx->NewState) { | ||||
|          _mesa_update_state(ctx); | ||||
|       } | ||||
|    if (ctx->DrawBuffer->_Status != GL_FRAMEBUFFER_COMPLETE_EXT) { | ||||
|       _mesa_error(ctx, GL_INVALID_FRAMEBUFFER_OPERATION_EXT, | ||||
|                   "glDrawPixels(incomplete framebuffer)" ); | ||||
|       return; | ||||
|    } | ||||
|  | ||||
|    if (!ctx->Current.RasterPosValid) { | ||||
|       return; | ||||
|    } | ||||
|  | ||||
|    if (ctx->RenderMode == GL_RENDER) { | ||||
|       /* Round, to satisfy conformance tests (matches SGI's OpenGL) */ | ||||
|       x = IROUND(ctx->Current.RasterPos[0]); | ||||
|       y = IROUND(ctx->Current.RasterPos[1]); | ||||
|  | ||||
|       GLint x = IROUND(ctx->Current.RasterPos[0]); | ||||
|       GLint y = IROUND(ctx->Current.RasterPos[1]); | ||||
|       ctx->OcclusionResult = GL_TRUE; | ||||
|       ctx->Driver.DrawPixels(ctx, x, y, width, height, format, type, | ||||
| 			     &ctx->Unpack, pixels); | ||||
|    } | ||||
|    else if (ctx->RenderMode==GL_FEEDBACK) { | ||||
|    else if (ctx->RenderMode == GL_FEEDBACK) { | ||||
|       /* Feedback the current raster pos info */ | ||||
|       if (ctx->Current.RasterPosValid) { | ||||
| 	 FLUSH_CURRENT( ctx, 0 ); | ||||
|          FEEDBACK_TOKEN( ctx, (GLfloat) (GLint) GL_DRAW_PIXEL_TOKEN ); | ||||
|          _mesa_feedback_vertex( ctx, | ||||
| 				ctx->Current.RasterPos, | ||||
| 				ctx->Current.RasterColor, | ||||
| 				ctx->Current.RasterIndex, | ||||
| 				ctx->Current.RasterTexCoords[0] ); | ||||
|       } | ||||
|       FLUSH_CURRENT( ctx, 0 ); | ||||
|       FEEDBACK_TOKEN( ctx, (GLfloat) (GLint) GL_DRAW_PIXEL_TOKEN ); | ||||
|       _mesa_feedback_vertex( ctx, | ||||
|                              ctx->Current.RasterPos, | ||||
|                              ctx->Current.RasterColor, | ||||
|                              ctx->Current.RasterIndex, | ||||
|                              ctx->Current.RasterTexCoords[0] ); | ||||
|    } | ||||
|    else if (ctx->RenderMode==GL_SELECT) { | ||||
|       if (ctx->Current.RasterPosValid) { | ||||
|          _mesa_update_hitflag( ctx, ctx->Current.RasterPos[2] ); | ||||
|       } | ||||
|    else { | ||||
|       ASSERT(ctx->RenderMode == GL_SELECT); | ||||
|       /* Do nothing.  See OpenGL Spec, Appendix B, Corollary 6. */ | ||||
|    } | ||||
| } | ||||
|  | ||||
| @@ -99,7 +100,6 @@ _mesa_CopyPixels( GLint srcx, GLint srcy, GLsizei width, GLsizei height, | ||||
|                   GLenum type ) | ||||
| { | ||||
|    GET_CURRENT_CONTEXT(ctx); | ||||
|    GLint destx, desty; | ||||
|    ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); | ||||
|  | ||||
|    if (ctx->FragmentProgram.Enabled && !ctx->FragmentProgram._Enabled) { | ||||
| @@ -117,34 +117,37 @@ _mesa_CopyPixels( GLint srcx, GLint srcy, GLsizei width, GLsizei height, | ||||
|       _mesa_update_state(ctx); | ||||
|    } | ||||
|  | ||||
|    if (ctx->RenderMode==GL_RENDER) { | ||||
|       /* Destination of copy: */ | ||||
|       if (!ctx->Current.RasterPosValid) { | ||||
| 	 return; | ||||
|       } | ||||
|    if (ctx->DrawBuffer->_Status != GL_FRAMEBUFFER_COMPLETE_EXT || | ||||
|        ctx->ReadBuffer->_Status != GL_FRAMEBUFFER_COMPLETE_EXT) { | ||||
|       _mesa_error(ctx, GL_INVALID_FRAMEBUFFER_OPERATION_EXT, | ||||
|                   "glCopyPixels(incomplete framebuffer)" ); | ||||
|       return; | ||||
|    } | ||||
|  | ||||
|       /* Round, to satisfy conformance tests (matches SGI's OpenGL) */ | ||||
|       destx = IROUND(ctx->Current.RasterPos[0]); | ||||
|       desty = IROUND(ctx->Current.RasterPos[1]); | ||||
|    if (!ctx->Current.RasterPosValid) { | ||||
|       return; | ||||
|    } | ||||
|  | ||||
|    if (ctx->RenderMode == GL_RENDER) { | ||||
|       /* Round to satisfy conformance tests (matches SGI's OpenGL) */ | ||||
|       GLint destx = IROUND(ctx->Current.RasterPos[0]); | ||||
|       GLint desty = IROUND(ctx->Current.RasterPos[1]); | ||||
|       ctx->OcclusionResult = GL_TRUE; | ||||
|  | ||||
|       ctx->Driver.CopyPixels( ctx, srcx, srcy, width, height, destx, desty, | ||||
| 			      type ); | ||||
|    } | ||||
|    else if (ctx->RenderMode == GL_FEEDBACK) { | ||||
|       if (ctx->Current.RasterPosValid) { | ||||
|          FLUSH_CURRENT( ctx, 0 ); | ||||
|          FEEDBACK_TOKEN( ctx, (GLfloat) (GLint) GL_COPY_PIXEL_TOKEN ); | ||||
|          _mesa_feedback_vertex( ctx,  | ||||
|                                 ctx->Current.RasterPos, | ||||
|                                 ctx->Current.RasterColor, | ||||
|                                 ctx->Current.RasterIndex, | ||||
|                                 ctx->Current.RasterTexCoords[0] ); | ||||
|       } | ||||
|       FLUSH_CURRENT( ctx, 0 ); | ||||
|       FEEDBACK_TOKEN( ctx, (GLfloat) (GLint) GL_COPY_PIXEL_TOKEN ); | ||||
|       _mesa_feedback_vertex( ctx,  | ||||
|                              ctx->Current.RasterPos, | ||||
|                              ctx->Current.RasterColor, | ||||
|                              ctx->Current.RasterIndex, | ||||
|                              ctx->Current.RasterTexCoords[0] ); | ||||
|    } | ||||
|    else if (ctx->RenderMode == GL_SELECT) { | ||||
|       _mesa_update_hitflag( ctx, ctx->Current.RasterPos[2] ); | ||||
|    else { | ||||
|       ASSERT(ctx->RenderMode == GL_SELECT); | ||||
|       /* Do nothing.  See OpenGL Spec, Appendix B, Corollary 6. */ | ||||
|    } | ||||
| } | ||||
|  | ||||
| @@ -157,6 +160,7 @@ _mesa_ReadPixels( GLint x, GLint y, GLsizei width, GLsizei height, | ||||
| 		  GLenum format, GLenum type, GLvoid *pixels ) | ||||
| { | ||||
|    GET_CURRENT_CONTEXT(ctx); | ||||
|    const struct gl_renderbuffer *rb = ctx->ReadBuffer->_ColorReadBuffer; | ||||
|    ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); | ||||
|  | ||||
|    if (width < 0 || height < 0) { | ||||
| @@ -168,6 +172,17 @@ _mesa_ReadPixels( GLint x, GLint y, GLsizei width, GLsizei height, | ||||
|    if (ctx->NewState) | ||||
|       _mesa_update_state(ctx); | ||||
|  | ||||
|    if (ctx->ReadBuffer->_Status != GL_FRAMEBUFFER_COMPLETE_EXT) { | ||||
|       _mesa_error(ctx, GL_INVALID_FRAMEBUFFER_OPERATION_EXT, | ||||
|                   "glReadPixels(incomplete framebuffer)" ); | ||||
|       return; | ||||
|    } | ||||
|  | ||||
|    if (!rb) { | ||||
|       _mesa_error(ctx, GL_INVALID_OPERATION, "glReadPixels(no readbuffer)"); | ||||
|       return; | ||||
|    } | ||||
|  | ||||
|    ctx->Driver.ReadPixels(ctx, x, y, width, height, | ||||
| 			  format, type, &ctx->Pack, pixels); | ||||
| } | ||||
| @@ -193,37 +208,40 @@ _mesa_Bitmap( GLsizei width, GLsizei height, | ||||
|       return; | ||||
|    } | ||||
|  | ||||
|    if (ctx->Current.RasterPosValid == GL_FALSE) { | ||||
|    if (!ctx->Current.RasterPosValid) { | ||||
|       return;    /* do nothing */ | ||||
|    } | ||||
|  | ||||
|    if (ctx->RenderMode==GL_RENDER) { | ||||
|    if (ctx->NewState) { | ||||
|       _mesa_update_state(ctx); | ||||
|    } | ||||
|  | ||||
|    if (ctx->DrawBuffer->_Status != GL_FRAMEBUFFER_COMPLETE_EXT) { | ||||
|       _mesa_error(ctx, GL_INVALID_FRAMEBUFFER_OPERATION_EXT, | ||||
|                   "glBitmap(incomplete framebuffer)"); | ||||
|       return; | ||||
|    } | ||||
|  | ||||
|    if (ctx->RenderMode == GL_RENDER) { | ||||
|       /* Truncate, to satisfy conformance tests (matches SGI's OpenGL). */ | ||||
|       GLint x = IFLOOR(ctx->Current.RasterPos[0] - xorig); | ||||
|       GLint y = IFLOOR(ctx->Current.RasterPos[1] - yorig); | ||||
|  | ||||
|       if (ctx->NewState) { | ||||
|          _mesa_update_state(ctx); | ||||
|       } | ||||
|  | ||||
|       ctx->OcclusionResult = GL_TRUE; | ||||
|       ctx->Driver.Bitmap( ctx, x, y, width, height, &ctx->Unpack, bitmap ); | ||||
|    } | ||||
| #if _HAVE_FULL_GL | ||||
|    else if (ctx->RenderMode==GL_FEEDBACK) { | ||||
|       if (ctx->Current.RasterPosValid) { | ||||
| 	 FLUSH_CURRENT(ctx, 0); | ||||
|          FEEDBACK_TOKEN( ctx, (GLfloat) (GLint) GL_BITMAP_TOKEN ); | ||||
|          _mesa_feedback_vertex( ctx, | ||||
| 				ctx->Current.RasterPos, | ||||
| 				ctx->Current.RasterColor, | ||||
| 				ctx->Current.RasterIndex,  | ||||
| 				ctx->Current.RasterTexCoords[0] ); | ||||
|       } | ||||
|    else if (ctx->RenderMode == GL_FEEDBACK) { | ||||
|       FLUSH_CURRENT(ctx, 0); | ||||
|       FEEDBACK_TOKEN( ctx, (GLfloat) (GLint) GL_BITMAP_TOKEN ); | ||||
|       _mesa_feedback_vertex( ctx, | ||||
|                              ctx->Current.RasterPos, | ||||
|                              ctx->Current.RasterColor, | ||||
|                              ctx->Current.RasterIndex,  | ||||
|                              ctx->Current.RasterTexCoords[0] ); | ||||
|    } | ||||
|    else { | ||||
|       ASSERT(ctx->RenderMode == GL_SELECT); | ||||
|       /* Bitmaps don't generate selection hits.  See appendix B of 1.1 spec. */ | ||||
|       /* Do nothing.  See OpenGL Spec, Appendix B, Corollary 6. */ | ||||
|    } | ||||
| #endif | ||||
|  | ||||
| @@ -257,41 +275,42 @@ _mesa_DrawDepthPixelsMESA( GLsizei width, GLsizei height, | ||||
|       return; | ||||
|    } | ||||
|  | ||||
|    if (ctx->RenderMode==GL_RENDER) { | ||||
|       GLint x, y; | ||||
|       if (!colors || !depths || !ctx->Current.RasterPosValid) { | ||||
| 	 return; | ||||
|       } | ||||
|    if (!ctx->Current.RasterPosValid) { | ||||
|       return; | ||||
|    } | ||||
|  | ||||
|       if (ctx->NewState) { | ||||
|          _mesa_update_state(ctx); | ||||
|       } | ||||
|    if (ctx->NewState) { | ||||
|       _mesa_update_state(ctx); | ||||
|    } | ||||
|  | ||||
|    if (ctx->DrawBuffer->_Status != GL_FRAMEBUFFER_COMPLETE_EXT) { | ||||
|       _mesa_error(ctx, GL_INVALID_FRAMEBUFFER_OPERATION_EXT, | ||||
|                   "glDrawDepthPixelsMESA(incomplete framebuffer)"); | ||||
|       return; | ||||
|    } | ||||
|  | ||||
|    if (ctx->RenderMode == GL_RENDER) { | ||||
|       /* Round, to satisfy conformance tests (matches SGI's OpenGL) */ | ||||
|       x = IROUND(ctx->Current.RasterPos[0]); | ||||
|       y = IROUND(ctx->Current.RasterPos[1]); | ||||
|  | ||||
|       GLint x = IROUND(ctx->Current.RasterPos[0]); | ||||
|       GLint y = IROUND(ctx->Current.RasterPos[1]); | ||||
|       ctx->OcclusionResult = GL_TRUE; | ||||
|       ctx->Driver.DrawDepthPixelsMESA(ctx, x, y, width, height, | ||||
|                                       colorFormat, colorType, colors, | ||||
|                                       depthType, depths, &ctx->Unpack); | ||||
|    } | ||||
|    else if (ctx->RenderMode==GL_FEEDBACK) { | ||||
|    else if (ctx->RenderMode == GL_FEEDBACK) { | ||||
|       /* Feedback the current raster pos info */ | ||||
|       if (ctx->Current.RasterPosValid) { | ||||
| 	 FLUSH_CURRENT( ctx, 0 ); | ||||
|          FEEDBACK_TOKEN( ctx, (GLfloat) (GLint) GL_DRAW_PIXEL_TOKEN ); | ||||
|          _mesa_feedback_vertex( ctx, | ||||
| 				ctx->Current.RasterPos, | ||||
| 				ctx->Current.RasterColor, | ||||
| 				ctx->Current.RasterIndex, | ||||
| 				ctx->Current.RasterTexCoords[0] ); | ||||
|       } | ||||
|       FLUSH_CURRENT( ctx, 0 ); | ||||
|       FEEDBACK_TOKEN( ctx, (GLfloat) (GLint) GL_DRAW_PIXEL_TOKEN ); | ||||
|       _mesa_feedback_vertex( ctx, | ||||
|                              ctx->Current.RasterPos, | ||||
|                              ctx->Current.RasterColor, | ||||
|                              ctx->Current.RasterIndex, | ||||
|                              ctx->Current.RasterTexCoords[0] ); | ||||
|    } | ||||
|    else if (ctx->RenderMode==GL_SELECT) { | ||||
|       if (ctx->Current.RasterPosValid) { | ||||
|          _mesa_update_hitflag( ctx, ctx->Current.RasterPos[2] ); | ||||
|       } | ||||
|    else { | ||||
|       ASSERT(ctx->RenderMode == GL_SELECT); | ||||
|       /* Do nothing.  See OpenGL Spec, Appendix B, Corollary 6. */ | ||||
|    } | ||||
| } | ||||
|  | ||||
|   | ||||
| @@ -3267,6 +3267,7 @@ static const enum_elt all_enums[1612] = | ||||
|  | ||||
| static const unsigned reduced_enums[1232] = | ||||
| { | ||||
|         26, /* GL_ALL_CLIENT_ATTRIB_BITS */ | ||||
|        389, /* GL_FALSE */ | ||||
|        561, /* GL_LINES */ | ||||
|        563, /* GL_LINE_LOOP */ | ||||
| @@ -4498,7 +4499,6 @@ static const unsigned reduced_enums[1232] = | ||||
|       1212, /* GL_SCISSOR_BIT */ | ||||
|         25, /* GL_ALL_ATTRIB_BITS */ | ||||
|        845, /* GL_MULTISAMPLE_BIT */ | ||||
|         26, /* GL_ALL_CLIENT_ATTRIB_BITS */ | ||||
| }; | ||||
|  | ||||
| #define Elements(x) sizeof(x)/sizeof(*x) | ||||
|   | ||||
							
								
								
									
										132
									
								
								src/mesa/main/execmem.c
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										132
									
								
								src/mesa/main/execmem.c
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,132 @@ | ||||
| /* | ||||
|  * Mesa 3-D graphics library | ||||
|  * Version:  6.5 | ||||
|  * | ||||
|  * Copyright (C) 1999-2005  Brian Paul   All Rights Reserved. | ||||
|  * | ||||
|  * Permission is hereby granted, free of charge, to any person obtaining a | ||||
|  * copy of this software and associated documentation files (the "Software"), | ||||
|  * 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. | ||||
|  */ | ||||
|  | ||||
|  | ||||
| /** | ||||
|  * \file exemem.c | ||||
|  * Functions for allocating executable memory. | ||||
|  * | ||||
|  * \author Keith Whitwell | ||||
|  */ | ||||
|  | ||||
|  | ||||
| #include "imports.h" | ||||
| #include "glthread.h" | ||||
|  | ||||
|  | ||||
|  | ||||
| #if defined(__linux__) && !defined(XFree86Server) | ||||
|  | ||||
| /* | ||||
|  * Allocate a large block of memory which can hold code then dole it out | ||||
|  * in pieces by means of the generic memory manager code. | ||||
| */ | ||||
|  | ||||
|  | ||||
| #include <unistd.h> | ||||
| #include <sys/mman.h> | ||||
| #include "mm.h" | ||||
|  | ||||
| #define EXEC_HEAP_SIZE (128*1024) | ||||
|  | ||||
| _glthread_DECLARE_STATIC_MUTEX(exec_mutex); | ||||
|  | ||||
| static memHeap_t *exec_heap = NULL; | ||||
| static unsigned char *exec_mem = NULL; | ||||
|  | ||||
|  | ||||
| static void | ||||
| init_heap(void) | ||||
| { | ||||
|    if (!exec_heap) | ||||
|       exec_heap = mmInit( 0, EXEC_HEAP_SIZE ); | ||||
|     | ||||
|    if (!exec_mem) | ||||
|       exec_mem = (unsigned char *) mmap(0, EXEC_HEAP_SIZE,  | ||||
| 					PROT_EXEC | PROT_READ | PROT_WRITE,  | ||||
| 					MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); | ||||
| } | ||||
|  | ||||
|  | ||||
| void * | ||||
| _mesa_exec_malloc(GLuint size) | ||||
| { | ||||
|    PMemBlock block = NULL; | ||||
|    void *addr = NULL; | ||||
|  | ||||
|    _glthread_LOCK_MUTEX(exec_mutex); | ||||
|  | ||||
|    init_heap(); | ||||
|  | ||||
|    if (exec_heap) { | ||||
|       size = (size + 31) & ~31; | ||||
|       block = mmAllocMem( exec_heap, size, 32, 0 ); | ||||
|    } | ||||
|  | ||||
|    if (block) | ||||
|       addr = exec_mem + block->ofs; | ||||
|  | ||||
|    _glthread_UNLOCK_MUTEX(exec_mutex); | ||||
|     | ||||
|    return addr; | ||||
| } | ||||
|  | ||||
|   | ||||
| void  | ||||
| _mesa_exec_free(void *addr) | ||||
| { | ||||
|    _glthread_LOCK_MUTEX(exec_mutex); | ||||
|  | ||||
|    if (exec_heap) { | ||||
|       PMemBlock block = mmFindBlock(exec_heap, (unsigned char *)addr - exec_mem); | ||||
|     | ||||
|       if (block) | ||||
| 	 mmFreeMem(block); | ||||
|    } | ||||
|  | ||||
|    _glthread_UNLOCK_MUTEX(exec_mutex); | ||||
| } | ||||
|  | ||||
|  | ||||
| #else | ||||
|  | ||||
| /* | ||||
|  * Just use regular memory. | ||||
|  */ | ||||
|  | ||||
| void * | ||||
| _mesa_exec_malloc(GLuint size) | ||||
| { | ||||
|    return _mesa_malloc( size ); | ||||
| } | ||||
|  | ||||
|   | ||||
| void  | ||||
| _mesa_exec_free(void *addr) | ||||
| { | ||||
|    _mesa_free(addr); | ||||
| } | ||||
|  | ||||
|  | ||||
| #endif | ||||
| @@ -484,10 +484,12 @@ _mesa_IsRenderbufferEXT(GLuint renderbuffer) | ||||
| { | ||||
|    GET_CURRENT_CONTEXT(ctx); | ||||
|    ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, GL_FALSE); | ||||
|    if (renderbuffer && lookup_renderbuffer(ctx, renderbuffer)) | ||||
|       return GL_TRUE; | ||||
|    else | ||||
|       return GL_FALSE; | ||||
|    if (renderbuffer) { | ||||
|       struct gl_renderbuffer *rb = lookup_renderbuffer(ctx, renderbuffer); | ||||
|       if (rb != NULL && rb != &DummyRenderbuffer) | ||||
|          return GL_TRUE; | ||||
|    } | ||||
|    return GL_FALSE; | ||||
| } | ||||
|  | ||||
|  | ||||
| @@ -498,7 +500,6 @@ _mesa_BindRenderbufferEXT(GLenum target, GLuint renderbuffer) | ||||
|    GET_CURRENT_CONTEXT(ctx); | ||||
|  | ||||
|    ASSERT_OUTSIDE_BEGIN_END(ctx); | ||||
|    FLUSH_VERTICES(ctx, _NEW_BUFFERS); | ||||
|  | ||||
|    if (target != GL_RENDERBUFFER_EXT) { | ||||
|          _mesa_error(ctx, GL_INVALID_ENUM, | ||||
| @@ -506,6 +507,8 @@ _mesa_BindRenderbufferEXT(GLenum target, GLuint renderbuffer) | ||||
|       return; | ||||
|    } | ||||
|  | ||||
|    FLUSH_VERTICES(ctx, _NEW_BUFFERS); | ||||
|  | ||||
|    if (renderbuffer) { | ||||
|       newRb = lookup_renderbuffer(ctx, renderbuffer); | ||||
|       if (newRb == &DummyRenderbuffer) { | ||||
| @@ -549,12 +552,20 @@ _mesa_DeleteRenderbuffersEXT(GLsizei n, const GLuint *renderbuffers) | ||||
|    GET_CURRENT_CONTEXT(ctx); | ||||
|  | ||||
|    ASSERT_OUTSIDE_BEGIN_END(ctx); | ||||
|    FLUSH_VERTICES(ctx, _NEW_BUFFERS); | ||||
|  | ||||
|    for (i = 0; i < n; i++) { | ||||
|       if (renderbuffers[i] > 0) { | ||||
| 	 struct gl_renderbuffer *rb; | ||||
| 	 rb = lookup_renderbuffer(ctx, renderbuffers[i]); | ||||
| 	 if (rb) { | ||||
|             /* check if deleting currently bound renderbuffer object */ | ||||
|             if (rb == ctx->CurrentRenderbuffer) { | ||||
|                /* bind default */ | ||||
|                ASSERT(rb->RefCount >= 2); | ||||
|                _mesa_BindRenderbufferEXT(GL_RENDERBUFFER_EXT, 0); | ||||
|             } | ||||
|  | ||||
| 	    /* remove from hash table immediately, to free the ID */ | ||||
| 	    _mesa_HashRemove(ctx->Shared->RenderBuffers, renderbuffers[i]); | ||||
|  | ||||
| @@ -658,7 +669,6 @@ _mesa_RenderbufferStorageEXT(GLenum target, GLenum internalFormat, | ||||
|    GET_CURRENT_CONTEXT(ctx); | ||||
|  | ||||
|    ASSERT_OUTSIDE_BEGIN_END(ctx); | ||||
|    FLUSH_VERTICES(ctx, _NEW_BUFFERS); | ||||
|  | ||||
|    if (target != GL_RENDERBUFFER_EXT) { | ||||
|       _mesa_error(ctx, GL_INVALID_ENUM, "glRenderbufferStorageEXT(target)"); | ||||
| @@ -689,6 +699,8 @@ _mesa_RenderbufferStorageEXT(GLenum target, GLenum internalFormat, | ||||
|       return; | ||||
|    } | ||||
|  | ||||
|    FLUSH_VERTICES(ctx, _NEW_BUFFERS); | ||||
|  | ||||
|    /* Now allocate the storage */ | ||||
|    ASSERT(rb->AllocStorage); | ||||
|    if (rb->AllocStorage(ctx, rb, internalFormat, width, height)) { | ||||
| @@ -734,6 +746,8 @@ _mesa_GetRenderbufferParameterivEXT(GLenum target, GLenum pname, GLint *params) | ||||
|       return; | ||||
|    } | ||||
|  | ||||
|    FLUSH_VERTICES(ctx, _NEW_BUFFERS); | ||||
|  | ||||
|    switch (pname) { | ||||
|    case GL_RENDERBUFFER_WIDTH_EXT: | ||||
|       *params = ctx->CurrentRenderbuffer->Width; | ||||
| @@ -810,10 +824,12 @@ _mesa_IsFramebufferEXT(GLuint framebuffer) | ||||
| { | ||||
|    GET_CURRENT_CONTEXT(ctx); | ||||
|    ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, GL_FALSE); | ||||
|    if (framebuffer && lookup_framebuffer(ctx, framebuffer)) | ||||
|       return GL_TRUE; | ||||
|    else | ||||
|       return GL_FALSE; | ||||
|    if (framebuffer) { | ||||
|       struct gl_framebuffer *rb = lookup_framebuffer(ctx, framebuffer); | ||||
|       if (rb != NULL && rb != &DummyFramebuffer) | ||||
|          return GL_TRUE; | ||||
|    } | ||||
|    return GL_FALSE; | ||||
| } | ||||
|  | ||||
|  | ||||
| @@ -824,7 +840,6 @@ _mesa_BindFramebufferEXT(GLenum target, GLuint framebuffer) | ||||
|    GET_CURRENT_CONTEXT(ctx); | ||||
|  | ||||
|    ASSERT_OUTSIDE_BEGIN_END(ctx); | ||||
|    FLUSH_VERTICES(ctx, _NEW_BUFFERS); | ||||
|  | ||||
|    if (target != GL_FRAMEBUFFER_EXT) { | ||||
|          _mesa_error(ctx, GL_INVALID_ENUM, | ||||
| @@ -832,6 +847,8 @@ _mesa_BindFramebufferEXT(GLenum target, GLuint framebuffer) | ||||
|       return; | ||||
|    } | ||||
|  | ||||
|    FLUSH_VERTICES(ctx, _NEW_BUFFERS); | ||||
|  | ||||
|    if (framebuffer) { | ||||
|       /* Binding a user-created framebuffer object */ | ||||
|       newFb = lookup_framebuffer(ctx, framebuffer); | ||||
| @@ -860,7 +877,7 @@ _mesa_BindFramebufferEXT(GLenum target, GLuint framebuffer) | ||||
|    } | ||||
|  | ||||
|    oldFb = ctx->DrawBuffer; | ||||
|    if (oldFb) { /* AND oldFb->Name != 0 */ | ||||
|    if (oldFb && oldFb->Name != 0) { | ||||
|       oldFb->RefCount--; | ||||
|       if (oldFb->RefCount == 0) { | ||||
|          oldFb->Delete(oldFb); | ||||
| @@ -882,6 +899,7 @@ _mesa_DeleteFramebuffersEXT(GLsizei n, const GLuint *framebuffers) | ||||
|    GET_CURRENT_CONTEXT(ctx); | ||||
|  | ||||
|    ASSERT_OUTSIDE_BEGIN_END(ctx); | ||||
|    FLUSH_VERTICES(ctx, _NEW_BUFFERS); | ||||
|  | ||||
|    for (i = 0; i < n; i++) { | ||||
|       if (framebuffers[i] > 0) { | ||||
| @@ -889,6 +907,14 @@ _mesa_DeleteFramebuffersEXT(GLsizei n, const GLuint *framebuffers) | ||||
| 	 fb = lookup_framebuffer(ctx, framebuffers[i]); | ||||
| 	 if (fb) { | ||||
|             ASSERT(fb == &DummyFramebuffer || fb->Name == framebuffers[i]); | ||||
|  | ||||
|             /* check if deleting currently bound framebuffer object */ | ||||
|             if (fb == ctx->DrawBuffer) { | ||||
|                /* bind default */ | ||||
|                ASSERT(fb->RefCount >= 2); | ||||
|                _mesa_BindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0); | ||||
|             } | ||||
|  | ||||
| 	    /* remove from hash table immediately, to free the ID */ | ||||
| 	    _mesa_HashRemove(ctx->Shared->FrameBuffers, framebuffers[i]); | ||||
|  | ||||
| @@ -955,6 +981,8 @@ _mesa_CheckFramebufferStatusEXT(GLenum target) | ||||
|       return GL_FRAMEBUFFER_COMPLETE_EXT; | ||||
|    } | ||||
|  | ||||
|    FLUSH_VERTICES(ctx, _NEW_BUFFERS); | ||||
|  | ||||
|    _mesa_test_framebuffer_completeness(ctx, ctx->DrawBuffer); | ||||
|    return ctx->DrawBuffer->_Status; | ||||
| } | ||||
| @@ -1017,7 +1045,6 @@ _mesa_FramebufferTexture1DEXT(GLenum target, GLenum attachment, | ||||
|    GET_CURRENT_CONTEXT(ctx); | ||||
|  | ||||
|    ASSERT_OUTSIDE_BEGIN_END(ctx); | ||||
|    FLUSH_VERTICES(ctx, _NEW_BUFFERS); /* XXX check */ | ||||
|  | ||||
|    if (error_check_framebuffer_texture(ctx, 1, target, attachment, | ||||
| 				       textarget, texture, level)) | ||||
| @@ -1032,6 +1059,8 @@ _mesa_FramebufferTexture1DEXT(GLenum target, GLenum attachment, | ||||
|       return; | ||||
|    } | ||||
|  | ||||
|    FLUSH_VERTICES(ctx, _NEW_BUFFERS); | ||||
|  | ||||
|    if (texture) { | ||||
|       texObj = (struct gl_texture_object *) | ||||
| 	 _mesa_HashLookup(ctx->Shared->TexObjects, texture); | ||||
| @@ -1063,7 +1092,6 @@ _mesa_FramebufferTexture2DEXT(GLenum target, GLenum attachment, | ||||
|    GET_CURRENT_CONTEXT(ctx); | ||||
|  | ||||
|    ASSERT_OUTSIDE_BEGIN_END(ctx); | ||||
|    FLUSH_VERTICES(ctx, _NEW_BUFFERS); /* XXX check */ | ||||
|  | ||||
|    if (error_check_framebuffer_texture(ctx, 2, target, attachment, | ||||
| 				       textarget, texture, level)) | ||||
| @@ -1080,6 +1108,8 @@ _mesa_FramebufferTexture2DEXT(GLenum target, GLenum attachment, | ||||
|       return; | ||||
|    } | ||||
|  | ||||
|    FLUSH_VERTICES(ctx, _NEW_BUFFERS); | ||||
|  | ||||
|    if (texture) { | ||||
|       texObj = (struct gl_texture_object *) | ||||
| 	 _mesa_HashLookup(ctx->Shared->TexObjects, texture); | ||||
| @@ -1116,7 +1146,6 @@ _mesa_FramebufferTexture3DEXT(GLenum target, GLenum attachment, | ||||
|    GET_CURRENT_CONTEXT(ctx); | ||||
|  | ||||
|    ASSERT_OUTSIDE_BEGIN_END(ctx); | ||||
|    FLUSH_VERTICES(ctx, _NEW_BUFFERS); /* XXX check */ | ||||
|  | ||||
|    if (error_check_framebuffer_texture(ctx, 3, target, attachment, | ||||
| 				       textarget, texture, level)) | ||||
| @@ -1131,6 +1160,8 @@ _mesa_FramebufferTexture3DEXT(GLenum target, GLenum attachment, | ||||
|       return; | ||||
|    } | ||||
|  | ||||
|    FLUSH_VERTICES(ctx, _NEW_BUFFERS); | ||||
|  | ||||
|    if (texture) { | ||||
|       const GLint maxSize = 1 << (ctx->Const.Max3DTextureLevels - 1); | ||||
|       texObj = (struct gl_texture_object *) | ||||
| @@ -1170,7 +1201,6 @@ _mesa_FramebufferRenderbufferEXT(GLenum target, GLenum attachment, | ||||
|    GET_CURRENT_CONTEXT(ctx); | ||||
|  | ||||
|    ASSERT_OUTSIDE_BEGIN_END(ctx); | ||||
|    FLUSH_VERTICES(ctx, _NEW_BUFFERS); | ||||
|  | ||||
|    if (target != GL_FRAMEBUFFER_EXT) { | ||||
|       _mesa_error(ctx, GL_INVALID_ENUM, | ||||
| @@ -1209,10 +1239,10 @@ _mesa_FramebufferRenderbufferEXT(GLenum target, GLenum attachment, | ||||
|       rb = NULL; | ||||
|    } | ||||
|  | ||||
|    FLUSH_VERTICES(ctx, _NEW_BUFFERS); | ||||
|  | ||||
|    assert(ctx->Driver.FramebufferRenderbuffer); | ||||
|    ctx->Driver.FramebufferRenderbuffer(ctx, att, rb); | ||||
|  | ||||
|    _mesa_update_framebuffer_visual(ctx->DrawBuffer); | ||||
| } | ||||
|  | ||||
|  | ||||
| @@ -1244,6 +1274,8 @@ _mesa_GetFramebufferAttachmentParameterivEXT(GLenum target, GLenum attachment, | ||||
|       return; | ||||
|    } | ||||
|  | ||||
|    FLUSH_VERTICES(ctx, _NEW_BUFFERS); | ||||
|  | ||||
|    switch (pname) { | ||||
|    case GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT: | ||||
|       *params = att->Type; | ||||
| @@ -1303,6 +1335,7 @@ _mesa_GenerateMipmapEXT(GLenum target) | ||||
|    GET_CURRENT_CONTEXT(ctx); | ||||
|  | ||||
|    ASSERT_OUTSIDE_BEGIN_END(ctx); | ||||
|    FLUSH_VERTICES(ctx, _NEW_BUFFERS); | ||||
|  | ||||
|    switch (target) { | ||||
|    case GL_TEXTURE_1D: | ||||
|   | ||||
| @@ -1,6 +1,6 @@ | ||||
| /* | ||||
|  * Mesa 3-D graphics library | ||||
|  * Version:  6.3 | ||||
|  * Version:  6.4 | ||||
|  * | ||||
|  * Copyright (C) 1999-2005  Brian Paul   All Rights Reserved. | ||||
|  * | ||||
| @@ -144,6 +144,7 @@ _mesa_initialize_framebuffer(struct gl_framebuffer *fb, const GLvisual *visual) | ||||
|    } | ||||
|  | ||||
|    fb->Delete = _mesa_destroy_framebuffer; | ||||
|    fb->_Status = GL_FRAMEBUFFER_COMPLETE_EXT; | ||||
|  | ||||
|    compute_depth_max(fb); | ||||
| } | ||||
| @@ -306,6 +307,9 @@ _mesa_resize_framebuffer(GLcontext *ctx, struct gl_framebuffer *fb, | ||||
|  | ||||
|    fb->Width = width; | ||||
|    fb->Height = height; | ||||
|  | ||||
|    /* to update scissor / window bounds */ | ||||
|    ctx->NewState |= _NEW_BUFFERS; | ||||
| } | ||||
|  | ||||
|  | ||||
| @@ -405,23 +409,31 @@ _mesa_update_draw_buffer_bounds(GLcontext *ctx) | ||||
| void | ||||
| _mesa_update_framebuffer_visual(struct gl_framebuffer *fb) | ||||
| { | ||||
|    GLuint i; | ||||
|  | ||||
|    assert(fb->Name != 0); | ||||
|  | ||||
|    _mesa_bzero(&fb->Visual, sizeof(fb->Visual)); | ||||
|    fb->Visual.rgbMode = GL_TRUE; | ||||
|  | ||||
|    if (fb->Attachment[BUFFER_FRONT_LEFT].Renderbuffer) { | ||||
|       fb->Visual.redBits | ||||
|          = fb->Attachment[BUFFER_FRONT_LEFT].Renderbuffer->ComponentSizes[0]; | ||||
|       fb->Visual.greenBits | ||||
|          = fb->Attachment[BUFFER_FRONT_LEFT].Renderbuffer->ComponentSizes[1]; | ||||
|       fb->Visual.blueBits | ||||
|          = fb->Attachment[BUFFER_FRONT_LEFT].Renderbuffer->ComponentSizes[2]; | ||||
|       fb->Visual.alphaBits | ||||
|          = fb->Attachment[BUFFER_FRONT_LEFT].Renderbuffer->ComponentSizes[3]; | ||||
|       fb->Visual.rgbBits | ||||
|          = fb->Visual.redBits + fb->Visual.greenBits + fb->Visual.blueBits; | ||||
|       fb->Visual.floatMode = GL_FALSE; | ||||
|    /* find first RGB or CI renderbuffer */ | ||||
|    for (i = 0; i < BUFFER_COUNT; i++) { | ||||
|       if (fb->Attachment[i].Renderbuffer) { | ||||
|          const struct gl_renderbuffer *rb = fb->Attachment[i].Renderbuffer; | ||||
|          if (rb->_BaseFormat == GL_RGBA || rb->_BaseFormat == GL_RGB) { | ||||
|             fb->Visual.redBits = rb->ComponentSizes[0]; | ||||
|             fb->Visual.greenBits = rb->ComponentSizes[1]; | ||||
|             fb->Visual.blueBits = rb->ComponentSizes[2]; | ||||
|             fb->Visual.alphaBits = rb->ComponentSizes[3]; | ||||
|             fb->Visual.floatMode = GL_FALSE; | ||||
|             break; | ||||
|          } | ||||
|          else if (rb->_BaseFormat == GL_COLOR_INDEX) { | ||||
|             fb->Visual.indexBits = rb->ComponentSizes[0]; | ||||
|             fb->Visual.rgbMode = GL_FALSE; | ||||
|             break; | ||||
|          } | ||||
|       } | ||||
|    } | ||||
|  | ||||
|    if (fb->Attachment[BUFFER_DEPTH].Renderbuffer) { | ||||
| @@ -469,8 +481,10 @@ _mesa_update_framebuffer(GLcontext *ctx) | ||||
|    GLuint output; | ||||
|  | ||||
|    /* Completeness only matters for user-created framebuffers */ | ||||
|    if (fb->Name != 0) | ||||
|    if (fb->Name != 0) { | ||||
|       _mesa_test_framebuffer_completeness(ctx, fb); | ||||
|       _mesa_update_framebuffer_visual(fb); | ||||
|    } | ||||
|  | ||||
|    /* | ||||
|     * Update the list of drawing renderbuffer pointers. | ||||
| @@ -492,7 +506,7 @@ _mesa_update_framebuffer(GLcontext *ctx) | ||||
|                count++; | ||||
|             } | ||||
|             else { | ||||
|                _mesa_warning(ctx, "DrawBuffer names a missing buffer!"); | ||||
|                /*_mesa_warning(ctx, "DrawBuffer names a missing buffer!");*/ | ||||
|             } | ||||
|             bufferMask &= ~bufferBit; | ||||
|          } | ||||
|   | ||||
| @@ -11,6 +11,7 @@ | ||||
| #include "get.h" | ||||
| #include "macros.h" | ||||
| #include "mtypes.h" | ||||
| #include "state.h" | ||||
| #include "texcompress.h" | ||||
|  | ||||
|  | ||||
| @@ -85,6 +86,9 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params ) | ||||
|    if (!params) | ||||
|       return; | ||||
|  | ||||
|    if (ctx->NewState) | ||||
|       _mesa_update_state(ctx); | ||||
|  | ||||
|    if (ctx->Driver.GetBooleanv && | ||||
|        ctx->Driver.GetBooleanv(ctx, pname, params)) | ||||
|       return; | ||||
| @@ -1930,6 +1934,9 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params ) | ||||
|    if (!params) | ||||
|       return; | ||||
|  | ||||
|    if (ctx->NewState) | ||||
|       _mesa_update_state(ctx); | ||||
|  | ||||
|    if (ctx->Driver.GetFloatv && | ||||
|        ctx->Driver.GetFloatv(ctx, pname, params)) | ||||
|       return; | ||||
| @@ -3775,6 +3782,9 @@ _mesa_GetIntegerv( GLenum pname, GLint *params ) | ||||
|    if (!params) | ||||
|       return; | ||||
|  | ||||
|    if (ctx->NewState) | ||||
|       _mesa_update_state(ctx); | ||||
|  | ||||
|    if (ctx->Driver.GetIntegerv && | ||||
|        ctx->Driver.GetIntegerv(ctx, pname, params)) | ||||
|       return; | ||||
|   | ||||
| @@ -1040,6 +1040,9 @@ def EmitGetFunction(stateVars, returnType): | ||||
| 	print "   if (!params)" | ||||
| 	print "      return;" | ||||
| 	print "" | ||||
| 	print "   if (ctx->NewState)" | ||||
| 	print "      _mesa_update_state(ctx);" | ||||
| 	print "" | ||||
| 	print "   if (ctx->Driver.%s &&" % function | ||||
| 	print "       ctx->Driver.%s(ctx, pname, params))" % function | ||||
| 	print "      return;" | ||||
| @@ -1090,6 +1093,7 @@ def EmitHeader(): | ||||
| #include "get.h" | ||||
| #include "macros.h" | ||||
| #include "mtypes.h" | ||||
| #include "state.h" | ||||
| #include "texcompress.h" | ||||
|  | ||||
|  | ||||
|   | ||||
| @@ -12,7 +12,7 @@ | ||||
|  | ||||
| /* | ||||
|  * Mesa 3-D graphics library | ||||
|  * Version:  6.3 | ||||
|  * Version:  6.4 | ||||
|  * | ||||
|  * Copyright (C) 1999-2005  Brian Paul   All Rights Reserved. | ||||
|  * | ||||
| @@ -384,6 +384,8 @@ _mesa_HashFindFreeKeyBlock(struct _mesa_HashTable *table, GLuint numKeys) | ||||
| } | ||||
|  | ||||
|  | ||||
| #if 0 /* debug only */ | ||||
|  | ||||
| /** | ||||
|  * Test walking over all the entries in a hash table. | ||||
|  */ | ||||
| @@ -445,3 +447,5 @@ _mesa_test_hash_functions(void) | ||||
|  | ||||
|    test_hash_walking(); | ||||
| } | ||||
|  | ||||
| #endif | ||||
|   | ||||
| @@ -1,8 +1,8 @@ | ||||
| /* | ||||
|  * Mesa 3-D graphics library | ||||
|  * Version:  6.2 | ||||
|  * Version:  6.4 | ||||
|  * | ||||
|  * Copyright (C) 1999-2004  Brian Paul   All Rights Reserved. | ||||
|  * Copyright (C) 1999-2005  Brian Paul   All Rights Reserved. | ||||
|  * | ||||
|  * Permission is hereby granted, free of charge, to any person obtaining a | ||||
|  * copy of this software and associated documentation files (the "Software"), | ||||
| @@ -205,6 +205,7 @@ typedef union { GLfloat f; GLint i; } fi_type; | ||||
|     defined(__hppa__) || defined(hpux) || \ | ||||
|     defined(__mips) || defined(_MIPS_ARCH) || \ | ||||
|     defined(__arm__) || \ | ||||
|     defined(__sh__) || \ | ||||
|     (defined(__alpha__) && (defined(__IEEE_FLOAT) || !defined(VMS))) | ||||
| #define USE_IEEE | ||||
| #define IEEE_ONE 0x3f800000 | ||||
| @@ -331,6 +332,7 @@ static INLINE int GET_FLOAT_BITS( float x ) | ||||
|  *** CEILF: ceiling of float | ||||
|  *** FLOORF: floor of float | ||||
|  *** FABSF: absolute value of float | ||||
|  *** EXPF: raise e to the value | ||||
|  *** LDEXPF: multiply value by an integral power of two | ||||
|  *** FREXPF: extract mantissa and exponent from value | ||||
|  ***/ | ||||
| @@ -338,6 +340,7 @@ static INLINE int GET_FLOAT_BITS( float x ) | ||||
| #define CEILF(x)   ((GLfloat) xf86ceil(x)) | ||||
| #define FLOORF(x)  ((GLfloat) xf86floor(x)) | ||||
| #define FABSF(x)   ((GLfloat) xf86fabs(x)) | ||||
| #define EXPF(x)    ((GLfloat) xf86exp(x)) | ||||
| #define LDEXPF(x,y)   ((GLfloat) xf86ldexp(x,y)) | ||||
| #define FREXPF(x,y)   ((GLfloat) xf86frexp(x,y)) | ||||
| #elif defined(__gnu_linux__) | ||||
| @@ -345,12 +348,14 @@ static INLINE int GET_FLOAT_BITS( float x ) | ||||
| #define CEILF(x)   ceilf(x) | ||||
| #define FLOORF(x)  floorf(x) | ||||
| #define FABSF(x)   fabsf(x) | ||||
| #define EXPF(x)    expf(x) | ||||
| #define LDEXPF(x,y)  ldexpf(x,y) | ||||
| #define FREXPF(x,y)  frexpf(x,y) | ||||
| #else | ||||
| #define CEILF(x)   ((GLfloat) ceil(x)) | ||||
| #define FLOORF(x)  ((GLfloat) floor(x)) | ||||
| #define FABSF(x)   ((GLfloat) fabs(x)) | ||||
| #define EXPF(x)    ((GLfloat) exp(x)) | ||||
| #define LDEXPF(x,y)  ((GLfloat) ldexp(x,y)) | ||||
| #define FREXPF(x,y)  ((GLfloat) frexp(x,y)) | ||||
| #endif | ||||
| @@ -655,6 +660,12 @@ _mesa_align_calloc( size_t bytes, unsigned long alignment ); | ||||
| extern void | ||||
| _mesa_align_free( void *ptr ); | ||||
|  | ||||
| extern void * | ||||
| _mesa_exec_malloc( GLuint size ); | ||||
|  | ||||
| extern void  | ||||
| _mesa_exec_free( void *addr ); | ||||
|  | ||||
| extern void * | ||||
| _mesa_realloc( void *oldBuffer, size_t oldSize, size_t newSize ); | ||||
|  | ||||
|   | ||||
| @@ -21,17 +21,14 @@ | ||||
|  * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||||
|  * | ||||
|  */ | ||||
| /* $XFree86: xc/lib/GL/mesa/src/drv/common/mm.c,v 1.4 2002/10/30 12:51:27 alanh Exp $ */ | ||||
| 
 | ||||
| #include <stdlib.h> | ||||
| #include <stdio.h> | ||||
| 
 | ||||
| #include "mm.h" | ||||
| 
 | ||||
| 
 | ||||
| void mmDumpMemInfo( memHeap_t *heap ) | ||||
| void | ||||
| mmDumpMemInfo(const memHeap_t *heap) | ||||
| { | ||||
|    TMemBlock *p; | ||||
|    const TMemBlock *p; | ||||
| 
 | ||||
|    fprintf(stderr, "Memory heap %p:\n", (void *)heap); | ||||
|    if (heap == 0) { | ||||
| @@ -48,34 +45,37 @@ void mmDumpMemInfo( memHeap_t *heap ) | ||||
|    fprintf(stderr, "End of memory blocks\n"); | ||||
| } | ||||
| 
 | ||||
| memHeap_t *mmInit(int ofs, | ||||
| 		  int size) | ||||
| memHeap_t * | ||||
| mmInit(int ofs, int size) | ||||
| { | ||||
|    PMemBlock blocks; | ||||
|    | ||||
|    if (size <= 0) { | ||||
|       return NULL; | ||||
|    } | ||||
|    blocks = (TMemBlock *) calloc(1,sizeof(TMemBlock)); | ||||
|    blocks = (TMemBlock *) _mesa_calloc(sizeof(TMemBlock)); | ||||
|    if (blocks) { | ||||
|       blocks->ofs = ofs; | ||||
|       blocks->size = size; | ||||
|       blocks->free = 1; | ||||
|       return (memHeap_t *)blocks; | ||||
|    } else | ||||
|    } | ||||
|    else { | ||||
|       return NULL; | ||||
|    } | ||||
| } | ||||
| 
 | ||||
| 
 | ||||
| static TMemBlock* SliceBlock(TMemBlock *p,  | ||||
| 			     int startofs, int size,  | ||||
| 			     int reserved, int alignment) | ||||
| static TMemBlock * | ||||
| SliceBlock(TMemBlock *p,  | ||||
|            int startofs, int size,  | ||||
|            int reserved, int alignment) | ||||
| { | ||||
|    TMemBlock *newblock; | ||||
| 
 | ||||
|    /* break left */ | ||||
|    if (startofs > p->ofs) { | ||||
|       newblock = (TMemBlock*) calloc(1,sizeof(TMemBlock)); | ||||
|       newblock = (TMemBlock*) _mesa_calloc(sizeof(TMemBlock)); | ||||
|       if (!newblock) | ||||
| 	 return NULL; | ||||
|       newblock->ofs = startofs; | ||||
| @@ -89,7 +89,7 @@ static TMemBlock* SliceBlock(TMemBlock *p, | ||||
| 
 | ||||
|    /* break right */ | ||||
|    if (size < p->size) { | ||||
|       newblock = (TMemBlock*) calloc(1,sizeof(TMemBlock)); | ||||
|       newblock = (TMemBlock*) _mesa_calloc(sizeof(TMemBlock)); | ||||
|       if (!newblock) | ||||
| 	 return NULL; | ||||
|       newblock->ofs = startofs + size; | ||||
| @@ -107,7 +107,9 @@ static TMemBlock* SliceBlock(TMemBlock *p, | ||||
|    return p; | ||||
| } | ||||
| 
 | ||||
| PMemBlock mmAllocMem( memHeap_t *heap, int size, int align2, int startSearch) | ||||
| 
 | ||||
| PMemBlock | ||||
| mmAllocMem(memHeap_t *heap, int size, int align2, int startSearch) | ||||
| { | ||||
|    int mask,startofs,endofs; | ||||
|    TMemBlock *p; | ||||
| @@ -136,19 +138,39 @@ PMemBlock mmAllocMem( memHeap_t *heap, int size, int align2, int startSearch) | ||||
|    return p; | ||||
| } | ||||
| 
 | ||||
| static __inline__ int Join2Blocks(TMemBlock *p) | ||||
| 
 | ||||
| PMemBlock | ||||
| mmFindBlock(memHeap_t *heap, int start) | ||||
| { | ||||
|    TMemBlock *p = (TMemBlock *)heap; | ||||
| 
 | ||||
|    while (p) { | ||||
|       if (p->ofs == start && p->free)  | ||||
| 	 return p; | ||||
| 
 | ||||
|       p = p->next; | ||||
|    } | ||||
| 
 | ||||
|    return NULL; | ||||
| } | ||||
| 
 | ||||
| 
 | ||||
| static INLINE int | ||||
| Join2Blocks(TMemBlock *p) | ||||
| { | ||||
|    /* XXX there should be some assertions here */ | ||||
|    if (p->free && p->next && p->next->free) { | ||||
|       TMemBlock *q = p->next; | ||||
|       p->size += q->size; | ||||
|       p->next = q->next; | ||||
|       free(q); | ||||
|       _mesa_free(q); | ||||
|       return 1; | ||||
|    } | ||||
|    return 0; | ||||
| } | ||||
| 
 | ||||
| int mmFreeMem(PMemBlock b) | ||||
| int | ||||
| mmFreeMem(PMemBlock b) | ||||
| { | ||||
|    TMemBlock *p,*prev; | ||||
| 
 | ||||
| @@ -181,16 +203,18 @@ int mmFreeMem(PMemBlock b) | ||||
| } | ||||
| 
 | ||||
| 
 | ||||
| void mmDestroy(memHeap_t *heap) | ||||
| void | ||||
| mmDestroy(memHeap_t *heap) | ||||
| { | ||||
|    TMemBlock *p,*q; | ||||
|    TMemBlock *p; | ||||
| 
 | ||||
|    if (!heap) | ||||
|       return; | ||||
|    p = (TMemBlock *)heap; | ||||
| 
 | ||||
|    p = (TMemBlock *) heap; | ||||
|    while (p) { | ||||
|       q = p->next; | ||||
|       free(p); | ||||
|       p = q; | ||||
|       TMemBlock *next = p->next; | ||||
|       _mesa_free(p); | ||||
|       p = next; | ||||
|    } | ||||
| } | ||||
| @@ -19,11 +19,21 @@ | ||||
|  * 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. | ||||
|  * | ||||
|  */ | ||||
| 
 | ||||
| #ifndef MM_INC | ||||
| #define MM_INC | ||||
| 
 | ||||
| /**
 | ||||
|  * Memory manager code.  Primarily used by device drivers to manage texture | ||||
|  * heaps, etc. | ||||
|  */ | ||||
| 
 | ||||
| 
 | ||||
| #ifndef MM_H | ||||
| #define MM_H | ||||
| 
 | ||||
| 
 | ||||
| #include "imports.h" | ||||
| 
 | ||||
| 
 | ||||
| struct mem_block_t { | ||||
|   struct mem_block_t *next; | ||||
| @@ -33,25 +43,39 @@ struct mem_block_t { | ||||
|   unsigned int free:1; | ||||
|   unsigned int reserved:1; | ||||
| }; | ||||
| 
 | ||||
| typedef struct mem_block_t TMemBlock; | ||||
| 
 | ||||
| typedef struct mem_block_t *PMemBlock; | ||||
| 
 | ||||
| /* a heap is just the first block in a chain */ | ||||
| typedef struct mem_block_t memHeap_t; | ||||
| 
 | ||||
| static __inline__ int mmBlockSize(PMemBlock b) | ||||
| { return b->size; } | ||||
| 
 | ||||
| static __inline__ int mmOffset(PMemBlock b) | ||||
| { return b->ofs; } | ||||
| /* XXX are these needed? */ | ||||
| #if 0 | ||||
| static INLINE int | ||||
| mmBlockSize(PMemBlock b) | ||||
| { | ||||
|    return b->size; | ||||
| } | ||||
| 
 | ||||
| /* 
 | ||||
| static INLINE int | ||||
| mmOffset(PMemBlock b) | ||||
| { | ||||
|    return b->ofs; | ||||
| } | ||||
| #endif | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| /** 
 | ||||
|  * input: total size in bytes | ||||
|  * return: a heap pointer if OK, NULL if error | ||||
|  */ | ||||
| memHeap_t *mmInit( int ofs, int size ); | ||||
| extern memHeap_t *mmInit(int ofs, int size); | ||||
| 
 | ||||
| /*
 | ||||
| /**
 | ||||
|  * Allocate 'size' bytes with 2^align2 bytes alignment, | ||||
|  * restrict the search to free memory after 'startSearch' | ||||
|  * depth and back buffers should be in different 4mb banks | ||||
| @@ -61,22 +85,31 @@ memHeap_t *mmInit( int ofs, int size ); | ||||
|  *		startSearch = linear offset from start of heap to begin search | ||||
|  * return: pointer to the allocated block, 0 if error | ||||
|  */ | ||||
| PMemBlock  mmAllocMem( memHeap_t *heap, int size, int align2,  | ||||
| 		       int startSearch ); | ||||
| extern PMemBlock mmAllocMem(memHeap_t *heap, int size, int align2,  | ||||
|                             int startSearch); | ||||
| 
 | ||||
| /*
 | ||||
| /**
 | ||||
|  * Free block starts at offset | ||||
|  * input: pointer to a block | ||||
|  * return: 0 if OK, -1 if error | ||||
|  */ | ||||
| int  mmFreeMem( PMemBlock b ); | ||||
| extern int mmFreeMem(PMemBlock b); | ||||
| 
 | ||||
| /*
 | ||||
| /**
 | ||||
|  * Free block starts at offset | ||||
|  * input: pointer to a heap, start offset | ||||
|  * return: pointer to a block | ||||
|  */ | ||||
| extern PMemBlock mmFindBlock(memHeap_t *heap, int start); | ||||
| 
 | ||||
| /**
 | ||||
|  * destroy MM | ||||
|  */ | ||||
| void mmDestroy( memHeap_t *mmInit ); | ||||
| extern void mmDestroy(memHeap_t *mmInit); | ||||
| 
 | ||||
| /* For debuging purpose. */ | ||||
| void mmDumpMemInfo( memHeap_t *mmInit ); | ||||
| /**
 | ||||
|  * For debuging purpose. | ||||
|  */ | ||||
| extern void mmDumpMemInfo(const memHeap_t *mmInit); | ||||
| 
 | ||||
| #endif | ||||
| @@ -2056,6 +2056,9 @@ struct gl_renderbuffer | ||||
|    GLubyte ComponentSizes[4];  /* bits per component or channel */ | ||||
|    GLvoid *Data; | ||||
|  | ||||
|    /* Used to wrap one renderbuffer around another: */ | ||||
|    struct gl_renderbuffer *Wrapped; | ||||
|  | ||||
|    /* Delete this renderbuffer */ | ||||
|    void (*Delete)(struct gl_renderbuffer *rb); | ||||
|  | ||||
|   | ||||
| @@ -5,9 +5,9 @@ | ||||
|  | ||||
| /* | ||||
|  * Mesa 3-D graphics library | ||||
|  * Version:  6.2 | ||||
|  * Version:  6.5 | ||||
|  * | ||||
|  * Copyright (C) 1999-2004  Brian Paul   All Rights Reserved. | ||||
|  * Copyright (C) 1999-2005  Brian Paul   All Rights Reserved. | ||||
|  * | ||||
|  * Permission is hereby granted, free of charge, to any person obtaining a | ||||
|  * copy of this software and associated documentation files (the "Software"), | ||||
| @@ -37,17 +37,9 @@ | ||||
|  | ||||
|  | ||||
| /** | ||||
|  * Set the point size. | ||||
|  * | ||||
|  * \param size pointer diameter. | ||||
|  * | ||||
|  * Set current point size. | ||||
|  * \param size  point diameter in pixels | ||||
|  * \sa glPointSize(). | ||||
|  * | ||||
|  * Verifies the parameter and updates gl_point_attrib::Size. On a change, | ||||
|  * flushes the vertices, updates the clamped point size and marks the | ||||
|  * DD_POINT_SIZE flag in __GLcontextRec::_TriangleCaps for the drivers if the | ||||
|  * size is different from one. Notifies the driver via | ||||
|  * the dd_function_table::PointSize callback. | ||||
|  */ | ||||
| void GLAPIENTRY | ||||
| _mesa_PointSize( GLfloat size ) | ||||
| @@ -65,17 +57,9 @@ _mesa_PointSize( GLfloat size ) | ||||
|  | ||||
|    FLUSH_VERTICES(ctx, _NEW_POINT); | ||||
|    ctx->Point.Size = size; | ||||
|    ctx->Point._Size = CLAMP(size, | ||||
| 			    ctx->Const.MinPointSize, | ||||
| 			    ctx->Const.MaxPointSize); | ||||
|  | ||||
|    if (ctx->Point._Size == 1.0F) | ||||
|       ctx->_TriangleCaps &= ~DD_POINT_SIZE; | ||||
|    else | ||||
|       ctx->_TriangleCaps |= DD_POINT_SIZE; | ||||
|  | ||||
|    if (ctx->Driver.PointSize) | ||||
|       (*ctx->Driver.PointSize)(ctx, size); | ||||
|       ctx->Driver.PointSize(ctx, size); | ||||
| } | ||||
|  | ||||
|  | ||||
| @@ -127,24 +111,10 @@ _mesa_PointParameterfvEXT( GLenum pname, const GLfloat *params) | ||||
|    switch (pname) { | ||||
|       case GL_DISTANCE_ATTENUATION_EXT: | ||||
|          if (ctx->Extensions.EXT_point_parameters) { | ||||
|             const GLboolean tmp = ctx->Point._Attenuated; | ||||
|             if (TEST_EQ_3V(ctx->Point.Params, params)) | ||||
| 	       return; | ||||
|  | ||||
| 	    FLUSH_VERTICES(ctx, _NEW_POINT); | ||||
|             COPY_3V(ctx->Point.Params, params); | ||||
|  | ||||
| 	    /* Update several derived values now.  This likely to be | ||||
| 	     * more efficient than trying to catch this statechange in | ||||
| 	     * state.c. | ||||
| 	     */ | ||||
|             ctx->Point._Attenuated = (params[0] != 1.0 || | ||||
| 				      params[1] != 0.0 || | ||||
| 				      params[2] != 0.0); | ||||
|  | ||||
|             if (tmp != ctx->Point._Attenuated) { | ||||
|                ctx->_TriangleCaps ^= DD_POINT_ATTEN; | ||||
|             } | ||||
|          } | ||||
|          else { | ||||
|             _mesa_error(ctx, GL_INVALID_ENUM, | ||||
| @@ -260,6 +230,37 @@ _mesa_PointParameterfvEXT( GLenum pname, const GLfloat *params) | ||||
| #endif | ||||
|  | ||||
|  | ||||
|  | ||||
| /** | ||||
|  * Update derived point-related state. | ||||
|  */ | ||||
| void | ||||
| _mesa_update_point(GLcontext *ctx) | ||||
| { | ||||
|    /* clamp to user-specified limits now, clamp to ctx->Const.Min/Max | ||||
|     * limits during rasterization. | ||||
|     */ | ||||
|    ctx->Point._Size = CLAMP(ctx->Point.Size, | ||||
| 			    ctx->Point.MinSize, | ||||
| 			    ctx->Point.MaxSize); | ||||
|  | ||||
|    if (ctx->Point._Size == 1.0F) | ||||
|       ctx->_TriangleCaps &= ~DD_POINT_SIZE; | ||||
|    else | ||||
|       ctx->_TriangleCaps |= DD_POINT_SIZE; | ||||
|  | ||||
|    ctx->Point._Attenuated = (ctx->Point.Params[0] != 1.0 || | ||||
|                              ctx->Point.Params[1] != 0.0 || | ||||
|                              ctx->Point.Params[2] != 0.0); | ||||
|  | ||||
|    if (ctx->Point._Attenuated) | ||||
|       ctx->_TriangleCaps |= DD_POINT_ATTEN; | ||||
|    else | ||||
|       ctx->_TriangleCaps &= ~DD_POINT_ATTEN; | ||||
| } | ||||
|  | ||||
|  | ||||
|  | ||||
| /** | ||||
|  * Initialize the context point state. | ||||
|  * | ||||
| @@ -268,11 +269,11 @@ _mesa_PointParameterfvEXT( GLenum pname, const GLfloat *params) | ||||
|  * Initializes __GLcontextRec::Point and point related constants in | ||||
|  * __GLcontextRec::Const. | ||||
|  */ | ||||
| void _mesa_init_point( GLcontext * ctx ) | ||||
| void | ||||
| _mesa_init_point(GLcontext *ctx) | ||||
| { | ||||
|    int i; | ||||
|     | ||||
|    /* Point group */ | ||||
|    GLuint i; | ||||
|  | ||||
|    ctx->Point.SmoothFlag = GL_FALSE; | ||||
|    ctx->Point.Size = 1.0; | ||||
|    ctx->Point._Size = 1.0; | ||||
| @@ -281,12 +282,13 @@ void _mesa_init_point( GLcontext * ctx ) | ||||
|    ctx->Point.Params[2] = 0.0; | ||||
|    ctx->Point._Attenuated = GL_FALSE; | ||||
|    ctx->Point.MinSize = 0.0; | ||||
|    ctx->Point.MaxSize = ctx->Const.MaxPointSize; | ||||
|    ctx->Point.MaxSize | ||||
|       = MAX2(ctx->Const.MaxPointSize, ctx->Const.MaxPointSizeAA); | ||||
|    ctx->Point.Threshold = 1.0; | ||||
|    ctx->Point.PointSprite = GL_FALSE; /* GL_ARB_point_sprite / GL_NV_point_sprite */ | ||||
|    ctx->Point.PointSprite = GL_FALSE; /* GL_ARB/NV_point_sprite */ | ||||
|    ctx->Point.SpriteRMode = GL_ZERO; /* GL_NV_point_sprite (only!) */ | ||||
|    ctx->Point.SpriteOrigin = GL_UPPER_LEFT; /* GL_ARB_point_sprite */ | ||||
|    for (i = 0; i < MAX_TEXTURE_UNITS; i++) { | ||||
|       ctx->Point.CoordReplace[i] = GL_FALSE; /* GL_ARB_point_sprite / GL_NV_point_sprite */ | ||||
|       ctx->Point.CoordReplace[i] = GL_FALSE; /* GL_ARB/NV_point_sprite */ | ||||
|    } | ||||
| } | ||||
|   | ||||
| @@ -5,9 +5,9 @@ | ||||
|  | ||||
| /* | ||||
|  * Mesa 3-D graphics library | ||||
|  * Version:  4.1 | ||||
|  * Version:  6.5 | ||||
|  * | ||||
|  * Copyright (C) 1999-2002  Brian Paul   All Rights Reserved. | ||||
|  * Copyright (C) 1999-2005  Brian Paul   All Rights Reserved. | ||||
|  * | ||||
|  * Permission is hereby granted, free of charge, to any person obtaining a | ||||
|  * copy of this software and associated documentation files (the "Software"), | ||||
| @@ -50,6 +50,9 @@ _mesa_PointParameterfEXT( GLenum pname, GLfloat param ); | ||||
| extern void GLAPIENTRY | ||||
| _mesa_PointParameterfvEXT( GLenum pname, const GLfloat *params ); | ||||
|  | ||||
| extern void | ||||
| _mesa_update_point(GLcontext *ctx); | ||||
|  | ||||
| extern void  | ||||
| _mesa_init_point( GLcontext * ctx ); | ||||
|  | ||||
|   | ||||
Some files were not shown because too many files have changed in this diff Show More
		Reference in New Issue
	
	Block a user