Compare commits
	
		
			278 Commits
		
	
	
		
			mesa-21.1.
			...
			mesa_7_4_4
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
|  | d0c391b6a2 | ||
|  | eaed8dc609 | ||
|  | b5609e6444 | ||
|  | 0b870bbb2a | ||
|  | 1dbbc39f48 | ||
|  | 4b8cd0b0ad | ||
|  | 5d387a35ff | ||
|  | 2ae6859215 | ||
|  | afe0ca1f3f | ||
|  | 6b782231d0 | ||
|  | 2b890c9818 | ||
|  | e0b13e15f1 | ||
|  | 420c74b870 | ||
|  | a64f994a3a | ||
|  | c568446dc6 | ||
|  | acbf9c6f3c | ||
|  | 3b842feead | ||
|  | 6d62b8d5c1 | ||
|  | 02659868e8 | ||
|  | 457f4efab0 | ||
|  | 0269eb5e3f | ||
|  | b7d9be69b2 | ||
|  | 7b8b856c97 | ||
|  | 24bffc4cc2 | ||
|  | 586341afd9 | ||
|  | 1e4334f623 | ||
|  | 8861577fd1 | ||
|  | cf997e0d2e | ||
|  | 506d340363 | ||
|  | 9dbe32f5eb | ||
|  | 9adca8814d | ||
|  | 8125c5ce92 | ||
|  | ba3f8dc0aa | ||
|  | 85cf1675d4 | ||
|  | 3aeace2928 | ||
|  | 0edb61afef | ||
|  | accffe2b73 | ||
|  | 35f5222ae0 | ||
|  | 1096a6c579 | ||
|  | 1eb59f49a4 | ||
|  | 63d1e89138 | ||
|  | 3ed7e9bfcc | ||
|  | 46a2aad2cf | ||
|  | b5eafa2d51 | ||
|  | d1fcb4a263 | ||
|  | da709f163f | ||
|  | 3a1bcbe579 | ||
|  | ec863602f2 | ||
|  | 2ff47b80f5 | ||
|  | 63cde0ea0e | ||
|  | c521d4629b | ||
|  | e9d5569bf3 | ||
|  | 6337525497 | ||
|  | 7541c3806a | ||
|  | a1ce4efefb | ||
|  | 656cd707db | ||
|  | ce7f78694d | ||
|  | fd95e8ee33 | ||
|  | d2b8c41b7a | ||
|  | bfd6bb31a6 | ||
|  | c3e7fc394f | ||
|  | dd56897b27 | ||
|  | e8807a14a6 | ||
|  | c38397866d | ||
|  | dce84002c2 | ||
|  | c490349825 | ||
|  | f62d45fd0d | ||
|  | b2dfc29a82 | ||
|  | 7c1e61f41c | ||
|  | 5654197d12 | ||
|  | 87cb55e9c6 | ||
|  | e7d499f935 | ||
|  | 51e7600d77 | ||
|  | 69b17abd6b | ||
|  | a975da7aca | ||
|  | ecf47b5046 | ||
|  | fed8dc53ad | ||
|  | 1f462e26c0 | ||
|  | 85396d8ef4 | ||
|  | f11b84998d | ||
|  | d2f6791062 | ||
|  | 49e0c74ddd | ||
|  | 83e14773c5 | ||
|  | 4605937843 | ||
|  | b8ef30c45c | ||
|  | 4f17040cb1 | ||
|  | 98c2c9ef8c | ||
|  | d805c82068 | ||
|  | 6c3bec4387 | ||
|  | 7d3561c871 | ||
|  | 5c47d53924 | ||
|  | a18216308a | ||
|  | 14f13fbcfa | ||
|  | ca24095c1e | ||
|  | d5e0e03d43 | ||
|  | 775ca8e3fa | ||
|  | 39345a4928 | ||
|  | 7be149cfd1 | ||
|  | 8c9d7b2474 | ||
|  | 6ef0951b17 | ||
|  | 2b33b77337 | ||
|  | 0590edeea0 | ||
|  | 7511d76bd7 | ||
|  | 7f30aba920 | ||
|  | 4fa700260e | ||
|  | 781fb79c59 | ||
|  | 5b7e9f2f3a | ||
|  | d4d4b63d7f | ||
|  | 9e9fe51acd | ||
|  | b65bc1b6cb | ||
|  | 6cb796f6fc | ||
|  | de197cf991 | ||
|  | bf1e6581a5 | ||
|  | 80ec7843bc | ||
|  | 366d6e8cd1 | ||
|  | 63ed288396 | ||
|  | 88ce34f400 | ||
|  | f535de8721 | ||
|  | 1db913f687 | ||
|  | 0e5d1f43af | ||
|  | 09c587ae55 | ||
|  | 775d8431e9 | ||
|  | 3217ea8a1d | ||
|  | 00aea5853d | ||
|  | 20d34b50b5 | ||
|  | 9cff0acb36 | ||
|  | 791b59493f | ||
|  | 7dff7029fa | ||
|  | f8fd9bc46b | ||
|  | 53f0e141c0 | ||
|  | 14a794300e | ||
|  | 912ec292c1 | ||
|  | e814b5ae2f | ||
|  | 0fea05915a | ||
|  | dfa44f0ff9 | ||
|  | f850ff2bcc | ||
|  | 66f972ab55 | ||
|  | 17db2db9dc | ||
|  | dba79af9bc | ||
|  | b009a32bf4 | ||
|  | 7122490982 | ||
|  | 6ada1d47d9 | ||
|  | 55865335f4 | ||
|  | 918e5221ef | ||
|  | 9feb26584a | ||
|  | a8528a2e86 | ||
|  | 119360cccd | ||
|  | ac2216542d | ||
|  | 37e5c057f1 | ||
|  | 4d9b8e0f93 | ||
|  | c1b71f46b5 | ||
|  | 4a25ac9564 | ||
|  | 35d965b39b | ||
|  | d0aab00609 | ||
|  | ef33d0f103 | ||
|  | 349b819768 | ||
|  | 50443db882 | ||
|  | c503cacb53 | ||
|  | e862b4e38f | ||
|  | e9dfc858fb | ||
|  | 5efbca1e21 | ||
|  | d6d8663a88 | ||
|  | 13990bd98a | ||
|  | def630d0a2 | ||
|  | ca2564f1e6 | ||
|  | 711a57f7c7 | ||
|  | 058cf2fff1 | ||
|  | 715f509c5d | ||
|  | e704e6c6f3 | ||
|  | 01f34e667a | ||
|  | 4d0a7b33c5 | ||
|  | fb1d2ed34c | ||
|  | 9395fedf98 | ||
|  | 9abc0d80af | ||
|  | 90e89c01df | ||
|  | 790d93e362 | ||
|  | e9f3783169 | ||
|  | e41780fedc | ||
|  | d0edbbb3f3 | ||
|  | e10119c23e | ||
|  | 208c087f39 | ||
|  | 0c8b40b42b | ||
|  | 5199f451bb | ||
|  | dd7cde5230 | ||
|  | ab5746e5d8 | ||
|  | 3bd446c0ab | ||
|  | 9b78402ee4 | ||
|  | cf1ef0f308 | ||
|  | fd1f65ba61 | ||
|  | 967345b497 | ||
|  | 41ad853a6a | ||
|  | 842baa29cb | ||
|  | 9556d870a1 | ||
|  | 42ce790086 | ||
|  | b17769af42 | ||
|  | 9030277b0d | ||
|  | a37a9bf769 | ||
|  | 8afb8a8145 | ||
|  | 801f933694 | ||
|  | 75ecd6ebbf | ||
|  | 1cd7317fdb | ||
|  | 1865291701 | ||
|  | 3edbcce7d5 | ||
|  | b1fb34d0ac | ||
|  | 606099f545 | ||
|  | 32e3142071 | ||
|  | 66eea4e104 | ||
|  | e428cf3afd | ||
|  | 842b5164d2 | ||
|  | a6f7e909a7 | ||
|  | ca87e5a7bd | ||
|  | 45c4b4dfbd | ||
|  | 2adaec1226 | ||
|  | 549586c319 | ||
|  | 463ac421a5 | ||
|  | 6801240205 | ||
|  | a22088b7d5 | ||
|  | e89c49147f | ||
|  | 67634240d1 | ||
|  | 819b028a8e | ||
|  | a43c30ef41 | ||
|  | b65bfde84d | ||
|  | c39e6917ac | ||
|  | c79079895f | ||
|  | 4480e631cd | ||
|  | c32661c3ce | ||
|  | d5c06bb812 | ||
|  | 9d5aa36239 | ||
|  | e3050c1777 | ||
|  | 06295ddbdd | ||
|  | e2092bb23c | ||
|  | 528836d0ad | ||
|  | 3511442e43 | ||
|  | d20c53b511 | ||
|  | 091cc122ad | ||
|  | c983abbb9e | ||
|  | a0a81204c2 | ||
|  | 409d4f839c | ||
|  | 0ab36958ea | ||
|  | c2445f43a3 | ||
|  | f3d1c136b7 | ||
|  | dd10a8b09d | ||
|  | dd312366da | ||
|  | d2fe466ef3 | ||
|  | fe5328bfad | ||
|  | c0891dde07 | ||
|  | 0e6d9c1a55 | ||
|  | 5f74a66132 | ||
|  | 46f8b62d5f | ||
|  | 3e3e80c431 | ||
|  | 0486d117e4 | ||
|  | 29981c14da | ||
|  | 98d5efb2c5 | ||
|  | 77a44aafaf | ||
|  | 8278c70716 | ||
|  | ac0955f5e2 | ||
|  | 4130c35ca8 | ||
|  | d440647eb8 | ||
|  | 7e8f2c56c0 | ||
|  | a0880a152f | ||
|  | 4608a9172f | ||
|  | d0e38f7ec0 | ||
|  | a69bdbbbdd | ||
|  | 88c97a2662 | ||
|  | ce9c69ddbc | ||
|  | e430fcb716 | ||
|  | 11a363e632 | ||
|  | 41e63fbdb2 | ||
|  | b543401a5c | ||
|  | 8c4f08fbad | ||
|  | f3081a34d2 | ||
|  | 7b1d3cf392 | ||
|  | 25515b557e | ||
|  | 51625ff86e | ||
|  | 4d8f661726 | ||
|  | efa69a2f66 | ||
|  | 30a6dd78d5 | ||
|  | 9f75836308 | 
							
								
								
									
										15
									
								
								Makefile
									
									
									
									
									
								
							
							
						
						
									
										15
									
								
								Makefile
									
									
									
									
									
								
							| @@ -35,6 +35,8 @@ realclean: clean | ||||
| 	  -name depend -o -name depend.bak ')' -exec rm -f '{}' ';' | ||||
|  | ||||
|  | ||||
| distclean: realclean | ||||
|  | ||||
|  | ||||
| install: | ||||
| 	@for dir in $(SUBDIRS) ; do \ | ||||
| @@ -48,7 +50,9 @@ install: | ||||
| linux-directfb-install: | ||||
| 	cd src/mesa/drivers/directfb && $(MAKE) install | ||||
|  | ||||
| .PHONY: default doxygen clean realclean install linux-directfb-install | ||||
|  | ||||
| .PHONY: default doxygen clean realclean distclean install linux-directfb-install | ||||
|  | ||||
|  | ||||
| # If there's no current configuration file | ||||
| $(TOP)/configs/current: | ||||
| @@ -174,10 +178,11 @@ ultrix-gcc: | ||||
|  | ||||
| # Rules for making release tarballs | ||||
|  | ||||
| DIRECTORY = Mesa-7.3 | ||||
| LIB_NAME = MesaLib-7.3 | ||||
| DEMO_NAME = MesaDemos-7.3 | ||||
| GLUT_NAME = MesaGLUT-7.3 | ||||
| VERSION=7.4.4 | ||||
| DIRECTORY = Mesa-$(VERSION) | ||||
| LIB_NAME = MesaLib-$(VERSION) | ||||
| DEMO_NAME = MesaDemos-$(VERSION) | ||||
| GLUT_NAME = MesaGLUT-$(VERSION) | ||||
|  | ||||
| MAIN_FILES = \ | ||||
| 	$(DIRECTORY)/Makefile*						\ | ||||
|   | ||||
							
								
								
									
										28
									
								
								bin/mklib
									
									
									
									
									
								
							
							
						
						
									
										28
									
								
								bin/mklib
									
									
									
									
									
								
							| @@ -394,6 +394,30 @@ case $ARCH in | ||||
| 		fi | ||||
| 	    fi | ||||
|  | ||||
| 	    # If using Sun C++ compiler, need to tell it not to add runpaths | ||||
| 	    # that are specific to the build machine | ||||
| 	    if [ ${LINK} = "CC" ] ; then | ||||
| 		OPTS="${OPTS} -norunpath" | ||||
| 	    fi | ||||
|  | ||||
| 	    # Solaris linker requires explicitly listing the Standard C & C++ | ||||
| 	    # libraries in the link path when building shared objects | ||||
| 	    if [ ${LINK} = "CC" ] ; then | ||||
| 		DEPS="${DEPS} -lCrun" | ||||
| 	    fi | ||||
| 	    DEPS="${DEPS} -lc" | ||||
|  | ||||
| 	    if [ $EXPORTS ] ; then | ||||
| 		# Make the 'mapfile.scope' linker mapfile | ||||
| 		echo "{" > mapfile.scope | ||||
| 		echo "global:" >> mapfile.scope | ||||
| 		sed 's/$/;/' ${EXPORTS} >> mapfile.scope | ||||
| 		echo "local:" >> mapfile.scope | ||||
| 		echo "    *;" >> mapfile.scope | ||||
| 		echo "};" >> mapfile.scope | ||||
| 		OPTS="${OPTS} -Wl,-Mmapfile.scope" | ||||
| 	    fi | ||||
|  | ||||
| 	    # Check if objects are SPARC v9 | ||||
| 	    # file says: ELF 64-bit MSB relocatable SPARCV9 Version 1 | ||||
| 	    set ${OBJECTS} | ||||
| @@ -406,17 +430,19 @@ case $ARCH in | ||||
|             if [ "${ALTOPTS}" ] ; then | ||||
|                 OPTS=${ALTOPTS} | ||||
|             fi | ||||
|  | ||||
| 	    # for debug: | ||||
| 	    #echo "mklib: linker is" ${LINK} ${OPTS} | ||||
| 	    if [ $NOPREFIX = 1 ] ; then | ||||
| 		rm -f ${LIBNAME} | ||||
| 		${LINK} ${OPTS} ${LDFLAGS} -o ${LIBNAME} ${OBJECTS} ${DEPS} | ||||
| 		FINAL_LIBS="${LIBNAME}" | ||||
| 	    else | ||||
| 		rm -f ${LIBNAME}.${MAJOR} ${LIBNAME} | ||||
| 		${LINK} ${OPTS} ${LDFLAGS} -o ${LIBNAME}.${MAJOR} -h ${LIBNAME}.${MAJOR} ${OBJECTS} ${DEPS} | ||||
| 		ln -s ${LIBNAME}.${MAJOR} ${LIBNAME} | ||||
| 		FINAL_LIBS="${LIBNAME}.${MAJOR} ${LIBNAME}" | ||||
| 	    fi | ||||
| 	    FINAL_LIBS="${LIBNAME}.${MAJOR} ${LIBNAME}" | ||||
| 	fi | ||||
| 	;; | ||||
|  | ||||
|   | ||||
| @@ -6,6 +6,8 @@ CONFIG_NAME = darwin | ||||
|  | ||||
| INSTALL_DIR = /usr/X11 | ||||
|  | ||||
| X11_DIR = $(INSTALL_DIR) | ||||
|  | ||||
| # Compiler and flags | ||||
| CC = gcc | ||||
| CXX = gcc | ||||
| @@ -21,9 +23,9 @@ DEFINES =  -D_DARWIN_C_SOURCE -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L \ | ||||
| ARCH_FLAGS += $(RC_CFLAGS) | ||||
|  | ||||
| CFLAGS =  -ggdb3 -Os -Wall -Wmissing-prototypes -std=c99 -ffast-math -fno-strict-aliasing \ | ||||
| 	-I$(INSTALL_DIR)/include $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(ASM_FLAGS) $(DEFINES) | ||||
| 	-I$(INSTALL_DIR)/include -I$(X11_DIR)/include $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(ASM_FLAGS) $(DEFINES) | ||||
| CXXFLAGS =  -ggdb3 -Os -Wall -fno-strict-aliasing \ | ||||
| 	-I$(INSTALL_DIR)/include $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(ASM_FLAGS) $(DEFINES) | ||||
| 	-I$(INSTALL_DIR)/include -I$(X11_DIR)/include $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(ASM_FLAGS) $(DEFINES) | ||||
|  | ||||
| # Library names (actual file names) | ||||
| GL_LIB_NAME = libGL.dylib | ||||
| @@ -39,12 +41,12 @@ GLUT_LIB_GLOB = libglut.*dylib | ||||
| GLW_LIB_GLOB = libGLw.*dylib | ||||
| OSMESA_LIB_GLOB = libOSMesa.*dylib | ||||
|  | ||||
| GL_LIB_DEPS = -L$(INSTALL_DIR)/$(LIB_DIR) -lX11 -lXext -lm -lpthread | ||||
| GL_LIB_DEPS = -L$(INSTALL_DIR)/$(LIB_DIR) -L$(X11_DIR)/$(LIB_DIR) -lX11 -lXext -lm -lpthread | ||||
| OSMESA_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) | ||||
| GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) | ||||
| GLUT_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB)  -L$(INSTALL_DIR)/$(LIB_DIR) -lX11 -lXmu -lXi -lXext | ||||
| GLW_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -L$(INSTALL_DIR)/$(LIB_DIR) -lX11 -lXt | ||||
| APP_LIB_DEPS = -L$(TOP)/lib -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -L$(INSTALL_DIR)/$(LIB_DIR) -lX11 -lXmu -lXt -lXi -lm | ||||
| GLUT_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB)  -L$(INSTALL_DIR)/$(LIB_DIR) -L$(X11_DIR)/$(LIB_DIR) -lX11 -lXmu -lXi -lXext | ||||
| GLW_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -L$(INSTALL_DIR)/$(LIB_DIR) -L$(X11_DIR)/$(LIB_DIR) -lX11 -lXt | ||||
| APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -L$(INSTALL_DIR)/$(LIB_DIR) -L$(X11_DIR)/$(LIB_DIR) -lX11 -lXmu -lXt -lXi -lm | ||||
|  | ||||
| # omit glw lib for now: | ||||
| SRC_DIRS = glx/x11 mesa glu glut/glx | ||||
|   | ||||
| @@ -9,8 +9,8 @@ CONFIG_NAME = default | ||||
|  | ||||
| # Version info | ||||
| MESA_MAJOR=7 | ||||
| MESA_MINOR=3 | ||||
| MESA_TINY=0 | ||||
| MESA_MINOR=4 | ||||
| MESA_TINY=4 | ||||
| MESA_VERSION = $(MESA_MAJOR).$(MESA_MINOR).$(MESA_TINY) | ||||
|  | ||||
| # external projects.  This should be useless now that we use libdrm. | ||||
|   | ||||
							
								
								
									
										54
									
								
								configure.ac
									
									
									
									
									
								
							
							
						
						
									
										54
									
								
								configure.ac
									
									
									
									
									
								
							| @@ -46,10 +46,14 @@ esac | ||||
| MKDEP_OPTIONS=-fdepend | ||||
| dnl Ask gcc where it's keeping its secret headers | ||||
| if test "x$GCC" = xyes; then | ||||
|     GCC_INCLUDES=`$CC -print-file-name=include` | ||||
|     if test "x$GCC_INCLUDES" != x; then | ||||
|         MKDEP_OPTIONS="$MKDEP_OPTIONS -I$GCC_INCLUDES" | ||||
|     fi | ||||
|     for dir in include include-fixed; do | ||||
|         GCC_INCLUDES=`$CC -print-file-name=$dir` | ||||
|         if test "x$GCC_INCLUDES" != x && \ | ||||
|            test "$GCC_INCLUDES" != "$dir" && \ | ||||
|            test -d "$GCC_INCLUDES"; then | ||||
|             MKDEP_OPTIONS="$MKDEP_OPTIONS -I$GCC_INCLUDES" | ||||
|         fi | ||||
|     done | ||||
| fi | ||||
| AC_SUBST([MKDEP_OPTIONS]) | ||||
|  | ||||
| @@ -83,7 +87,7 @@ dnl Compiler macros | ||||
| DEFINES="" | ||||
| AC_SUBST([DEFINES]) | ||||
| case "$host_os" in | ||||
| *-gnu*) | ||||
| linux*|*-gnu*) | ||||
|     DEFINES="$DEFINES -D_GNU_SOURCE -DPTHREADS" | ||||
|     ;; | ||||
| solaris*) | ||||
| @@ -342,17 +346,6 @@ if test "x$enable_selinux" = "xyes"; then | ||||
|     DEFINES="$DEFINES -DMESA_SELINUX" | ||||
| fi | ||||
|  | ||||
| dnl OS-specific libraries | ||||
| OS_LIBS="" | ||||
| case "$host_os" in | ||||
| solaris*) | ||||
|     OS_LIBS="-lc" | ||||
|     if test "x$GXX" != xyes; then | ||||
|         OS_CPLUSPLUS_LIBS="-lCrun $OS_LIBS" | ||||
|     fi | ||||
|     ;; | ||||
| esac | ||||
|  | ||||
| dnl | ||||
| dnl Driver configuration. Options are xlib, dri and osmesa right now. | ||||
| dnl More later: directfb, fbdev, ... | ||||
| @@ -362,7 +355,7 @@ default_driver="xlib" | ||||
| case "$host_os" in | ||||
| linux*) | ||||
|     case "$host_cpu" in | ||||
|     i*86|x86_64|powerpc*) default_driver="dri";; | ||||
|     i*86|x86_64|powerpc*|sparc*) default_driver="dri";; | ||||
|     esac | ||||
|     ;; | ||||
| *freebsd* | dragonfly*) | ||||
| @@ -514,8 +507,8 @@ xlib) | ||||
|         GL_PC_LIB_PRIV="$GL_LIB_DEPS" | ||||
|         GL_PC_CFLAGS="$X11_INCLUDES" | ||||
|     fi | ||||
|     GL_LIB_DEPS="$GL_LIB_DEPS $SELINUX_LIBS -lm -lpthread $OS_LIBS" | ||||
|     GL_PC_LIB_PRIV="$GL_PC_LIB_PRIV $SELINUX_LIBS -lm -lpthread $OS_LIBS" | ||||
|     GL_LIB_DEPS="$GL_LIB_DEPS $SELINUX_LIBS -lm -lpthread" | ||||
|     GL_PC_LIB_PRIV="$GL_PC_LIB_PRIV $SELINUX_LIBS -lm -lpthread" | ||||
|  | ||||
|     # if static, move the external libraries to the programs | ||||
|     # and empty the libraries for libGL | ||||
| @@ -565,12 +558,12 @@ dri) | ||||
|     fi | ||||
|  | ||||
|     # need DRM libs, -lpthread, etc. | ||||
|     GL_LIB_DEPS="$GL_LIB_DEPS $LIBDRM_LIBS -lm -lpthread $DLOPEN_LIBS $OS_LIBS" | ||||
|     GL_PC_LIB_PRIV="-lm -lpthread $DLOPEN_LIBS $OS_LIBS" | ||||
|     GL_LIB_DEPS="$GL_LIB_DEPS $LIBDRM_LIBS -lm -lpthread $DLOPEN_LIBS" | ||||
|     GL_PC_LIB_PRIV="-lm -lpthread $DLOPEN_LIBS" | ||||
|     ;; | ||||
| osmesa) | ||||
|     # No libGL for osmesa | ||||
|     GL_LIB_DEPS="$OS_LIBS" | ||||
|     GL_LIB_DEPS="" | ||||
|     ;; | ||||
| esac | ||||
| AC_SUBST([GL_LIB_DEPS]) | ||||
| @@ -793,12 +786,12 @@ case "$mesa_driver" in | ||||
| osmesa) | ||||
|     # only link libraries with osmesa if shared | ||||
|     if test "$enable_static" = no; then | ||||
|         OSMESA_LIB_DEPS="-lm -lpthread $SELINUX_LIBS" | ||||
|         OSMESA_LIB_DEPS="-lm -lpthread $SELINUX_LIBS $DLOPEN_LIBS" | ||||
|     else | ||||
|         OSMESA_LIB_DEPS="" | ||||
|     fi | ||||
|     OSMESA_MESA_DEPS="" | ||||
|     OSMESA_PC_LIB_PRIV="-lm -lpthread $SELINUX_LIBS" | ||||
|     OSMESA_PC_LIB_PRIV="-lm -lpthread $SELINUX_LIBS $DLOPEN_LIBS" | ||||
|     ;; | ||||
| *) | ||||
|     # Link OSMesa to libGL otherwise | ||||
| @@ -812,10 +805,7 @@ osmesa) | ||||
|     OSMESA_PC_REQ="gl" | ||||
|     ;; | ||||
| esac | ||||
| if test "$enable_static" = no; then | ||||
|     OSMESA_LIB_DEPS="$OSMESA_LIB_DEPS $OS_LIBS" | ||||
| fi | ||||
| OSMESA_PC_LIB_PRIV="$OSMESA_PC_LIB_PRIV $OS_LIBS" | ||||
| OSMESA_PC_LIB_PRIV="$OSMESA_PC_LIB_PRIV" | ||||
| AC_SUBST([OSMESA_LIB_DEPS]) | ||||
| AC_SUBST([OSMESA_MESA_DEPS]) | ||||
| AC_SUBST([OSMESA_PC_REQ]) | ||||
| @@ -928,10 +918,10 @@ if test "x$enable_glw" = xyes; then | ||||
|     fi | ||||
|  | ||||
|     # If static, empty GLW_LIB_DEPS and add libs for programs to link | ||||
|     GLW_PC_LIB_PRIV="$GLW_PC_LIB_PRIV $OS_LIBS" | ||||
|     GLW_PC_LIB_PRIV="$GLW_PC_LIB_PRIV" | ||||
|     if test "$enable_static" = no; then | ||||
|         GLW_MESA_DEPS='-l$(GL_LIB)' | ||||
|         GLW_LIB_DEPS="$GLW_LIB_DEPS $OS_LIBS" | ||||
|         GLW_LIB_DEPS="$GLW_LIB_DEPS" | ||||
|     else | ||||
|         APP_LIB_DEPS="$APP_LIB_DEPS $GLW_LIB_DEPS" | ||||
|         GLW_LIB_DEPS="" | ||||
| @@ -987,8 +977,8 @@ if test "x$enable_glut" = xyes; then | ||||
|         GLUT_PC_LIB_PRIV="$GLUT_LIB_DEPS" | ||||
|         GLUT_PC_CFLAGS="$X11_INCLUDES" | ||||
|     fi | ||||
|     GLUT_LIB_DEPS="$GLUT_LIB_DEPS -lm $OS_LIBS" | ||||
|     GLUT_PC_LIB_PRIV="$GLUT_PC_LIB_PRIV -lm $OS_LIBS" | ||||
|     GLUT_LIB_DEPS="$GLUT_LIB_DEPS -lm" | ||||
|     GLUT_PC_LIB_PRIV="$GLUT_PC_LIB_PRIV -lm" | ||||
|  | ||||
|     # If glut is available, we can build most programs | ||||
|     if test "$with_demos" = yes; then | ||||
|   | ||||
| @@ -9,9 +9,7 @@ | ||||
| <H1>Downloading</H1> | ||||
|  | ||||
| <p> | ||||
| Current development release: <b>7.3</b> | ||||
| <br> | ||||
| Last stable release: <b>7.2</b> | ||||
| Current stable release: <b>7.4.3</b> | ||||
| </p> | ||||
|  | ||||
| <p> | ||||
|   | ||||
| @@ -11,6 +11,42 @@ | ||||
| <H1>News</H1> | ||||
|  | ||||
|  | ||||
| <h2>June 23, 2009</h2> | ||||
| <p> | ||||
| <a href="relnotes-7.4.4.html">Mesa 7.4.4</a> is released. | ||||
| This is a stable release that fixes a regression in the i915/i965 drivers | ||||
| that slipped into the 7.4.3 release. | ||||
| </p> | ||||
|  | ||||
|  | ||||
| <h2>June 19, 2009</h2> | ||||
| <p> | ||||
| <a href="relnotes-7.4.3.html">Mesa 7.4.3</a> is released. | ||||
| This is a stable release fixing bugs since the 7.4.2 release. | ||||
| </p> | ||||
|  | ||||
|  | ||||
| <h2>May 15, 2009</h2> | ||||
| <p> | ||||
| <a href="relnotes-7.4.2.html">Mesa 7.4.2</a> is released. | ||||
| This is a stable release fixing bugs since the 7.4.1 release. | ||||
| </p> | ||||
|  | ||||
|  | ||||
| <h2>April 18, 2009</h2> | ||||
| <p> | ||||
| <a href="relnotes-7.4.1.html">Mesa 7.4.1</a> is released. | ||||
| This is a stable release fixing bugs since the 7.4 release. | ||||
| </p> | ||||
|  | ||||
|  | ||||
| <h2>March 27, 2009</h2> | ||||
| <p> | ||||
| <a href="relnotes-7.4.html">Mesa 7.4</a> is released. | ||||
| This is a stable release fixing bugs since the 7.3 release. | ||||
| </p> | ||||
|  | ||||
|  | ||||
| <h2>January 22, 2009</h2> | ||||
| <p> | ||||
| <a href="relnotes-7.3.html">Mesa 7.3</a> is released. | ||||
|   | ||||
| @@ -22,7 +22,7 @@ Some drivers don't support all the features required in OpenGL 2.1. | ||||
| </p> | ||||
| <p> | ||||
| See the <a href="install.html">Compiling/Installing page</a> for prerequisites | ||||
| for DRI ardware acceleration. | ||||
| for DRI hardware acceleration. | ||||
| </p> | ||||
|  | ||||
|  | ||||
|   | ||||
							
								
								
									
										79
									
								
								docs/relnotes-7.4.1.html
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										79
									
								
								docs/relnotes-7.4.1.html
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,79 @@ | ||||
| <HTML> | ||||
|  | ||||
| <TITLE>Mesa Release Notes</TITLE> | ||||
|  | ||||
| <head><link rel="stylesheet" type="text/css" href="mesa.css"></head> | ||||
|  | ||||
| <BODY> | ||||
|  | ||||
| <body bgcolor="#eeeeee"> | ||||
|  | ||||
| <H1>Mesa 7.4.1 Release Notes / 18 April 2009</H1> | ||||
|  | ||||
| <p> | ||||
| Mesa 7.4.1 is a stable development release fixing bugs since the 7.4 release. | ||||
| </p> | ||||
| <p> | ||||
| Mesa 7.4.1 implements the OpenGL 2.1 API, but the version reported by | ||||
| glGetString(GL_VERSION) depends on the particular driver being used. | ||||
| Some drivers don't support all the features required in OpenGL 2.1. | ||||
| </p> | ||||
| <p> | ||||
| See the <a href="install.html">Compiling/Installing page</a> for prerequisites | ||||
| for DRI hardware acceleration. | ||||
| </p> | ||||
|  | ||||
|  | ||||
| <h2>MD5 checksums</h2> | ||||
| <pre> | ||||
| 0c3a72f3295a53a134c04bd7d209ea62  MesaLib-7.4.1.tar.gz | ||||
| 423260578b653818ba66c2fcbde6d7ad  MesaLib-7.4.1.tar.bz2 | ||||
| 84f78b154d4bd5c3ecc42eeff2e56676  MesaLib-7.4.1.zip | ||||
| aa0ad323e59d6d10ff33ac0dde462a60  MesaDemos-7.4.1.tar.gz | ||||
| 1e169fb6abc2b45613f1c98a82dfe690  MesaDemos-7.4.1.tar.bz2 | ||||
| 294e42be2d74176596c994ec23322fcf  MesaDemos-7.4.1.zip | ||||
| 92373bfa48e7b68dddf356e86b0e5699  MesaGLUT-7.4.1.tar.gz | ||||
| 336f3824b578b072211e0beecf4f04f4  MesaGLUT-7.4.1.tar.bz2 | ||||
| 20751388d8ef16b42d25d9e3d705d101  MesaGLUT-7.4.1.zip | ||||
| </pre> | ||||
|  | ||||
|  | ||||
| <h2>Bug fixes</h2> | ||||
| <ul> | ||||
| <li>Fixed a two-sided lighting bug in fixed-function-to-GPU code generation | ||||
| <li>Fixed some Darwin issues (Jeremy Huddleston) | ||||
| <li>Indexing the GLSL gl_EyePlane[] or gl_ObjectPlane[] arrays with a variable | ||||
|     was broken, bug 20986 | ||||
| <li>Fixed incorrect texture unit bias in TXB instruction | ||||
| <li>glTexParameter settings weren't always propogated to drivers | ||||
| <li>Assorted vertex/fragment program bug fixes | ||||
| <li>Fixed point rendering in software rasterizer | ||||
| <li>Fixed potential deadlock in object hash functions | ||||
| <li>Fix a couple bugs surrounding front-buffer rendering with DRI2, but this | ||||
|     is not quite complete. | ||||
| <li>Fixed glPopAttrib() bug when restoring user clip planes | ||||
| </ul> | ||||
|  | ||||
|  | ||||
|  | ||||
| <h2>Driver Status</h2> | ||||
|  | ||||
| <pre> | ||||
| Driver			Status | ||||
| ----------------------	---------------------- | ||||
| DRI drivers		varies with the driver | ||||
| XMesa/GLX (on Xlib)	implements OpenGL 2.1 | ||||
| OSMesa (off-screen)	implements OpenGL 2.1 | ||||
| Windows/Win32		implements OpenGL 2.1 | ||||
| Glide (3dfx Voodoo1/2)	implements OpenGL 1.3 | ||||
| SVGA			unsupported | ||||
| Wind River UGL		unsupported | ||||
| DJGPP			unsupported | ||||
| GGI			unsupported | ||||
| BeOS			unsupported | ||||
| Allegro			unsupported | ||||
| D3D			unsupported | ||||
| </pre> | ||||
|  | ||||
| </body> | ||||
| </html> | ||||
							
								
								
									
										74
									
								
								docs/relnotes-7.4.2.html
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										74
									
								
								docs/relnotes-7.4.2.html
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,74 @@ | ||||
| <HTML> | ||||
|  | ||||
| <TITLE>Mesa Release Notes</TITLE> | ||||
|  | ||||
| <head><link rel="stylesheet" type="text/css" href="mesa.css"></head> | ||||
|  | ||||
| <BODY> | ||||
|  | ||||
| <body bgcolor="#eeeeee"> | ||||
|  | ||||
| <H1>Mesa 7.4.2 Release Notes / May 15, 2009</H1> | ||||
|  | ||||
| <p> | ||||
| Mesa 7.4.2 is a stable development release fixing bugs since the 7.4.1 release. | ||||
| </p> | ||||
| <p> | ||||
| Mesa 7.4.2 implements the OpenGL 2.1 API, but the version reported by | ||||
| glGetString(GL_VERSION) depends on the particular driver being used. | ||||
| Some drivers don't support all the features required in OpenGL 2.1. | ||||
| </p> | ||||
| <p> | ||||
| See the <a href="install.html">Compiling/Installing page</a> for prerequisites | ||||
| for DRI hardware acceleration. | ||||
| </p> | ||||
|  | ||||
|  | ||||
| <h2>MD5 checksums</h2> | ||||
| <pre> | ||||
| 172f5193154dad731387f97bd44ab68f  MesaLib-7.4.2.tar.gz | ||||
| b10a76e32bde4645cfc34ea0416d7d8b  MesaLib-7.4.2.tar.bz2 | ||||
| cc6dfc2efd424cc342b84e6bcd78ce5d  MesaLib-7.4.2.zip | ||||
| 182a7e78aa7a480b3650a5c956dbddd1  MesaDemos-7.4.2.tar.gz | ||||
| bf559a0485667a3bfa4513a23501579b  MesaDemos-7.4.2.tar.bz2 | ||||
| 5379e622b65e8c22022dba34aeb6f4f9  MesaDemos-7.4.2.zip | ||||
| 7cc43c1c35bf6a279a16e063dea3b8c5  MesaGLUT-7.4.2.tar.gz | ||||
| e0dfc44d537904a030861e5b3c760c11  MesaGLUT-7.4.2.tar.bz2 | ||||
| 4a6cf5bbbac190d6ba97448b3098b7f4  MesaGLUT-7.4.2.zip | ||||
| </pre> | ||||
|  | ||||
|  | ||||
| <h2>Bug fixes</h2> | ||||
| <ul> | ||||
| <li>Fixed segfault when rendering to front buffer with DRI 1. | ||||
| <li>Fixed swrast texture rectangle bug when wrap mode = GL_CLAMP_TO_BORDER and | ||||
|     filter mode = GL_LINEAR.  (bug 21461) | ||||
| <li>Fixed texture object mem leak during context destruction. | ||||
| <li>Fixed a state validation bug in glCopyTex[Sub]Image() | ||||
| <li>Fixed some i965 GLSL bugs. | ||||
| <li>Fixed an R300 driver texture object bad memory reference. | ||||
| </ul> | ||||
|  | ||||
|  | ||||
|  | ||||
| <h2>Driver Status</h2> | ||||
|  | ||||
| <pre> | ||||
| Driver			Status | ||||
| ----------------------	---------------------- | ||||
| DRI drivers		varies with the driver | ||||
| XMesa/GLX (on Xlib)	implements OpenGL 2.1 | ||||
| OSMesa (off-screen)	implements OpenGL 2.1 | ||||
| Windows/Win32		implements OpenGL 2.1 | ||||
| Glide (3dfx Voodoo1/2)	implements OpenGL 1.3 | ||||
| SVGA			unsupported | ||||
| Wind River UGL		unsupported | ||||
| DJGPP			unsupported | ||||
| GGI			unsupported | ||||
| BeOS			unsupported | ||||
| Allegro			unsupported | ||||
| D3D			unsupported | ||||
| </pre> | ||||
|  | ||||
| </body> | ||||
| </html> | ||||
							
								
								
									
										79
									
								
								docs/relnotes-7.4.3.html
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										79
									
								
								docs/relnotes-7.4.3.html
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,79 @@ | ||||
| <HTML> | ||||
|  | ||||
| <TITLE>Mesa Release Notes</TITLE> | ||||
|  | ||||
| <head><link rel="stylesheet" type="text/css" href="mesa.css"></head> | ||||
|  | ||||
| <BODY> | ||||
|  | ||||
| <body bgcolor="#eeeeee"> | ||||
|  | ||||
| <H1>Mesa 7.4.3 Release Notes / 19 June 2009</H1> | ||||
|  | ||||
| <p> | ||||
| Mesa 7.4.3 is a stable development release fixing bugs since the 7.4.2 release. | ||||
| </p> | ||||
| <p> | ||||
| Mesa 7.4.3 implements the OpenGL 2.1 API, but the version reported by | ||||
| glGetString(GL_VERSION) depends on the particular driver being used. | ||||
| Some drivers don't support all the features required in OpenGL 2.1. | ||||
| </p> | ||||
| <p> | ||||
| See the <a href="install.html">Compiling/Installing page</a> for prerequisites | ||||
| for DRI hardware acceleration. | ||||
| </p> | ||||
|  | ||||
|  | ||||
| <h2>MD5 checksums</h2> | ||||
| <pre> | ||||
| 34c5a6c47ed51f31c4fa36e269831352  MesaLib-7.4.3.tar.gz | ||||
| 70a983ba3deaa8bd63b18bbab283f698  MesaLib-7.4.3.tar.bz2 | ||||
| 34f21b3205b271d575030aa98a2dda51  MesaLib-7.4.3.zip | ||||
| 56752b7adede212e6097afb10d0c0d59  MesaDemos-7.4.3.tar.gz | ||||
| 8ffa51c4833b1e298300a005e2d7ca2a  MesaDemos-7.4.3.tar.bz2 | ||||
| 0037d24d41400d6fb9800ae55b8c863f  MesaDemos-7.4.3.zip | ||||
| 20e24f6692c0c90e7e3b220f79c4108d  MesaGLUT-7.4.3.tar.gz | ||||
| 03a4beeef74fc5ef0b1d6d04710e5a8a  MesaGLUT-7.4.3.tar.bz2 | ||||
| 273788230adbdb9d57371309adedcf5f  MesaGLUT-7.4.3.zip | ||||
| </pre> | ||||
|  | ||||
|  | ||||
| <h2>Bug fixes</h2> | ||||
| <ul> | ||||
| <li>Fixed texture object reference counting bug (bug 21756) | ||||
| <li>Allow depth/stencil textures to be attached to GL_STENCIL_ATTACHMENT point | ||||
|     (SF bug 2793846) | ||||
| <li>Added missing glGet case for GL_VERTEX_ARRAY_BINDING_APPLE | ||||
| <li>Fixed some OSMesa build issues | ||||
| <li>Fixed a vertex buffer object crash | ||||
| <li>Fixed broken glTexImage3D() when image type = GL_BITMAP | ||||
| <li>Fixed some GLSL preprocessor bugs | ||||
| <li>Fixed framebuffer mem leak in i945/i965 DRI drivers | ||||
| <li>Fixed texture coordinate repeat bug in swrast (bug 21872) | ||||
| <li>Fixed incorrect viewport clamping (lower bound is zero, not one) | ||||
| <li>GLX fix for glean's makeCurrent test case | ||||
| </ul> | ||||
|  | ||||
|  | ||||
|  | ||||
| <h2>Driver Status</h2> | ||||
|  | ||||
| <pre> | ||||
| Driver			Status | ||||
| ----------------------	---------------------- | ||||
| DRI drivers		varies with the driver | ||||
| XMesa/GLX (on Xlib)	implements OpenGL 2.1 | ||||
| OSMesa (off-screen)	implements OpenGL 2.1 | ||||
| Windows/Win32		implements OpenGL 2.1 | ||||
| Glide (3dfx Voodoo1/2)	implements OpenGL 1.3 | ||||
| SVGA			unsupported | ||||
| Wind River UGL		unsupported | ||||
| DJGPP			unsupported | ||||
| GGI			unsupported | ||||
| BeOS			unsupported | ||||
| Allegro			unsupported | ||||
| D3D			unsupported | ||||
| </pre> | ||||
|  | ||||
| </body> | ||||
| </html> | ||||
							
								
								
									
										59
									
								
								docs/relnotes-7.4.4.html
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										59
									
								
								docs/relnotes-7.4.4.html
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,59 @@ | ||||
| <HTML> | ||||
|  | ||||
| <TITLE>Mesa Release Notes</TITLE> | ||||
|  | ||||
| <head><link rel="stylesheet" type="text/css" href="mesa.css"></head> | ||||
|  | ||||
| <BODY> | ||||
|  | ||||
| <body bgcolor="#eeeeee"> | ||||
|  | ||||
| <H1>Mesa 7.4.4 Release Notes / 23 June 2009</H1> | ||||
|  | ||||
| <p> | ||||
| Mesa 7.4.4 is a stable development release fixing bugs since the 7.4.3 release. | ||||
| </p> | ||||
| <p> | ||||
| Mesa 7.4.4 implements the OpenGL 2.1 API, but the version reported by | ||||
| glGetString(GL_VERSION) depends on the particular driver being used. | ||||
| Some drivers don't support all the features required in OpenGL 2.1. | ||||
| </p> | ||||
| <p> | ||||
| See the <a href="install.html">Compiling/Installing page</a> for prerequisites | ||||
| for DRI hardware acceleration. | ||||
| </p> | ||||
|  | ||||
|  | ||||
| <h2>MD5 checksums</h2> | ||||
| <pre> | ||||
| </pre> | ||||
|  | ||||
|  | ||||
| <h2>Bug fixes</h2> | ||||
| <ul> | ||||
| <li>Fixed i965/i915 segfault in screen destruction (bug 22408) | ||||
| </ul> | ||||
|  | ||||
|  | ||||
|  | ||||
| <h2>Driver Status</h2> | ||||
|  | ||||
| <pre> | ||||
| Driver			Status | ||||
| ----------------------	---------------------- | ||||
| DRI drivers		varies with the driver | ||||
| XMesa/GLX (on Xlib)	implements OpenGL 2.1 | ||||
| OSMesa (off-screen)	implements OpenGL 2.1 | ||||
| Windows/Win32		implements OpenGL 2.1 | ||||
| Glide (3dfx Voodoo1/2)	implements OpenGL 1.3 | ||||
| SVGA			unsupported | ||||
| Wind River UGL		unsupported | ||||
| DJGPP			unsupported | ||||
| GGI			unsupported | ||||
| BeOS			unsupported | ||||
| Allegro			unsupported | ||||
| D3D			unsupported | ||||
| </pre> | ||||
|  | ||||
| </body> | ||||
| </html> | ||||
| @@ -8,7 +8,7 @@ | ||||
|  | ||||
| <body bgcolor="#eeeeee"> | ||||
|  | ||||
| <H1>Mesa 7.4 Release Notes / date TBD</H1> | ||||
| <H1>Mesa 7.4 Release Notes / 27 March 2009</H1> | ||||
|  | ||||
| <p> | ||||
| Mesa 7.4 is a stable development release fixing bugs since the 7.3 release. | ||||
| @@ -20,27 +20,48 @@ Some drivers don't support all the features required in OpenGL 2.1. | ||||
| </p> | ||||
| <p> | ||||
| See the <a href="install.html">Compiling/Installing page</a> for prerequisites | ||||
| for DRI ardware acceleration. | ||||
| for DRI hardware acceleration. | ||||
| </p> | ||||
|  | ||||
|  | ||||
| <h2>MD5 checksums</h2> | ||||
| <pre> | ||||
| tbd | ||||
| ed6bd7437177307e51e16d0c7c381dfa  MesaLib-7.4.tar.gz | ||||
| 7ecddb341a2691e0dfdb02f697109834  MesaLib-7.4.tar.bz2 | ||||
| 433e823f8245f9fd5f397e7b719a8e47  MesaLib-7.4.zip | ||||
| 656eee6128016fb237e01aa8dabbc703  MesaDemos-7.4.tar.gz | ||||
| 02816f10f30b1dc5e069e0f68c177c98  MesaDemos-7.4.tar.bz2 | ||||
| 44a70d6db4aa4c64ecc47871b6aceee8  MesaDemos-7.4.zip | ||||
| 25f80db4f8645cd3e58e2c9af53ec341  MesaGLUT-7.4.tar.gz | ||||
| 04ec01caebde44f5b0d619f00716b368  MesaGLUT-7.4.tar.bz2 | ||||
| 019dc213baecaa3cb1278847d41b8591  MesaGLUT-7.4.zip | ||||
| </pre> | ||||
|  | ||||
|  | ||||
| <h2>New features</h2> | ||||
| <ul> | ||||
| <li>Added MESA_GLX_FORCE_DIRECT env var for Xlib/software driver | ||||
| <li>GLSL version 1.20 is returnd by the GL_SHADING_LANGUAGE_VERSION query | ||||
| </ul> | ||||
|  | ||||
|  | ||||
| <h2>Bug fixes</h2> | ||||
| <ul> | ||||
| <li>glGetActiveUniform() returned wrong size for some array types | ||||
| <li>Fixed some error checking in glUniform() | ||||
| <li>Fixed a potential glTexImage('proxy target') segfault | ||||
| <li>Fixed bad reference counting for 1D/2D texture arrays | ||||
| <li>Fixed VBO + glPush/PopClientAttrib() bug #19835 | ||||
| <li>Assorted i965 driver bug fixes | ||||
| <li>Fixed a Windows compilation failure in s_triangle.c | ||||
| <li>Fixed a GLSL array indexing bug | ||||
| <li>Fixes for building on Haiku | ||||
| </ul> | ||||
|  | ||||
| <h2>Changes</h2> | ||||
| <ul> | ||||
| <li>Updated GL/glxext.h to version 48 | ||||
| <li>Assorted updates for building on Solaris | ||||
| </ul> | ||||
|  | ||||
|  | ||||
|   | ||||
| @@ -8,18 +8,15 @@ | ||||
|  | ||||
| <H1>Release Notes</H1> | ||||
|  | ||||
| <p> | ||||
| Mesa uses an even/odd version number scheme like the Linux kernel. | ||||
| Odd numbered versions (such as 6.5) designate new developmental releases. | ||||
| Even numbered versions (such as 6.4) designate stable releases. | ||||
| </p> | ||||
|  | ||||
|  | ||||
| <p> | ||||
| The release notes summarize what's new or changed in each Mesa release. | ||||
| </p> | ||||
|  | ||||
| <UL> | ||||
| <LI><A HREF="relnotes-7.4.4.html">7.4.4 release notes</A> | ||||
| <LI><A HREF="relnotes-7.4.3.html">7.4.3 release notes</A> | ||||
| <LI><A HREF="relnotes-7.4.2.html">7.4.2 release notes</A> | ||||
| <LI><A HREF="relnotes-7.4.1.html">7.4.1 release notes</A> | ||||
| <LI><A HREF="relnotes-7.4.html">7.4 release notes</A> | ||||
| <LI><A HREF="relnotes-7.3.html">7.3 release notes</A> | ||||
| <LI><A HREF="relnotes-7.2.html">7.2 release notes</A> | ||||
|   | ||||
| @@ -169,6 +169,20 @@ the Gamma FAQ</a> | ||||
| </p> | ||||
|  | ||||
|  | ||||
| <H2>Direct Rendering Flag</H2> | ||||
| <p> | ||||
| Some applications won't run with indirect rendering contexts (which is | ||||
| what the Xlib driver supports). | ||||
| To force the glXIsDirect() query to return True, set the MESA_GLX_FORCE_DIRECT | ||||
| environment variable. | ||||
| For example: | ||||
| </p> | ||||
| <pre> | ||||
| 	$ export MESA_GLX_FORCE_DIRECT=1 | ||||
| </pre> | ||||
|  | ||||
|  | ||||
|  | ||||
| <H2>Overlay Planes</H2> | ||||
| <p> | ||||
| Hardware overlay planes are supported by the Xlib driver.  To | ||||
| @@ -268,6 +282,8 @@ This extension was added in Mesa 2.6 | ||||
|    MESA_BACK_BUFFER - specifies how to implement the back color buffer (X only) | ||||
|    MESA_PRIVATE_CMAP - force aux/tk libraries to use private colormaps (X only) | ||||
|    MESA_GAMMA - gamma correction coefficients (X only) | ||||
|    MESA_GLX_FORCE_DIRECT - report that the driver is direct rendering, even | ||||
|       though it's not. | ||||
| </pre> | ||||
|  | ||||
|  | ||||
|   | ||||
| @@ -1,6 +1,6 @@ | ||||
| /* | ||||
|  * Mesa 3-D graphics library | ||||
|  * Version:  6.5.1 | ||||
|  * Version:  7.4 | ||||
|  * | ||||
|  * Copyright (C) 1999-2006  Brian Paul   All Rights Reserved. | ||||
|  * | ||||
|   | ||||
| @@ -48,34 +48,49 @@ | ||||
| #define glAsyncMarkerSGIX		MANGLE(AsyncMarkerSGIX) | ||||
| #define glAttachObjectARB		MANGLE(AttachObjectARB) | ||||
| #define glAttachShader		MANGLE(AttachShader) | ||||
| #define glBeginConditionalRender		MANGLE(BeginConditionalRender) | ||||
| #define glBeginConditionalRenderNV		MANGLE(BeginConditionalRenderNV) | ||||
| #define glBeginFragmentShaderATI		MANGLE(BeginFragmentShaderATI) | ||||
| #define glBegin		MANGLE(Begin) | ||||
| #define glBeginOcclusionQueryNV		MANGLE(BeginOcclusionQueryNV) | ||||
| #define glBeginQueryARB		MANGLE(BeginQueryARB) | ||||
| #define glBeginQuery		MANGLE(BeginQuery) | ||||
| #define glBeginTransformFeedbackEXT		MANGLE(BeginTransformFeedbackEXT) | ||||
| #define glBeginTransformFeedback		MANGLE(BeginTransformFeedback) | ||||
| #define glBeginTransformFeedbackNV		MANGLE(BeginTransformFeedbackNV) | ||||
| #define glBeginVertexShaderEXT		MANGLE(BeginVertexShaderEXT) | ||||
| #define glBindAttribLocationARB		MANGLE(BindAttribLocationARB) | ||||
| #define glBindAttribLocation		MANGLE(BindAttribLocation) | ||||
| #define glBindBufferARB		MANGLE(BindBufferARB) | ||||
| #define glBindBufferBaseEXT		MANGLE(BindBufferBaseEXT) | ||||
| #define glBindBufferBase		MANGLE(BindBufferBase) | ||||
| #define glBindBufferBaseNV		MANGLE(BindBufferBaseNV) | ||||
| #define glBindBuffer		MANGLE(BindBuffer) | ||||
| #define glBindBufferOffsetEXT		MANGLE(BindBufferOffsetEXT) | ||||
| #define glBindBufferOffsetNV		MANGLE(BindBufferOffsetNV) | ||||
| #define glBindBufferRangeEXT		MANGLE(BindBufferRangeEXT) | ||||
| #define glBindBufferRange		MANGLE(BindBufferRange) | ||||
| #define glBindBufferRangeNV		MANGLE(BindBufferRangeNV) | ||||
| #define glBindFragDataLocationEXT		MANGLE(BindFragDataLocationEXT) | ||||
| #define glBindFragDataLocation		MANGLE(BindFragDataLocation) | ||||
| #define glBindFragmentShaderATI		MANGLE(BindFragmentShaderATI) | ||||
| #define glBindFramebufferEXT		MANGLE(BindFramebufferEXT) | ||||
| #define glBindFramebuffer		MANGLE(BindFramebuffer) | ||||
| #define glBindLightParameterEXT		MANGLE(BindLightParameterEXT) | ||||
| #define glBindMaterialParameterEXT		MANGLE(BindMaterialParameterEXT) | ||||
| #define glBindMultiTextureEXT		MANGLE(BindMultiTextureEXT) | ||||
| #define glBindParameterEXT		MANGLE(BindParameterEXT) | ||||
| #define glBindProgramARB		MANGLE(BindProgramARB) | ||||
| #define glBindProgramNV		MANGLE(BindProgramNV) | ||||
| #define glBindRenderbufferEXT		MANGLE(BindRenderbufferEXT) | ||||
| #define glBindRenderbuffer		MANGLE(BindRenderbuffer) | ||||
| #define glBindTexGenParameterEXT		MANGLE(BindTexGenParameterEXT) | ||||
| #define glBindTextureEXT		MANGLE(BindTextureEXT) | ||||
| #define glBindTexture		MANGLE(BindTexture) | ||||
| #define glBindTextureUnitParameterEXT		MANGLE(BindTextureUnitParameterEXT) | ||||
| #define glBindTransformFeedbackNV		MANGLE(BindTransformFeedbackNV) | ||||
| #define glBindVertexArrayAPPLE		MANGLE(BindVertexArrayAPPLE) | ||||
| #define glBindVertexArray		MANGLE(BindVertexArray) | ||||
| #define glBindVertexShaderEXT		MANGLE(BindVertexShaderEXT) | ||||
| #define glBinormal3bEXT		MANGLE(Binormal3bEXT) | ||||
| #define glBinormal3bvEXT		MANGLE(Binormal3bvEXT) | ||||
| @@ -101,6 +116,7 @@ | ||||
| #define glBlendFuncSeparateINGR		MANGLE(BlendFuncSeparateINGR) | ||||
| #define glBlendFuncSeparate		MANGLE(BlendFuncSeparate) | ||||
| #define glBlitFramebufferEXT		MANGLE(BlitFramebufferEXT) | ||||
| #define glBlitFramebuffer		MANGLE(BlitFramebuffer) | ||||
| #define glBufferDataARB		MANGLE(BufferDataARB) | ||||
| #define glBufferData		MANGLE(BufferData) | ||||
| #define glBufferParameteriAPPLE		MANGLE(BufferParameteriAPPLE) | ||||
| @@ -109,8 +125,15 @@ | ||||
| #define glCallList		MANGLE(CallList) | ||||
| #define glCallLists		MANGLE(CallLists) | ||||
| #define glCheckFramebufferStatusEXT		MANGLE(CheckFramebufferStatusEXT) | ||||
| #define glCheckFramebufferStatus		MANGLE(CheckFramebufferStatus) | ||||
| #define glCheckNamedFramebufferStatusEXT		MANGLE(CheckNamedFramebufferStatusEXT) | ||||
| #define glClampColorARB		MANGLE(ClampColorARB) | ||||
| #define glClampColor		MANGLE(ClampColor) | ||||
| #define glClearAccum		MANGLE(ClearAccum) | ||||
| #define glClearBufferfi		MANGLE(ClearBufferfi) | ||||
| #define glClearBufferfv		MANGLE(ClearBufferfv) | ||||
| #define glClearBufferiv		MANGLE(ClearBufferiv) | ||||
| #define glClearBufferuiv		MANGLE(ClearBufferuiv) | ||||
| #define glClearColorIiEXT		MANGLE(ClearColorIiEXT) | ||||
| #define glClearColorIuiEXT		MANGLE(ClearColorIuiEXT) | ||||
| #define glClearColor		MANGLE(ClearColor) | ||||
| @@ -123,6 +146,7 @@ | ||||
| #define glClientActiveTextureARB		MANGLE(ClientActiveTextureARB) | ||||
| #define glClientActiveTexture		MANGLE(ClientActiveTexture) | ||||
| #define glClientActiveVertexStreamATI		MANGLE(ClientActiveVertexStreamATI) | ||||
| #define glClientAttribDefaultEXT		MANGLE(ClientAttribDefaultEXT) | ||||
| #define glClipPlane		MANGLE(ClipPlane) | ||||
| #define glColor3b		MANGLE(Color3b) | ||||
| #define glColor3bv		MANGLE(Color3bv) | ||||
| @@ -171,6 +195,7 @@ | ||||
| #define glColorFragmentOp1ATI		MANGLE(ColorFragmentOp1ATI) | ||||
| #define glColorFragmentOp2ATI		MANGLE(ColorFragmentOp2ATI) | ||||
| #define glColorFragmentOp3ATI		MANGLE(ColorFragmentOp3ATI) | ||||
| #define glColorMaski		MANGLE(ColorMaski) | ||||
| #define glColorMaskIndexedEXT		MANGLE(ColorMaskIndexedEXT) | ||||
| #define glColorMask		MANGLE(ColorMask) | ||||
| #define glColorMaterial		MANGLE(ColorMaterial) | ||||
| @@ -196,6 +221,12 @@ | ||||
| #define glCombinerStageParameterfvNV		MANGLE(CombinerStageParameterfvNV) | ||||
| #define glCompileShaderARB		MANGLE(CompileShaderARB) | ||||
| #define glCompileShader		MANGLE(CompileShader) | ||||
| #define glCompressedMultiTexImage1DEXT		MANGLE(CompressedMultiTexImage1DEXT) | ||||
| #define glCompressedMultiTexImage2DEXT		MANGLE(CompressedMultiTexImage2DEXT) | ||||
| #define glCompressedMultiTexImage3DEXT		MANGLE(CompressedMultiTexImage3DEXT) | ||||
| #define glCompressedMultiTexSubImage1DEXT		MANGLE(CompressedMultiTexSubImage1DEXT) | ||||
| #define glCompressedMultiTexSubImage2DEXT		MANGLE(CompressedMultiTexSubImage2DEXT) | ||||
| #define glCompressedMultiTexSubImage3DEXT		MANGLE(CompressedMultiTexSubImage3DEXT) | ||||
| #define glCompressedTexImage1DARB		MANGLE(CompressedTexImage1DARB) | ||||
| #define glCompressedTexImage1D		MANGLE(CompressedTexImage1D) | ||||
| #define glCompressedTexImage2DARB		MANGLE(CompressedTexImage2DARB) | ||||
| @@ -208,6 +239,12 @@ | ||||
| #define glCompressedTexSubImage2D		MANGLE(CompressedTexSubImage2D) | ||||
| #define glCompressedTexSubImage3DARB		MANGLE(CompressedTexSubImage3DARB) | ||||
| #define glCompressedTexSubImage3D		MANGLE(CompressedTexSubImage3D) | ||||
| #define glCompressedTextureImage1DEXT		MANGLE(CompressedTextureImage1DEXT) | ||||
| #define glCompressedTextureImage2DEXT		MANGLE(CompressedTextureImage2DEXT) | ||||
| #define glCompressedTextureImage3DEXT		MANGLE(CompressedTextureImage3DEXT) | ||||
| #define glCompressedTextureSubImage1DEXT		MANGLE(CompressedTextureSubImage1DEXT) | ||||
| #define glCompressedTextureSubImage2DEXT		MANGLE(CompressedTextureSubImage2DEXT) | ||||
| #define glCompressedTextureSubImage3DEXT		MANGLE(CompressedTextureSubImage3DEXT) | ||||
| #define glConvolutionFilter1DEXT		MANGLE(ConvolutionFilter1DEXT) | ||||
| #define glConvolutionFilter1D		MANGLE(ConvolutionFilter1D) | ||||
| #define glConvolutionFilter2DEXT		MANGLE(ConvolutionFilter2DEXT) | ||||
| @@ -228,6 +265,11 @@ | ||||
| #define glCopyConvolutionFilter1D		MANGLE(CopyConvolutionFilter1D) | ||||
| #define glCopyConvolutionFilter2DEXT		MANGLE(CopyConvolutionFilter2DEXT) | ||||
| #define glCopyConvolutionFilter2D		MANGLE(CopyConvolutionFilter2D) | ||||
| #define glCopyMultiTexImage1DEXT		MANGLE(CopyMultiTexImage1DEXT) | ||||
| #define glCopyMultiTexImage2DEXT		MANGLE(CopyMultiTexImage2DEXT) | ||||
| #define glCopyMultiTexSubImage1DEXT		MANGLE(CopyMultiTexSubImage1DEXT) | ||||
| #define glCopyMultiTexSubImage2DEXT		MANGLE(CopyMultiTexSubImage2DEXT) | ||||
| #define glCopyMultiTexSubImage3DEXT		MANGLE(CopyMultiTexSubImage3DEXT) | ||||
| #define glCopyPixels		MANGLE(CopyPixels) | ||||
| #define glCopyTexImage1DEXT		MANGLE(CopyTexImage1DEXT) | ||||
| #define glCopyTexImage1D		MANGLE(CopyTexImage1D) | ||||
| @@ -239,6 +281,11 @@ | ||||
| #define glCopyTexSubImage2D		MANGLE(CopyTexSubImage2D) | ||||
| #define glCopyTexSubImage3DEXT		MANGLE(CopyTexSubImage3DEXT) | ||||
| #define glCopyTexSubImage3D		MANGLE(CopyTexSubImage3D) | ||||
| #define glCopyTextureImage1DEXT		MANGLE(CopyTextureImage1DEXT) | ||||
| #define glCopyTextureImage2DEXT		MANGLE(CopyTextureImage2DEXT) | ||||
| #define glCopyTextureSubImage1DEXT		MANGLE(CopyTextureSubImage1DEXT) | ||||
| #define glCopyTextureSubImage2DEXT		MANGLE(CopyTextureSubImage2DEXT) | ||||
| #define glCopyTextureSubImage3DEXT		MANGLE(CopyTextureSubImage3DEXT) | ||||
| #define glCreateDebugObjectMESA		MANGLE(CreateDebugObjectMESA) | ||||
| #define glCreateProgram		MANGLE(CreateProgram) | ||||
| #define glCreateProgramObjectARB		MANGLE(CreateProgramObjectARB) | ||||
| @@ -258,6 +305,7 @@ | ||||
| #define glDeleteFencesNV		MANGLE(DeleteFencesNV) | ||||
| #define glDeleteFragmentShaderATI		MANGLE(DeleteFragmentShaderATI) | ||||
| #define glDeleteFramebuffersEXT		MANGLE(DeleteFramebuffersEXT) | ||||
| #define glDeleteFramebuffers		MANGLE(DeleteFramebuffers) | ||||
| #define glDeleteLists		MANGLE(DeleteLists) | ||||
| #define glDeleteObjectARB		MANGLE(DeleteObjectARB) | ||||
| #define glDeleteOcclusionQueriesNV		MANGLE(DeleteOcclusionQueriesNV) | ||||
| @@ -267,10 +315,13 @@ | ||||
| #define glDeleteQueriesARB		MANGLE(DeleteQueriesARB) | ||||
| #define glDeleteQueries		MANGLE(DeleteQueries) | ||||
| #define glDeleteRenderbuffersEXT		MANGLE(DeleteRenderbuffersEXT) | ||||
| #define glDeleteRenderbuffers		MANGLE(DeleteRenderbuffers) | ||||
| #define glDeleteShader		MANGLE(DeleteShader) | ||||
| #define glDeleteTexturesEXT		MANGLE(DeleteTexturesEXT) | ||||
| #define glDeleteTextures		MANGLE(DeleteTextures) | ||||
| #define glDeleteTransformFeedbacksNV		MANGLE(DeleteTransformFeedbacksNV) | ||||
| #define glDeleteVertexArraysAPPLE		MANGLE(DeleteVertexArraysAPPLE) | ||||
| #define glDeleteVertexArrays		MANGLE(DeleteVertexArrays) | ||||
| #define glDeleteVertexShaderEXT		MANGLE(DeleteVertexShaderEXT) | ||||
| #define glDepthBoundsdNV		MANGLE(DepthBoundsdNV) | ||||
| #define glDepthBoundsEXT		MANGLE(DepthBoundsEXT) | ||||
| @@ -281,13 +332,16 @@ | ||||
| #define glDetachObjectARB		MANGLE(DetachObjectARB) | ||||
| #define glDetachShader		MANGLE(DetachShader) | ||||
| #define glDetailTexFuncSGIS		MANGLE(DetailTexFuncSGIS) | ||||
| #define glDisableClientStateIndexedEXT		MANGLE(DisableClientStateIndexedEXT) | ||||
| #define glDisableClientState		MANGLE(DisableClientState) | ||||
| #define glDisablei		MANGLE(Disablei) | ||||
| #define glDisableIndexedEXT		MANGLE(DisableIndexedEXT) | ||||
| #define glDisable		MANGLE(Disable) | ||||
| #define glDisableVariantClientStateEXT		MANGLE(DisableVariantClientStateEXT) | ||||
| #define glDisableVertexAttribArrayARB		MANGLE(DisableVertexAttribArrayARB) | ||||
| #define glDisableVertexAttribArray		MANGLE(DisableVertexAttribArray) | ||||
| #define glDrawArraysEXT		MANGLE(DrawArraysEXT) | ||||
| #define glDrawArraysInstancedARB		MANGLE(DrawArraysInstancedARB) | ||||
| #define glDrawArraysInstancedEXT		MANGLE(DrawArraysInstancedEXT) | ||||
| #define glDrawArrays		MANGLE(DrawArrays) | ||||
| #define glDrawBuffer		MANGLE(DrawBuffer) | ||||
| @@ -296,6 +350,7 @@ | ||||
| #define glDrawBuffers		MANGLE(DrawBuffers) | ||||
| #define glDrawElementArrayAPPLE		MANGLE(DrawElementArrayAPPLE) | ||||
| #define glDrawElementArrayATI		MANGLE(DrawElementArrayATI) | ||||
| #define glDrawElementsInstancedARB		MANGLE(DrawElementsInstancedARB) | ||||
| #define glDrawElementsInstancedEXT		MANGLE(DrawElementsInstancedEXT) | ||||
| #define glDrawElements		MANGLE(DrawElements) | ||||
| #define glDrawMeshArraysSUN		MANGLE(DrawMeshArraysSUN) | ||||
| @@ -304,6 +359,7 @@ | ||||
| #define glDrawRangeElementArrayATI		MANGLE(DrawRangeElementArrayATI) | ||||
| #define glDrawRangeElementsEXT		MANGLE(DrawRangeElementsEXT) | ||||
| #define glDrawRangeElements		MANGLE(DrawRangeElements) | ||||
| #define glDrawTransformFeedbackNV		MANGLE(DrawTransformFeedbackNV) | ||||
| #define glEdgeFlag		MANGLE(EdgeFlag) | ||||
| #define glEdgeFlagPointerEXT		MANGLE(EdgeFlagPointerEXT) | ||||
| #define glEdgeFlagPointerListIBM		MANGLE(EdgeFlagPointerListIBM) | ||||
| @@ -311,18 +367,24 @@ | ||||
| #define glEdgeFlagv		MANGLE(EdgeFlagv) | ||||
| #define glElementPointerAPPLE		MANGLE(ElementPointerAPPLE) | ||||
| #define glElementPointerATI		MANGLE(ElementPointerATI) | ||||
| #define glEnableClientStateIndexedEXT		MANGLE(EnableClientStateIndexedEXT) | ||||
| #define glEnableClientState		MANGLE(EnableClientState) | ||||
| #define glEnablei		MANGLE(Enablei) | ||||
| #define glEnableIndexedEXT		MANGLE(EnableIndexedEXT) | ||||
| #define glEnable		MANGLE(Enable) | ||||
| #define glEnableVariantClientStateEXT		MANGLE(EnableVariantClientStateEXT) | ||||
| #define glEnableVertexAttribArrayARB		MANGLE(EnableVertexAttribArrayARB) | ||||
| #define glEnableVertexAttribArray		MANGLE(EnableVertexAttribArray) | ||||
| #define glEndConditionalRender		MANGLE(EndConditionalRender) | ||||
| #define glEndConditionalRenderNV		MANGLE(EndConditionalRenderNV) | ||||
| #define glEndFragmentShaderATI		MANGLE(EndFragmentShaderATI) | ||||
| #define glEndList		MANGLE(EndList) | ||||
| #define glEnd		MANGLE(End) | ||||
| #define glEndOcclusionQueryNV		MANGLE(EndOcclusionQueryNV) | ||||
| #define glEndQueryARB		MANGLE(EndQueryARB) | ||||
| #define glEndQuery		MANGLE(EndQuery) | ||||
| #define glEndTransformFeedbackEXT		MANGLE(EndTransformFeedbackEXT) | ||||
| #define glEndTransformFeedback		MANGLE(EndTransformFeedback) | ||||
| #define glEndTransformFeedbackNV		MANGLE(EndTransformFeedbackNV) | ||||
| #define glEndVertexShaderEXT		MANGLE(EndVertexShaderEXT) | ||||
| #define glEvalCoord1d		MANGLE(EvalCoord1d) | ||||
| @@ -350,6 +412,7 @@ | ||||
| #define glFinishTextureSUNX		MANGLE(FinishTextureSUNX) | ||||
| #define glFlush		MANGLE(Flush) | ||||
| #define glFlushMappedBufferRangeAPPLE		MANGLE(FlushMappedBufferRangeAPPLE) | ||||
| #define glFlushMappedBufferRange		MANGLE(FlushMappedBufferRange) | ||||
| #define glFlushPixelDataRangeNV		MANGLE(FlushPixelDataRangeNV) | ||||
| #define glFlushRasterSGIX		MANGLE(FlushRasterSGIX) | ||||
| #define glFlushVertexArrayRangeAPPLE		MANGLE(FlushVertexArrayRangeAPPLE) | ||||
| @@ -385,13 +448,25 @@ | ||||
| #define glFragmentMaterialfvSGIX		MANGLE(FragmentMaterialfvSGIX) | ||||
| #define glFragmentMaterialiSGIX		MANGLE(FragmentMaterialiSGIX) | ||||
| #define glFragmentMaterialivSGIX		MANGLE(FragmentMaterialivSGIX) | ||||
| #define glFramebufferDrawBufferEXT		MANGLE(FramebufferDrawBufferEXT) | ||||
| #define glFramebufferDrawBuffersEXT		MANGLE(FramebufferDrawBuffersEXT) | ||||
| #define glFramebufferReadBufferEXT		MANGLE(FramebufferReadBufferEXT) | ||||
| #define glFramebufferRenderbufferEXT		MANGLE(FramebufferRenderbufferEXT) | ||||
| #define glFramebufferRenderbuffer		MANGLE(FramebufferRenderbuffer) | ||||
| #define glFramebufferTexture1DEXT		MANGLE(FramebufferTexture1DEXT) | ||||
| #define glFramebufferTexture1D		MANGLE(FramebufferTexture1D) | ||||
| #define glFramebufferTexture2DEXT		MANGLE(FramebufferTexture2DEXT) | ||||
| #define glFramebufferTexture2D		MANGLE(FramebufferTexture2D) | ||||
| #define glFramebufferTexture3DEXT		MANGLE(FramebufferTexture3DEXT) | ||||
| #define glFramebufferTexture3D		MANGLE(FramebufferTexture3D) | ||||
| #define glFramebufferTextureARB		MANGLE(FramebufferTextureARB) | ||||
| #define glFramebufferTextureEXT		MANGLE(FramebufferTextureEXT) | ||||
| #define glFramebufferTextureFaceARB		MANGLE(FramebufferTextureFaceARB) | ||||
| #define glFramebufferTextureFaceEXT		MANGLE(FramebufferTextureFaceEXT) | ||||
| #define glFramebufferTextureLayerARB		MANGLE(FramebufferTextureLayerARB) | ||||
| #define glFramebufferTextureLayerEXT		MANGLE(FramebufferTextureLayerEXT) | ||||
| #define glFramebufferTextureLayer		MANGLE(FramebufferTextureLayer) | ||||
| #define glFrameTerminatorGREMEDY		MANGLE(FrameTerminatorGREMEDY) | ||||
| #define glFrameZoomSGIX		MANGLE(FrameZoomSGIX) | ||||
| #define glFreeObjectBufferATI		MANGLE(FreeObjectBufferATI) | ||||
| #define glFrontFace		MANGLE(FrontFace) | ||||
| @@ -400,10 +475,14 @@ | ||||
| #define glGenBuffersARB		MANGLE(GenBuffersARB) | ||||
| #define glGenBuffers		MANGLE(GenBuffers) | ||||
| #define glGenerateMipmapEXT		MANGLE(GenerateMipmapEXT) | ||||
| #define glGenerateMipmap		MANGLE(GenerateMipmap) | ||||
| #define glGenerateMultiTexMipmapEXT		MANGLE(GenerateMultiTexMipmapEXT) | ||||
| #define glGenerateTextureMipmapEXT		MANGLE(GenerateTextureMipmapEXT) | ||||
| #define glGenFencesAPPLE		MANGLE(GenFencesAPPLE) | ||||
| #define glGenFencesNV		MANGLE(GenFencesNV) | ||||
| #define glGenFragmentShadersATI		MANGLE(GenFragmentShadersATI) | ||||
| #define glGenFramebuffersEXT		MANGLE(GenFramebuffersEXT) | ||||
| #define glGenFramebuffers		MANGLE(GenFramebuffers) | ||||
| #define glGenLists		MANGLE(GenLists) | ||||
| #define glGenOcclusionQueriesNV		MANGLE(GenOcclusionQueriesNV) | ||||
| #define glGenProgramsARB		MANGLE(GenProgramsARB) | ||||
| @@ -411,10 +490,13 @@ | ||||
| #define glGenQueriesARB		MANGLE(GenQueriesARB) | ||||
| #define glGenQueries		MANGLE(GenQueries) | ||||
| #define glGenRenderbuffersEXT		MANGLE(GenRenderbuffersEXT) | ||||
| #define glGenRenderbuffers		MANGLE(GenRenderbuffers) | ||||
| #define glGenSymbolsEXT		MANGLE(GenSymbolsEXT) | ||||
| #define glGenTexturesEXT		MANGLE(GenTexturesEXT) | ||||
| #define glGenTextures		MANGLE(GenTextures) | ||||
| #define glGenTransformFeedbacksNV		MANGLE(GenTransformFeedbacksNV) | ||||
| #define glGenVertexArraysAPPLE		MANGLE(GenVertexArraysAPPLE) | ||||
| #define glGenVertexArrays		MANGLE(GenVertexArrays) | ||||
| #define glGenVertexShadersEXT		MANGLE(GenVertexShadersEXT) | ||||
| #define glGetActiveAttribARB		MANGLE(GetActiveAttribARB) | ||||
| #define glGetActiveAttrib		MANGLE(GetActiveAttrib) | ||||
| @@ -428,6 +510,7 @@ | ||||
| #define glGetAttribLocationARB		MANGLE(GetAttribLocationARB) | ||||
| #define glGetAttribLocation		MANGLE(GetAttribLocation) | ||||
| #define glGetBooleanIndexedvEXT		MANGLE(GetBooleanIndexedvEXT) | ||||
| #define glGetBooleani_v		MANGLE(GetBooleani_v) | ||||
| #define glGetBooleanv		MANGLE(GetBooleanv) | ||||
| #define glGetBufferParameterivARB		MANGLE(GetBufferParameterivARB) | ||||
| #define glGetBufferParameteriv		MANGLE(GetBufferParameteriv) | ||||
| @@ -450,8 +533,10 @@ | ||||
| #define glGetCombinerOutputParameterfvNV		MANGLE(GetCombinerOutputParameterfvNV) | ||||
| #define glGetCombinerOutputParameterivNV		MANGLE(GetCombinerOutputParameterivNV) | ||||
| #define glGetCombinerStageParameterfvNV		MANGLE(GetCombinerStageParameterfvNV) | ||||
| #define glGetCompressedMultiTexImageEXT		MANGLE(GetCompressedMultiTexImageEXT) | ||||
| #define glGetCompressedTexImageARB		MANGLE(GetCompressedTexImageARB) | ||||
| #define glGetCompressedTexImage		MANGLE(GetCompressedTexImage) | ||||
| #define glGetCompressedTextureImageEXT		MANGLE(GetCompressedTextureImageEXT) | ||||
| #define glGetConvolutionFilterEXT		MANGLE(GetConvolutionFilterEXT) | ||||
| #define glGetConvolutionFilter		MANGLE(GetConvolutionFilter) | ||||
| #define glGetConvolutionParameterfvEXT		MANGLE(GetConvolutionParameterfvEXT) | ||||
| @@ -461,19 +546,24 @@ | ||||
| #define glGetDebugLogLengthMESA		MANGLE(GetDebugLogLengthMESA) | ||||
| #define glGetDebugLogMESA		MANGLE(GetDebugLogMESA) | ||||
| #define glGetDetailTexFuncSGIS		MANGLE(GetDetailTexFuncSGIS) | ||||
| #define glGetDoubleIndexedvEXT		MANGLE(GetDoubleIndexedvEXT) | ||||
| #define glGetDoublev		MANGLE(GetDoublev) | ||||
| #define glGetError		MANGLE(GetError) | ||||
| #define glGetFenceivNV		MANGLE(GetFenceivNV) | ||||
| #define glGetFinalCombinerInputParameterfvNV		MANGLE(GetFinalCombinerInputParameterfvNV) | ||||
| #define glGetFinalCombinerInputParameterivNV		MANGLE(GetFinalCombinerInputParameterivNV) | ||||
| #define glGetFloatIndexedvEXT		MANGLE(GetFloatIndexedvEXT) | ||||
| #define glGetFloatv		MANGLE(GetFloatv) | ||||
| #define glGetFogFuncSGIS		MANGLE(GetFogFuncSGIS) | ||||
| #define glGetFragDataLocationEXT		MANGLE(GetFragDataLocationEXT) | ||||
| #define glGetFragDataLocation		MANGLE(GetFragDataLocation) | ||||
| #define glGetFragmentLightfvSGIX		MANGLE(GetFragmentLightfvSGIX) | ||||
| #define glGetFragmentLightivSGIX		MANGLE(GetFragmentLightivSGIX) | ||||
| #define glGetFragmentMaterialfvSGIX		MANGLE(GetFragmentMaterialfvSGIX) | ||||
| #define glGetFragmentMaterialivSGIX		MANGLE(GetFragmentMaterialivSGIX) | ||||
| #define glGetFramebufferAttachmentParameterivEXT		MANGLE(GetFramebufferAttachmentParameterivEXT) | ||||
| #define glGetFramebufferAttachmentParameteriv		MANGLE(GetFramebufferAttachmentParameteriv) | ||||
| #define glGetFramebufferParameterivEXT		MANGLE(GetFramebufferParameterivEXT) | ||||
| #define glGetHandleARB		MANGLE(GetHandleARB) | ||||
| #define glGetHistogramEXT		MANGLE(GetHistogramEXT) | ||||
| #define glGetHistogram		MANGLE(GetHistogram) | ||||
| @@ -486,6 +576,7 @@ | ||||
| #define glGetInfoLogARB		MANGLE(GetInfoLogARB) | ||||
| #define glGetInstrumentsSGIX		MANGLE(GetInstrumentsSGIX) | ||||
| #define glGetIntegerIndexedvEXT		MANGLE(GetIntegerIndexedvEXT) | ||||
| #define glGetIntegeri_v		MANGLE(GetIntegeri_v) | ||||
| #define glGetIntegerv		MANGLE(GetIntegerv) | ||||
| #define glGetInvariantBooleanvEXT		MANGLE(GetInvariantBooleanvEXT) | ||||
| #define glGetInvariantFloatvEXT		MANGLE(GetInvariantFloatvEXT) | ||||
| @@ -513,6 +604,30 @@ | ||||
| #define glGetMinmaxParameterfv		MANGLE(GetMinmaxParameterfv) | ||||
| #define glGetMinmaxParameterivEXT		MANGLE(GetMinmaxParameterivEXT) | ||||
| #define glGetMinmaxParameteriv		MANGLE(GetMinmaxParameteriv) | ||||
| #define glGetMultisamplefvNV		MANGLE(GetMultisamplefvNV) | ||||
| #define glGetMultiTexEnvfvEXT		MANGLE(GetMultiTexEnvfvEXT) | ||||
| #define glGetMultiTexEnvivEXT		MANGLE(GetMultiTexEnvivEXT) | ||||
| #define glGetMultiTexGendvEXT		MANGLE(GetMultiTexGendvEXT) | ||||
| #define glGetMultiTexGenfvEXT		MANGLE(GetMultiTexGenfvEXT) | ||||
| #define glGetMultiTexGenivEXT		MANGLE(GetMultiTexGenivEXT) | ||||
| #define glGetMultiTexImageEXT		MANGLE(GetMultiTexImageEXT) | ||||
| #define glGetMultiTexLevelParameterfvEXT		MANGLE(GetMultiTexLevelParameterfvEXT) | ||||
| #define glGetMultiTexLevelParameterivEXT		MANGLE(GetMultiTexLevelParameterivEXT) | ||||
| #define glGetMultiTexParameterfvEXT		MANGLE(GetMultiTexParameterfvEXT) | ||||
| #define glGetMultiTexParameterIivEXT		MANGLE(GetMultiTexParameterIivEXT) | ||||
| #define glGetMultiTexParameterIuivEXT		MANGLE(GetMultiTexParameterIuivEXT) | ||||
| #define glGetMultiTexParameterivEXT		MANGLE(GetMultiTexParameterivEXT) | ||||
| #define glGetNamedBufferParameterivEXT		MANGLE(GetNamedBufferParameterivEXT) | ||||
| #define glGetNamedBufferPointervEXT		MANGLE(GetNamedBufferPointervEXT) | ||||
| #define glGetNamedBufferSubDataEXT		MANGLE(GetNamedBufferSubDataEXT) | ||||
| #define glGetNamedFramebufferAttachmentParameterivEXT		MANGLE(GetNamedFramebufferAttachmentParameterivEXT) | ||||
| #define glGetNamedProgramivEXT		MANGLE(GetNamedProgramivEXT) | ||||
| #define glGetNamedProgramLocalParameterdvEXT		MANGLE(GetNamedProgramLocalParameterdvEXT) | ||||
| #define glGetNamedProgramLocalParameterfvEXT		MANGLE(GetNamedProgramLocalParameterfvEXT) | ||||
| #define glGetNamedProgramLocalParameterIivEXT		MANGLE(GetNamedProgramLocalParameterIivEXT) | ||||
| #define glGetNamedProgramLocalParameterIuivEXT		MANGLE(GetNamedProgramLocalParameterIuivEXT) | ||||
| #define glGetNamedProgramStringEXT		MANGLE(GetNamedProgramStringEXT) | ||||
| #define glGetNamedRenderbufferParameterivEXT		MANGLE(GetNamedRenderbufferParameterivEXT) | ||||
| #define glGetObjectBufferfvATI		MANGLE(GetObjectBufferfvATI) | ||||
| #define glGetObjectBufferivATI		MANGLE(GetObjectBufferivATI) | ||||
| #define glGetObjectParameterfvARB		MANGLE(GetObjectParameterfvARB) | ||||
| @@ -524,6 +639,7 @@ | ||||
| #define glGetPixelMapusv		MANGLE(GetPixelMapusv) | ||||
| #define glGetPixelTexGenParameterfvSGIS		MANGLE(GetPixelTexGenParameterfvSGIS) | ||||
| #define glGetPixelTexGenParameterivSGIS		MANGLE(GetPixelTexGenParameterivSGIS) | ||||
| #define glGetPointerIndexedvEXT		MANGLE(GetPointerIndexedvEXT) | ||||
| #define glGetPointervEXT		MANGLE(GetPointervEXT) | ||||
| #define glGetPointerv		MANGLE(GetPointerv) | ||||
| #define glGetPolygonStipple		MANGLE(GetPolygonStipple) | ||||
| @@ -555,6 +671,7 @@ | ||||
| #define glGetQueryObjectuivARB		MANGLE(GetQueryObjectuivARB) | ||||
| #define glGetQueryObjectuiv		MANGLE(GetQueryObjectuiv) | ||||
| #define glGetRenderbufferParameterivEXT		MANGLE(GetRenderbufferParameterivEXT) | ||||
| #define glGetRenderbufferParameteriv		MANGLE(GetRenderbufferParameteriv) | ||||
| #define glGetSeparableFilterEXT		MANGLE(GetSeparableFilterEXT) | ||||
| #define glGetSeparableFilter		MANGLE(GetSeparableFilter) | ||||
| #define glGetShaderInfoLog		MANGLE(GetShaderInfoLog) | ||||
| @@ -562,6 +679,7 @@ | ||||
| #define glGetShaderSourceARB		MANGLE(GetShaderSourceARB) | ||||
| #define glGetShaderSource		MANGLE(GetShaderSource) | ||||
| #define glGetSharpenTexFuncSGIS		MANGLE(GetSharpenTexFuncSGIS) | ||||
| #define glGetStringi		MANGLE(GetStringi) | ||||
| #define glGetString		MANGLE(GetString) | ||||
| #define glGetTexBumpParameterfvATI		MANGLE(GetTexBumpParameterfvATI) | ||||
| #define glGetTexBumpParameterivATI		MANGLE(GetTexBumpParameterivATI) | ||||
| @@ -576,9 +694,20 @@ | ||||
| #define glGetTexLevelParameteriv		MANGLE(GetTexLevelParameteriv) | ||||
| #define glGetTexParameterfv		MANGLE(GetTexParameterfv) | ||||
| #define glGetTexParameterIivEXT		MANGLE(GetTexParameterIivEXT) | ||||
| #define glGetTexParameterIiv		MANGLE(GetTexParameterIiv) | ||||
| #define glGetTexParameterIuivEXT		MANGLE(GetTexParameterIuivEXT) | ||||
| #define glGetTexParameterIuiv		MANGLE(GetTexParameterIuiv) | ||||
| #define glGetTexParameteriv		MANGLE(GetTexParameteriv) | ||||
| #define glGetTextureImageEXT		MANGLE(GetTextureImageEXT) | ||||
| #define glGetTextureLevelParameterfvEXT		MANGLE(GetTextureLevelParameterfvEXT) | ||||
| #define glGetTextureLevelParameterivEXT		MANGLE(GetTextureLevelParameterivEXT) | ||||
| #define glGetTextureParameterfvEXT		MANGLE(GetTextureParameterfvEXT) | ||||
| #define glGetTextureParameterIivEXT		MANGLE(GetTextureParameterIivEXT) | ||||
| #define glGetTextureParameterIuivEXT		MANGLE(GetTextureParameterIuivEXT) | ||||
| #define glGetTextureParameterivEXT		MANGLE(GetTextureParameterivEXT) | ||||
| #define glGetTrackMatrixivNV		MANGLE(GetTrackMatrixivNV) | ||||
| #define glGetTransformFeedbackVaryingEXT		MANGLE(GetTransformFeedbackVaryingEXT) | ||||
| #define glGetTransformFeedbackVarying		MANGLE(GetTransformFeedbackVarying) | ||||
| #define glGetTransformFeedbackVaryingNV		MANGLE(GetTransformFeedbackVaryingNV) | ||||
| #define glGetUniformBufferSizeEXT		MANGLE(GetUniformBufferSizeEXT) | ||||
| #define glGetUniformfvARB		MANGLE(GetUniformfvARB) | ||||
| @@ -589,6 +718,7 @@ | ||||
| #define glGetUniformLocation		MANGLE(GetUniformLocation) | ||||
| #define glGetUniformOffsetEXT		MANGLE(GetUniformOffsetEXT) | ||||
| #define glGetUniformuivEXT		MANGLE(GetUniformuivEXT) | ||||
| #define glGetUniformuiv		MANGLE(GetUniformuiv) | ||||
| #define glGetVariantArrayObjectfvATI		MANGLE(GetVariantArrayObjectfvATI) | ||||
| #define glGetVariantArrayObjectivATI		MANGLE(GetVariantArrayObjectivATI) | ||||
| #define glGetVariantBooleanvEXT		MANGLE(GetVariantBooleanvEXT) | ||||
| @@ -605,7 +735,9 @@ | ||||
| #define glGetVertexAttribfv		MANGLE(GetVertexAttribfv) | ||||
| #define glGetVertexAttribfvNV		MANGLE(GetVertexAttribfvNV) | ||||
| #define glGetVertexAttribIivEXT		MANGLE(GetVertexAttribIivEXT) | ||||
| #define glGetVertexAttribIiv		MANGLE(GetVertexAttribIiv) | ||||
| #define glGetVertexAttribIuivEXT		MANGLE(GetVertexAttribIuivEXT) | ||||
| #define glGetVertexAttribIuiv		MANGLE(GetVertexAttribIuiv) | ||||
| #define glGetVertexAttribivARB		MANGLE(GetVertexAttribivARB) | ||||
| #define glGetVertexAttribiv		MANGLE(GetVertexAttribiv) | ||||
| #define glGetVertexAttribivNV		MANGLE(GetVertexAttribivNV) | ||||
| @@ -652,11 +784,13 @@ | ||||
| #define glIsAsyncMarkerSGIX		MANGLE(IsAsyncMarkerSGIX) | ||||
| #define glIsBufferARB		MANGLE(IsBufferARB) | ||||
| #define glIsBuffer		MANGLE(IsBuffer) | ||||
| #define glIsEnabledi		MANGLE(IsEnabledi) | ||||
| #define glIsEnabledIndexedEXT		MANGLE(IsEnabledIndexedEXT) | ||||
| #define glIsEnabled		MANGLE(IsEnabled) | ||||
| #define glIsFenceAPPLE		MANGLE(IsFenceAPPLE) | ||||
| #define glIsFenceNV		MANGLE(IsFenceNV) | ||||
| #define glIsFramebufferEXT		MANGLE(IsFramebufferEXT) | ||||
| #define glIsFramebuffer		MANGLE(IsFramebuffer) | ||||
| #define glIsList		MANGLE(IsList) | ||||
| #define glIsObjectBufferATI		MANGLE(IsObjectBufferATI) | ||||
| #define glIsOcclusionQueryNV		MANGLE(IsOcclusionQueryNV) | ||||
| @@ -666,11 +800,14 @@ | ||||
| #define glIsQueryARB		MANGLE(IsQueryARB) | ||||
| #define glIsQuery		MANGLE(IsQuery) | ||||
| #define glIsRenderbufferEXT		MANGLE(IsRenderbufferEXT) | ||||
| #define glIsRenderbuffer		MANGLE(IsRenderbuffer) | ||||
| #define glIsShader		MANGLE(IsShader) | ||||
| #define glIsTextureEXT		MANGLE(IsTextureEXT) | ||||
| #define glIsTexture		MANGLE(IsTexture) | ||||
| #define glIsTransformFeedbackNV		MANGLE(IsTransformFeedbackNV) | ||||
| #define glIsVariantEnabledEXT		MANGLE(IsVariantEnabledEXT) | ||||
| #define glIsVertexArrayAPPLE		MANGLE(IsVertexArrayAPPLE) | ||||
| #define glIsVertexArray		MANGLE(IsVertexArray) | ||||
| #define glLightEnviSGIX		MANGLE(LightEnviSGIX) | ||||
| #define glLightf		MANGLE(Lightf) | ||||
| #define glLightfv		MANGLE(Lightfv) | ||||
| @@ -707,11 +844,13 @@ | ||||
| #define glMap2f		MANGLE(Map2f) | ||||
| #define glMapBufferARB		MANGLE(MapBufferARB) | ||||
| #define glMapBuffer		MANGLE(MapBuffer) | ||||
| #define glMapBufferRange		MANGLE(MapBufferRange) | ||||
| #define glMapControlPointsNV		MANGLE(MapControlPointsNV) | ||||
| #define glMapGrid1d		MANGLE(MapGrid1d) | ||||
| #define glMapGrid1f		MANGLE(MapGrid1f) | ||||
| #define glMapGrid2d		MANGLE(MapGrid2d) | ||||
| #define glMapGrid2f		MANGLE(MapGrid2f) | ||||
| #define glMapNamedBufferEXT		MANGLE(MapNamedBufferEXT) | ||||
| #define glMapObjectBufferATI		MANGLE(MapObjectBufferATI) | ||||
| #define glMapParameterfvNV		MANGLE(MapParameterfvNV) | ||||
| #define glMapParameterivNV		MANGLE(MapParameterivNV) | ||||
| @@ -719,11 +858,30 @@ | ||||
| #define glMaterialfv		MANGLE(Materialfv) | ||||
| #define glMateriali		MANGLE(Materiali) | ||||
| #define glMaterialiv		MANGLE(Materialiv) | ||||
| #define glMatrixFrustumEXT		MANGLE(MatrixFrustumEXT) | ||||
| #define glMatrixIndexPointerARB		MANGLE(MatrixIndexPointerARB) | ||||
| #define glMatrixIndexubvARB		MANGLE(MatrixIndexubvARB) | ||||
| #define glMatrixIndexuivARB		MANGLE(MatrixIndexuivARB) | ||||
| #define glMatrixIndexusvARB		MANGLE(MatrixIndexusvARB) | ||||
| #define glMatrixLoaddEXT		MANGLE(MatrixLoaddEXT) | ||||
| #define glMatrixLoadfEXT		MANGLE(MatrixLoadfEXT) | ||||
| #define glMatrixLoadIdentityEXT		MANGLE(MatrixLoadIdentityEXT) | ||||
| #define glMatrixLoadTransposedEXT		MANGLE(MatrixLoadTransposedEXT) | ||||
| #define glMatrixLoadTransposefEXT		MANGLE(MatrixLoadTransposefEXT) | ||||
| #define glMatrixMode		MANGLE(MatrixMode) | ||||
| #define glMatrixMultdEXT		MANGLE(MatrixMultdEXT) | ||||
| #define glMatrixMultfEXT		MANGLE(MatrixMultfEXT) | ||||
| #define glMatrixMultTransposedEXT		MANGLE(MatrixMultTransposedEXT) | ||||
| #define glMatrixMultTransposefEXT		MANGLE(MatrixMultTransposefEXT) | ||||
| #define glMatrixOrthoEXT		MANGLE(MatrixOrthoEXT) | ||||
| #define glMatrixPopEXT		MANGLE(MatrixPopEXT) | ||||
| #define glMatrixPushEXT		MANGLE(MatrixPushEXT) | ||||
| #define glMatrixRotatedEXT		MANGLE(MatrixRotatedEXT) | ||||
| #define glMatrixRotatefEXT		MANGLE(MatrixRotatefEXT) | ||||
| #define glMatrixScaledEXT		MANGLE(MatrixScaledEXT) | ||||
| #define glMatrixScalefEXT		MANGLE(MatrixScalefEXT) | ||||
| #define glMatrixTranslatedEXT		MANGLE(MatrixTranslatedEXT) | ||||
| #define glMatrixTranslatefEXT		MANGLE(MatrixTranslatefEXT) | ||||
| #define glMinmaxEXT		MANGLE(MinmaxEXT) | ||||
| #define glMinmax		MANGLE(Minmax) | ||||
| #define glMultiDrawArraysEXT		MANGLE(MultiDrawArraysEXT) | ||||
| @@ -734,6 +892,7 @@ | ||||
| #define glMultiDrawRangeElementArrayAPPLE		MANGLE(MultiDrawRangeElementArrayAPPLE) | ||||
| #define glMultiModeDrawArraysIBM		MANGLE(MultiModeDrawArraysIBM) | ||||
| #define glMultiModeDrawElementsIBM		MANGLE(MultiModeDrawElementsIBM) | ||||
| #define glMultiTexBufferEXT		MANGLE(MultiTexBufferEXT) | ||||
| #define glMultiTexCoord1dARB		MANGLE(MultiTexCoord1dARB) | ||||
| #define glMultiTexCoord1d		MANGLE(MultiTexCoord1d) | ||||
| #define glMultiTexCoord1dvARB		MANGLE(MultiTexCoord1dvARB) | ||||
| @@ -806,12 +965,60 @@ | ||||
| #define glMultiTexCoord4s		MANGLE(MultiTexCoord4s) | ||||
| #define glMultiTexCoord4svARB		MANGLE(MultiTexCoord4svARB) | ||||
| #define glMultiTexCoord4sv		MANGLE(MultiTexCoord4sv) | ||||
| #define glMultiTexCoordPointerEXT		MANGLE(MultiTexCoordPointerEXT) | ||||
| #define glMultiTexEnvfEXT		MANGLE(MultiTexEnvfEXT) | ||||
| #define glMultiTexEnvfvEXT		MANGLE(MultiTexEnvfvEXT) | ||||
| #define glMultiTexEnviEXT		MANGLE(MultiTexEnviEXT) | ||||
| #define glMultiTexEnvivEXT		MANGLE(MultiTexEnvivEXT) | ||||
| #define glMultiTexGendEXT		MANGLE(MultiTexGendEXT) | ||||
| #define glMultiTexGendvEXT		MANGLE(MultiTexGendvEXT) | ||||
| #define glMultiTexGenfEXT		MANGLE(MultiTexGenfEXT) | ||||
| #define glMultiTexGenfvEXT		MANGLE(MultiTexGenfvEXT) | ||||
| #define glMultiTexGeniEXT		MANGLE(MultiTexGeniEXT) | ||||
| #define glMultiTexGenivEXT		MANGLE(MultiTexGenivEXT) | ||||
| #define glMultiTexImage1DEXT		MANGLE(MultiTexImage1DEXT) | ||||
| #define glMultiTexImage2DEXT		MANGLE(MultiTexImage2DEXT) | ||||
| #define glMultiTexImage3DEXT		MANGLE(MultiTexImage3DEXT) | ||||
| #define glMultiTexParameterfEXT		MANGLE(MultiTexParameterfEXT) | ||||
| #define glMultiTexParameterfvEXT		MANGLE(MultiTexParameterfvEXT) | ||||
| #define glMultiTexParameteriEXT		MANGLE(MultiTexParameteriEXT) | ||||
| #define glMultiTexParameterIivEXT		MANGLE(MultiTexParameterIivEXT) | ||||
| #define glMultiTexParameterIuivEXT		MANGLE(MultiTexParameterIuivEXT) | ||||
| #define glMultiTexParameterivEXT		MANGLE(MultiTexParameterivEXT) | ||||
| #define glMultiTexRenderbufferEXT		MANGLE(MultiTexRenderbufferEXT) | ||||
| #define glMultiTexSubImage1DEXT		MANGLE(MultiTexSubImage1DEXT) | ||||
| #define glMultiTexSubImage2DEXT		MANGLE(MultiTexSubImage2DEXT) | ||||
| #define glMultiTexSubImage3DEXT		MANGLE(MultiTexSubImage3DEXT) | ||||
| #define glMultMatrixd		MANGLE(MultMatrixd) | ||||
| #define glMultMatrixf		MANGLE(MultMatrixf) | ||||
| #define glMultTransposeMatrixdARB		MANGLE(MultTransposeMatrixdARB) | ||||
| #define glMultTransposeMatrixd		MANGLE(MultTransposeMatrixd) | ||||
| #define glMultTransposeMatrixfARB		MANGLE(MultTransposeMatrixfARB) | ||||
| #define glMultTransposeMatrixf		MANGLE(MultTransposeMatrixf) | ||||
| #define glNamedBufferDataEXT		MANGLE(NamedBufferDataEXT) | ||||
| #define glNamedBufferSubDataEXT		MANGLE(NamedBufferSubDataEXT) | ||||
| #define glNamedFramebufferRenderbufferEXT		MANGLE(NamedFramebufferRenderbufferEXT) | ||||
| #define glNamedFramebufferTexture1DEXT		MANGLE(NamedFramebufferTexture1DEXT) | ||||
| #define glNamedFramebufferTexture2DEXT		MANGLE(NamedFramebufferTexture2DEXT) | ||||
| #define glNamedFramebufferTexture3DEXT		MANGLE(NamedFramebufferTexture3DEXT) | ||||
| #define glNamedFramebufferTextureEXT		MANGLE(NamedFramebufferTextureEXT) | ||||
| #define glNamedFramebufferTextureFaceEXT		MANGLE(NamedFramebufferTextureFaceEXT) | ||||
| #define glNamedFramebufferTextureLayerEXT		MANGLE(NamedFramebufferTextureLayerEXT) | ||||
| #define glNamedProgramLocalParameter4dEXT		MANGLE(NamedProgramLocalParameter4dEXT) | ||||
| #define glNamedProgramLocalParameter4dvEXT		MANGLE(NamedProgramLocalParameter4dvEXT) | ||||
| #define glNamedProgramLocalParameter4fEXT		MANGLE(NamedProgramLocalParameter4fEXT) | ||||
| #define glNamedProgramLocalParameter4fvEXT		MANGLE(NamedProgramLocalParameter4fvEXT) | ||||
| #define glNamedProgramLocalParameterI4iEXT		MANGLE(NamedProgramLocalParameterI4iEXT) | ||||
| #define glNamedProgramLocalParameterI4ivEXT		MANGLE(NamedProgramLocalParameterI4ivEXT) | ||||
| #define glNamedProgramLocalParameterI4uiEXT		MANGLE(NamedProgramLocalParameterI4uiEXT) | ||||
| #define glNamedProgramLocalParameterI4uivEXT		MANGLE(NamedProgramLocalParameterI4uivEXT) | ||||
| #define glNamedProgramLocalParameters4fvEXT		MANGLE(NamedProgramLocalParameters4fvEXT) | ||||
| #define glNamedProgramLocalParametersI4ivEXT		MANGLE(NamedProgramLocalParametersI4ivEXT) | ||||
| #define glNamedProgramLocalParametersI4uivEXT		MANGLE(NamedProgramLocalParametersI4uivEXT) | ||||
| #define glNamedProgramStringEXT		MANGLE(NamedProgramStringEXT) | ||||
| #define glNamedRenderbufferStorageEXT		MANGLE(NamedRenderbufferStorageEXT) | ||||
| #define glNamedRenderbufferStorageMultisampleCoverageEXT		MANGLE(NamedRenderbufferStorageMultisampleCoverageEXT) | ||||
| #define glNamedRenderbufferStorageMultisampleEXT		MANGLE(NamedRenderbufferStorageMultisampleEXT) | ||||
| #define glNewList		MANGLE(NewList) | ||||
| #define glNewObjectBufferATI		MANGLE(NewObjectBufferATI) | ||||
| #define glNormal3b		MANGLE(Normal3b) | ||||
| @@ -845,6 +1052,7 @@ | ||||
| #define glOrtho		MANGLE(Ortho) | ||||
| #define glPassTexCoordATI		MANGLE(PassTexCoordATI) | ||||
| #define glPassThrough		MANGLE(PassThrough) | ||||
| #define glPauseTransformFeedbackNV		MANGLE(PauseTransformFeedbackNV) | ||||
| #define glPixelDataRangeNV		MANGLE(PixelDataRangeNV) | ||||
| #define glPixelMapfv		MANGLE(PixelMapfv) | ||||
| #define glPixelMapuiv		MANGLE(PixelMapuiv) | ||||
| @@ -926,12 +1134,47 @@ | ||||
| #define glProgramParameter4dvNV		MANGLE(ProgramParameter4dvNV) | ||||
| #define glProgramParameter4fNV		MANGLE(ProgramParameter4fNV) | ||||
| #define glProgramParameter4fvNV		MANGLE(ProgramParameter4fvNV) | ||||
| #define glProgramParameteriARB		MANGLE(ProgramParameteriARB) | ||||
| #define glProgramParameteriEXT		MANGLE(ProgramParameteriEXT) | ||||
| #define glProgramParameters4dvNV		MANGLE(ProgramParameters4dvNV) | ||||
| #define glProgramParameters4fvNV		MANGLE(ProgramParameters4fvNV) | ||||
| #define glProgramStringARB		MANGLE(ProgramStringARB) | ||||
| #define glProgramUniform1fEXT		MANGLE(ProgramUniform1fEXT) | ||||
| #define glProgramUniform1fvEXT		MANGLE(ProgramUniform1fvEXT) | ||||
| #define glProgramUniform1iEXT		MANGLE(ProgramUniform1iEXT) | ||||
| #define glProgramUniform1ivEXT		MANGLE(ProgramUniform1ivEXT) | ||||
| #define glProgramUniform1uiEXT		MANGLE(ProgramUniform1uiEXT) | ||||
| #define glProgramUniform1uivEXT		MANGLE(ProgramUniform1uivEXT) | ||||
| #define glProgramUniform2fEXT		MANGLE(ProgramUniform2fEXT) | ||||
| #define glProgramUniform2fvEXT		MANGLE(ProgramUniform2fvEXT) | ||||
| #define glProgramUniform2iEXT		MANGLE(ProgramUniform2iEXT) | ||||
| #define glProgramUniform2ivEXT		MANGLE(ProgramUniform2ivEXT) | ||||
| #define glProgramUniform2uiEXT		MANGLE(ProgramUniform2uiEXT) | ||||
| #define glProgramUniform2uivEXT		MANGLE(ProgramUniform2uivEXT) | ||||
| #define glProgramUniform3fEXT		MANGLE(ProgramUniform3fEXT) | ||||
| #define glProgramUniform3fvEXT		MANGLE(ProgramUniform3fvEXT) | ||||
| #define glProgramUniform3iEXT		MANGLE(ProgramUniform3iEXT) | ||||
| #define glProgramUniform3ivEXT		MANGLE(ProgramUniform3ivEXT) | ||||
| #define glProgramUniform3uiEXT		MANGLE(ProgramUniform3uiEXT) | ||||
| #define glProgramUniform3uivEXT		MANGLE(ProgramUniform3uivEXT) | ||||
| #define glProgramUniform4fEXT		MANGLE(ProgramUniform4fEXT) | ||||
| #define glProgramUniform4fvEXT		MANGLE(ProgramUniform4fvEXT) | ||||
| #define glProgramUniform4iEXT		MANGLE(ProgramUniform4iEXT) | ||||
| #define glProgramUniform4ivEXT		MANGLE(ProgramUniform4ivEXT) | ||||
| #define glProgramUniform4uiEXT		MANGLE(ProgramUniform4uiEXT) | ||||
| #define glProgramUniform4uivEXT		MANGLE(ProgramUniform4uivEXT) | ||||
| #define glProgramUniformMatrix2fvEXT		MANGLE(ProgramUniformMatrix2fvEXT) | ||||
| #define glProgramUniformMatrix2x3fvEXT		MANGLE(ProgramUniformMatrix2x3fvEXT) | ||||
| #define glProgramUniformMatrix2x4fvEXT		MANGLE(ProgramUniformMatrix2x4fvEXT) | ||||
| #define glProgramUniformMatrix3fvEXT		MANGLE(ProgramUniformMatrix3fvEXT) | ||||
| #define glProgramUniformMatrix3x2fvEXT		MANGLE(ProgramUniformMatrix3x2fvEXT) | ||||
| #define glProgramUniformMatrix3x4fvEXT		MANGLE(ProgramUniformMatrix3x4fvEXT) | ||||
| #define glProgramUniformMatrix4fvEXT		MANGLE(ProgramUniformMatrix4fvEXT) | ||||
| #define glProgramUniformMatrix4x2fvEXT		MANGLE(ProgramUniformMatrix4x2fvEXT) | ||||
| #define glProgramUniformMatrix4x3fvEXT		MANGLE(ProgramUniformMatrix4x3fvEXT) | ||||
| #define glProgramVertexLimitNV		MANGLE(ProgramVertexLimitNV) | ||||
| #define glPushAttrib		MANGLE(PushAttrib) | ||||
| #define glPushClientAttribDefaultEXT		MANGLE(PushClientAttribDefaultEXT) | ||||
| #define glPushClientAttrib		MANGLE(PushClientAttrib) | ||||
| #define glPushMatrix		MANGLE(PushMatrix) | ||||
| #define glPushName		MANGLE(PushName) | ||||
| @@ -972,8 +1215,10 @@ | ||||
| #define glRectsv		MANGLE(Rectsv) | ||||
| #define glReferencePlaneSGIX		MANGLE(ReferencePlaneSGIX) | ||||
| #define glRenderbufferStorageEXT		MANGLE(RenderbufferStorageEXT) | ||||
| #define glRenderbufferStorage		MANGLE(RenderbufferStorage) | ||||
| #define glRenderbufferStorageMultisampleCoverageNV		MANGLE(RenderbufferStorageMultisampleCoverageNV) | ||||
| #define glRenderbufferStorageMultisampleEXT		MANGLE(RenderbufferStorageMultisampleEXT) | ||||
| #define glRenderbufferStorageMultisample		MANGLE(RenderbufferStorageMultisample) | ||||
| #define glRenderMode		MANGLE(RenderMode) | ||||
| #define glReplacementCodePointerSUN		MANGLE(ReplacementCodePointerSUN) | ||||
| #define glReplacementCodeubSUN		MANGLE(ReplacementCodeubSUN) | ||||
| @@ -1004,12 +1249,14 @@ | ||||
| #define glResetMinmaxEXT		MANGLE(ResetMinmaxEXT) | ||||
| #define glResetMinmax		MANGLE(ResetMinmax) | ||||
| #define glResizeBuffersMESA		MANGLE(ResizeBuffersMESA) | ||||
| #define glResumeTransformFeedbackNV		MANGLE(ResumeTransformFeedbackNV) | ||||
| #define glRotated		MANGLE(Rotated) | ||||
| #define glRotatef		MANGLE(Rotatef) | ||||
| #define glSampleCoverageARB		MANGLE(SampleCoverageARB) | ||||
| #define glSampleCoverage		MANGLE(SampleCoverage) | ||||
| #define glSampleMapATI		MANGLE(SampleMapATI) | ||||
| #define glSampleMaskEXT		MANGLE(SampleMaskEXT) | ||||
| #define glSampleMaskIndexedNV		MANGLE(SampleMaskIndexedNV) | ||||
| #define glSampleMaskSGIS		MANGLE(SampleMaskSGIS) | ||||
| #define glSamplePatternEXT		MANGLE(SamplePatternEXT) | ||||
| #define glSamplePatternSGIS		MANGLE(SamplePatternSGIS) | ||||
| @@ -1101,6 +1348,7 @@ | ||||
| #define glTestFenceAPPLE		MANGLE(TestFenceAPPLE) | ||||
| #define glTestFenceNV		MANGLE(TestFenceNV) | ||||
| #define glTestObjectAPPLE		MANGLE(TestObjectAPPLE) | ||||
| #define glTexBufferARB		MANGLE(TexBufferARB) | ||||
| #define glTexBufferEXT		MANGLE(TexBufferEXT) | ||||
| #define glTexBumpParameterfvATI		MANGLE(TexBumpParameterfvATI) | ||||
| #define glTexBumpParameterivATI		MANGLE(TexBumpParameterivATI) | ||||
| @@ -1181,9 +1429,12 @@ | ||||
| #define glTexParameterf		MANGLE(TexParameterf) | ||||
| #define glTexParameterfv		MANGLE(TexParameterfv) | ||||
| #define glTexParameterIivEXT		MANGLE(TexParameterIivEXT) | ||||
| #define glTexParameterIiv		MANGLE(TexParameterIiv) | ||||
| #define glTexParameteri		MANGLE(TexParameteri) | ||||
| #define glTexParameterIuivEXT		MANGLE(TexParameterIuivEXT) | ||||
| #define glTexParameterIuiv		MANGLE(TexParameterIuiv) | ||||
| #define glTexParameteriv		MANGLE(TexParameteriv) | ||||
| #define glTexRenderbufferNV		MANGLE(TexRenderbufferNV) | ||||
| #define glTexSubImage1DEXT		MANGLE(TexSubImage1DEXT) | ||||
| #define glTexSubImage1D		MANGLE(TexSubImage1D) | ||||
| #define glTexSubImage2DEXT		MANGLE(TexSubImage2DEXT) | ||||
| @@ -1191,12 +1442,28 @@ | ||||
| #define glTexSubImage3DEXT		MANGLE(TexSubImage3DEXT) | ||||
| #define glTexSubImage3D		MANGLE(TexSubImage3D) | ||||
| #define glTexSubImage4DSGIS		MANGLE(TexSubImage4DSGIS) | ||||
| #define glTextureBufferEXT		MANGLE(TextureBufferEXT) | ||||
| #define glTextureColorMaskSGIS		MANGLE(TextureColorMaskSGIS) | ||||
| #define glTextureImage1DEXT		MANGLE(TextureImage1DEXT) | ||||
| #define glTextureImage2DEXT		MANGLE(TextureImage2DEXT) | ||||
| #define glTextureImage3DEXT		MANGLE(TextureImage3DEXT) | ||||
| #define glTextureLightEXT		MANGLE(TextureLightEXT) | ||||
| #define glTextureMaterialEXT		MANGLE(TextureMaterialEXT) | ||||
| #define glTextureNormalEXT		MANGLE(TextureNormalEXT) | ||||
| #define glTextureParameterfEXT		MANGLE(TextureParameterfEXT) | ||||
| #define glTextureParameterfvEXT		MANGLE(TextureParameterfvEXT) | ||||
| #define glTextureParameteriEXT		MANGLE(TextureParameteriEXT) | ||||
| #define glTextureParameterIivEXT		MANGLE(TextureParameterIivEXT) | ||||
| #define glTextureParameterIuivEXT		MANGLE(TextureParameterIuivEXT) | ||||
| #define glTextureParameterivEXT		MANGLE(TextureParameterivEXT) | ||||
| #define glTextureRenderbufferEXT		MANGLE(TextureRenderbufferEXT) | ||||
| #define glTextureSubImage1DEXT		MANGLE(TextureSubImage1DEXT) | ||||
| #define glTextureSubImage2DEXT		MANGLE(TextureSubImage2DEXT) | ||||
| #define glTextureSubImage3DEXT		MANGLE(TextureSubImage3DEXT) | ||||
| #define glTrackMatrixNV		MANGLE(TrackMatrixNV) | ||||
| #define glTransformFeedbackAttribsNV		MANGLE(TransformFeedbackAttribsNV) | ||||
| #define glTransformFeedbackVaryingsEXT		MANGLE(TransformFeedbackVaryingsEXT) | ||||
| #define glTransformFeedbackVaryings		MANGLE(TransformFeedbackVaryings) | ||||
| #define glTransformFeedbackVaryingsNV		MANGLE(TransformFeedbackVaryingsNV) | ||||
| #define glTranslated		MANGLE(Translated) | ||||
| #define glTranslatef		MANGLE(Translatef) | ||||
| @@ -1209,7 +1476,9 @@ | ||||
| #define glUniform1ivARB		MANGLE(Uniform1ivARB) | ||||
| #define glUniform1iv		MANGLE(Uniform1iv) | ||||
| #define glUniform1uiEXT		MANGLE(Uniform1uiEXT) | ||||
| #define glUniform1ui		MANGLE(Uniform1ui) | ||||
| #define glUniform1uivEXT		MANGLE(Uniform1uivEXT) | ||||
| #define glUniform1uiv		MANGLE(Uniform1uiv) | ||||
| #define glUniform2fARB		MANGLE(Uniform2fARB) | ||||
| #define glUniform2f		MANGLE(Uniform2f) | ||||
| #define glUniform2fvARB		MANGLE(Uniform2fvARB) | ||||
| @@ -1219,7 +1488,9 @@ | ||||
| #define glUniform2ivARB		MANGLE(Uniform2ivARB) | ||||
| #define glUniform2iv		MANGLE(Uniform2iv) | ||||
| #define glUniform2uiEXT		MANGLE(Uniform2uiEXT) | ||||
| #define glUniform2ui		MANGLE(Uniform2ui) | ||||
| #define glUniform2uivEXT		MANGLE(Uniform2uivEXT) | ||||
| #define glUniform2uiv		MANGLE(Uniform2uiv) | ||||
| #define glUniform3fARB		MANGLE(Uniform3fARB) | ||||
| #define glUniform3f		MANGLE(Uniform3f) | ||||
| #define glUniform3fvARB		MANGLE(Uniform3fvARB) | ||||
| @@ -1229,7 +1500,9 @@ | ||||
| #define glUniform3ivARB		MANGLE(Uniform3ivARB) | ||||
| #define glUniform3iv		MANGLE(Uniform3iv) | ||||
| #define glUniform3uiEXT		MANGLE(Uniform3uiEXT) | ||||
| #define glUniform3ui		MANGLE(Uniform3ui) | ||||
| #define glUniform3uivEXT		MANGLE(Uniform3uivEXT) | ||||
| #define glUniform3uiv		MANGLE(Uniform3uiv) | ||||
| #define glUniform4fARB		MANGLE(Uniform4fARB) | ||||
| #define glUniform4f		MANGLE(Uniform4f) | ||||
| #define glUniform4fvARB		MANGLE(Uniform4fvARB) | ||||
| @@ -1239,7 +1512,9 @@ | ||||
| #define glUniform4ivARB		MANGLE(Uniform4ivARB) | ||||
| #define glUniform4iv		MANGLE(Uniform4iv) | ||||
| #define glUniform4uiEXT		MANGLE(Uniform4uiEXT) | ||||
| #define glUniform4ui		MANGLE(Uniform4ui) | ||||
| #define glUniform4uivEXT		MANGLE(Uniform4uivEXT) | ||||
| #define glUniform4uiv		MANGLE(Uniform4uiv) | ||||
| #define glUniformBufferEXT		MANGLE(UniformBufferEXT) | ||||
| #define glUniformMatrix2fvARB		MANGLE(UniformMatrix2fvARB) | ||||
| #define glUniformMatrix2fv		MANGLE(UniformMatrix2fv) | ||||
| @@ -1256,6 +1531,7 @@ | ||||
| #define glUnlockArraysEXT		MANGLE(UnlockArraysEXT) | ||||
| #define glUnmapBufferARB		MANGLE(UnmapBufferARB) | ||||
| #define glUnmapBuffer		MANGLE(UnmapBuffer) | ||||
| #define glUnmapNamedBufferEXT		MANGLE(UnmapNamedBufferEXT) | ||||
| #define glUnmapObjectBufferATI		MANGLE(UnmapObjectBufferATI) | ||||
| #define glUpdateObjectBufferATI		MANGLE(UpdateObjectBufferATI) | ||||
| #define glUseProgram		MANGLE(UseProgram) | ||||
| @@ -1412,27 +1688,49 @@ | ||||
| #define glVertexAttrib4usvARB		MANGLE(VertexAttrib4usvARB) | ||||
| #define glVertexAttrib4usv		MANGLE(VertexAttrib4usv) | ||||
| #define glVertexAttribArrayObjectATI		MANGLE(VertexAttribArrayObjectATI) | ||||
| #define glVertexAttribDivisor		MANGLE(VertexAttribDivisor) | ||||
| #define glVertexAttribI1iEXT		MANGLE(VertexAttribI1iEXT) | ||||
| #define glVertexAttribI1i		MANGLE(VertexAttribI1i) | ||||
| #define glVertexAttribI1ivEXT		MANGLE(VertexAttribI1ivEXT) | ||||
| #define glVertexAttribI1iv		MANGLE(VertexAttribI1iv) | ||||
| #define glVertexAttribI1uiEXT		MANGLE(VertexAttribI1uiEXT) | ||||
| #define glVertexAttribI1ui		MANGLE(VertexAttribI1ui) | ||||
| #define glVertexAttribI1uivEXT		MANGLE(VertexAttribI1uivEXT) | ||||
| #define glVertexAttribI1uiv		MANGLE(VertexAttribI1uiv) | ||||
| #define glVertexAttribI2iEXT		MANGLE(VertexAttribI2iEXT) | ||||
| #define glVertexAttribI2i		MANGLE(VertexAttribI2i) | ||||
| #define glVertexAttribI2ivEXT		MANGLE(VertexAttribI2ivEXT) | ||||
| #define glVertexAttribI2iv		MANGLE(VertexAttribI2iv) | ||||
| #define glVertexAttribI2uiEXT		MANGLE(VertexAttribI2uiEXT) | ||||
| #define glVertexAttribI2ui		MANGLE(VertexAttribI2ui) | ||||
| #define glVertexAttribI2uivEXT		MANGLE(VertexAttribI2uivEXT) | ||||
| #define glVertexAttribI2uiv		MANGLE(VertexAttribI2uiv) | ||||
| #define glVertexAttribI3iEXT		MANGLE(VertexAttribI3iEXT) | ||||
| #define glVertexAttribI3i		MANGLE(VertexAttribI3i) | ||||
| #define glVertexAttribI3ivEXT		MANGLE(VertexAttribI3ivEXT) | ||||
| #define glVertexAttribI3iv		MANGLE(VertexAttribI3iv) | ||||
| #define glVertexAttribI3uiEXT		MANGLE(VertexAttribI3uiEXT) | ||||
| #define glVertexAttribI3ui		MANGLE(VertexAttribI3ui) | ||||
| #define glVertexAttribI3uivEXT		MANGLE(VertexAttribI3uivEXT) | ||||
| #define glVertexAttribI3uiv		MANGLE(VertexAttribI3uiv) | ||||
| #define glVertexAttribI4bvEXT		MANGLE(VertexAttribI4bvEXT) | ||||
| #define glVertexAttribI4bv		MANGLE(VertexAttribI4bv) | ||||
| #define glVertexAttribI4iEXT		MANGLE(VertexAttribI4iEXT) | ||||
| #define glVertexAttribI4i		MANGLE(VertexAttribI4i) | ||||
| #define glVertexAttribI4ivEXT		MANGLE(VertexAttribI4ivEXT) | ||||
| #define glVertexAttribI4iv		MANGLE(VertexAttribI4iv) | ||||
| #define glVertexAttribI4svEXT		MANGLE(VertexAttribI4svEXT) | ||||
| #define glVertexAttribI4sv		MANGLE(VertexAttribI4sv) | ||||
| #define glVertexAttribI4ubvEXT		MANGLE(VertexAttribI4ubvEXT) | ||||
| #define glVertexAttribI4ubv		MANGLE(VertexAttribI4ubv) | ||||
| #define glVertexAttribI4uiEXT		MANGLE(VertexAttribI4uiEXT) | ||||
| #define glVertexAttribI4ui		MANGLE(VertexAttribI4ui) | ||||
| #define glVertexAttribI4uivEXT		MANGLE(VertexAttribI4uivEXT) | ||||
| #define glVertexAttribI4uiv		MANGLE(VertexAttribI4uiv) | ||||
| #define glVertexAttribI4usvEXT		MANGLE(VertexAttribI4usvEXT) | ||||
| #define glVertexAttribI4usv		MANGLE(VertexAttribI4usv) | ||||
| #define glVertexAttribIPointerEXT		MANGLE(VertexAttribIPointerEXT) | ||||
| #define glVertexAttribIPointer		MANGLE(VertexAttribIPointer) | ||||
| #define glVertexAttribPointerARB		MANGLE(VertexAttribPointerARB) | ||||
| #define glVertexAttribPointer		MANGLE(VertexAttribPointer) | ||||
| #define glVertexAttribPointerNV		MANGLE(VertexAttribPointerNV) | ||||
|   | ||||
| @@ -46,9 +46,9 @@ extern "C" { | ||||
| /*************************************************************/ | ||||
|  | ||||
| /* Header file version number, required by OpenGL ABI for Linux */ | ||||
| /* glext.h last updated 2008/11/14 */ | ||||
| /* glext.h last updated 2009/03/19 */ | ||||
| /* Current version at http://www.opengl.org/registry/ */ | ||||
| #define GL_GLEXT_VERSION 44 | ||||
| #define GL_GLEXT_VERSION 48 | ||||
|  | ||||
| #ifndef GL_VERSION_1_2 | ||||
| #define GL_UNSIGNED_BYTE_3_3_2            0x8032 | ||||
| @@ -3862,6 +3862,42 @@ extern "C" { | ||||
| #define GL_TRANSFORM_FEEDBACK_BINDING_NV  0x8E25 | ||||
| #endif | ||||
|  | ||||
| #ifndef GL_ATI_meminfo | ||||
| #define GL_VBO_FREE_MEMORY_ATI            0x87FB | ||||
| #define GL_TEXTURE_FREE_MEMORY_ATI        0x87FC | ||||
| #define GL_RENDERBUFFER_FREE_MEMORY_ATI   0x87FD | ||||
| #endif | ||||
|  | ||||
| #ifndef GL_AMD_performance_monitor | ||||
| #define GL_COUNTER_TYPE_AMD               0x8BC0 | ||||
| #define GL_COUNTER_RANGE_AMD              0x8BC1 | ||||
| #define GL_UNSIGNED_INT64_AMD             0x8BC2 | ||||
| #define GL_PERCENTAGE_AMD                 0x8BC3 | ||||
| #define GL_PERFMON_RESULT_AVAILABLE_AMD   0x8BC4 | ||||
| #define GL_PERFMON_RESULT_SIZE_AMD        0x8BC5 | ||||
| #define GL_PERFMON_RESULT_AMD             0x8BC6 | ||||
| #endif | ||||
|  | ||||
| #ifndef GL_AMD_texture_texture4 | ||||
| #endif | ||||
|  | ||||
| #ifndef GL_AMD_vertex_shader_tesselator | ||||
| #define GL_SAMPLER_BUFFER_AMD             0x9001 | ||||
| #define GL_INT_SAMPLER_BUFFER_AMD         0x9002 | ||||
| #define GL_UNSIGNED_INT_SAMPLER_BUFFER_AMD 0x9003 | ||||
| #define GL_TESSELLATION_MODE_AMD          0x9004 | ||||
| #define GL_TESSELLATION_FACTOR_AMD        0x9005 | ||||
| #define GL_DISCRETE_AMD                   0x9006 | ||||
| #define GL_CONTINUOUS_AMD                 0x9007 | ||||
| #endif | ||||
|  | ||||
| #ifndef GL_EXT_provoking_vertex | ||||
| #define GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION_EXT 0x8E4C | ||||
| #define GL_FIRST_VERTEX_CONVENTION_EXT    0x8E4D | ||||
| #define GL_LAST_VERTEX_CONVENTION_EXT     0x8E4E | ||||
| #define GL_PROVOKING_VERTEX_EXT           0x8E4F | ||||
| #endif | ||||
|  | ||||
|  | ||||
| /*************************************************************/ | ||||
|  | ||||
| @@ -4487,8 +4523,8 @@ GLAPI void APIENTRY glBeginTransformFeedback (GLenum); | ||||
| GLAPI void APIENTRY glEndTransformFeedback (void); | ||||
| GLAPI void APIENTRY glBindBufferRange (GLenum, GLuint, GLuint, GLintptr, GLsizeiptr); | ||||
| GLAPI void APIENTRY glBindBufferBase (GLenum, GLuint, GLuint); | ||||
| GLAPI void APIENTRY glTransformFeedbackVaryings (GLuint, GLsizei, const GLint *, GLenum); | ||||
| GLAPI void APIENTRY glGetTransformFeedbackVarying (GLuint, GLuint, GLint *); | ||||
| GLAPI void APIENTRY glTransformFeedbackVaryings (GLuint, GLsizei, const GLchar* *, GLenum); | ||||
| GLAPI void APIENTRY glGetTransformFeedbackVarying (GLuint, GLuint, GLsizei, GLsizei *, GLsizei *, GLenum *, GLchar *); | ||||
| GLAPI void APIENTRY glClampColor (GLenum, GLenum); | ||||
| GLAPI void APIENTRY glBeginConditionalRender (GLuint, GLenum); | ||||
| GLAPI void APIENTRY glEndConditionalRender (void); | ||||
| @@ -4546,8 +4582,8 @@ typedef void (APIENTRYP PFNGLBEGINTRANSFORMFEEDBACKPROC) (GLenum primitiveMode); | ||||
| typedef void (APIENTRYP PFNGLENDTRANSFORMFEEDBACKPROC) (void); | ||||
| typedef void (APIENTRYP PFNGLBINDBUFFERRANGEPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); | ||||
| typedef void (APIENTRYP PFNGLBINDBUFFERBASEPROC) (GLenum target, GLuint index, GLuint buffer); | ||||
| typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKVARYINGSPROC) (GLuint program, GLsizei count, const GLint *locations, GLenum bufferMode); | ||||
| typedef void (APIENTRYP PFNGLGETTRANSFORMFEEDBACKVARYINGPROC) (GLuint program, GLuint index, GLint *location); | ||||
| typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKVARYINGSPROC) (GLuint program, GLsizei count, const GLchar* *varyings, GLenum bufferMode); | ||||
| typedef void (APIENTRYP PFNGLGETTRANSFORMFEEDBACKVARYINGPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name); | ||||
| typedef void (APIENTRYP PFNGLCLAMPCOLORPROC) (GLenum target, GLenum clamp); | ||||
| typedef void (APIENTRYP PFNGLBEGINCONDITIONALRENDERPROC) (GLuint id, GLenum mode); | ||||
| typedef void (APIENTRYP PFNGLENDCONDITIONALRENDERPROC) (void); | ||||
| @@ -5268,10 +5304,10 @@ typedef void (APIENTRYP PFNGLVERTEXATTRIBDIVISORPROC) (GLuint index, GLuint divi | ||||
| #ifndef GL_ARB_map_buffer_range | ||||
| #define GL_ARB_map_buffer_range 1 | ||||
| #ifdef GL_GLEXT_PROTOTYPES | ||||
| GLAPI void APIENTRY glMapBufferRange (GLenum, GLintptr, GLsizeiptr, GLbitfield); | ||||
| GLAPI GLvoid* APIENTRY glMapBufferRange (GLenum, GLintptr, GLsizeiptr, GLbitfield); | ||||
| GLAPI void APIENTRY glFlushMappedBufferRange (GLenum, GLintptr, GLsizeiptr); | ||||
| #endif /* GL_GLEXT_PROTOTYPES */ | ||||
| typedef void (APIENTRYP PFNGLMAPBUFFERRANGEPROC) (GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access); | ||||
| typedef GLvoid* (APIENTRYP PFNGLMAPBUFFERRANGEPROC) (GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access); | ||||
| typedef void (APIENTRYP PFNGLFLUSHMAPPEDBUFFERRANGEPROC) (GLenum target, GLintptr offset, GLsizeiptr length); | ||||
| #endif | ||||
|  | ||||
| @@ -8011,6 +8047,22 @@ typedef void (APIENTRYP PFNGLENDCONDITIONALRENDERNVPROC) (void); | ||||
|  | ||||
| #ifndef GL_NV_present_video | ||||
| #define GL_NV_present_video 1 | ||||
| #ifdef GL_GLEXT_PROTOTYPES | ||||
| GLAPI void APIENTRY glPresentFrameKeyedNV (GLuint, GLuint64EXT, GLuint, GLuint, GLenum, GLenum, GLuint, GLuint, GLenum, GLuint, GLuint); | ||||
| GLAPI void APIENTRY glPresentFrameDualFillNV (GLuint, GLuint64EXT, GLuint, GLuint, GLenum, GLenum, GLuint, GLenum, GLuint, GLenum, GLuint, GLenum, GLuint); | ||||
| GLAPI void APIENTRY glGetVideoivNV (GLuint, GLenum, GLint *); | ||||
| GLAPI void APIENTRY glGetVideouivNV (GLuint, GLenum, GLuint *); | ||||
| GLAPI void APIENTRY glGetVideoi64vNV (GLuint, GLenum, GLint64EXT *); | ||||
| GLAPI void APIENTRY glGetVideoui64vNV (GLuint, GLenum, GLuint64EXT *); | ||||
| GLAPI void APIENTRY glVideoParameterivNV (GLuint, GLenum, const GLint *); | ||||
| #endif /* GL_GLEXT_PROTOTYPES */ | ||||
| typedef void (APIENTRYP PFNGLPRESENTFRAMEKEYEDNVPROC) (GLuint video_slot, GLuint64EXT minPresentTime, GLuint beginPresentTimeId, GLuint presentDurationId, GLenum type, GLenum target0, GLuint fill0, GLuint key0, GLenum target1, GLuint fill1, GLuint key1); | ||||
| typedef void (APIENTRYP PFNGLPRESENTFRAMEDUALFILLNVPROC) (GLuint video_slot, GLuint64EXT minPresentTime, GLuint beginPresentTimeId, GLuint presentDurationId, GLenum type, GLenum target0, GLuint fill0, GLenum target1, GLuint fill1, GLenum target2, GLuint fill2, GLenum target3, GLuint fill3); | ||||
| typedef void (APIENTRYP PFNGLGETVIDEOIVNVPROC) (GLuint video_slot, GLenum pname, GLint *params); | ||||
| typedef void (APIENTRYP PFNGLGETVIDEOUIVNVPROC) (GLuint video_slot, GLenum pname, GLuint *params); | ||||
| typedef void (APIENTRYP PFNGLGETVIDEOI64VNVPROC) (GLuint video_slot, GLenum pname, GLint64EXT *params); | ||||
| typedef void (APIENTRYP PFNGLGETVIDEOUI64VNVPROC) (GLuint video_slot, GLenum pname, GLuint64EXT *params); | ||||
| typedef void (APIENTRYP PFNGLVIDEOPARAMETERIVNVPROC) (GLuint video_slot, GLenum pname, const GLint *params); | ||||
| #endif | ||||
|  | ||||
| #ifndef GL_EXT_transform_feedback | ||||
| @@ -8021,16 +8073,16 @@ GLAPI void APIENTRY glEndTransformFeedbackEXT (void); | ||||
| GLAPI void APIENTRY glBindBufferRangeEXT (GLenum, GLuint, GLuint, GLintptr, GLsizeiptr); | ||||
| GLAPI void APIENTRY glBindBufferOffsetEXT (GLenum, GLuint, GLuint, GLintptr); | ||||
| GLAPI void APIENTRY glBindBufferBaseEXT (GLenum, GLuint, GLuint); | ||||
| GLAPI void APIENTRY glTransformFeedbackVaryingsEXT (GLuint, GLsizei, const GLint *, GLenum); | ||||
| GLAPI void APIENTRY glGetTransformFeedbackVaryingEXT (GLuint, GLuint, GLint *); | ||||
| GLAPI void APIENTRY glTransformFeedbackVaryingsEXT (GLuint, GLsizei, const GLchar* *, GLenum); | ||||
| GLAPI void APIENTRY glGetTransformFeedbackVaryingEXT (GLuint, GLuint, GLsizei, GLsizei *, GLsizei *, GLenum *, GLchar *); | ||||
| #endif /* GL_GLEXT_PROTOTYPES */ | ||||
| typedef void (APIENTRYP PFNGLBEGINTRANSFORMFEEDBACKEXTPROC) (GLenum primitiveMode); | ||||
| typedef void (APIENTRYP PFNGLENDTRANSFORMFEEDBACKEXTPROC) (void); | ||||
| typedef void (APIENTRYP PFNGLBINDBUFFERRANGEEXTPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); | ||||
| typedef void (APIENTRYP PFNGLBINDBUFFEROFFSETEXTPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset); | ||||
| typedef void (APIENTRYP PFNGLBINDBUFFERBASEEXTPROC) (GLenum target, GLuint index, GLuint buffer); | ||||
| typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKVARYINGSEXTPROC) (GLuint program, GLsizei count, const GLint *locations, GLenum bufferMode); | ||||
| typedef void (APIENTRYP PFNGLGETTRANSFORMFEEDBACKVARYINGEXTPROC) (GLuint program, GLuint index, GLint *location); | ||||
| typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKVARYINGSEXTPROC) (GLuint program, GLsizei count, const GLchar* *varyings, GLenum bufferMode); | ||||
| typedef void (APIENTRYP PFNGLGETTRANSFORMFEEDBACKVARYINGEXTPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name); | ||||
| #endif | ||||
|  | ||||
| #ifndef GL_EXT_direct_state_access | ||||
| @@ -8451,6 +8503,60 @@ typedef void (APIENTRYP PFNGLRESUMETRANSFORMFEEDBACKNVPROC) (void); | ||||
| typedef void (APIENTRYP PFNGLDRAWTRANSFORMFEEDBACKNVPROC) (GLenum mode, GLuint id); | ||||
| #endif | ||||
|  | ||||
| #ifndef GL_ATI_meminfo | ||||
| #define GL_ATI_meminfo 1 | ||||
| #endif | ||||
|  | ||||
| #ifndef GL_AMD_performance_monitor | ||||
| #define GL_AMD_performance_monitor 1 | ||||
| #ifdef GL_GLEXT_PROTOTYPES | ||||
| GLAPI void APIENTRY glGetPerfMonitorGroupsAMD (GLint *, GLsizei, GLuint *); | ||||
| GLAPI void APIENTRY glGetPerfMonitorCountersAMD (GLuint, GLint *, GLint *, GLsizei, GLuint *); | ||||
| GLAPI void APIENTRY glGetPerfMonitorGroupStringAMD (GLuint, GLsizei, GLsizei *, GLchar *); | ||||
| GLAPI void APIENTRY glGetPerfMonitorCounterStringAMD (GLuint, GLuint, GLsizei, GLsizei *, GLchar *); | ||||
| GLAPI void APIENTRY glGetPerfMonitorCounterInfoAMD (GLuint, GLuint, GLenum, void *); | ||||
| GLAPI void APIENTRY glGenPerfMonitorsAMD (GLsizei, GLuint *); | ||||
| GLAPI void APIENTRY glDeletePerfMonitorsAMD (GLsizei, GLuint *); | ||||
| GLAPI void APIENTRY glSelectPerfMonitorCountersAMD (GLuint, GLboolean, GLuint, GLint, GLuint *); | ||||
| GLAPI void APIENTRY glBeginPerfMonitorAMD (GLuint); | ||||
| GLAPI void APIENTRY glEndPerfMonitorAMD (GLuint); | ||||
| GLAPI void APIENTRY glGetPerfMonitorCounterDataAMD (GLuint, GLenum, GLsizei, GLuint *, GLint *); | ||||
| #endif /* GL_GLEXT_PROTOTYPES */ | ||||
| typedef void (APIENTRYP PFNGLGETPERFMONITORGROUPSAMDPROC) (GLint *numGroups, GLsizei groupsSize, GLuint *groups); | ||||
| typedef void (APIENTRYP PFNGLGETPERFMONITORCOUNTERSAMDPROC) (GLuint group, GLint *numCounters, GLint *maxActiveCounters, GLsizei counterSize, GLuint *counters); | ||||
| typedef void (APIENTRYP PFNGLGETPERFMONITORGROUPSTRINGAMDPROC) (GLuint group, GLsizei bufSize, GLsizei *length, GLchar *groupString); | ||||
| typedef void (APIENTRYP PFNGLGETPERFMONITORCOUNTERSTRINGAMDPROC) (GLuint group, GLuint counter, GLsizei bufSize, GLsizei *length, GLchar *counterString); | ||||
| typedef void (APIENTRYP PFNGLGETPERFMONITORCOUNTERINFOAMDPROC) (GLuint group, GLuint counter, GLenum pname, void *data); | ||||
| typedef void (APIENTRYP PFNGLGENPERFMONITORSAMDPROC) (GLsizei n, GLuint *monitors); | ||||
| typedef void (APIENTRYP PFNGLDELETEPERFMONITORSAMDPROC) (GLsizei n, GLuint *monitors); | ||||
| typedef void (APIENTRYP PFNGLSELECTPERFMONITORCOUNTERSAMDPROC) (GLuint monitor, GLboolean enable, GLuint group, GLint numCounters, GLuint *counterList); | ||||
| typedef void (APIENTRYP PFNGLBEGINPERFMONITORAMDPROC) (GLuint monitor); | ||||
| typedef void (APIENTRYP PFNGLENDPERFMONITORAMDPROC) (GLuint monitor); | ||||
| typedef void (APIENTRYP PFNGLGETPERFMONITORCOUNTERDATAAMDPROC) (GLuint monitor, GLenum pname, GLsizei dataSize, GLuint *data, GLint *bytesWritten); | ||||
| #endif | ||||
|  | ||||
| #ifndef GL_AMD_texture_texture4 | ||||
| #define GL_AMD_texture_texture4 1 | ||||
| #endif | ||||
|  | ||||
| #ifndef GL_AMD_vertex_shader_tesselator | ||||
| #define GL_AMD_vertex_shader_tesselator 1 | ||||
| #ifdef GL_GLEXT_PROTOTYPES | ||||
| GLAPI void APIENTRY glTessellationFactorAMD (GLfloat); | ||||
| GLAPI void APIENTRY glTessellationModeAMD (GLenum); | ||||
| #endif /* GL_GLEXT_PROTOTYPES */ | ||||
| typedef void (APIENTRYP PFNGLTESSELLATIONFACTORAMDPROC) (GLfloat factor); | ||||
| typedef void (APIENTRYP PFNGLTESSELLATIONMODEAMDPROC) (GLenum mode); | ||||
| #endif | ||||
|  | ||||
| #ifndef GL_EXT_provoking_vertex | ||||
| #define GL_EXT_provoking_vertex 1 | ||||
| #ifdef GL_GLEXT_PROTOTYPES | ||||
| GLAPI void APIENTRY glProvokingVertexEXT (GLenum); | ||||
| #endif /* GL_GLEXT_PROTOTYPES */ | ||||
| typedef void (APIENTRYP PFNGLPROVOKINGVERTEXEXTPROC) (GLenum mode); | ||||
| #endif | ||||
|  | ||||
|  | ||||
| #ifdef __cplusplus | ||||
| } | ||||
|   | ||||
| @@ -636,7 +636,7 @@ struct __DRIbufferRec { | ||||
| }; | ||||
|  | ||||
| #define __DRI_DRI2_LOADER "DRI_DRI2Loader" | ||||
| #define __DRI_DRI2_LOADER_VERSION 1 | ||||
| #define __DRI_DRI2_LOADER_VERSION 2 | ||||
| struct __DRIdri2LoaderExtensionRec { | ||||
|     __DRIextension base; | ||||
|  | ||||
| @@ -644,6 +644,19 @@ struct __DRIdri2LoaderExtensionRec { | ||||
| 			       int *width, int *height, | ||||
| 			       unsigned int *attachments, int count, | ||||
| 			       int *out_count, void *loaderPrivate); | ||||
|  | ||||
|     /** | ||||
|      * Flush pending front-buffer rendering | ||||
|      * | ||||
|      * Any rendering that has been performed to the | ||||
|      * \c __DRI_BUFFER_FAKE_FRONT_LEFT will be flushed to the | ||||
|      * \c __DRI_BUFFER_FRONT_LEFT. | ||||
|      * | ||||
|      * \param driDrawable    Drawable whose front-buffer is to be flushed | ||||
|      * \param loaderPrivate  Loader's private data that was previously passed | ||||
|      *                       into __DRIdri2ExtensionRec::createNewDrawable | ||||
|      */ | ||||
|     void (*flushFrontBuffer)(__DRIdrawable *driDrawable, void *loaderPrivate); | ||||
| }; | ||||
|  | ||||
| /** | ||||
|   | ||||
| @@ -47,9 +47,12 @@ static const char *TexFiles[2] = | ||||
|  | ||||
| static GLuint Program; | ||||
|  | ||||
| static GLfloat Xrot = -90.0, Yrot = .0, Zrot = 0.0; | ||||
| static GLfloat Xrot = 0.0, Yrot = .0, Zrot = 0.0; | ||||
| static GLfloat EyeDist = 10; | ||||
| static GLboolean Anim = GL_TRUE; | ||||
| static GLboolean UseArrays = GL_TRUE; | ||||
|  | ||||
| static GLint VertCoord_attr = -1, TexCoord0_attr = -1, TexCoord1_attr = -1; | ||||
|  | ||||
|  | ||||
| /* value[0] = tex unit */ | ||||
| @@ -60,32 +63,62 @@ static struct uniform_info Uniforms[] = { | ||||
| }; | ||||
|  | ||||
|  | ||||
| static const GLfloat Tex0Coords[4][2] = { | ||||
|    { 0.0, 0.0 }, { 2.0, 0.0 }, { 2.0, 2.0 }, { 0.0, 2.0 } | ||||
| }; | ||||
|  | ||||
| static const GLfloat Tex1Coords[4][2] = { | ||||
|    { 0.0, 0.0 }, { 1.0, 0.0 }, { 1.0, 1.0 }, { 0.0, 1.0 } | ||||
| }; | ||||
|  | ||||
| static const GLfloat VertCoords[4][2] = { | ||||
|    { -3.0, -3.0 }, { 3.0, -3.0 }, { 3.0, 3.0 }, { -3.0, 3.0 } | ||||
| }; | ||||
|  | ||||
|  | ||||
| static void | ||||
| DrawPolygon(GLfloat size) | ||||
| DrawPolygonArray(void) | ||||
| { | ||||
|    glPushMatrix(); | ||||
|    glRotatef(90, 1, 0, 0); | ||||
|    glNormal3f(0, 0, 1); | ||||
|    glBegin(GL_POLYGON); | ||||
|    if (VertCoord_attr >= 0) { | ||||
|       glVertexAttribPointer_func(VertCoord_attr, 2, GL_FLOAT, GL_FALSE, | ||||
|                                  0, VertCoords); | ||||
|       glEnableVertexAttribArray_func(VertCoord_attr); | ||||
|    } | ||||
|    else { | ||||
|       glVertexPointer(2, GL_FLOAT, 0, VertCoords); | ||||
|       glEnable(GL_VERTEX_ARRAY); | ||||
|    } | ||||
|  | ||||
|    glMultiTexCoord2f(GL_TEXTURE0, 0, 0); | ||||
|    glMultiTexCoord2f(GL_TEXTURE1, 0, 0); | ||||
|    glVertex2f(-size, -size); | ||||
|    glVertexAttribPointer_func(TexCoord0_attr, 2, GL_FLOAT, GL_FALSE, | ||||
|                               0, Tex0Coords); | ||||
|    glEnableVertexAttribArray_func(TexCoord0_attr); | ||||
|  | ||||
|    glMultiTexCoord2f(GL_TEXTURE0, 2, 0); | ||||
|    glMultiTexCoord2f(GL_TEXTURE1, 1, 0); | ||||
|    glVertex2f( size, -size); | ||||
|    glVertexAttribPointer_func(TexCoord1_attr, 2, GL_FLOAT, GL_FALSE, | ||||
|                               0, Tex1Coords); | ||||
|    glEnableVertexAttribArray_func(TexCoord1_attr); | ||||
|  | ||||
|    glMultiTexCoord2f(GL_TEXTURE0, 2, 2); | ||||
|    glMultiTexCoord2f(GL_TEXTURE1, 1, 1); | ||||
|    glVertex2f( size,  size); | ||||
|    glDrawArrays(GL_TRIANGLE_FAN, 0, 4); | ||||
| } | ||||
|  | ||||
|    glMultiTexCoord2f(GL_TEXTURE0, 0, 2); | ||||
|    glMultiTexCoord2f(GL_TEXTURE1, 0, 1); | ||||
|    glVertex2f(-size,  size); | ||||
|  | ||||
| static void | ||||
| DrawPolygonVert(void) | ||||
| { | ||||
|    GLuint i; | ||||
|  | ||||
|    glBegin(GL_TRIANGLE_FAN); | ||||
|  | ||||
|    for (i = 0; i < 4; i++) { | ||||
|       glVertexAttrib2fv_func(TexCoord0_attr, Tex0Coords[i]); | ||||
|       glVertexAttrib2fv_func(TexCoord1_attr, Tex1Coords[i]); | ||||
|  | ||||
|       if (VertCoord_attr >= 0) | ||||
|          glVertexAttrib2fv_func(VertCoord_attr, VertCoords[i]); | ||||
|       else | ||||
|          glVertex2fv(VertCoords[i]); | ||||
|    } | ||||
|  | ||||
|    glEnd(); | ||||
|    glPopMatrix(); | ||||
| } | ||||
|  | ||||
|  | ||||
| @@ -100,7 +133,10 @@ draw(void) | ||||
|       glRotatef(Yrot, 0, 1, 0); | ||||
|       glRotatef(Xrot, 1, 0, 0); | ||||
|  | ||||
|       DrawPolygon(3.0); | ||||
|       if (UseArrays) | ||||
|          DrawPolygonArray(); | ||||
|       else | ||||
|          DrawPolygonVert(); | ||||
|  | ||||
|    glPopMatrix(); | ||||
|  | ||||
| @@ -123,8 +159,11 @@ key(unsigned char k, int x, int y) | ||||
|    (void) x; | ||||
|    (void) y; | ||||
|    switch (k) { | ||||
|    case ' ': | ||||
|    case 'a': | ||||
|       UseArrays = !UseArrays; | ||||
|       printf("Arrays: %d\n", UseArrays); | ||||
|       break; | ||||
|    case ' ': | ||||
|       Anim = !Anim; | ||||
|       if (Anim) | ||||
|          glutIdleFunc(idle); | ||||
| @@ -232,6 +271,28 @@ CreateProgram(const char *vertProgFile, const char *fragProgFile, | ||||
|  | ||||
|    InitUniforms(program, uniforms); | ||||
|  | ||||
|    VertCoord_attr = glGetAttribLocation_func(program, "VertCoord"); | ||||
|    if (VertCoord_attr > 0) { | ||||
|       /* We want the VertCoord attrib to have position zero so that | ||||
|        * the call to glVertexAttrib(0, xyz) triggers vertex processing. | ||||
|        * Otherwise, if TexCoord0 or TexCoord1 gets position 0 we'd have | ||||
|        * to set that attribute last (which is a PITA to manage). | ||||
|        */ | ||||
|       glBindAttribLocation_func(program, 0, "VertCoord"); | ||||
|       /* re-link */ | ||||
|       glLinkProgram_func(program); | ||||
|       /* VertCoord_attr should be zero now */ | ||||
|       VertCoord_attr = glGetAttribLocation_func(program, "VertCoord"); | ||||
|       assert(VertCoord_attr == 0); | ||||
|    } | ||||
|  | ||||
|    TexCoord0_attr = glGetAttribLocation_func(program, "TexCoord0"); | ||||
|    TexCoord1_attr = glGetAttribLocation_func(program, "TexCoord1"); | ||||
|  | ||||
|    printf("TexCoord0_attr = %d\n", TexCoord0_attr); | ||||
|    printf("TexCoord1_attr = %d\n", TexCoord1_attr); | ||||
|    printf("VertCoord_attr = %d\n", VertCoord_attr); | ||||
|  | ||||
|    return program; | ||||
| } | ||||
|  | ||||
|   | ||||
| @@ -2,9 +2,13 @@ | ||||
| // Brian Paul | ||||
|  | ||||
|  | ||||
| attribute vec4 TexCoord0, TexCoord1; | ||||
| attribute vec4 VertCoord; | ||||
|  | ||||
| void main()  | ||||
| { | ||||
|    gl_TexCoord[0] = gl_MultiTexCoord0; | ||||
|    gl_TexCoord[1] = gl_MultiTexCoord1; | ||||
|    gl_Position = ftransform(); | ||||
|    gl_TexCoord[0] = TexCoord0; | ||||
|    gl_TexCoord[1] = TexCoord1; | ||||
|    // note: may use gl_Vertex or VertCoord here for testing: | ||||
|    gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; | ||||
| } | ||||
|   | ||||
| @@ -103,7 +103,7 @@ static void PrintColorStrings( void ) | ||||
| { | ||||
|     GLubyte ubbuf[3]; | ||||
|     int i, xleft, xright; | ||||
|     char colorString[18]; | ||||
|     char colorString[100]; | ||||
|  | ||||
|     xleft = 5 + windW/4; | ||||
|     xright = 5 + windW/2; | ||||
|   | ||||
| @@ -46,6 +46,13 @@ static PFNGLVERTEXATTRIB1FPROC glVertexAttrib1f_func = NULL; | ||||
| static PFNGLVERTEXATTRIB2FPROC glVertexAttrib2f_func = NULL; | ||||
| static PFNGLVERTEXATTRIB3FPROC glVertexAttrib3f_func = NULL; | ||||
| static PFNGLVERTEXATTRIB4FPROC glVertexAttrib4f_func = NULL; | ||||
| static PFNGLVERTEXATTRIB1FVPROC glVertexAttrib1fv_func = NULL; | ||||
| static PFNGLVERTEXATTRIB2FVPROC glVertexAttrib2fv_func = NULL; | ||||
| static PFNGLVERTEXATTRIB3FVPROC glVertexAttrib3fv_func = NULL; | ||||
| static PFNGLVERTEXATTRIB4FVPROC glVertexAttrib4fv_func = NULL; | ||||
| static PFNGLVERTEXATTRIBPOINTERPROC glVertexAttribPointer_func = NULL; | ||||
| static PFNGLENABLEVERTEXATTRIBARRAYPROC glEnableVertexAttribArray_func = NULL; | ||||
| static PFNGLDISABLEVERTEXATTRIBARRAYPROC glDisableVertexAttribArray_func = NULL; | ||||
|  | ||||
| /* OpenGL 2.1 */ | ||||
| static PFNGLUNIFORMMATRIX2X3FVPROC glUniformMatrix2x3fv_func = NULL; | ||||
| @@ -126,6 +133,14 @@ GetExtensionFuncs(void) | ||||
|    glVertexAttrib2f_func = (PFNGLVERTEXATTRIB2FPROC) glutGetProcAddress("glVertexAttrib2f"); | ||||
|    glVertexAttrib3f_func = (PFNGLVERTEXATTRIB3FPROC) glutGetProcAddress("glVertexAttrib3f"); | ||||
|    glVertexAttrib4f_func = (PFNGLVERTEXATTRIB4FPROC) glutGetProcAddress("glVertexAttrib4f"); | ||||
|    glVertexAttrib1fv_func = (PFNGLVERTEXATTRIB1FVPROC) glutGetProcAddress("glVertexAttrib1fv"); | ||||
|    glVertexAttrib2fv_func = (PFNGLVERTEXATTRIB2FVPROC) glutGetProcAddress("glVertexAttrib2fv"); | ||||
|    glVertexAttrib3fv_func = (PFNGLVERTEXATTRIB3FVPROC) glutGetProcAddress("glVertexAttrib3fv"); | ||||
|    glVertexAttrib4fv_func = (PFNGLVERTEXATTRIB4FVPROC) glutGetProcAddress("glVertexAttrib4fv"); | ||||
|  | ||||
|    glVertexAttribPointer_func = (PFNGLVERTEXATTRIBPOINTERPROC) glutGetProcAddress("glVertexAttribPointer"); | ||||
|    glEnableVertexAttribArray_func = (PFNGLENABLEVERTEXATTRIBARRAYPROC) glutGetProcAddress("glEnableVertexAttribArray"); | ||||
|    glDisableVertexAttribArray_func = (PFNGLDISABLEVERTEXATTRIBARRAYPROC) glutGetProcAddress("glDisableVertexAttribArray"); | ||||
|  | ||||
|    /* OpenGL 2.1 */ | ||||
|    glUniformMatrix2x3fv_func = (PFNGLUNIFORMMATRIX2X3FVPROC) glutGetProcAddress("glUniformMatrix2x3fv"); | ||||
|   | ||||
| @@ -98,7 +98,7 @@ xrotfontdemo.o: xrotfontdemo.c xuserotfont.h | ||||
| 	$(CC) -c -I. -I$(INCDIR) $(X11_INCLUDES) $(CFLAGS) xrotfontdemo.c | ||||
|  | ||||
| corender: corender.o ipc.o | ||||
| 	$(CC) $(CFLAGS) corender.o ipc.o $(LIBS) -o $@ | ||||
| 	$(CC) $(CFLAGS) $(LDFLAGS) corender.o ipc.o $(LIBS) -o $@ | ||||
|  | ||||
| corender.o: corender.c ipc.h | ||||
| 	$(CC) -c -I. -I$(INCDIR) $(X11_INCLUDES) $(CFLAGS) corender.c | ||||
|   | ||||
| @@ -385,6 +385,10 @@ draw( Display *dpy, Window win ) | ||||
|    } else | ||||
|       do_draw(); | ||||
|  | ||||
|    glDeleteLists(gear1, 1); | ||||
|    glDeleteLists(gear2, 1); | ||||
|    glDeleteLists(gear3, 1); | ||||
|  | ||||
|    glXSwapBuffers(dpy, win); | ||||
|    glXDestroyContext(dpy, ctx); | ||||
| } | ||||
|   | ||||
| @@ -39,6 +39,9 @@ | ||||
| #include <GL/gl.h> | ||||
| #include <GL/glx.h> | ||||
|  | ||||
| static int is_glx_extension_supported(Display *dpy, const char *query); | ||||
|  | ||||
| static void query_vsync(Display *dpy); | ||||
|  | ||||
| #define BENCHMARK | ||||
|  | ||||
| @@ -560,6 +563,73 @@ make_window( Display *dpy, const char *name, | ||||
| } | ||||
|  | ||||
|  | ||||
| /** | ||||
|  * Determine whether or not a GLX extension is supported. | ||||
|  */ | ||||
| int | ||||
| is_glx_extension_supported(Display *dpy, const char *query) | ||||
| { | ||||
|    const int scrnum = DefaultScreen(dpy); | ||||
|    const char *glx_extensions = NULL; | ||||
|    const size_t len = strlen(query); | ||||
|    const char *ptr; | ||||
|  | ||||
|    if (glx_extensions == NULL) { | ||||
|       glx_extensions = glXQueryExtensionsString(dpy, scrnum); | ||||
|    } | ||||
|  | ||||
|    ptr = strstr(glx_extensions, query); | ||||
|    return ((ptr != NULL) && ((ptr[len] == ' ') || (ptr[len] == '\0'))); | ||||
| } | ||||
|  | ||||
|  | ||||
| /** | ||||
|  * Attempt to determine whether or not the display is synched to vblank. | ||||
|  */ | ||||
| void | ||||
| query_vsync(Display *dpy) | ||||
| { | ||||
|    int interval = 0; | ||||
|  | ||||
|  | ||||
| #ifdef GLX_MESA_swap_control | ||||
|    if ((interval <= 0) | ||||
|        && is_glx_extension_supported(dpy, "GLX_MESA_swap_control")) { | ||||
|       PFNGLXGETSWAPINTERVALMESAPROC pglXGetSwapIntervalMESA = | ||||
|           (PFNGLXGETSWAPINTERVALMESAPROC) | ||||
|           glXGetProcAddressARB((const GLubyte *) "glXGetSwapIntervalMESA"); | ||||
|  | ||||
|       interval = (*pglXGetSwapIntervalMESA)(); | ||||
|    } | ||||
| #endif | ||||
|  | ||||
|  | ||||
| #ifdef GLX_SGI_video_sync | ||||
|    if ((interval <= 0) | ||||
|        && is_glx_extension_supported(dpy, "GLX_SGI_video_sync")) { | ||||
|       PFNGLXGETVIDEOSYNCSGIPROC pglXGetVideoSyncSGI = | ||||
|           (PFNGLXGETVIDEOSYNCSGIPROC) | ||||
|           glXGetProcAddressARB((const GLubyte *) "glXGetVideoSyncSGI"); | ||||
|       unsigned count; | ||||
|  | ||||
|       if ((*pglXGetVideoSyncSGI)(& count) == 0) { | ||||
|          interval = (int) count; | ||||
|       } | ||||
|    } | ||||
| #endif | ||||
|  | ||||
|  | ||||
|    if (interval > 0) { | ||||
|       printf("Running synchronized to the vertical refresh.  The framerate should be\n"); | ||||
|       if (interval == 1) { | ||||
|          printf("approximately the same as the monitor refresh rate.\n"); | ||||
|       } else if (interval > 1) { | ||||
|          printf("approximately 1/%d the monitor refresh rate.\n", | ||||
|                 interval); | ||||
|       } | ||||
|    } | ||||
| } | ||||
|  | ||||
| /** | ||||
|  * Handle one X event. | ||||
|  * \return NOP, EXIT or DRAW | ||||
| @@ -567,6 +637,9 @@ make_window( Display *dpy, const char *name, | ||||
| static int | ||||
| handle_event(Display *dpy, Window win, XEvent *event) | ||||
| { | ||||
|    (void) dpy; | ||||
|    (void) win; | ||||
|  | ||||
|    switch (event->type) { | ||||
|    case Expose: | ||||
|       return DRAW; | ||||
| @@ -686,6 +759,7 @@ main(int argc, char *argv[]) | ||||
|    make_window(dpy, "glxgears", x, y, winWidth, winHeight, &win, &ctx); | ||||
|    XMapWindow(dpy, win); | ||||
|    glXMakeCurrent(dpy, win, ctx); | ||||
|    query_vsync(dpy); | ||||
|  | ||||
|    if (printInfo) { | ||||
|       printf("GL_RENDERER   = %s\n", (char *) glGetString(GL_RENDERER)); | ||||
|   | ||||
| @@ -178,6 +178,7 @@ int main( int argc, char *argv[] ) | ||||
|    glColor3f( 0.0, 1.0, 1.0 ); | ||||
|    glRectf( -0.75, -0.75, 0.75, 0.75 ); | ||||
|    glFlush(); | ||||
|    glXWaitGL(); | ||||
|  | ||||
|    XMapWindow( dpy, win ); | ||||
|  | ||||
|   | ||||
| @@ -286,7 +286,7 @@ EventLoop(void) | ||||
|                         XLookupString(&event.xkey, buf, sizeof(buf), &keySym, &stat); | ||||
|                         switch (keySym) { | ||||
|                            case XK_Escape: | ||||
|                               exit(0); | ||||
|                               return; | ||||
|                               break; | ||||
|                            case XK_d: | ||||
|                            case XK_D: | ||||
|   | ||||
| @@ -253,7 +253,7 @@ DRI2Buffer *DRI2GetBuffers(Display *dpy, XID drawable, | ||||
|     *height = rep.height; | ||||
|     *outCount = rep.count; | ||||
|  | ||||
|     buffers = Xmalloc(count * sizeof buffers[0]); | ||||
|     buffers = Xmalloc(rep.count * sizeof buffers[0]); | ||||
|     if (buffers == NULL) { | ||||
| 	_XEatData(dpy, rep.count * sizeof repBuffer); | ||||
| 	UnlockDisplay(dpy); | ||||
|   | ||||
| @@ -73,6 +73,8 @@ struct __GLXDRIdrawablePrivateRec { | ||||
|     __DRIbuffer buffers[5]; | ||||
|     int bufferCount; | ||||
|     int width, height; | ||||
|     int have_back; | ||||
|     int have_fake_front; | ||||
| }; | ||||
|  | ||||
| static void dri2DestroyContext(__GLXDRIcontext *context, | ||||
| @@ -166,6 +168,7 @@ static __GLXDRIdrawable *dri2CreateDrawable(__GLXscreenConfigs *psc, | ||||
|     pdraw->base.xDrawable = xDrawable; | ||||
|     pdraw->base.drawable = drawable; | ||||
|     pdraw->base.psc = psc; | ||||
|     pdraw->bufferCount = 0; | ||||
|  | ||||
|     DRI2CreateDrawable(psc->dpy, xDrawable); | ||||
|  | ||||
| @@ -190,6 +193,10 @@ static void dri2CopySubBuffer(__GLXDRIdrawable *pdraw, | ||||
|     XRectangle xrect; | ||||
|     XserverRegion region; | ||||
|  | ||||
|     /* Check we have the right attachments */ | ||||
|     if (!priv->have_back) | ||||
|     	return; | ||||
|  | ||||
|     xrect.x = x; | ||||
|     xrect.y = priv->height - y - height; | ||||
|     xrect.width = width; | ||||
| @@ -208,6 +215,56 @@ static void dri2SwapBuffers(__GLXDRIdrawable *pdraw) | ||||
|     dri2CopySubBuffer(pdraw, 0, 0, priv->width, priv->height); | ||||
| } | ||||
|  | ||||
| static void dri2WaitX(__GLXDRIdrawable *pdraw) | ||||
| { | ||||
|     __GLXDRIdrawablePrivate *priv = (__GLXDRIdrawablePrivate *) pdraw; | ||||
|     XRectangle xrect; | ||||
|     XserverRegion region; | ||||
|  | ||||
|     /* Check we have the right attachments */ | ||||
|     if (!priv->have_fake_front) | ||||
|     	return; | ||||
|  | ||||
|     xrect.x = 0; | ||||
|     xrect.y = 0; | ||||
|     xrect.width = priv->width; | ||||
|     xrect.height = priv->height; | ||||
|  | ||||
|     region = XFixesCreateRegion(pdraw->psc->dpy, &xrect, 1); | ||||
|     DRI2CopyRegion(pdraw->psc->dpy, pdraw->drawable, region, | ||||
| 		   DRI2BufferFakeFrontLeft, DRI2BufferFrontLeft); | ||||
|     XFixesDestroyRegion(pdraw->psc->dpy, region); | ||||
| } | ||||
|  | ||||
| static void dri2WaitGL(__GLXDRIdrawable *pdraw) | ||||
| { | ||||
|     __GLXDRIdrawablePrivate *priv = (__GLXDRIdrawablePrivate *) pdraw; | ||||
|     XRectangle xrect; | ||||
|     XserverRegion region; | ||||
|  | ||||
|     if (!priv->have_fake_front) | ||||
|     	return; | ||||
|  | ||||
|     xrect.x = 0; | ||||
|     xrect.y = 0; | ||||
|     xrect.width = priv->width; | ||||
|     xrect.height = priv->height; | ||||
|  | ||||
|     region = XFixesCreateRegion(pdraw->psc->dpy, &xrect, 1); | ||||
|     DRI2CopyRegion(pdraw->psc->dpy, pdraw->drawable, region, | ||||
| 		   DRI2BufferFrontLeft, DRI2BufferFakeFrontLeft); | ||||
|     XFixesDestroyRegion(pdraw->psc->dpy, region); | ||||
| } | ||||
|  | ||||
|  | ||||
| static void dri2FlushFrontBuffer(__DRIdrawable *driDrawable, | ||||
| 				 void *loaderPrivate) | ||||
| { | ||||
|     (void) driDrawable; | ||||
|     dri2WaitGL((__GLXDRIdrawable *) loaderPrivate); | ||||
| } | ||||
|  | ||||
|  | ||||
| static void dri2DestroyScreen(__GLXscreenConfigs *psc) | ||||
| { | ||||
|     /* Free the direct rendering per screen data */ | ||||
| @@ -233,6 +290,9 @@ dri2GetBuffers(__DRIdrawable *driDrawable, | ||||
|  | ||||
|     pdraw->width = *width; | ||||
|     pdraw->height = *height; | ||||
|     pdraw->bufferCount = *out_count; | ||||
|     pdraw->have_fake_front = 0; | ||||
|     pdraw->have_back = 0; | ||||
|  | ||||
|     /* This assumes the DRI2 buffer attachment tokens matches the | ||||
|      * __DRIbuffer tokens. */ | ||||
| @@ -242,6 +302,10 @@ dri2GetBuffers(__DRIdrawable *driDrawable, | ||||
| 	pdraw->buffers[i].pitch = buffers[i].pitch; | ||||
| 	pdraw->buffers[i].cpp = buffers[i].cpp; | ||||
| 	pdraw->buffers[i].flags = buffers[i].flags; | ||||
| 	if (pdraw->buffers[i].attachment == __DRI_BUFFER_FAKE_FRONT_LEFT) | ||||
| 	    pdraw->have_fake_front = 1; | ||||
| 	if (pdraw->buffers[i].attachment == __DRI_BUFFER_BACK_LEFT) | ||||
| 	    pdraw->have_back = 1; | ||||
|     } | ||||
|  | ||||
|     Xfree(buffers); | ||||
| @@ -252,6 +316,7 @@ dri2GetBuffers(__DRIdrawable *driDrawable, | ||||
| static const __DRIdri2LoaderExtension dri2LoaderExtension = { | ||||
|     { __DRI_DRI2_LOADER, __DRI_DRI2_LOADER_VERSION }, | ||||
|     dri2GetBuffers, | ||||
|     dri2FlushFrontBuffer | ||||
| }; | ||||
|  | ||||
| static const __DRIextension *loader_extensions[] = { | ||||
| @@ -332,6 +397,8 @@ static __GLXDRIscreen *dri2CreateScreen(__GLXscreenConfigs *psc, int screen, | ||||
|     psp->createContext = dri2CreateContext; | ||||
|     psp->createDrawable = dri2CreateDrawable; | ||||
|     psp->swapBuffers = dri2SwapBuffers; | ||||
|     psp->waitGL = dri2WaitGL; | ||||
|     psp->waitX = dri2WaitX; | ||||
|  | ||||
|     /* DRI2 suports SubBuffer through DRI2CopyRegion, so it's always | ||||
|      * available.*/ | ||||
|   | ||||
| @@ -600,7 +600,7 @@ static __GLXDRIscreen *driCreateScreen(__GLXscreenConfigs *psc, int screen, | ||||
|     char *driverName; | ||||
|     int i; | ||||
|  | ||||
|     psp = Xmalloc(sizeof *psp); | ||||
|     psp = Xcalloc(1, sizeof *psp); | ||||
|     if (psp == NULL) | ||||
| 	return NULL; | ||||
|  | ||||
| @@ -655,6 +655,8 @@ static __GLXDRIscreen *driCreateScreen(__GLXscreenConfigs *psc, int screen, | ||||
|     psp->createContext = driCreateContext; | ||||
|     psp->createDrawable = driCreateDrawable; | ||||
|     psp->swapBuffers = driSwapBuffers; | ||||
|     psp->waitX = NULL; | ||||
|     psp->waitGL = NULL; | ||||
|  | ||||
|     return psp; | ||||
| } | ||||
|   | ||||
| @@ -359,7 +359,7 @@ driCreateScreen(__GLXscreenConfigs * psc, int screen, | ||||
|    const char *driverName = "swrast"; | ||||
|    int i; | ||||
|  | ||||
|    psp = Xmalloc(sizeof *psp); | ||||
|    psp = Xcalloc(1, sizeof *psp); | ||||
|    if (psp == NULL) | ||||
|       return NULL; | ||||
|  | ||||
| @@ -405,6 +405,8 @@ driCreateScreen(__GLXscreenConfigs * psc, int screen, | ||||
|    psp->createContext = driCreateContext; | ||||
|    psp->createDrawable = driCreateDrawable; | ||||
|    psp->swapBuffers = driSwapBuffers; | ||||
|    psp->waitX = NULL; | ||||
|    psp->waitGL = NULL; | ||||
|  | ||||
|    return psp; | ||||
|  | ||||
|   | ||||
| @@ -139,6 +139,8 @@ struct __GLXDRIscreenRec { | ||||
|     void (*swapBuffers)(__GLXDRIdrawable *pdraw); | ||||
|     void (*copySubBuffer)(__GLXDRIdrawable *pdraw, | ||||
| 			  int x, int y, int width, int height); | ||||
|     void (*waitX)(__GLXDRIdrawable *pdraw); | ||||
|     void (*waitGL)(__GLXDRIdrawable *pdraw); | ||||
| }; | ||||
|  | ||||
| struct __GLXDRIcontextRec { | ||||
|   | ||||
| @@ -611,11 +611,15 @@ PUBLIC void glXWaitGL(void) | ||||
|  | ||||
| #ifdef GLX_DIRECT_RENDERING | ||||
|     if (gc->driContext) { | ||||
| /* This bit of ugliness unwraps the glFinish function */ | ||||
| #ifdef glFinish | ||||
| #undef glFinish | ||||
| #endif | ||||
| 	glFinish(); | ||||
|     	int screen; | ||||
|     	__GLXDRIdrawable *pdraw = GetGLXDRIDrawable(dpy, gc->currentDrawable, &screen); | ||||
|  | ||||
|     	if ( pdraw != NULL ) { | ||||
| 	    __GLXscreenConfigs * const psc = GetGLXScreenConfigs(dpy, screen); | ||||
| 	    glFlush(); | ||||
| 	    if (psc->driScreen->waitGL != NULL) | ||||
| 	    	(*psc->driScreen->waitGL)(pdraw); | ||||
| 	} | ||||
| 	return; | ||||
|     } | ||||
| #endif | ||||
| @@ -647,7 +651,15 @@ PUBLIC void glXWaitX(void) | ||||
|  | ||||
| #ifdef GLX_DIRECT_RENDERING | ||||
|     if (gc->driContext) { | ||||
| 	XSync(dpy, False); | ||||
|     	int screen; | ||||
|     	__GLXDRIdrawable *pdraw = GetGLXDRIDrawable(dpy, gc->currentDrawable, &screen); | ||||
|  | ||||
|     	if ( pdraw != NULL ) { | ||||
| 	    __GLXscreenConfigs * const psc = GetGLXScreenConfigs(dpy, screen); | ||||
| 	    if (psc->driScreen->waitX != NULL) | ||||
| 	    	(*psc->driScreen->waitX)(pdraw); | ||||
| 	} else | ||||
| 	    XSync(dpy, False); | ||||
| 	return; | ||||
|     } | ||||
| #endif | ||||
| @@ -1690,7 +1702,8 @@ PUBLIC GLXFBConfig *glXGetFBConfigs(Display *dpy, int screen, int *nelements) | ||||
|     int   i; | ||||
|  | ||||
|     *nelements = 0; | ||||
|     if ( (priv->screenConfigs != NULL) | ||||
|     if ( priv | ||||
|          && (priv->screenConfigs != NULL) | ||||
| 	 && (screen >= 0) && (screen <= ScreenCount(dpy)) | ||||
| 	 && (priv->screenConfigs[screen].configs != NULL) | ||||
| 	 && (priv->screenConfigs[screen].configs->fbconfigID != GLX_DONT_CARE) ) { | ||||
|   | ||||
| @@ -429,7 +429,7 @@ MakeContextCurrent(Display * dpy, GLXDrawable draw, | ||||
|                                     &dummy_reply); | ||||
|    } | ||||
| #ifdef GLX_DIRECT_RENDERING | ||||
|    else if (oldGC->driContext) { | ||||
|    else if (oldGC->driContext && oldGC != gc) { | ||||
|       oldGC->driContext->unbindContext(oldGC->driContext); | ||||
|    } | ||||
| #endif | ||||
|   | ||||
| @@ -5198,9 +5198,13 @@ glDeleteTexturesEXT(GLsizei n, const GLuint * textures) | ||||
| { | ||||
|     __GLXcontext *const gc = __glXGetCurrentContext(); | ||||
|  | ||||
| #ifdef GLX_DIRECT_RENDERING | ||||
|     if (gc->driContext) { | ||||
|         CALL_DeleteTextures(GET_DISPATCH(), (n, textures)); | ||||
|     } else { | ||||
| #else | ||||
|     { | ||||
| #endif | ||||
|         __GLXcontext *const gc = __glXGetCurrentContext(); | ||||
|         Display *const dpy = gc->currentDpy; | ||||
|         const GLuint cmdlen = 4 + __GLX_PAD((n * 4)); | ||||
| @@ -5266,9 +5270,13 @@ glGenTexturesEXT(GLsizei n, GLuint * textures) | ||||
| { | ||||
|     __GLXcontext *const gc = __glXGetCurrentContext(); | ||||
|  | ||||
| #ifdef GLX_DIRECT_RENDERING     | ||||
|     if (gc->driContext) { | ||||
|         CALL_GenTextures(GET_DISPATCH(), (n, textures)); | ||||
|     } else { | ||||
| #else  | ||||
|     { | ||||
| #endif | ||||
|         __GLXcontext *const gc = __glXGetCurrentContext(); | ||||
|         Display *const dpy = gc->currentDpy; | ||||
|         const GLuint cmdlen = 4; | ||||
| @@ -5328,9 +5336,13 @@ glIsTextureEXT(GLuint texture) | ||||
| { | ||||
|     __GLXcontext *const gc = __glXGetCurrentContext(); | ||||
|  | ||||
| #ifdef GLX_DIRECT_RENDERING     | ||||
|     if (gc->driContext) { | ||||
|         return CALL_IsTexture(GET_DISPATCH(), (texture)); | ||||
|     } else { | ||||
| #else  | ||||
|     { | ||||
| #endif | ||||
|         __GLXcontext *const gc = __glXGetCurrentContext(); | ||||
|         Display *const dpy = gc->currentDpy; | ||||
|         GLboolean retval = (GLboolean) 0; | ||||
| @@ -5641,9 +5653,13 @@ glGetColorTableEXT(GLenum target, GLenum format, GLenum type, GLvoid * table) | ||||
| { | ||||
|     __GLXcontext *const gc = __glXGetCurrentContext(); | ||||
|  | ||||
| #ifdef GLX_DIRECT_RENDERING     | ||||
|     if (gc->driContext) { | ||||
|         CALL_GetColorTable(GET_DISPATCH(), (target, format, type, table)); | ||||
|     } else { | ||||
| #else  | ||||
|     { | ||||
| #endif | ||||
|         __GLXcontext *const gc = __glXGetCurrentContext(); | ||||
|         const __GLXattribute *const state = gc->client_state_private; | ||||
|         Display *const dpy = gc->currentDpy; | ||||
| @@ -5714,10 +5730,14 @@ glGetColorTableParameterfvEXT(GLenum target, GLenum pname, GLfloat * params) | ||||
| { | ||||
|     __GLXcontext *const gc = __glXGetCurrentContext(); | ||||
|  | ||||
| #ifdef GLX_DIRECT_RENDERING     | ||||
|     if (gc->driContext) { | ||||
|         CALL_GetColorTableParameterfv(GET_DISPATCH(), | ||||
|                                       (target, pname, params)); | ||||
|     } else { | ||||
| #else  | ||||
|     { | ||||
| #endif | ||||
|         __GLXcontext *const gc = __glXGetCurrentContext(); | ||||
|         Display *const dpy = gc->currentDpy; | ||||
|         const GLuint cmdlen = 8; | ||||
| @@ -5784,10 +5804,14 @@ glGetColorTableParameterivEXT(GLenum target, GLenum pname, GLint * params) | ||||
| { | ||||
|     __GLXcontext *const gc = __glXGetCurrentContext(); | ||||
|  | ||||
| #ifdef GLX_DIRECT_RENDERING     | ||||
|     if (gc->driContext) { | ||||
|         CALL_GetColorTableParameteriv(GET_DISPATCH(), | ||||
|                                       (target, pname, params)); | ||||
|     } else { | ||||
| #else  | ||||
|     { | ||||
| #endif | ||||
|         __GLXcontext *const gc = __glXGetCurrentContext(); | ||||
|         Display *const dpy = gc->currentDpy; | ||||
|         const GLuint cmdlen = 8; | ||||
| @@ -6107,10 +6131,14 @@ gl_dispatch_stub_356(GLenum target, GLenum format, GLenum type, | ||||
| { | ||||
|     __GLXcontext *const gc = __glXGetCurrentContext(); | ||||
|  | ||||
| #ifdef GLX_DIRECT_RENDERING     | ||||
|     if (gc->driContext) { | ||||
|         CALL_GetConvolutionFilter(GET_DISPATCH(), | ||||
|                                   (target, format, type, image)); | ||||
|     } else { | ||||
| #else  | ||||
|     { | ||||
| #endif | ||||
|         __GLXcontext *const gc = __glXGetCurrentContext(); | ||||
|         const __GLXattribute *const state = gc->client_state_private; | ||||
|         Display *const dpy = gc->currentDpy; | ||||
| @@ -6182,10 +6210,14 @@ gl_dispatch_stub_357(GLenum target, GLenum pname, GLfloat * params) | ||||
| { | ||||
|     __GLXcontext *const gc = __glXGetCurrentContext(); | ||||
|  | ||||
| #ifdef GLX_DIRECT_RENDERING     | ||||
|     if (gc->driContext) { | ||||
|         CALL_GetConvolutionParameterfv(GET_DISPATCH(), | ||||
|                                        (target, pname, params)); | ||||
|     } else { | ||||
| #else  | ||||
|     { | ||||
| #endif | ||||
|         __GLXcontext *const gc = __glXGetCurrentContext(); | ||||
|         Display *const dpy = gc->currentDpy; | ||||
|         const GLuint cmdlen = 8; | ||||
| @@ -6252,10 +6284,14 @@ gl_dispatch_stub_358(GLenum target, GLenum pname, GLint * params) | ||||
| { | ||||
|     __GLXcontext *const gc = __glXGetCurrentContext(); | ||||
|  | ||||
| #ifdef GLX_DIRECT_RENDERING     | ||||
|     if (gc->driContext) { | ||||
|         CALL_GetConvolutionParameteriv(GET_DISPATCH(), | ||||
|                                        (target, pname, params)); | ||||
|     } else { | ||||
| #else  | ||||
|     { | ||||
| #endif | ||||
|         __GLXcontext *const gc = __glXGetCurrentContext(); | ||||
|         Display *const dpy = gc->currentDpy; | ||||
|         const GLuint cmdlen = 8; | ||||
| @@ -6329,10 +6365,14 @@ gl_dispatch_stub_361(GLenum target, GLboolean reset, GLenum format, | ||||
| { | ||||
|     __GLXcontext *const gc = __glXGetCurrentContext(); | ||||
|  | ||||
| #ifdef GLX_DIRECT_RENDERING     | ||||
|     if (gc->driContext) { | ||||
|         CALL_GetHistogram(GET_DISPATCH(), | ||||
|                           (target, reset, format, type, values)); | ||||
|     } else { | ||||
| #else  | ||||
|     { | ||||
| #endif | ||||
|         __GLXcontext *const gc = __glXGetCurrentContext(); | ||||
|         const __GLXattribute *const state = gc->client_state_private; | ||||
|         Display *const dpy = gc->currentDpy; | ||||
| @@ -6403,9 +6443,13 @@ gl_dispatch_stub_362(GLenum target, GLenum pname, GLfloat * params) | ||||
| { | ||||
|     __GLXcontext *const gc = __glXGetCurrentContext(); | ||||
|  | ||||
| #ifdef GLX_DIRECT_RENDERING     | ||||
|     if (gc->driContext) { | ||||
|         CALL_GetHistogramParameterfv(GET_DISPATCH(), (target, pname, params)); | ||||
|     } else { | ||||
| #else  | ||||
|     { | ||||
| #endif | ||||
|         __GLXcontext *const gc = __glXGetCurrentContext(); | ||||
|         Display *const dpy = gc->currentDpy; | ||||
|         const GLuint cmdlen = 8; | ||||
| @@ -6471,9 +6515,13 @@ gl_dispatch_stub_363(GLenum target, GLenum pname, GLint * params) | ||||
| { | ||||
|     __GLXcontext *const gc = __glXGetCurrentContext(); | ||||
|  | ||||
| #ifdef GLX_DIRECT_RENDERING     | ||||
|     if (gc->driContext) { | ||||
|         CALL_GetHistogramParameteriv(GET_DISPATCH(), (target, pname, params)); | ||||
|     } else { | ||||
| #else  | ||||
|     { | ||||
| #endif | ||||
|         __GLXcontext *const gc = __glXGetCurrentContext(); | ||||
|         Display *const dpy = gc->currentDpy; | ||||
|         const GLuint cmdlen = 8; | ||||
| @@ -6543,9 +6591,13 @@ gl_dispatch_stub_364(GLenum target, GLboolean reset, GLenum format, | ||||
| { | ||||
|     __GLXcontext *const gc = __glXGetCurrentContext(); | ||||
|  | ||||
| #ifdef GLX_DIRECT_RENDERING     | ||||
|     if (gc->driContext) { | ||||
|         CALL_GetMinmax(GET_DISPATCH(), (target, reset, format, type, values)); | ||||
|     } else { | ||||
| #else  | ||||
|     { | ||||
| #endif | ||||
|         __GLXcontext *const gc = __glXGetCurrentContext(); | ||||
|         const __GLXattribute *const state = gc->client_state_private; | ||||
|         Display *const dpy = gc->currentDpy; | ||||
| @@ -6614,9 +6666,13 @@ gl_dispatch_stub_365(GLenum target, GLenum pname, GLfloat * params) | ||||
| { | ||||
|     __GLXcontext *const gc = __glXGetCurrentContext(); | ||||
|  | ||||
| #ifdef GLX_DIRECT_RENDERING     | ||||
|     if (gc->driContext) { | ||||
|         CALL_GetMinmaxParameterfv(GET_DISPATCH(), (target, pname, params)); | ||||
|     } else { | ||||
| #else  | ||||
|     { | ||||
| #endif | ||||
|         __GLXcontext *const gc = __glXGetCurrentContext(); | ||||
|         Display *const dpy = gc->currentDpy; | ||||
|         const GLuint cmdlen = 8; | ||||
| @@ -6679,9 +6735,13 @@ gl_dispatch_stub_366(GLenum target, GLenum pname, GLint * params) | ||||
| { | ||||
|     __GLXcontext *const gc = __glXGetCurrentContext(); | ||||
|  | ||||
| #ifdef GLX_DIRECT_RENDERING     | ||||
|     if (gc->driContext) { | ||||
|         CALL_GetMinmaxParameteriv(GET_DISPATCH(), (target, pname, params)); | ||||
|     } else { | ||||
| #else  | ||||
|     { | ||||
| #endif | ||||
|         __GLXcontext *const gc = __glXGetCurrentContext(); | ||||
|         Display *const dpy = gc->currentDpy; | ||||
|         const GLuint cmdlen = 8; | ||||
|   | ||||
| @@ -30,6 +30,10 @@ | ||||
| #include "indirect_vertex_array.h" | ||||
| #include <GL/glxproto.h> | ||||
|  | ||||
| #if !defined __GNUC__ || __GNUC__ < 3 | ||||
| #  define __builtin_expect(x, y) x | ||||
| #endif | ||||
|  | ||||
| static void | ||||
| do_vertex_attrib_enable(GLuint index, GLboolean val) | ||||
| { | ||||
|   | ||||
| @@ -31,6 +31,10 @@ | ||||
| #include "glxclient.h" | ||||
| #include "indirect.h" | ||||
|  | ||||
| #if !defined __GNUC__ || __GNUC__ < 3 | ||||
| #  define __builtin_expect(x, y) x | ||||
| #endif | ||||
|  | ||||
| /** | ||||
|  * Send glPixelStore command to the server | ||||
|  *  | ||||
|   | ||||
| @@ -119,6 +119,9 @@ static int driUnbindContext(__DRIcontext *pcp) | ||||
|     pdp = pcp->driDrawablePriv; | ||||
|     prp = pcp->driReadablePriv; | ||||
|  | ||||
|     /* already unbound */ | ||||
|     if (!pdp && !prp) | ||||
|       return GL_TRUE; | ||||
|     /* Let driver unbind drawable from context */ | ||||
|     (*psp->DriverAPI.UnbindContext)(pcp); | ||||
|  | ||||
| @@ -143,9 +146,10 @@ static int driUnbindContext(__DRIcontext *pcp) | ||||
|      * window we can determine the last context bound to the window and | ||||
|      * use that context's lock. (BrianP, 2-Dec-2000) | ||||
|      */ | ||||
|     pcp->driDrawablePriv = pcp->driReadablePriv = NULL; | ||||
|  | ||||
| #if 0 | ||||
|     /* Unbind the drawable */ | ||||
|     pcp->driDrawablePriv = NULL; | ||||
|     pdp->driContextPriv = &psp->dummyContextPriv; | ||||
| #endif | ||||
|  | ||||
|   | ||||
| @@ -1063,31 +1063,31 @@ void driInitTextureObjects( GLcontext *ctx, driTextureObject * swapped, | ||||
|       ctx->Texture.CurrentUnit = i; | ||||
|  | ||||
|       if ( (targets & DRI_TEXMGR_DO_TEXTURE_1D) != 0 ) { | ||||
| 	 texObj = ctx->Texture.Unit[i].Current1D; | ||||
| 	 texObj = ctx->Texture.Unit[i].CurrentTex[TEXTURE_1D_INDEX]; | ||||
| 	 ctx->Driver.BindTexture( ctx, GL_TEXTURE_1D, texObj ); | ||||
| 	 move_to_tail( swapped, (driTextureObject *) texObj->DriverData ); | ||||
|       } | ||||
|  | ||||
|       if ( (targets & DRI_TEXMGR_DO_TEXTURE_2D) != 0 ) { | ||||
| 	 texObj = ctx->Texture.Unit[i].Current2D; | ||||
| 	 texObj = ctx->Texture.Unit[i].CurrentTex[TEXTURE_2D_INDEX]; | ||||
| 	 ctx->Driver.BindTexture( ctx, GL_TEXTURE_2D, texObj ); | ||||
| 	 move_to_tail( swapped, (driTextureObject *) texObj->DriverData ); | ||||
|       } | ||||
|  | ||||
|       if ( (targets & DRI_TEXMGR_DO_TEXTURE_3D) != 0 ) { | ||||
| 	 texObj = ctx->Texture.Unit[i].Current3D; | ||||
| 	 texObj = ctx->Texture.Unit[i].CurrentTex[TEXTURE_3D_INDEX]; | ||||
| 	 ctx->Driver.BindTexture( ctx, GL_TEXTURE_3D, texObj ); | ||||
| 	 move_to_tail( swapped, (driTextureObject *) texObj->DriverData ); | ||||
|       } | ||||
|  | ||||
|       if ( (targets & DRI_TEXMGR_DO_TEXTURE_CUBE) != 0 ) { | ||||
| 	 texObj = ctx->Texture.Unit[i].CurrentCubeMap; | ||||
| 	 texObj = ctx->Texture.Unit[i].CurrentTex[TEXTURE_CUBE_INDEX]; | ||||
| 	 ctx->Driver.BindTexture( ctx, GL_TEXTURE_CUBE_MAP_ARB, texObj ); | ||||
| 	 move_to_tail( swapped, (driTextureObject *) texObj->DriverData ); | ||||
|       } | ||||
|  | ||||
|       if ( (targets & DRI_TEXMGR_DO_TEXTURE_RECT) != 0 ) { | ||||
| 	 texObj = ctx->Texture.Unit[i].CurrentRect; | ||||
| 	 texObj = ctx->Texture.Unit[i].CurrentTex[TEXTURE_RECT_INDEX]; | ||||
| 	 ctx->Driver.BindTexture( ctx, GL_TEXTURE_RECTANGLE_NV, texObj ); | ||||
| 	 move_to_tail( swapped, (driTextureObject *) texObj->DriverData ); | ||||
|       } | ||||
|   | ||||
| @@ -400,19 +400,19 @@ void gammaInitTextureObjects( GLcontext *ctx ) | ||||
|  | ||||
|    ctx->Texture.CurrentUnit = 0; | ||||
|  | ||||
|    texObj = ctx->Texture.Unit[0].Current1D; | ||||
|    texObj = ctx->Texture.Unit[0].CurrentTex[TEXTURE_1D_INDEX]; | ||||
|    gammaBindTexture( ctx, GL_TEXTURE_1D, texObj ); | ||||
|  | ||||
|    texObj = ctx->Texture.Unit[0].Current2D; | ||||
|    texObj = ctx->Texture.Unit[0].CurrentTex[TEXTURE_2D_INDEX]; | ||||
|    gammaBindTexture( ctx, GL_TEXTURE_2D, texObj ); | ||||
|  | ||||
| #if 0 | ||||
|    ctx->Texture.CurrentUnit = 1; | ||||
|  | ||||
|    texObj = ctx->Texture.Unit[1].Current1D; | ||||
|    texObj = ctx->Texture.Unit[1].CurrentTex[TEXTURE_1D_INDEX]; | ||||
|    gammaBindTexture( ctx, GL_TEXTURE_1D, texObj ); | ||||
|  | ||||
|    texObj = ctx->Texture.Unit[1].Current2D; | ||||
|    texObj = ctx->Texture.Unit[1].CurrentTex[TEXTURE_2D_INDEX]; | ||||
|    gammaBindTexture( ctx, GL_TEXTURE_2D, texObj ); | ||||
| #endif | ||||
|  | ||||
|   | ||||
| @@ -18,6 +18,7 @@ DRIVER_SOURCES = \ | ||||
| 	intel_regions.c \ | ||||
| 	intel_buffer_objects.c \ | ||||
| 	intel_batchbuffer.c \ | ||||
| 	intel_clear.c \ | ||||
| 	intel_mipmap_tree.c \ | ||||
| 	i915_tex_layout.c \ | ||||
| 	intel_tex_layout.c \ | ||||
| @@ -34,6 +35,7 @@ DRIVER_SOURCES = \ | ||||
| 	intel_pixel_read.c \ | ||||
| 	intel_buffers.c \ | ||||
| 	intel_blit.c \ | ||||
| 	intel_swapbuffers.c \ | ||||
| 	i915_tex.c \ | ||||
| 	i915_texstate.c \ | ||||
| 	i915_context.c \ | ||||
|   | ||||
| @@ -41,6 +41,7 @@ | ||||
| #include "intel_fbo.h" | ||||
| #include "intel_screen.h" | ||||
| #include "intel_batchbuffer.h" | ||||
| #include "intel_buffers.h" | ||||
|  | ||||
| #include "i915_context.h" | ||||
| #include "i915_reg.h" | ||||
| @@ -301,6 +302,74 @@ i915DepthMask(GLcontext * ctx, GLboolean flag) | ||||
|       i915->state.Ctx[I915_CTXREG_LIS6] &= ~S6_DEPTH_WRITE_ENABLE; | ||||
| } | ||||
|  | ||||
|  | ||||
|  | ||||
| /** | ||||
|  * Update the viewport transformation matrix.  Depends on: | ||||
|  *  - viewport pos/size | ||||
|  *  - depthrange | ||||
|  *  - window pos/size or FBO size | ||||
|  */ | ||||
| void | ||||
| intelCalcViewport(GLcontext * ctx) | ||||
| { | ||||
|    struct intel_context *intel = intel_context(ctx); | ||||
|    const GLfloat *v = ctx->Viewport._WindowMap.m; | ||||
|    const GLfloat depthScale = 1.0F / ctx->DrawBuffer->_DepthMaxF; | ||||
|    GLfloat *m = intel->ViewportMatrix.m; | ||||
|    GLfloat yScale, yBias; | ||||
|  | ||||
|    if (ctx->DrawBuffer->Name) { | ||||
|       /* User created FBO */ | ||||
|       struct intel_renderbuffer *irb | ||||
|          = intel_renderbuffer(ctx->DrawBuffer->_ColorDrawBuffers[0]); | ||||
|       if (irb && !irb->RenderToTexture) { | ||||
|          /* y=0=top */ | ||||
|          yScale = -1.0; | ||||
|          yBias = irb->Base.Height; | ||||
|       } | ||||
|       else { | ||||
|          /* y=0=bottom */ | ||||
|          yScale = 1.0; | ||||
|          yBias = 0.0; | ||||
|       } | ||||
|    } | ||||
|    else { | ||||
|       /* window buffer, y=0=top */ | ||||
|       yScale = -1.0; | ||||
|       yBias = (intel->driDrawable) ? intel->driDrawable->h : 0.0F; | ||||
|    } | ||||
|  | ||||
|    m[MAT_SX] = v[MAT_SX]; | ||||
|    m[MAT_TX] = v[MAT_TX]; | ||||
|  | ||||
|    m[MAT_SY] = v[MAT_SY] * yScale; | ||||
|    m[MAT_TY] = v[MAT_TY] * yScale + yBias; | ||||
|  | ||||
|    m[MAT_SZ] = v[MAT_SZ] * depthScale; | ||||
|    m[MAT_TZ] = v[MAT_TZ] * depthScale; | ||||
| } | ||||
|  | ||||
|  | ||||
| /** Called from ctx->Driver.Viewport() */ | ||||
| static void | ||||
| intelViewport(GLcontext * ctx, | ||||
|               GLint x, GLint y, GLsizei width, GLsizei height) | ||||
| { | ||||
|    intelCalcViewport(ctx); | ||||
|  | ||||
|    intel_viewport(ctx, x, y, width, height); | ||||
| } | ||||
|  | ||||
|  | ||||
| /** Called from ctx->Driver.DepthRange() */ | ||||
| static void | ||||
| intelDepthRange(GLcontext * ctx, GLclampd nearval, GLclampd farval) | ||||
| { | ||||
|    intelCalcViewport(ctx); | ||||
| } | ||||
|  | ||||
|  | ||||
| /* ============================================================= | ||||
|  * Polygon stipple | ||||
|  * | ||||
| @@ -964,6 +1033,8 @@ i915InitStateFunctions(struct dd_function_table *functions) | ||||
|    functions->StencilFuncSeparate = i915StencilFuncSeparate; | ||||
|    functions->StencilMaskSeparate = i915StencilMaskSeparate; | ||||
|    functions->StencilOpSeparate = i915StencilOpSeparate; | ||||
|    functions->DepthRange = intelDepthRange; | ||||
|    functions->Viewport = intelViewport; | ||||
| } | ||||
|  | ||||
|  | ||||
|   | ||||
							
								
								
									
										1
									
								
								src/mesa/drivers/dri/i915/intel_clear.c
									
									
									
									
									
										Symbolic link
									
								
							
							
						
						
									
										1
									
								
								src/mesa/drivers/dri/i915/intel_clear.c
									
									
									
									
									
										Symbolic link
									
								
							| @@ -0,0 +1 @@ | ||||
| ../intel/intel_clear.c | ||||
| @@ -35,7 +35,6 @@ | ||||
|  | ||||
| #include "intel_screen.h" | ||||
| #include "intel_context.h" | ||||
| #include "intel_fbo.h" | ||||
| #include "intel_regions.h" | ||||
| #include "swrast/swrast.h" | ||||
|  | ||||
| @@ -216,67 +215,6 @@ intelClearColor(GLcontext * ctx, const GLfloat color[4]) | ||||
| } | ||||
|  | ||||
|  | ||||
| /** | ||||
|  * Update the viewport transformation matrix.  Depends on: | ||||
|  *  - viewport pos/size | ||||
|  *  - depthrange | ||||
|  *  - window pos/size or FBO size | ||||
|  */ | ||||
| static void | ||||
| intelCalcViewport(GLcontext * ctx) | ||||
| { | ||||
|    struct intel_context *intel = intel_context(ctx); | ||||
|    const GLfloat *v = ctx->Viewport._WindowMap.m; | ||||
|    const GLfloat depthScale = 1.0F / ctx->DrawBuffer->_DepthMaxF; | ||||
|    GLfloat *m = intel->ViewportMatrix.m; | ||||
|    GLfloat yScale, yBias; | ||||
|  | ||||
|    if (ctx->DrawBuffer->Name) { | ||||
|       /* User created FBO */ | ||||
|       struct intel_renderbuffer *irb | ||||
|          = intel_renderbuffer(ctx->DrawBuffer->_ColorDrawBuffers[0]); | ||||
|       if (irb && !irb->RenderToTexture) { | ||||
|          /* y=0=top */ | ||||
|          yScale = -1.0; | ||||
|          yBias = irb->Base.Height; | ||||
|       } | ||||
|       else { | ||||
|          /* y=0=bottom */ | ||||
|          yScale = 1.0; | ||||
|          yBias = 0.0; | ||||
|       } | ||||
|    } | ||||
|    else { | ||||
|       /* window buffer, y=0=top */ | ||||
|       yScale = -1.0; | ||||
|       yBias = (intel->driDrawable) ? intel->driDrawable->h : 0.0F; | ||||
|    } | ||||
|  | ||||
|    m[MAT_SX] = v[MAT_SX]; | ||||
|    m[MAT_TX] = v[MAT_TX]; | ||||
|  | ||||
|    m[MAT_SY] = v[MAT_SY] * yScale; | ||||
|    m[MAT_TY] = v[MAT_TY] * yScale + yBias; | ||||
|  | ||||
|    m[MAT_SZ] = v[MAT_SZ] * depthScale; | ||||
|    m[MAT_TZ] = v[MAT_TZ] * depthScale; | ||||
| } | ||||
|  | ||||
| static void | ||||
| intelViewport(GLcontext * ctx, | ||||
|               GLint x, GLint y, GLsizei width, GLsizei height) | ||||
| { | ||||
|    intelCalcViewport(ctx); | ||||
|  | ||||
|    intel_viewport(ctx, x, y, width, height); | ||||
| } | ||||
|  | ||||
| static void | ||||
| intelDepthRange(GLcontext * ctx, GLclampd nearval, GLclampd farval) | ||||
| { | ||||
|    intelCalcViewport(ctx); | ||||
| } | ||||
|  | ||||
| /* Fallback to swrast for select and feedback. | ||||
|  */ | ||||
| static void | ||||
| @@ -291,7 +229,5 @@ void | ||||
| intelInitStateFuncs(struct dd_function_table *functions) | ||||
| { | ||||
|    functions->RenderMode = intelRenderMode; | ||||
|    functions->Viewport = intelViewport; | ||||
|    functions->DepthRange = intelDepthRange; | ||||
|    functions->ClearColor = intelClearColor; | ||||
| } | ||||
|   | ||||
							
								
								
									
										1
									
								
								src/mesa/drivers/dri/i915/intel_swapbuffers.c
									
									
									
									
									
										Symbolic link
									
								
							
							
						
						
									
										1
									
								
								src/mesa/drivers/dri/i915/intel_swapbuffers.c
									
									
									
									
									
										Symbolic link
									
								
							| @@ -0,0 +1 @@ | ||||
| ../intel/intel_swapbuffers.c | ||||
| @@ -989,7 +989,7 @@ intelChooseRenderState(GLcontext * ctx) | ||||
|             intel->draw_tri = intel_fallback_tri; | ||||
|  | ||||
|          if (flags & DD_TRI_SMOOTH) { | ||||
| 	    if (intel->strict_conformance) | ||||
| 	    if (intel->conformance_mode > 0) | ||||
| 	       intel->draw_tri = intel_fallback_tri; | ||||
| 	 } | ||||
|  | ||||
| @@ -1001,7 +1001,7 @@ intelChooseRenderState(GLcontext * ctx) | ||||
| 	 } | ||||
|  | ||||
| 	 if (flags & DD_POINT_SMOOTH) { | ||||
| 	    if (intel->strict_conformance) | ||||
| 	    if (intel->conformance_mode > 0) | ||||
| 	       intel->draw_point = intel_fallback_point; | ||||
| 	 } | ||||
|  | ||||
|   | ||||
| @@ -9,6 +9,7 @@ DRIVER_SOURCES = \ | ||||
| 	intel_blit.c \ | ||||
| 	intel_buffer_objects.c \ | ||||
| 	intel_buffers.c \ | ||||
| 	intel_clear.c \ | ||||
| 	intel_context.c \ | ||||
| 	intel_decode.c \ | ||||
| 	intel_depthstencil.c \ | ||||
| @@ -22,6 +23,7 @@ DRIVER_SOURCES = \ | ||||
| 	intel_pixel_copy.c \ | ||||
| 	intel_pixel_draw.c \ | ||||
| 	intel_state.c \ | ||||
| 	intel_swapbuffers.c \ | ||||
| 	intel_tex.c \ | ||||
| 	intel_tex_copy.c \ | ||||
| 	intel_tex_format.c \ | ||||
| @@ -49,7 +51,6 @@ DRIVER_SOURCES = \ | ||||
| 	brw_gs.c \ | ||||
| 	brw_gs_emit.c \ | ||||
| 	brw_gs_state.c \ | ||||
| 	brw_metaops.c \ | ||||
| 	brw_misc_state.c \ | ||||
| 	brw_program.c \ | ||||
| 	brw_queryobj.c \ | ||||
|   | ||||
| @@ -83,59 +83,60 @@ struct brw_cc_unit_key { | ||||
| static void | ||||
| cc_unit_populate_key(struct brw_context *brw, struct brw_cc_unit_key *key) | ||||
| { | ||||
|    struct gl_stencil_attrib *stencil = brw->attribs.Stencil; | ||||
|    GLcontext *ctx = &brw->intel.ctx; | ||||
|    const unsigned back = ctx->Stencil._BackFace; | ||||
|  | ||||
|    memset(key, 0, sizeof(*key)); | ||||
|  | ||||
|    key->stencil = stencil->Enabled; | ||||
|    key->stencil_two_side = stencil->_TestTwoSide; | ||||
|    key->stencil = ctx->Stencil.Enabled; | ||||
|    key->stencil_two_side = ctx->Stencil._TestTwoSide; | ||||
|  | ||||
|    if (key->stencil) { | ||||
|       key->stencil_func[0] = stencil->Function[0]; | ||||
|       key->stencil_fail_op[0] = stencil->FailFunc[0]; | ||||
|       key->stencil_pass_depth_fail_op[0] = stencil->ZFailFunc[0]; | ||||
|       key->stencil_pass_depth_pass_op[0] = stencil->ZPassFunc[0]; | ||||
|       key->stencil_ref[0] = stencil->Ref[0]; | ||||
|       key->stencil_write_mask[0] = stencil->WriteMask[0]; | ||||
|       key->stencil_test_mask[0] = stencil->ValueMask[0]; | ||||
|       key->stencil_func[0] = ctx->Stencil.Function[0]; | ||||
|       key->stencil_fail_op[0] = ctx->Stencil.FailFunc[0]; | ||||
|       key->stencil_pass_depth_fail_op[0] = ctx->Stencil.ZFailFunc[0]; | ||||
|       key->stencil_pass_depth_pass_op[0] = ctx->Stencil.ZPassFunc[0]; | ||||
|       key->stencil_ref[0] = ctx->Stencil.Ref[0]; | ||||
|       key->stencil_write_mask[0] = ctx->Stencil.WriteMask[0]; | ||||
|       key->stencil_test_mask[0] = ctx->Stencil.ValueMask[0]; | ||||
|    } | ||||
|    if (key->stencil_two_side) { | ||||
|       key->stencil_func[1] = stencil->Function[1]; | ||||
|       key->stencil_fail_op[1] = stencil->FailFunc[1]; | ||||
|       key->stencil_pass_depth_fail_op[1] = stencil->ZFailFunc[1]; | ||||
|       key->stencil_pass_depth_pass_op[1] = stencil->ZPassFunc[1]; | ||||
|       key->stencil_ref[1] = stencil->Ref[1]; | ||||
|       key->stencil_write_mask[1] = stencil->WriteMask[1]; | ||||
|       key->stencil_test_mask[1] = stencil->ValueMask[1]; | ||||
|       key->stencil_func[1] = ctx->Stencil.Function[back]; | ||||
|       key->stencil_fail_op[1] = ctx->Stencil.FailFunc[back]; | ||||
|       key->stencil_pass_depth_fail_op[1] = ctx->Stencil.ZFailFunc[back]; | ||||
|       key->stencil_pass_depth_pass_op[1] = ctx->Stencil.ZPassFunc[back]; | ||||
|       key->stencil_ref[1] = ctx->Stencil.Ref[back]; | ||||
|       key->stencil_write_mask[1] = ctx->Stencil.WriteMask[back]; | ||||
|       key->stencil_test_mask[1] = ctx->Stencil.ValueMask[back]; | ||||
|    } | ||||
|  | ||||
|    if (brw->attribs.Color->_LogicOpEnabled) | ||||
|       key->logic_op = brw->attribs.Color->LogicOp; | ||||
|    if (ctx->Color._LogicOpEnabled) | ||||
|       key->logic_op = ctx->Color.LogicOp; | ||||
|    else | ||||
|       key->logic_op = GL_COPY; | ||||
|  | ||||
|    key->color_blend = brw->attribs.Color->BlendEnabled; | ||||
|    key->color_blend = ctx->Color.BlendEnabled; | ||||
|    if (key->color_blend) { | ||||
|       key->blend_eq_rgb = brw->attribs.Color->BlendEquationRGB; | ||||
|       key->blend_eq_a = brw->attribs.Color->BlendEquationA; | ||||
|       key->blend_src_rgb = brw->attribs.Color->BlendSrcRGB; | ||||
|       key->blend_dst_rgb = brw->attribs.Color->BlendDstRGB; | ||||
|       key->blend_src_a = brw->attribs.Color->BlendSrcA; | ||||
|       key->blend_dst_a = brw->attribs.Color->BlendDstA; | ||||
|       key->blend_eq_rgb = ctx->Color.BlendEquationRGB; | ||||
|       key->blend_eq_a = ctx->Color.BlendEquationA; | ||||
|       key->blend_src_rgb = ctx->Color.BlendSrcRGB; | ||||
|       key->blend_dst_rgb = ctx->Color.BlendDstRGB; | ||||
|       key->blend_src_a = ctx->Color.BlendSrcA; | ||||
|       key->blend_dst_a = ctx->Color.BlendDstA; | ||||
|    } | ||||
|  | ||||
|    key->alpha_enabled = brw->attribs.Color->AlphaEnabled; | ||||
|    key->alpha_enabled = ctx->Color.AlphaEnabled; | ||||
|    if (key->alpha_enabled) { | ||||
|       key->alpha_func = brw->attribs.Color->AlphaFunc; | ||||
|       key->alpha_ref = brw->attribs.Color->AlphaRef; | ||||
|       key->alpha_func = ctx->Color.AlphaFunc; | ||||
|       key->alpha_ref = ctx->Color.AlphaRef; | ||||
|    } | ||||
|  | ||||
|    key->dither = brw->attribs.Color->DitherFlag; | ||||
|    key->dither = ctx->Color.DitherFlag; | ||||
|  | ||||
|    key->depth_test = brw->attribs.Depth->Test; | ||||
|    key->depth_test = ctx->Depth.Test; | ||||
|    if (key->depth_test) { | ||||
|       key->depth_func = brw->attribs.Depth->Func; | ||||
|       key->depth_write = brw->attribs.Depth->Mask; | ||||
|       key->depth_func = ctx->Depth.Func; | ||||
|       key->depth_write = ctx->Depth.Mask; | ||||
|    } | ||||
| } | ||||
|  | ||||
|   | ||||
| @@ -145,14 +145,14 @@ static void upload_clip_prog(struct brw_context *brw) | ||||
|    /* CACHE_NEW_VS_PROG */ | ||||
|    key.attrs = brw->vs.prog_data->outputs_written; | ||||
|    /* _NEW_LIGHT */ | ||||
|    key.do_flat_shading = (brw->attribs.Light->ShadeModel == GL_FLAT); | ||||
|    key.do_flat_shading = (ctx->Light.ShadeModel == GL_FLAT); | ||||
|    /* _NEW_TRANSFORM */ | ||||
|    key.nr_userclip = brw_count_bits(brw->attribs.Transform->ClipPlanesEnabled); | ||||
|    key.nr_userclip = brw_count_bits(ctx->Transform.ClipPlanesEnabled); | ||||
|    key.clip_mode = BRW_CLIPMODE_NORMAL; | ||||
|  | ||||
|    /* _NEW_POLYGON */ | ||||
|    if (key.primitive == GL_TRIANGLES) { | ||||
|       if (brw->attribs.Polygon->CullFaceMode == GL_FRONT_AND_BACK)  | ||||
|       if (ctx->Polygon.CullFaceMode == GL_FRONT_AND_BACK)  | ||||
| 	 key.clip_mode = BRW_CLIPMODE_REJECT_ALL; | ||||
|       else { | ||||
| 	 GLuint fill_front = CLIP_CULL; | ||||
| @@ -160,44 +160,44 @@ static void upload_clip_prog(struct brw_context *brw) | ||||
| 	 GLuint offset_front = 0; | ||||
| 	 GLuint offset_back = 0; | ||||
|  | ||||
| 	 if (!brw->attribs.Polygon->CullFlag || | ||||
| 	     brw->attribs.Polygon->CullFaceMode != GL_FRONT) { | ||||
| 	    switch (brw->attribs.Polygon->FrontMode) { | ||||
| 	 if (!ctx->Polygon.CullFlag || | ||||
| 	     ctx->Polygon.CullFaceMode != GL_FRONT) { | ||||
| 	    switch (ctx->Polygon.FrontMode) { | ||||
| 	    case GL_FILL:  | ||||
| 	       fill_front = CLIP_FILL;  | ||||
| 	       offset_front = 0; | ||||
| 	       break; | ||||
| 	    case GL_LINE: | ||||
| 	       fill_front = CLIP_LINE; | ||||
| 	       offset_front = brw->attribs.Polygon->OffsetLine; | ||||
| 	       offset_front = ctx->Polygon.OffsetLine; | ||||
| 	       break; | ||||
| 	    case GL_POINT: | ||||
| 	       fill_front = CLIP_POINT; | ||||
| 	       offset_front = brw->attribs.Polygon->OffsetPoint; | ||||
| 	       offset_front = ctx->Polygon.OffsetPoint; | ||||
| 	       break; | ||||
| 	    } | ||||
| 	 } | ||||
|  | ||||
| 	 if (!brw->attribs.Polygon->CullFlag || | ||||
| 	     brw->attribs.Polygon->CullFaceMode != GL_BACK) { | ||||
| 	    switch (brw->attribs.Polygon->BackMode) { | ||||
| 	 if (!ctx->Polygon.CullFlag || | ||||
| 	     ctx->Polygon.CullFaceMode != GL_BACK) { | ||||
| 	    switch (ctx->Polygon.BackMode) { | ||||
| 	    case GL_FILL:  | ||||
| 	       fill_back = CLIP_FILL;  | ||||
| 	       offset_back = 0; | ||||
| 	       break; | ||||
| 	    case GL_LINE: | ||||
| 	       fill_back = CLIP_LINE; | ||||
| 	       offset_back = brw->attribs.Polygon->OffsetLine; | ||||
| 	       offset_back = ctx->Polygon.OffsetLine; | ||||
| 	       break; | ||||
| 	    case GL_POINT: | ||||
| 	       fill_back = CLIP_POINT; | ||||
| 	       offset_back = brw->attribs.Polygon->OffsetPoint; | ||||
| 	       offset_back = ctx->Polygon.OffsetPoint; | ||||
| 	       break; | ||||
| 	    } | ||||
| 	 } | ||||
|  | ||||
| 	 if (brw->attribs.Polygon->BackMode != GL_FILL || | ||||
| 	     brw->attribs.Polygon->FrontMode != GL_FILL) { | ||||
| 	 if (ctx->Polygon.BackMode != GL_FILL || | ||||
| 	     ctx->Polygon.FrontMode != GL_FILL) { | ||||
| 	    key.do_unfilled = 1; | ||||
|  | ||||
| 	    /* Most cases the fixed function units will handle.  Cases where | ||||
| @@ -207,17 +207,17 @@ static void upload_clip_prog(struct brw_context *brw) | ||||
|  | ||||
| 	    if (offset_back || offset_front) { | ||||
| 	       /* _NEW_POLYGON, _NEW_BUFFERS */ | ||||
| 	       key.offset_units = brw->attribs.Polygon->OffsetUnits * brw->intel.polygon_offset_scale; | ||||
| 	       key.offset_factor = brw->attribs.Polygon->OffsetFactor * ctx->DrawBuffer->_MRD; | ||||
| 	       key.offset_units = ctx->Polygon.OffsetUnits * brw->intel.polygon_offset_scale; | ||||
| 	       key.offset_factor = ctx->Polygon.OffsetFactor * ctx->DrawBuffer->_MRD; | ||||
| 	    } | ||||
|  | ||||
| 	    switch (brw->attribs.Polygon->FrontFace) { | ||||
| 	    switch (ctx->Polygon.FrontFace) { | ||||
| 	    case GL_CCW: | ||||
| 	       key.fill_ccw = fill_front; | ||||
| 	       key.fill_cw = fill_back; | ||||
| 	       key.offset_ccw = offset_front; | ||||
| 	       key.offset_cw = offset_back; | ||||
| 	       if (brw->attribs.Light->Model.TwoSide && | ||||
| 	       if (ctx->Light.Model.TwoSide && | ||||
| 		   key.fill_cw != CLIP_CULL)  | ||||
| 		  key.copy_bfc_cw = 1; | ||||
| 	       break; | ||||
| @@ -226,7 +226,7 @@ static void upload_clip_prog(struct brw_context *brw) | ||||
| 	       key.fill_ccw = fill_back; | ||||
| 	       key.offset_cw = offset_front; | ||||
| 	       key.offset_ccw = offset_back; | ||||
| 	       if (brw->attribs.Light->Model.TwoSide && | ||||
| 	       if (ctx->Light.Model.TwoSide && | ||||
| 		   key.fill_ccw != CLIP_CULL)  | ||||
| 		  key.copy_bfc_ccw = 1; | ||||
| 	       break; | ||||
|   | ||||
| @@ -181,34 +181,54 @@ static void clip_and_emit_line( struct brw_clip_compile *c ) | ||||
| 	 brw_DP4(p, vec4(c->reg.dp1), deref_4f(vtx1, c->offset[VERT_RESULT_HPOS]), c->reg.plane_equation); | ||||
| 	 is_negative = brw_IF(p, BRW_EXECUTE_1); | ||||
| 	 { | ||||
| 	    brw_ADD(p, c->reg.t, c->reg.dp1, negate(c->reg.dp0)); | ||||
| 	    brw_math_invert(p, c->reg.t, c->reg.t); | ||||
| 	    brw_MUL(p, c->reg.t, c->reg.t, c->reg.dp1); | ||||
|              /* | ||||
|               * Both can be negative on GM965/G965 due to RHW workaround | ||||
|               * if so, this object should be rejected. | ||||
|               */ | ||||
|              if (!BRW_IS_G4X(p->brw)) { | ||||
|                  brw_CMP(p, vec1(brw_null_reg()), BRW_CONDITIONAL_LE, c->reg.dp0, brw_imm_f(0.0)); | ||||
|                  is_neg2 = brw_IF(p, BRW_EXECUTE_1); | ||||
|                  { | ||||
|                      brw_clip_kill_thread(c); | ||||
|                  } | ||||
|                  brw_ENDIF(p, is_neg2); | ||||
|              } | ||||
|  | ||||
| 	    brw_CMP(p, vec1(brw_null_reg()), BRW_CONDITIONAL_G, c->reg.t, c->reg.t1 ); | ||||
| 	    brw_MOV(p, c->reg.t1, c->reg.t); | ||||
| 	    brw_set_predicate_control(p, BRW_PREDICATE_NONE); | ||||
|              brw_ADD(p, c->reg.t, c->reg.dp1, negate(c->reg.dp0)); | ||||
|              brw_math_invert(p, c->reg.t, c->reg.t); | ||||
|              brw_MUL(p, c->reg.t, c->reg.t, c->reg.dp1); | ||||
|  | ||||
|              brw_CMP(p, vec1(brw_null_reg()), BRW_CONDITIONAL_G, c->reg.t, c->reg.t1 ); | ||||
|              brw_MOV(p, c->reg.t1, c->reg.t); | ||||
|              brw_set_predicate_control(p, BRW_PREDICATE_NONE); | ||||
| 	 }  | ||||
| 	 is_negative = brw_ELSE(p, is_negative); | ||||
| 	 { | ||||
| 	    /* Coming back in.  We know that both cannot be negative | ||||
| 	     * because the line would have been culled in that case. | ||||
| 	     */ | ||||
|              /* Coming back in.  We know that both cannot be negative | ||||
|               * because the line would have been culled in that case. | ||||
|               */ | ||||
|  | ||||
|              /* If both are positive, do nothing */ | ||||
|              /* Only on GM965/G965 */ | ||||
|              if (!BRW_IS_G4X(p->brw)) { | ||||
|                  brw_CMP(p, vec1(brw_null_reg()), BRW_CONDITIONAL_L, c->reg.dp0, brw_imm_f(0.0)); | ||||
|                  is_neg2 = brw_IF(p, BRW_EXECUTE_1); | ||||
|              } | ||||
|  | ||||
| 	    /* If both are positive, do nothing */ | ||||
|              brw_CMP(p, vec1(brw_null_reg()), BRW_CONDITIONAL_L, c->reg.dp0, brw_imm_f(0.0)); | ||||
|              is_neg2 = brw_IF(p, BRW_EXECUTE_1); | ||||
|              { | ||||
| 		brw_ADD(p, c->reg.t, c->reg.dp0, negate(c->reg.dp1)); | ||||
| 		brw_math_invert(p, c->reg.t, c->reg.t); | ||||
| 		brw_MUL(p, c->reg.t, c->reg.t, c->reg.dp0); | ||||
|                  brw_ADD(p, c->reg.t, c->reg.dp0, negate(c->reg.dp1)); | ||||
|                  brw_math_invert(p, c->reg.t, c->reg.t); | ||||
|                  brw_MUL(p, c->reg.t, c->reg.t, c->reg.dp0); | ||||
|  | ||||
| 		brw_CMP(p, vec1(brw_null_reg()), BRW_CONDITIONAL_G, c->reg.t, c->reg.t0 ); | ||||
| 		brw_MOV(p, c->reg.t0, c->reg.t); | ||||
| 		brw_set_predicate_control(p, BRW_PREDICATE_NONE); | ||||
| 	     } | ||||
| 	     brw_ENDIF(p, is_neg2); | ||||
| 	 } | ||||
|                  brw_CMP(p, vec1(brw_null_reg()), BRW_CONDITIONAL_G, c->reg.t, c->reg.t0 ); | ||||
|                  brw_MOV(p, c->reg.t0, c->reg.t); | ||||
|                  brw_set_predicate_control(p, BRW_PREDICATE_NONE); | ||||
|              } | ||||
|  | ||||
|              if (!BRW_IS_G4X(p->brw)) { | ||||
|                  brw_ENDIF(p, is_neg2); | ||||
|              } | ||||
|          } | ||||
| 	 brw_ENDIF(p, is_negative);	  | ||||
|       } | ||||
|       brw_ENDIF(p, plane_active); | ||||
|   | ||||
| @@ -455,6 +455,8 @@ static void brw_clip_test( struct brw_clip_compile *c ) | ||||
|     struct brw_indirect vt2 = brw_indirect(2, 0); | ||||
|  | ||||
|     struct brw_compile *p = &c->func; | ||||
|     struct brw_instruction *is_outside; | ||||
|     struct brw_reg tmp0 = c->reg.loopcount; /* handy temporary */ | ||||
|  | ||||
|     brw_MOV(p, get_addr_reg(vt0), brw_address(c->reg.vertex[0])); | ||||
|     brw_MOV(p, get_addr_reg(vt1), brw_address(c->reg.vertex[1])); | ||||
| @@ -462,53 +464,87 @@ static void brw_clip_test( struct brw_clip_compile *c ) | ||||
|     brw_MOV(p, v0, deref_4f(vt0, c->offset[VERT_RESULT_HPOS])); | ||||
|     brw_MOV(p, v1, deref_4f(vt1, c->offset[VERT_RESULT_HPOS])); | ||||
|     brw_MOV(p, v2, deref_4f(vt2, c->offset[VERT_RESULT_HPOS])); | ||||
|     brw_AND(p, c->reg.planemask, c->reg.planemask, brw_imm_ud(~0x3f)); | ||||
|  | ||||
|     /* test nearz, xmin, ymin plane */ | ||||
|     brw_CMP(p, t1, BRW_CONDITIONAL_LE, negate(v0), get_element(v0, 3));  | ||||
|     /* clip.xyz < -clip.w */ | ||||
|     brw_CMP(p, t1, BRW_CONDITIONAL_L, v0, negate(get_element(v0, 3)));  | ||||
|     brw_set_predicate_control(p, BRW_PREDICATE_NONE); | ||||
|     brw_CMP(p, t2, BRW_CONDITIONAL_LE, negate(v1), get_element(v1, 3));  | ||||
|     brw_CMP(p, t2, BRW_CONDITIONAL_L, v1, negate(get_element(v1, 3)));  | ||||
|     brw_set_predicate_control(p, BRW_PREDICATE_NONE); | ||||
|     brw_CMP(p, t3, BRW_CONDITIONAL_LE, negate(v2), get_element(v2, 3));  | ||||
|     brw_CMP(p, t3, BRW_CONDITIONAL_L, v2, negate(get_element(v2, 3)));  | ||||
|     brw_set_predicate_control(p, BRW_PREDICATE_NONE); | ||||
|  | ||||
|     /* All vertices are outside of a plane, rejected */ | ||||
|     brw_AND(p, t, t1, t2); | ||||
|     brw_AND(p, t, t, t3); | ||||
|     brw_OR(p, tmp0, get_element(t, 0), get_element(t, 1)); | ||||
|     brw_OR(p, tmp0, tmp0, get_element(t, 2)); | ||||
|     brw_set_conditionalmod(p, BRW_CONDITIONAL_NZ); | ||||
|     brw_AND(p, brw_null_reg(), tmp0, brw_imm_ud(0x1)); | ||||
|     is_outside = brw_IF(p, BRW_EXECUTE_1); | ||||
|     { | ||||
|         brw_clip_kill_thread(c); | ||||
|     } | ||||
|     brw_ENDIF(p, is_outside); | ||||
|     brw_set_predicate_control(p, BRW_PREDICATE_NONE); | ||||
|  | ||||
|     /* some vertices are inside a plane, some are outside,need to clip */ | ||||
|     brw_XOR(p, t, t1, t2); | ||||
|     brw_XOR(p, t1, t2, t3); | ||||
|     brw_OR(p, t, t, t1); | ||||
|  | ||||
|     brw_CMP(p, brw_null_reg(), BRW_CONDITIONAL_NZ,  | ||||
| 	    get_element(t, 0), brw_imm_ud(0)); | ||||
|     brw_AND(p, t, t, brw_imm_ud(0x1)); | ||||
|     brw_CMP(p, brw_null_reg(), BRW_CONDITIONAL_NZ, | ||||
|             get_element(t, 0), brw_imm_ud(0)); | ||||
|     brw_OR(p, c->reg.planemask, c->reg.planemask, brw_imm_ud((1<<5))); | ||||
|     brw_set_predicate_control(p, BRW_PREDICATE_NONE); | ||||
|     brw_CMP(p, brw_null_reg(), BRW_CONDITIONAL_NZ,  | ||||
| 	    get_element(t, 1), brw_imm_ud(0)); | ||||
|     brw_CMP(p, brw_null_reg(), BRW_CONDITIONAL_NZ, | ||||
|             get_element(t, 1), brw_imm_ud(0)); | ||||
|     brw_OR(p, c->reg.planemask, c->reg.planemask, brw_imm_ud((1<<3))); | ||||
|     brw_set_predicate_control(p, BRW_PREDICATE_NONE); | ||||
|     brw_CMP(p, brw_null_reg(), BRW_CONDITIONAL_NZ,  | ||||
| 	    get_element(t, 2), brw_imm_ud(0)); | ||||
|     brw_CMP(p, brw_null_reg(), BRW_CONDITIONAL_NZ, | ||||
|             get_element(t, 2), brw_imm_ud(0)); | ||||
|     brw_OR(p, c->reg.planemask, c->reg.planemask, brw_imm_ud((1<<1))); | ||||
|     brw_set_predicate_control(p, BRW_PREDICATE_NONE); | ||||
|  | ||||
|     /* test farz, xmax, ymax plane */ | ||||
|     brw_CMP(p, t1, BRW_CONDITIONAL_L, v0, get_element(v0, 3));  | ||||
|     /* clip.xyz > clip.w */ | ||||
|     brw_CMP(p, t1, BRW_CONDITIONAL_G, v0, get_element(v0, 3));  | ||||
|     brw_set_predicate_control(p, BRW_PREDICATE_NONE); | ||||
|     brw_CMP(p, t2, BRW_CONDITIONAL_L, v1, get_element(v1, 3));  | ||||
|     brw_CMP(p, t2, BRW_CONDITIONAL_G, v1, get_element(v1, 3));  | ||||
|     brw_set_predicate_control(p, BRW_PREDICATE_NONE); | ||||
|     brw_CMP(p, t3, BRW_CONDITIONAL_L, v2, get_element(v2, 3));  | ||||
|     brw_CMP(p, t3, BRW_CONDITIONAL_G, v2, get_element(v2, 3));  | ||||
|     brw_set_predicate_control(p, BRW_PREDICATE_NONE); | ||||
|  | ||||
|     /* All vertices are outside of a plane, rejected */ | ||||
|     brw_AND(p, t, t1, t2); | ||||
|     brw_AND(p, t, t, t3); | ||||
|     brw_OR(p, tmp0, get_element(t, 0), get_element(t, 1)); | ||||
|     brw_OR(p, tmp0, tmp0, get_element(t, 2)); | ||||
|     brw_set_conditionalmod(p, BRW_CONDITIONAL_NZ); | ||||
|     brw_AND(p, brw_null_reg(), tmp0, brw_imm_ud(0x1)); | ||||
|     is_outside = brw_IF(p, BRW_EXECUTE_1); | ||||
|     { | ||||
|         brw_clip_kill_thread(c); | ||||
|     } | ||||
|     brw_ENDIF(p, is_outside); | ||||
|     brw_set_predicate_control(p, BRW_PREDICATE_NONE); | ||||
|  | ||||
|     /* some vertices are inside a plane, some are outside,need to clip */ | ||||
|     brw_XOR(p, t, t1, t2); | ||||
|     brw_XOR(p, t1, t2, t3); | ||||
|     brw_OR(p, t, t, t1); | ||||
|  | ||||
|     brw_CMP(p, brw_null_reg(), BRW_CONDITIONAL_NZ,  | ||||
| 	    get_element(t, 0), brw_imm_ud(0)); | ||||
|     brw_AND(p, t, t, brw_imm_ud(0x1)); | ||||
|     brw_CMP(p, brw_null_reg(), BRW_CONDITIONAL_NZ, | ||||
|             get_element(t, 0), brw_imm_ud(0)); | ||||
|     brw_OR(p, c->reg.planemask, c->reg.planemask, brw_imm_ud((1<<4))); | ||||
|     brw_set_predicate_control(p, BRW_PREDICATE_NONE); | ||||
|     brw_CMP(p, brw_null_reg(), BRW_CONDITIONAL_NZ,  | ||||
| 	    get_element(t, 1), brw_imm_ud(0)); | ||||
|     brw_CMP(p, brw_null_reg(), BRW_CONDITIONAL_NZ, | ||||
|             get_element(t, 1), brw_imm_ud(0)); | ||||
|     brw_OR(p, c->reg.planemask, c->reg.planemask, brw_imm_ud((1<<2))); | ||||
|     brw_set_predicate_control(p, BRW_PREDICATE_NONE); | ||||
|     brw_CMP(p, brw_null_reg(), BRW_CONDITIONAL_NZ,  | ||||
| 	    get_element(t, 2), brw_imm_ud(0)); | ||||
|     brw_CMP(p, brw_null_reg(), BRW_CONDITIONAL_NZ, | ||||
|             get_element(t, 2), brw_imm_ud(0)); | ||||
|     brw_OR(p, c->reg.planemask, c->reg.planemask, brw_imm_ud((1<<0))); | ||||
|     brw_set_predicate_control(p, BRW_PREDICATE_NONE); | ||||
|  | ||||
|   | ||||
| @@ -76,30 +76,6 @@ static void brwInitDriverFunctions( struct dd_function_table *functions ) | ||||
|    functions->Viewport = intel_viewport; | ||||
| } | ||||
|  | ||||
|  | ||||
| static void brw_init_attribs( struct brw_context *brw ) | ||||
| { | ||||
|    GLcontext *ctx = &brw->intel.ctx; | ||||
|  | ||||
|    brw->attribs.Color = &ctx->Color; | ||||
|    brw->attribs.Depth = &ctx->Depth; | ||||
|    brw->attribs.Fog = &ctx->Fog; | ||||
|    brw->attribs.Hint = &ctx->Hint; | ||||
|    brw->attribs.Light = &ctx->Light; | ||||
|    brw->attribs.Line = &ctx->Line; | ||||
|    brw->attribs.Point = &ctx->Point; | ||||
|    brw->attribs.Polygon = &ctx->Polygon; | ||||
|    brw->attribs.Scissor = &ctx->Scissor; | ||||
|    brw->attribs.Stencil = &ctx->Stencil; | ||||
|    brw->attribs.Texture = &ctx->Texture; | ||||
|    brw->attribs.Transform = &ctx->Transform; | ||||
|    brw->attribs.Viewport = &ctx->Viewport; | ||||
|    brw->attribs.VertexProgram = &ctx->VertexProgram; | ||||
|    brw->attribs.FragmentProgram = &ctx->FragmentProgram; | ||||
|    brw->attribs.PolygonStipple = &ctx->PolygonStipple[0]; | ||||
| } | ||||
|  | ||||
|  | ||||
| GLboolean brwCreateContext( const __GLcontextModes *mesaVis, | ||||
| 			    __DRIcontextPrivate *driContextPriv, | ||||
| 			    void *sharedContextPrivate) | ||||
| @@ -146,10 +122,11 @@ GLboolean brwCreateContext( const __GLcontextModes *mesaVis, | ||||
|    /* if conformance mode is set, swrast can handle any size AA point */ | ||||
|    ctx->Const.MaxPointSizeAA = 255.0; | ||||
|  | ||||
|    /* We want the GLSL compiler to emit code that uses condition codes */ | ||||
|    ctx->Shader.EmitCondCodes = GL_TRUE; | ||||
|  | ||||
| /*    ctx->Const.MaxNativeVertexProgramTemps = 32; */ | ||||
|  | ||||
|    brw_init_attribs( brw ); | ||||
|    brw_init_metaops( brw ); | ||||
|    brw_init_state( brw ); | ||||
|  | ||||
|    brw->state.dirty.mesa = ~0; | ||||
|   | ||||
| @@ -131,7 +131,6 @@ struct brw_context; | ||||
| #define BRW_NEW_WM_INPUT_DIMENSIONS     0x100 | ||||
| #define BRW_NEW_INPUT_VARYING           0x200 | ||||
| #define BRW_NEW_PSP                     0x800 | ||||
| #define BRW_NEW_METAOPS                 0x1000 | ||||
| #define BRW_NEW_FENCE                   0x2000 | ||||
| #define BRW_NEW_INDICES			0x4000 | ||||
| #define BRW_NEW_VERTICES		0x8000 | ||||
| @@ -303,26 +302,6 @@ struct brw_cache { | ||||
| }; | ||||
|  | ||||
|  | ||||
|  | ||||
| struct brw_state_pointers { | ||||
|    struct gl_colorbuffer_attrib	*Color; | ||||
|    struct gl_depthbuffer_attrib	*Depth; | ||||
|    struct gl_fog_attrib		*Fog; | ||||
|    struct gl_hint_attrib	*Hint; | ||||
|    struct gl_light_attrib	*Light; | ||||
|    struct gl_line_attrib	*Line; | ||||
|    struct gl_point_attrib	*Point; | ||||
|    struct gl_polygon_attrib	*Polygon; | ||||
|    GLuint                       *PolygonStipple; | ||||
|    struct gl_scissor_attrib	*Scissor; | ||||
|    struct gl_stencil_attrib	*Stencil; | ||||
|    struct gl_texture_attrib	*Texture; | ||||
|    struct gl_transform_attrib	*Transform; | ||||
|    struct gl_viewport_attrib	*Viewport; | ||||
|    struct gl_vertex_program_state *VertexProgram;  | ||||
|    struct gl_fragment_program_state *FragmentProgram; | ||||
| }; | ||||
|  | ||||
| /* Considered adding a member to this struct to document which flags | ||||
|  * an update might raise so that ordering of the state atoms can be | ||||
|  * checked or derived at runtime.  Dropped the idea in favor of having | ||||
| @@ -457,7 +436,6 @@ struct brw_context | ||||
|       int validated_bo_count; | ||||
|    } state; | ||||
|  | ||||
|    struct brw_state_pointers attribs; | ||||
|    struct brw_cache cache; | ||||
|    struct brw_cached_batch_item *cached_batch_items; | ||||
|  | ||||
| @@ -491,28 +469,6 @@ struct brw_context | ||||
|       unsigned int offset; | ||||
|    } ib; | ||||
|  | ||||
|    struct { | ||||
|       /* Will be allocated on demand if needed.    | ||||
|        */ | ||||
|       struct brw_state_pointers attribs; | ||||
|       struct gl_vertex_program *vp; | ||||
|       struct gl_fragment_program *fp, *fp_tex; | ||||
|  | ||||
|       struct gl_buffer_object *vbo; | ||||
|  | ||||
|       struct intel_region *saved_draw_region; | ||||
|       GLuint saved_nr_draw_regions; | ||||
|       struct intel_region *saved_depth_region; | ||||
|  | ||||
|       GLuint restore_draw_buffers[MAX_DRAW_BUFFERS]; | ||||
|       GLuint restore_num_draw_buffers; | ||||
|  | ||||
|       struct gl_fragment_program *restore_fp; | ||||
|        | ||||
|       GLboolean active; | ||||
|    } metaops; | ||||
|  | ||||
|  | ||||
|    /* Active vertex program:  | ||||
|     */ | ||||
|    const struct gl_vertex_program *vertex_program; | ||||
| @@ -703,13 +659,6 @@ void brw_FrameBufferTexInit( struct brw_context *brw, | ||||
| void brw_FrameBufferTexDestroy( struct brw_context *brw ); | ||||
| void brw_validate_textures( struct brw_context *brw ); | ||||
|  | ||||
| /*====================================================================== | ||||
|  * brw_metaops.c | ||||
|  */ | ||||
|  | ||||
| void brw_init_metaops( struct brw_context *brw ); | ||||
| void brw_destroy_metaops( struct brw_context *brw ); | ||||
|  | ||||
|  | ||||
| /*====================================================================== | ||||
|  * brw_program.c | ||||
|   | ||||
| @@ -48,6 +48,7 @@ | ||||
|  */ | ||||
| static void calculate_curbe_offsets( struct brw_context *brw ) | ||||
| { | ||||
|    GLcontext *ctx = &brw->intel.ctx; | ||||
|    /* CACHE_NEW_WM_PROG */ | ||||
|    GLuint nr_fp_regs = (brw->wm.prog_data->nr_params + 15) / 16; | ||||
|     | ||||
| @@ -58,8 +59,8 @@ static void calculate_curbe_offsets( struct brw_context *brw ) | ||||
|    GLuint total_regs; | ||||
|  | ||||
|    /* _NEW_TRANSFORM */ | ||||
|    if (brw->attribs.Transform->ClipPlanesEnabled) { | ||||
|       GLuint nr_planes = 6 + brw_count_bits(brw->attribs.Transform->ClipPlanesEnabled); | ||||
|    if (ctx->Transform.ClipPlanesEnabled) { | ||||
|       GLuint nr_planes = 6 + brw_count_bits(ctx->Transform.ClipPlanesEnabled); | ||||
|       nr_clip_regs = (nr_planes * 4 + 15) / 16; | ||||
|    } | ||||
|  | ||||
| @@ -233,11 +234,11 @@ static void prepare_constant_buffer(struct brw_context *brw) | ||||
|        */ | ||||
|       assert(MAX_CLIP_PLANES == 6); | ||||
|       for (j = 0; j < MAX_CLIP_PLANES; j++) { | ||||
| 	 if (brw->attribs.Transform->ClipPlanesEnabled & (1<<j)) { | ||||
| 	    buf[offset + i * 4 + 0] = brw->attribs.Transform->_ClipUserPlane[j][0]; | ||||
| 	    buf[offset + i * 4 + 1] = brw->attribs.Transform->_ClipUserPlane[j][1]; | ||||
| 	    buf[offset + i * 4 + 2] = brw->attribs.Transform->_ClipUserPlane[j][2]; | ||||
| 	    buf[offset + i * 4 + 3] = brw->attribs.Transform->_ClipUserPlane[j][3]; | ||||
| 	 if (ctx->Transform.ClipPlanesEnabled & (1<<j)) { | ||||
| 	    buf[offset + i * 4 + 0] = ctx->Transform._ClipUserPlane[j][0]; | ||||
| 	    buf[offset + i * 4 + 1] = ctx->Transform._ClipUserPlane[j][1]; | ||||
| 	    buf[offset + i * 4 + 2] = ctx->Transform._ClipUserPlane[j][2]; | ||||
| 	    buf[offset + i * 4 + 3] = ctx->Transform._ClipUserPlane[j][3]; | ||||
| 	    i++; | ||||
| 	 } | ||||
|       } | ||||
|   | ||||
| @@ -84,15 +84,17 @@ static const GLenum reduced_prim[GL_POLYGON+1] = { | ||||
|  */ | ||||
| static GLuint brw_set_prim(struct brw_context *brw, GLenum prim) | ||||
| { | ||||
|    GLcontext *ctx = &brw->intel.ctx; | ||||
|  | ||||
|    if (INTEL_DEBUG & DEBUG_PRIMS) | ||||
|       _mesa_printf("PRIM: %s\n", _mesa_lookup_enum_by_nr(prim)); | ||||
|     | ||||
|    /* Slight optimization to avoid the GS program when not needed: | ||||
|     */ | ||||
|    if (prim == GL_QUAD_STRIP && | ||||
|        brw->attribs.Light->ShadeModel != GL_FLAT && | ||||
|        brw->attribs.Polygon->FrontMode == GL_FILL && | ||||
|        brw->attribs.Polygon->BackMode == GL_FILL) | ||||
|        ctx->Light.ShadeModel != GL_FLAT && | ||||
|        ctx->Polygon.FrontMode == GL_FILL && | ||||
|        ctx->Polygon.BackMode == GL_FILL) | ||||
|       prim = GL_TRIANGLE_STRIP; | ||||
|  | ||||
|    if (prim != brw->primitive) { | ||||
| @@ -166,14 +168,11 @@ static void brw_merge_inputs( struct brw_context *brw, | ||||
|    for (i = 0; i < VERT_ATTRIB_MAX; i++) { | ||||
|       brw->vb.inputs[i].glarray = arrays[i]; | ||||
|  | ||||
|       /* XXX: metaops passes null arrays */ | ||||
|       if (arrays[i]) { | ||||
| 	 if (arrays[i]->StrideB != 0) | ||||
| 	    brw->vb.info.varying |= 1 << i; | ||||
|       if (arrays[i]->StrideB != 0) | ||||
| 	 brw->vb.info.varying |= 1 << i; | ||||
|  | ||||
| 	 brw->vb.info.sizes[i/16] |= (brw->vb.inputs[i].glarray->Size - 1) << | ||||
| 	    ((i%16) * 2); | ||||
|       } | ||||
|    } | ||||
|  | ||||
|    /* Raise statechanges if input sizes and varying have changed:  | ||||
| @@ -192,12 +191,20 @@ static GLboolean check_fallbacks( struct brw_context *brw, | ||||
| 				  const struct _mesa_prim *prim, | ||||
| 				  GLuint nr_prims ) | ||||
| { | ||||
|    GLcontext *ctx = &brw->intel.ctx; | ||||
|    GLuint i; | ||||
|  | ||||
|    if (!brw->intel.strict_conformance) | ||||
|    /* If we don't require strict OpenGL conformance, never  | ||||
|     * use fallbacks.  If we're forcing fallbacks, always | ||||
|     * use fallfacks. | ||||
|     */ | ||||
|    if (brw->intel.conformance_mode == 0) | ||||
|       return GL_FALSE; | ||||
|  | ||||
|    if (brw->attribs.Polygon->SmoothFlag) { | ||||
|    if (brw->intel.conformance_mode == 2) | ||||
|       return GL_TRUE; | ||||
|  | ||||
|    if (ctx->Polygon.SmoothFlag) { | ||||
|       for (i = 0; i < nr_prims; i++) | ||||
| 	 if (reduced_prim[prim[i].mode] == GL_TRIANGLES)  | ||||
| 	    return GL_TRUE; | ||||
| @@ -206,7 +213,7 @@ static GLboolean check_fallbacks( struct brw_context *brw, | ||||
|    /* BRW hardware will do AA lines, but they are non-conformant it | ||||
|     * seems.  TBD whether we keep this fallback: | ||||
|     */ | ||||
|    if (brw->attribs.Line->SmoothFlag) { | ||||
|    if (ctx->Line.SmoothFlag) { | ||||
|       for (i = 0; i < nr_prims; i++) | ||||
| 	 if (reduced_prim[prim[i].mode] == GL_LINES)  | ||||
| 	    return GL_TRUE; | ||||
| @@ -215,28 +222,61 @@ static GLboolean check_fallbacks( struct brw_context *brw, | ||||
|    /* Stipple -- these fallbacks could be resolved with a little | ||||
|     * bit of work? | ||||
|     */ | ||||
|    if (brw->attribs.Line->StippleFlag) { | ||||
|    if (ctx->Line.StippleFlag) { | ||||
|       for (i = 0; i < nr_prims; i++) { | ||||
| 	 /* GS doesn't get enough information to know when to reset | ||||
| 	  * the stipple counter?!? | ||||
| 	  */ | ||||
| 	 if (prim[i].mode == GL_LINE_LOOP)  | ||||
| 	 if (prim[i].mode == GL_LINE_LOOP || prim[i].mode == GL_LINE_STRIP)  | ||||
| 	    return GL_TRUE; | ||||
| 	     | ||||
| 	 if (prim[i].mode == GL_POLYGON && | ||||
| 	     (brw->attribs.Polygon->FrontMode == GL_LINE || | ||||
| 	      brw->attribs.Polygon->BackMode == GL_LINE)) | ||||
| 	     (ctx->Polygon.FrontMode == GL_LINE || | ||||
| 	      ctx->Polygon.BackMode == GL_LINE)) | ||||
| 	    return GL_TRUE; | ||||
|       } | ||||
|    } | ||||
|  | ||||
|  | ||||
|    if (brw->attribs.Point->SmoothFlag) { | ||||
|    if (ctx->Point.SmoothFlag) { | ||||
|       for (i = 0; i < nr_prims; i++) | ||||
| 	 if (prim[i].mode == GL_POINTS)  | ||||
| 	    return GL_TRUE; | ||||
|    } | ||||
|  | ||||
|    /* BRW hardware doesn't handle GL_CLAMP texturing correctly; | ||||
|     * brw_wm_sampler_state:translate_wrap_mode() treats GL_CLAMP | ||||
|     * as GL_CLAMP_TO_EDGE instead.  If we're using GL_CLAMP, and | ||||
|     * we want strict conformance, force the fallback. | ||||
|     * Right now, we only do this for 2D textures. | ||||
|     */ | ||||
|    { | ||||
|       int u; | ||||
|       for (u = 0; u < ctx->Const.MaxTextureCoordUnits; u++) { | ||||
|          struct gl_texture_unit *texUnit = &ctx->Texture.Unit[u]; | ||||
|          if (texUnit->Enabled) { | ||||
|             if (texUnit->Enabled & TEXTURE_1D_BIT) { | ||||
|                if (texUnit->CurrentTex[TEXTURE_1D_INDEX]->WrapS == GL_CLAMP) { | ||||
|                    return GL_TRUE; | ||||
|                } | ||||
|             } | ||||
|             if (texUnit->Enabled & TEXTURE_2D_BIT) { | ||||
|                if (texUnit->CurrentTex[TEXTURE_2D_INDEX]->WrapS == GL_CLAMP || | ||||
|                    texUnit->CurrentTex[TEXTURE_2D_INDEX]->WrapT == GL_CLAMP) { | ||||
|                    return GL_TRUE; | ||||
|                } | ||||
|             } | ||||
|             if (texUnit->Enabled & TEXTURE_3D_BIT) { | ||||
|                if (texUnit->CurrentTex[TEXTURE_3D_INDEX]->WrapS == GL_CLAMP || | ||||
|                    texUnit->CurrentTex[TEXTURE_3D_INDEX]->WrapT == GL_CLAMP || | ||||
|                    texUnit->CurrentTex[TEXTURE_3D_INDEX]->WrapR == GL_CLAMP) { | ||||
|                    return GL_TRUE; | ||||
|                } | ||||
|             } | ||||
|          } | ||||
|       } | ||||
|    } | ||||
|        | ||||
|    /* Nothing stopping us from the fast path now */ | ||||
|    return GL_FALSE; | ||||
| } | ||||
|  | ||||
| @@ -261,11 +301,18 @@ static GLboolean brw_try_draw_prims( GLcontext *ctx, | ||||
|    if (ctx->NewState) | ||||
|       _mesa_update_state( ctx ); | ||||
|  | ||||
|    /* We have to validate the textures *before* checking for fallbacks; | ||||
|     * otherwise, the software fallback won't be able to rely on the | ||||
|     * texture state, the firstLevel and lastLevel fields won't be | ||||
|     * set in the intel texture object (they'll both be 0), and the  | ||||
|     * software fallback will segfault if it attempts to access any | ||||
|     * texture level other than level 0. | ||||
|     */ | ||||
|    brw_validate_textures( brw ); | ||||
|  | ||||
|    if (check_fallbacks(brw, prim, nr_prims)) | ||||
|       return GL_FALSE; | ||||
|  | ||||
|    brw_validate_textures( brw ); | ||||
|  | ||||
|    /* Bind all inputs, derive varying and size information: | ||||
|     */ | ||||
|    brw_merge_inputs( brw, arrays ); | ||||
|   | ||||
| @@ -129,3 +129,126 @@ const GLuint *brw_get_program( struct brw_compile *p, | ||||
|    return (const GLuint *)p->store; | ||||
| } | ||||
|  | ||||
|  | ||||
|  | ||||
| /** | ||||
|  * Subroutine calls require special attention. | ||||
|  * Mesa instructions may be expanded into multiple hardware instructions | ||||
|  * so the prog_instruction::BranchTarget field can't be used as an index | ||||
|  * into the hardware instructions. | ||||
|  * | ||||
|  * The BranchTarget field isn't needed, however.  Mesa's GLSL compiler | ||||
|  * emits CAL and BGNSUB instructions with labels that can be used to map | ||||
|  * subroutine calls to actual subroutine code blocks. | ||||
|  * | ||||
|  * The structures and function here implement patching of CAL instructions | ||||
|  * so they jump to the right subroutine code... | ||||
|  */ | ||||
|  | ||||
|  | ||||
| /** | ||||
|  * For each OPCODE_BGNSUB we create one of these. | ||||
|  */ | ||||
| struct brw_glsl_label | ||||
| { | ||||
|    const char *name; /**< the label string */ | ||||
|    GLuint position;  /**< the position of the brw instruction for this label */ | ||||
|    struct brw_glsl_label *next;  /**< next in linked list */ | ||||
| }; | ||||
|  | ||||
|  | ||||
| /** | ||||
|  * For each OPCODE_CAL we create one of these. | ||||
|  */ | ||||
| struct brw_glsl_call | ||||
| { | ||||
|    GLuint call_inst_pos;  /**< location of the CAL instruction */ | ||||
|    const char *sub_name;  /**< name of subroutine to call */ | ||||
|    struct brw_glsl_call *next;  /**< next in linked list */ | ||||
| }; | ||||
|  | ||||
|  | ||||
| /** | ||||
|  * Called for each OPCODE_BGNSUB. | ||||
|  */ | ||||
| void | ||||
| brw_save_label(struct brw_compile *c, const char *name, GLuint position) | ||||
| { | ||||
|    struct brw_glsl_label *label = CALLOC_STRUCT(brw_glsl_label); | ||||
|    label->name = name; | ||||
|    label->position = position; | ||||
|    label->next = c->first_label; | ||||
|    c->first_label = label; | ||||
| } | ||||
|  | ||||
|  | ||||
| /** | ||||
|  * Called for each OPCODE_CAL. | ||||
|  */ | ||||
| void | ||||
| brw_save_call(struct brw_compile *c, const char *name, GLuint call_pos) | ||||
| { | ||||
|    struct brw_glsl_call *call = CALLOC_STRUCT(brw_glsl_call); | ||||
|    call->call_inst_pos = call_pos; | ||||
|    call->sub_name = name; | ||||
|    call->next = c->first_call; | ||||
|    c->first_call = call; | ||||
| } | ||||
|  | ||||
|  | ||||
| /** | ||||
|  * Lookup a label, return label's position/offset. | ||||
|  */ | ||||
| static GLuint | ||||
| brw_lookup_label(struct brw_compile *c, const char *name) | ||||
| { | ||||
|    const struct brw_glsl_label *label; | ||||
|    for (label = c->first_label; label; label = label->next) { | ||||
|       if (strcmp(name, label->name) == 0) { | ||||
|          return label->position; | ||||
|       } | ||||
|    } | ||||
|    abort();  /* should never happen */ | ||||
|    return ~0; | ||||
| } | ||||
|  | ||||
|  | ||||
| /** | ||||
|  * When we're done generating code, this function is called to resolve | ||||
|  * subroutine calls. | ||||
|  */ | ||||
| void | ||||
| brw_resolve_cals(struct brw_compile *c) | ||||
| { | ||||
|     const struct brw_glsl_call *call; | ||||
|  | ||||
|     for (call = c->first_call; call; call = call->next) { | ||||
|         const GLuint sub_loc = brw_lookup_label(c, call->sub_name); | ||||
| 	struct brw_instruction *brw_call_inst = &c->store[call->call_inst_pos]; | ||||
| 	struct brw_instruction *brw_sub_inst = &c->store[sub_loc]; | ||||
| 	GLint offset = brw_sub_inst - brw_call_inst; | ||||
|  | ||||
| 	/* patch brw_inst1 to point to brw_inst2 */ | ||||
| 	brw_set_src1(brw_call_inst, brw_imm_d(offset * 16)); | ||||
|     } | ||||
|  | ||||
|     /* free linked list of calls */ | ||||
|     { | ||||
|         struct brw_glsl_call *call, *next; | ||||
|         for (call = c->first_call; call; call = next) { | ||||
| 	    next = call->next; | ||||
| 	    _mesa_free(call); | ||||
| 	} | ||||
| 	c->first_call = NULL; | ||||
|     } | ||||
|  | ||||
|     /* free linked list of labels */ | ||||
|     { | ||||
|         struct brw_glsl_label *label, *next; | ||||
| 	for (label = c->first_label; label; label = next) { | ||||
| 	    next = label->next; | ||||
| 	    _mesa_free(label); | ||||
| 	} | ||||
| 	c->first_label = NULL; | ||||
|     } | ||||
| } | ||||
|   | ||||
| @@ -91,6 +91,11 @@ struct brw_indirect { | ||||
| }; | ||||
|  | ||||
|  | ||||
| struct brw_glsl_label; | ||||
| struct brw_glsl_call; | ||||
|  | ||||
|  | ||||
|  | ||||
| #define BRW_EU_MAX_INSN_STACK 5 | ||||
| #define BRW_EU_MAX_INSN 1200 | ||||
|  | ||||
| @@ -106,9 +111,22 @@ struct brw_compile { | ||||
|    GLuint flag_value; | ||||
|    GLboolean single_program_flow; | ||||
|    struct brw_context *brw; | ||||
|  | ||||
|    struct brw_glsl_label *first_label;  /**< linked list of labels */ | ||||
|    struct brw_glsl_call *first_call;    /**< linked list of CALs */ | ||||
| }; | ||||
|  | ||||
|  | ||||
| void | ||||
| brw_save_label(struct brw_compile *c, const char *name, GLuint position); | ||||
|  | ||||
| void | ||||
| brw_save_call(struct brw_compile *c, const char *name, GLuint call_pos); | ||||
|  | ||||
| void | ||||
| brw_resolve_cals(struct brw_compile *c); | ||||
|  | ||||
|  | ||||
|  | ||||
| static INLINE int type_sz( GLuint type ) | ||||
| { | ||||
|   | ||||
| @@ -47,20 +47,12 @@ static GLboolean do_check_fallback(struct brw_context *brw) | ||||
|    GLcontext *ctx = &brw->intel.ctx; | ||||
|    GLuint i; | ||||
|  | ||||
|    /* BRW_NEW_METAOPS | ||||
|     */ | ||||
|    if (brw->metaops.active) | ||||
|       return GL_FALSE; | ||||
|  | ||||
|    if (brw->intel.no_rast) { | ||||
|       DBG("FALLBACK: rasterization disabled\n"); | ||||
|       return GL_TRUE; | ||||
|    } | ||||
|  | ||||
|    /* _NEW_RENDERMODE | ||||
|     * | ||||
|     * XXX: need to save/restore RenderMode in metaops state, or | ||||
|     * somehow move to a new attribs pointer: | ||||
|     */ | ||||
|    if (ctx->RenderMode != GL_RENDER) { | ||||
|       DBG("FALLBACK: render mode\n"); | ||||
| @@ -70,7 +62,7 @@ static GLboolean do_check_fallback(struct brw_context *brw) | ||||
|    /* _NEW_TEXTURE: | ||||
|     */ | ||||
|    for (i = 0; i < BRW_MAX_TEX_UNIT; i++) { | ||||
|       struct gl_texture_unit *texUnit = &brw->attribs.Texture->Unit[i]; | ||||
|       struct gl_texture_unit *texUnit = &ctx->Texture.Unit[i]; | ||||
|       if (texUnit->_ReallyEnabled) { | ||||
| 	 struct intel_texture_object *intelObj = intel_texture_object(texUnit->_Current); | ||||
| 	 struct gl_texture_image *texImage = intelObj->base.Image[0][intelObj->firstLevel]; | ||||
| @@ -83,8 +75,8 @@ static GLboolean do_check_fallback(struct brw_context *brw) | ||||
|     | ||||
|    /* _NEW_STENCIL  | ||||
|     */ | ||||
|    if (brw->attribs.Stencil->Enabled &&  | ||||
|        !brw->intel.hw_stencil) { | ||||
|    if (ctx->Stencil.Enabled && | ||||
|        (ctx->DrawBuffer->Name == 0 && !brw->intel.hw_stencil)) { | ||||
|       DBG("FALLBACK: stencil\n"); | ||||
|       return GL_TRUE; | ||||
|    } | ||||
| @@ -101,7 +93,7 @@ static void check_fallback(struct brw_context *brw) | ||||
| const struct brw_tracked_state brw_check_fallback = { | ||||
|    .dirty = { | ||||
|       .mesa = _NEW_BUFFERS | _NEW_RENDERMODE | _NEW_TEXTURE | _NEW_STENCIL, | ||||
|       .brw  = BRW_NEW_METAOPS, | ||||
|       .brw  = 0, | ||||
|       .cache = 0 | ||||
|    }, | ||||
|    .prepare = check_fallback | ||||
|   | ||||
| @@ -1,583 +0,0 @@ | ||||
| /* | ||||
|  Copyright (C) Intel Corp.  2006.  All Rights Reserved. | ||||
|  Intel funded Tungsten Graphics (http://www.tungstengraphics.com) to | ||||
|  develop this 3D driver. | ||||
|   | ||||
|  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 (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 NONINFRINGEMENT. | ||||
|  IN NO EVENT SHALL THE COPYRIGHT OWNER(S) 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. | ||||
|   | ||||
|  **********************************************************************/ | ||||
|  /* | ||||
|   * Authors: | ||||
|   *   Keith Whitwell <keith@tungstengraphics.com> | ||||
|   *   frame buffer texture by Gary Wong <gtw@gnu.org> | ||||
|   */ | ||||
|   | ||||
|  | ||||
|  | ||||
| #include "main/glheader.h" | ||||
| #include "main/context.h" | ||||
| #include "main/macros.h" | ||||
|  | ||||
| #include "shader/arbprogparse.h" | ||||
|  | ||||
| #include "intel_screen.h" | ||||
| #include "intel_batchbuffer.h" | ||||
| #include "intel_regions.h" | ||||
| #include "intel_buffers.h" | ||||
|  | ||||
| #include "brw_context.h" | ||||
| #include "brw_defines.h" | ||||
| #include "brw_draw.h" | ||||
| #include "brw_fallback.h" | ||||
|  | ||||
| #define INIT(brw, STRUCT, ATTRIB) 		\ | ||||
| do {						\ | ||||
|    brw->attribs.ATTRIB = &ctx->ATTRIB;		\ | ||||
| } while (0) | ||||
|  | ||||
| #define DUP(brw, STRUCT, ATTRIB) 		\ | ||||
| do {						\ | ||||
|    brw->metaops.attribs.ATTRIB = MALLOC_STRUCT(STRUCT);	\ | ||||
|    memcpy(brw->metaops.attribs.ATTRIB, 			\ | ||||
| 	  brw->attribs.ATTRIB,			\ | ||||
| 	  sizeof(struct STRUCT));		\ | ||||
| } while (0) | ||||
|  | ||||
|  | ||||
| #define INSTALL(brw, ATTRIB, STATE)		\ | ||||
| do {						\ | ||||
|    brw->attribs.ATTRIB = brw->metaops.attribs.ATTRIB;	\ | ||||
|    brw->state.dirty.mesa |= STATE;		\ | ||||
| } while (0) | ||||
|  | ||||
| #define RESTORE(brw, ATTRIB, STATE)			\ | ||||
| do {							\ | ||||
|    brw->attribs.ATTRIB = &brw->intel.ctx.ATTRIB;	\ | ||||
|    brw->state.dirty.mesa |= STATE;			\ | ||||
| } while (0) | ||||
|  | ||||
| static void init_attribs( struct brw_context *brw ) | ||||
| { | ||||
|    DUP(brw, gl_colorbuffer_attrib, Color); | ||||
|    DUP(brw, gl_depthbuffer_attrib, Depth); | ||||
|    DUP(brw, gl_fog_attrib, Fog); | ||||
|    DUP(brw, gl_hint_attrib, Hint); | ||||
|    DUP(brw, gl_light_attrib, Light); | ||||
|    DUP(brw, gl_line_attrib, Line); | ||||
|    DUP(brw, gl_point_attrib, Point); | ||||
|    DUP(brw, gl_polygon_attrib, Polygon); | ||||
|    DUP(brw, gl_scissor_attrib, Scissor); | ||||
|    DUP(brw, gl_stencil_attrib, Stencil); | ||||
|    DUP(brw, gl_texture_attrib, Texture); | ||||
|    DUP(brw, gl_transform_attrib, Transform); | ||||
|    DUP(brw, gl_viewport_attrib, Viewport); | ||||
|    DUP(brw, gl_vertex_program_state, VertexProgram); | ||||
|    DUP(brw, gl_fragment_program_state, FragmentProgram); | ||||
| } | ||||
|  | ||||
| static void install_attribs( struct brw_context *brw ) | ||||
| { | ||||
|    INSTALL(brw, Color, _NEW_COLOR); | ||||
|    INSTALL(brw, Depth, _NEW_DEPTH); | ||||
|    INSTALL(brw, Fog, _NEW_FOG); | ||||
|    INSTALL(brw, Hint, _NEW_HINT); | ||||
|    INSTALL(brw, Light, _NEW_LIGHT); | ||||
|    INSTALL(brw, Line, _NEW_LINE); | ||||
|    INSTALL(brw, Point, _NEW_POINT); | ||||
|    INSTALL(brw, Polygon, _NEW_POLYGON); | ||||
|    INSTALL(brw, Scissor, _NEW_SCISSOR); | ||||
|    INSTALL(brw, Stencil, _NEW_STENCIL); | ||||
|    INSTALL(brw, Texture, _NEW_TEXTURE); | ||||
|    INSTALL(brw, Transform, _NEW_TRANSFORM); | ||||
|    INSTALL(brw, Viewport, _NEW_VIEWPORT); | ||||
|    INSTALL(brw, VertexProgram, _NEW_PROGRAM); | ||||
|    INSTALL(brw, FragmentProgram, _NEW_PROGRAM); | ||||
| } | ||||
|  | ||||
| static void restore_attribs( struct brw_context *brw ) | ||||
| { | ||||
|    RESTORE(brw, Color, _NEW_COLOR); | ||||
|    RESTORE(brw, Depth, _NEW_DEPTH); | ||||
|    RESTORE(brw, Fog, _NEW_FOG); | ||||
|    RESTORE(brw, Hint, _NEW_HINT); | ||||
|    RESTORE(brw, Light, _NEW_LIGHT); | ||||
|    RESTORE(brw, Line, _NEW_LINE); | ||||
|    RESTORE(brw, Point, _NEW_POINT); | ||||
|    RESTORE(brw, Polygon, _NEW_POLYGON); | ||||
|    RESTORE(brw, Scissor, _NEW_SCISSOR); | ||||
|    RESTORE(brw, Stencil, _NEW_STENCIL); | ||||
|    RESTORE(brw, Texture, _NEW_TEXTURE); | ||||
|    RESTORE(brw, Transform, _NEW_TRANSFORM); | ||||
|    RESTORE(brw, Viewport, _NEW_VIEWPORT); | ||||
|    RESTORE(brw, VertexProgram, _NEW_PROGRAM); | ||||
|    RESTORE(brw, FragmentProgram, _NEW_PROGRAM); | ||||
| } | ||||
|  | ||||
|  | ||||
| static const char *vp_prog = | ||||
|       "!!ARBvp1.0\n" | ||||
|       "MOV  result.color, vertex.color;\n" | ||||
|       "MOV  result.position, vertex.position;\n" | ||||
|       "END\n"; | ||||
|  | ||||
| static const char *fp_prog = | ||||
|       "!!ARBfp1.0\n" | ||||
|       "MOV result.color, fragment.color;\n" | ||||
|       "END\n"; | ||||
|  | ||||
| static const char *fp_tex_prog = | ||||
|       "!!ARBfp1.0\n" | ||||
|       "TEMP a;\n" | ||||
|       "ADD a, fragment.position, program.local[0];\n" | ||||
|       "MUL a, a, program.local[1];\n" | ||||
|       "TEX result.color, a, texture[0], 2D;\n" | ||||
|       "MOV result.depth.z, fragment.position;\n" | ||||
|       "END\n"; | ||||
|  | ||||
| /* Derived values of importance: | ||||
|  * | ||||
|  *   FragmentProgram->_Current | ||||
|  *   VertexProgram->_Enabled | ||||
|  *   brw->vertex_program | ||||
|  *   DrawBuffer->_ColorDrawBufferIndexes[0] | ||||
|  *  | ||||
|  * | ||||
|  * More if drawpixels-through-texture is added.   | ||||
|  */ | ||||
| static void init_metaops_state( struct brw_context *brw ) | ||||
| { | ||||
|    GLcontext *ctx = &brw->intel.ctx; | ||||
|  | ||||
|    brw->metaops.vbo = ctx->Driver.NewBufferObject(ctx, 1, GL_ARRAY_BUFFER_ARB); | ||||
|  | ||||
|    ctx->Driver.BufferData(ctx, | ||||
| 			  GL_ARRAY_BUFFER_ARB, | ||||
| 			  4096, | ||||
| 			  NULL, | ||||
| 			  GL_DYNAMIC_DRAW_ARB, | ||||
| 			  brw->metaops.vbo); | ||||
|  | ||||
|    brw->metaops.fp = (struct gl_fragment_program *) | ||||
|       ctx->Driver.NewProgram(ctx, GL_FRAGMENT_PROGRAM_ARB, 1 ); | ||||
|  | ||||
|    brw->metaops.fp_tex = (struct gl_fragment_program *) | ||||
|       ctx->Driver.NewProgram(ctx, GL_FRAGMENT_PROGRAM_ARB, 1 ); | ||||
|  | ||||
|    brw->metaops.vp = (struct gl_vertex_program *) | ||||
|       ctx->Driver.NewProgram(ctx, GL_VERTEX_PROGRAM_ARB, 1 ); | ||||
|  | ||||
|    _mesa_parse_arb_fragment_program(ctx, GL_FRAGMENT_PROGRAM_ARB,  | ||||
| 				    fp_prog, strlen(fp_prog), | ||||
| 				    brw->metaops.fp); | ||||
|  | ||||
|    _mesa_parse_arb_fragment_program(ctx, GL_FRAGMENT_PROGRAM_ARB,  | ||||
| 				    fp_tex_prog, strlen(fp_tex_prog), | ||||
| 				    brw->metaops.fp_tex); | ||||
|  | ||||
|    _mesa_parse_arb_vertex_program(ctx, GL_VERTEX_PROGRAM_ARB,  | ||||
| 				  vp_prog, strlen(vp_prog), | ||||
| 				  brw->metaops.vp); | ||||
|  | ||||
|    brw->metaops.attribs.VertexProgram->_Current = brw->metaops.vp; | ||||
|    brw->metaops.attribs.VertexProgram->_Enabled = GL_TRUE; | ||||
|  | ||||
|    brw->metaops.attribs.FragmentProgram->_Current = brw->metaops.fp; | ||||
| } | ||||
|  | ||||
| static void meta_flat_shade( struct intel_context *intel ) | ||||
| { | ||||
|    struct brw_context *brw = brw_context(&intel->ctx); | ||||
|  | ||||
|    brw->metaops.attribs.Light->ShadeModel = GL_FLAT; | ||||
|    brw->state.dirty.mesa |= _NEW_LIGHT; | ||||
| } | ||||
|  | ||||
|  | ||||
| static void meta_no_stencil_write( struct intel_context *intel ) | ||||
| { | ||||
|    struct brw_context *brw = brw_context(&intel->ctx); | ||||
|  | ||||
|    brw->metaops.attribs.Stencil->Enabled = GL_FALSE; | ||||
|    brw->metaops.attribs.Stencil->WriteMask[0] = GL_FALSE;  | ||||
|    brw->state.dirty.mesa |= _NEW_STENCIL; | ||||
| } | ||||
|  | ||||
| static void meta_no_depth_write( struct intel_context *intel ) | ||||
| { | ||||
|    struct brw_context *brw = brw_context(&intel->ctx); | ||||
|  | ||||
|    brw->metaops.attribs.Depth->Test = GL_FALSE; | ||||
|    brw->metaops.attribs.Depth->Mask = GL_FALSE; | ||||
|    brw->state.dirty.mesa |= _NEW_DEPTH; | ||||
| } | ||||
|  | ||||
|  | ||||
| static void meta_depth_replace( struct intel_context *intel ) | ||||
| { | ||||
|    struct brw_context *brw = brw_context(&intel->ctx); | ||||
|  | ||||
|    /* ctx->Driver.Enable( ctx, GL_DEPTH_TEST, GL_TRUE ) | ||||
|     * ctx->Driver.DepthMask( ctx, GL_TRUE ) | ||||
|     */ | ||||
|    brw->metaops.attribs.Depth->Test = GL_TRUE; | ||||
|    brw->metaops.attribs.Depth->Mask = GL_TRUE; | ||||
|    brw->state.dirty.mesa |= _NEW_DEPTH; | ||||
|  | ||||
|    /* ctx->Driver.DepthFunc( ctx, GL_ALWAYS ) | ||||
|     */ | ||||
|    brw->metaops.attribs.Depth->Func = GL_ALWAYS; | ||||
|  | ||||
|    brw->state.dirty.mesa |= _NEW_DEPTH; | ||||
| } | ||||
|  | ||||
|  | ||||
| static void meta_stencil_replace( struct intel_context *intel, | ||||
| 				 GLuint s_mask, | ||||
| 				 GLuint s_clear) | ||||
| { | ||||
|    struct brw_context *brw = brw_context(&intel->ctx); | ||||
|  | ||||
|    brw->metaops.attribs.Stencil->Enabled = GL_TRUE; | ||||
|    brw->metaops.attribs.Stencil->WriteMask[0] = s_mask; | ||||
|    brw->metaops.attribs.Stencil->ValueMask[0] = 0xff; | ||||
|    brw->metaops.attribs.Stencil->Ref[0] = s_clear; | ||||
|    brw->metaops.attribs.Stencil->Function[0] = GL_ALWAYS; | ||||
|    brw->metaops.attribs.Stencil->FailFunc[0] = GL_REPLACE; | ||||
|    brw->metaops.attribs.Stencil->ZPassFunc[0] = GL_REPLACE; | ||||
|    brw->metaops.attribs.Stencil->ZFailFunc[0] = GL_REPLACE; | ||||
|    brw->state.dirty.mesa |= _NEW_STENCIL; | ||||
| } | ||||
|  | ||||
|  | ||||
| static void meta_color_mask( struct intel_context *intel, GLboolean state ) | ||||
| { | ||||
|    struct brw_context *brw = brw_context(&intel->ctx); | ||||
|  | ||||
|    if (state) | ||||
|       COPY_4V(brw->metaops.attribs.Color->ColorMask,  | ||||
| 	      brw->intel.ctx.Color.ColorMask);  | ||||
|    else | ||||
|       ASSIGN_4V(brw->metaops.attribs.Color->ColorMask, 0, 0, 0, 0); | ||||
|  | ||||
|    brw->state.dirty.mesa |= _NEW_COLOR; | ||||
| } | ||||
|  | ||||
| static void meta_no_texture( struct intel_context *intel ) | ||||
| { | ||||
|    struct brw_context *brw = brw_context(&intel->ctx); | ||||
|     | ||||
|    brw->metaops.attribs.FragmentProgram->_Current = brw->metaops.fp; | ||||
|     | ||||
|    brw->metaops.attribs.Texture->CurrentUnit = 0; | ||||
|    brw->metaops.attribs.Texture->_EnabledUnits = 0; | ||||
|    brw->metaops.attribs.Texture->_EnabledCoordUnits = 0; | ||||
|    brw->metaops.attribs.Texture->Unit[ 0 ].Enabled = 0; | ||||
|    brw->metaops.attribs.Texture->Unit[ 0 ]._ReallyEnabled = 0; | ||||
|  | ||||
|    brw->state.dirty.mesa |= _NEW_TEXTURE | _NEW_PROGRAM; | ||||
| } | ||||
|  | ||||
| static void meta_texture_blend_replace(struct intel_context *intel) | ||||
| { | ||||
|    struct brw_context *brw = brw_context(&intel->ctx); | ||||
|  | ||||
|    brw->metaops.attribs.Texture->CurrentUnit = 0; | ||||
|    brw->metaops.attribs.Texture->_EnabledUnits = 1; | ||||
|    brw->metaops.attribs.Texture->_EnabledCoordUnits = 1; | ||||
|    brw->metaops.attribs.Texture->Unit[ 0 ].Enabled = TEXTURE_2D_BIT; | ||||
|    brw->metaops.attribs.Texture->Unit[ 0 ]._ReallyEnabled = TEXTURE_2D_BIT; | ||||
|    brw->metaops.attribs.Texture->Unit[ 0 ].Current2D = | ||||
|       intel->frame_buffer_texobj; | ||||
|    brw->metaops.attribs.Texture->Unit[ 0 ]._Current = | ||||
|       intel->frame_buffer_texobj; | ||||
|  | ||||
|    brw->state.dirty.mesa |= _NEW_TEXTURE | _NEW_PROGRAM; | ||||
| } | ||||
|  | ||||
| static void meta_import_pixel_state(struct intel_context *intel) | ||||
| { | ||||
|    struct brw_context *brw = brw_context(&intel->ctx); | ||||
|     | ||||
|    RESTORE(brw, Color, _NEW_COLOR); | ||||
|    RESTORE(brw, Depth, _NEW_DEPTH); | ||||
|    RESTORE(brw, Fog, _NEW_FOG); | ||||
|    RESTORE(brw, Scissor, _NEW_SCISSOR); | ||||
|    RESTORE(brw, Stencil, _NEW_STENCIL); | ||||
|    RESTORE(brw, Texture, _NEW_TEXTURE); | ||||
|    RESTORE(brw, FragmentProgram, _NEW_PROGRAM); | ||||
| } | ||||
|  | ||||
| static void meta_frame_buffer_texture( struct intel_context *intel, | ||||
| 				       GLint xoff, GLint yoff ) | ||||
| { | ||||
|    struct brw_context *brw = brw_context(&intel->ctx); | ||||
|    struct intel_region *region = intel_drawbuf_region( intel ); | ||||
|     | ||||
|    INSTALL(brw, FragmentProgram, _NEW_PROGRAM); | ||||
|  | ||||
|    brw->metaops.attribs.FragmentProgram->_Current = brw->metaops.fp_tex; | ||||
|    /* This is unfortunate, but seems to be necessary, since later on we | ||||
|       will end up calling _mesa_load_state_parameters to lookup the | ||||
|       local params (below), and that will want to look in ctx.FragmentProgram | ||||
|       instead of brw->attribs.FragmentProgram. */ | ||||
|    intel->ctx.FragmentProgram.Current = brw->metaops.fp_tex; | ||||
|  | ||||
|    brw->metaops.fp_tex->Base.LocalParams[ 0 ][ 0 ] = xoff; | ||||
|    brw->metaops.fp_tex->Base.LocalParams[ 0 ][ 1 ] = yoff; | ||||
|    brw->metaops.fp_tex->Base.LocalParams[ 0 ][ 2 ] = 0.0; | ||||
|    brw->metaops.fp_tex->Base.LocalParams[ 0 ][ 3 ] = 0.0; | ||||
|    brw->metaops.fp_tex->Base.LocalParams[ 1 ][ 0 ] = | ||||
|       1.0 / region->pitch; | ||||
|    brw->metaops.fp_tex->Base.LocalParams[ 1 ][ 1 ] = | ||||
|       -1.0 / region->height; | ||||
|    brw->metaops.fp_tex->Base.LocalParams[ 1 ][ 2 ] = 0.0; | ||||
|    brw->metaops.fp_tex->Base.LocalParams[ 1 ][ 3 ] = 1.0; | ||||
|     | ||||
|    brw->state.dirty.mesa |= _NEW_PROGRAM; | ||||
| } | ||||
|  | ||||
|  | ||||
| static void meta_draw_region( struct intel_context *intel, | ||||
| 			     struct intel_region *draw_region, | ||||
| 			     struct intel_region *depth_region ) | ||||
| { | ||||
|    struct brw_context *brw = brw_context(&intel->ctx); | ||||
|  | ||||
|    if (!brw->metaops.saved_draw_region) { | ||||
|       brw->metaops.saved_draw_region = brw->state.draw_regions[0]; | ||||
|       brw->metaops.saved_nr_draw_regions = brw->state.nr_draw_regions; | ||||
|       brw->metaops.saved_depth_region = brw->state.depth_region; | ||||
|    } | ||||
|  | ||||
|    brw->state.draw_regions[0] = draw_region; | ||||
|    brw->state.nr_draw_regions = 1; | ||||
|    brw->state.depth_region = depth_region; | ||||
|  | ||||
|    if (intel->frame_buffer_texobj != NULL) | ||||
|       brw_FrameBufferTexDestroy(brw); | ||||
|  | ||||
|    if (draw_region) | ||||
|        brw_FrameBufferTexInit(brw, draw_region); | ||||
|  | ||||
|    brw->state.dirty.mesa |= _NEW_BUFFERS; | ||||
| } | ||||
|  | ||||
|  | ||||
| static void meta_draw_quad(struct intel_context *intel,  | ||||
| 			   GLfloat x0, GLfloat x1, | ||||
| 			   GLfloat y0, GLfloat y1,  | ||||
| 			   GLfloat z, | ||||
| 			   GLuint color, | ||||
| 			   GLfloat s0, GLfloat s1, | ||||
| 			   GLfloat t0, GLfloat t1) | ||||
| { | ||||
|    GLcontext *ctx = &intel->ctx; | ||||
|    struct brw_context *brw = brw_context(&intel->ctx); | ||||
|    struct gl_client_array pos_array; | ||||
|    struct gl_client_array color_array; | ||||
|    struct gl_client_array *attribs[VERT_ATTRIB_MAX]; | ||||
|    struct _mesa_prim prim[1]; | ||||
|    GLfloat pos[4][3]; | ||||
|  | ||||
|    ctx->Driver.BufferData(ctx, | ||||
| 			  GL_ARRAY_BUFFER_ARB, | ||||
| 			  sizeof(pos) + sizeof(color), | ||||
| 			  NULL, | ||||
| 			  GL_DYNAMIC_DRAW_ARB, | ||||
| 			  brw->metaops.vbo); | ||||
|  | ||||
|    pos[0][0] = x0; | ||||
|    pos[0][1] = y0; | ||||
|    pos[0][2] = z; | ||||
|  | ||||
|    pos[1][0] = x1; | ||||
|    pos[1][1] = y0; | ||||
|    pos[1][2] = z; | ||||
|  | ||||
|    pos[2][0] = x1; | ||||
|    pos[2][1] = y1; | ||||
|    pos[2][2] = z; | ||||
|  | ||||
|    pos[3][0] = x0; | ||||
|    pos[3][1] = y1; | ||||
|    pos[3][2] = z; | ||||
|  | ||||
|    ctx->Driver.BufferSubData(ctx, | ||||
| 			     GL_ARRAY_BUFFER_ARB, | ||||
| 			     0, | ||||
| 			     sizeof(pos), | ||||
| 			     pos, | ||||
| 			     brw->metaops.vbo); | ||||
|  | ||||
|    /* Convert incoming ARGB to required RGBA */ | ||||
|    /* Note this color is stored as GL_UNSIGNED_BYTE */ | ||||
|    color = (color & 0xff00ff00) | (((color >> 16) | (color << 16)) & 0xff00ff); | ||||
|  | ||||
|    ctx->Driver.BufferSubData(ctx, | ||||
| 			     GL_ARRAY_BUFFER_ARB, | ||||
| 			     sizeof(pos), | ||||
| 			     sizeof(color), | ||||
| 			     &color, | ||||
| 			     brw->metaops.vbo); | ||||
|  | ||||
|    /* Ignoring texture coords.  | ||||
|     */ | ||||
|  | ||||
|    memset(attribs, 0, VERT_ATTRIB_MAX * sizeof(*attribs)); | ||||
|  | ||||
|    attribs[VERT_ATTRIB_POS] = &pos_array; | ||||
|    attribs[VERT_ATTRIB_POS]->Ptr = 0; | ||||
|    attribs[VERT_ATTRIB_POS]->Type = GL_FLOAT; | ||||
|    attribs[VERT_ATTRIB_POS]->Enabled = 1; | ||||
|    attribs[VERT_ATTRIB_POS]->Size = 3; | ||||
|    attribs[VERT_ATTRIB_POS]->StrideB = 3 * sizeof(GLfloat); | ||||
|    attribs[VERT_ATTRIB_POS]->Stride = 3 * sizeof(GLfloat); | ||||
|    attribs[VERT_ATTRIB_POS]->_MaxElement = 4; | ||||
|    attribs[VERT_ATTRIB_POS]->Normalized = 0; | ||||
|    attribs[VERT_ATTRIB_POS]->BufferObj = brw->metaops.vbo; | ||||
|  | ||||
|    attribs[VERT_ATTRIB_COLOR0] = &color_array; | ||||
|    attribs[VERT_ATTRIB_COLOR0]->Ptr = (const GLubyte *)sizeof(pos); | ||||
|    attribs[VERT_ATTRIB_COLOR0]->Type = GL_UNSIGNED_BYTE; | ||||
|    attribs[VERT_ATTRIB_COLOR0]->Enabled = 1; | ||||
|    attribs[VERT_ATTRIB_COLOR0]->Size = 4; | ||||
|    attribs[VERT_ATTRIB_COLOR0]->StrideB = 0; | ||||
|    attribs[VERT_ATTRIB_COLOR0]->Stride = 0; | ||||
|    attribs[VERT_ATTRIB_COLOR0]->_MaxElement = 1; | ||||
|    attribs[VERT_ATTRIB_COLOR0]->Normalized = 1; | ||||
|    attribs[VERT_ATTRIB_COLOR0]->BufferObj = brw->metaops.vbo; | ||||
|     | ||||
|    /* Just ignoring texture coordinates for now.  | ||||
|     */ | ||||
|  | ||||
|    memset(prim, 0, sizeof(*prim)); | ||||
|  | ||||
|    prim[0].mode = GL_TRIANGLE_FAN; | ||||
|    prim[0].begin = 1; | ||||
|    prim[0].end = 1; | ||||
|    prim[0].weak = 0; | ||||
|    prim[0].pad = 0; | ||||
|    prim[0].start = 0; | ||||
|    prim[0].count = 4; | ||||
|  | ||||
|    brw_draw_prims(&brw->intel.ctx,  | ||||
| 		  (const struct gl_client_array **)attribs, | ||||
| 		  prim, 1, | ||||
| 		  NULL, | ||||
| 		  0, | ||||
| 		  3 ); | ||||
| } | ||||
|  | ||||
|  | ||||
| static void install_meta_state( struct intel_context *intel ) | ||||
| { | ||||
|    GLcontext *ctx = &intel->ctx; | ||||
|    struct brw_context *brw = brw_context(ctx); | ||||
|    GLuint i; | ||||
|  | ||||
|    if (!brw->metaops.vbo) { | ||||
|       init_metaops_state(brw); | ||||
|    } | ||||
|  | ||||
|    install_attribs(brw); | ||||
|     | ||||
|    meta_no_texture(&brw->intel); | ||||
|    meta_flat_shade(&brw->intel); | ||||
|    for (i = 0; i < ctx->Const.MaxDrawBuffers; i++) { | ||||
|       brw->metaops.restore_draw_buffers[i] | ||||
|          = ctx->DrawBuffer->_ColorDrawBufferIndexes[i]; | ||||
|    } | ||||
|    brw->metaops.restore_num_draw_buffers = ctx->DrawBuffer->_NumColorDrawBuffers; | ||||
|  | ||||
|    brw->metaops.restore_fp = ctx->FragmentProgram.Current; | ||||
|  | ||||
|    /* This works without adjusting refcounts.  Fix later?  | ||||
|     */ | ||||
|    brw->metaops.saved_draw_region = brw->state.draw_regions[0]; | ||||
|    brw->metaops.saved_nr_draw_regions = brw->state.nr_draw_regions; | ||||
|    brw->metaops.saved_depth_region = brw->state.depth_region; | ||||
|    brw->metaops.active = 1; | ||||
|     | ||||
|    brw->state.dirty.brw |= BRW_NEW_METAOPS; | ||||
| } | ||||
|  | ||||
| static void leave_meta_state( struct intel_context *intel ) | ||||
| { | ||||
|    GLcontext *ctx = &intel->ctx; | ||||
|    struct brw_context *brw = brw_context(ctx); | ||||
|    GLuint i; | ||||
|  | ||||
|    restore_attribs(brw); | ||||
|  | ||||
|    for (i = 0; i < ctx->Const.MaxDrawBuffers; i++) { | ||||
|       ctx->DrawBuffer->_ColorDrawBufferIndexes[i] | ||||
|          = brw->metaops.restore_draw_buffers[i]; | ||||
|    } | ||||
|    ctx->DrawBuffer->_NumColorDrawBuffers = brw->metaops.restore_num_draw_buffers; | ||||
|  | ||||
|    ctx->FragmentProgram.Current = brw->metaops.restore_fp; | ||||
|  | ||||
|    brw->state.draw_regions[0] = brw->metaops.saved_draw_region; | ||||
|    brw->state.nr_draw_regions = brw->metaops.saved_nr_draw_regions; | ||||
|    brw->state.depth_region = brw->metaops.saved_depth_region; | ||||
|    brw->metaops.saved_draw_region = NULL; | ||||
|    brw->metaops.saved_depth_region = NULL; | ||||
|    brw->metaops.active = 0; | ||||
|  | ||||
|    brw->state.dirty.mesa |= _NEW_BUFFERS; | ||||
|    brw->state.dirty.brw |= BRW_NEW_METAOPS; | ||||
| } | ||||
|  | ||||
|  | ||||
|  | ||||
| void brw_init_metaops( struct brw_context *brw ) | ||||
| { | ||||
|    init_attribs(brw); | ||||
|  | ||||
|  | ||||
|    brw->intel.vtbl.install_meta_state = install_meta_state; | ||||
|    brw->intel.vtbl.leave_meta_state = leave_meta_state; | ||||
|    brw->intel.vtbl.meta_no_depth_write = meta_no_depth_write; | ||||
|    brw->intel.vtbl.meta_no_stencil_write = meta_no_stencil_write; | ||||
|    brw->intel.vtbl.meta_stencil_replace = meta_stencil_replace; | ||||
|    brw->intel.vtbl.meta_depth_replace = meta_depth_replace; | ||||
|    brw->intel.vtbl.meta_color_mask = meta_color_mask; | ||||
|    brw->intel.vtbl.meta_no_texture = meta_no_texture; | ||||
|    brw->intel.vtbl.meta_import_pixel_state = meta_import_pixel_state; | ||||
|    brw->intel.vtbl.meta_frame_buffer_texture = meta_frame_buffer_texture; | ||||
|    brw->intel.vtbl.meta_draw_region = meta_draw_region; | ||||
|    brw->intel.vtbl.meta_draw_quad = meta_draw_quad; | ||||
|    brw->intel.vtbl.meta_texture_blend_replace = meta_texture_blend_replace; | ||||
| /*    brw->intel.vtbl.meta_tex_rect_source = meta_tex_rect_source; */ | ||||
| /*    brw->intel.vtbl.meta_draw_format = set_draw_format; */ | ||||
| } | ||||
|  | ||||
| void brw_destroy_metaops( struct brw_context *brw ) | ||||
| { | ||||
|    GLcontext *ctx = &brw->intel.ctx; | ||||
|  | ||||
|    if (brw->metaops.vbo) | ||||
|       ctx->Driver.DeleteBuffer( ctx, brw->metaops.vbo ); | ||||
|  | ||||
| /*    ctx->Driver.DeleteProgram( ctx, brw->metaops.fp ); */ | ||||
| /*    ctx->Driver.DeleteProgram( ctx, brw->metaops.fp_tex ); */ | ||||
| /*    ctx->Driver.DeleteProgram( ctx, brw->metaops.vp ); */ | ||||
| } | ||||
| @@ -48,15 +48,16 @@ | ||||
|  | ||||
| static void upload_blend_constant_color(struct brw_context *brw) | ||||
| { | ||||
|    GLcontext *ctx = &brw->intel.ctx; | ||||
|    struct brw_blend_constant_color bcc; | ||||
|  | ||||
|    memset(&bcc, 0, sizeof(bcc));       | ||||
|    bcc.header.opcode = CMD_BLEND_CONSTANT_COLOR; | ||||
|    bcc.header.length = sizeof(bcc)/4-2; | ||||
|    bcc.blend_constant_color[0] = brw->attribs.Color->BlendColor[0]; | ||||
|    bcc.blend_constant_color[1] = brw->attribs.Color->BlendColor[1]; | ||||
|    bcc.blend_constant_color[2] = brw->attribs.Color->BlendColor[2]; | ||||
|    bcc.blend_constant_color[3] = brw->attribs.Color->BlendColor[3]; | ||||
|    bcc.blend_constant_color[0] = ctx->Color.BlendColor[0]; | ||||
|    bcc.blend_constant_color[1] = ctx->Color.BlendColor[1]; | ||||
|    bcc.blend_constant_color[2] = ctx->Color.BlendColor[2]; | ||||
|    bcc.blend_constant_color[3] = ctx->Color.BlendColor[3]; | ||||
|  | ||||
|    BRW_CACHED_BATCH_STRUCT(brw, &bcc); | ||||
| } | ||||
| @@ -154,10 +155,7 @@ static void upload_pipelined_state_pointers(struct brw_context *brw ) | ||||
|       OUT_RELOC(brw->gs.state_bo, I915_GEM_DOMAIN_INSTRUCTION, 0, 1); | ||||
|    else | ||||
|       OUT_BATCH(0); | ||||
|    if (!brw->metaops.active) | ||||
|       OUT_RELOC(brw->clip.state_bo, I915_GEM_DOMAIN_INSTRUCTION, 0, 1); | ||||
|    else | ||||
|       OUT_BATCH(0); | ||||
|    OUT_RELOC(brw->clip.state_bo, I915_GEM_DOMAIN_INSTRUCTION, 0, 1); | ||||
|    OUT_RELOC(brw->sf.state_bo, I915_GEM_DOMAIN_INSTRUCTION, 0, 0); | ||||
|    OUT_RELOC(brw->wm.state_bo, I915_GEM_DOMAIN_INSTRUCTION, 0, 0); | ||||
|    OUT_RELOC(brw->cc.state_bo, I915_GEM_DOMAIN_INSTRUCTION, 0, 0); | ||||
| @@ -186,7 +184,7 @@ static void upload_psp_urb_cbs(struct brw_context *brw ) | ||||
| const struct brw_tracked_state brw_psp_urb_cbs = { | ||||
|    .dirty = { | ||||
|       .mesa = 0, | ||||
|       .brw = BRW_NEW_URB_FENCE | BRW_NEW_METAOPS | BRW_NEW_BATCH, | ||||
|       .brw = BRW_NEW_URB_FENCE | BRW_NEW_BATCH, | ||||
|       .cache = (CACHE_NEW_VS_UNIT |  | ||||
| 		CACHE_NEW_GS_UNIT |  | ||||
| 		CACHE_NEW_GS_PROG |  | ||||
| @@ -284,6 +282,7 @@ const struct brw_tracked_state brw_depthbuffer = { | ||||
|  | ||||
| static void upload_polygon_stipple(struct brw_context *brw) | ||||
| { | ||||
|    GLcontext *ctx = &brw->intel.ctx; | ||||
|    struct brw_polygon_stipple bps; | ||||
|    GLuint i; | ||||
|  | ||||
| @@ -291,8 +290,21 @@ static void upload_polygon_stipple(struct brw_context *brw) | ||||
|    bps.header.opcode = CMD_POLY_STIPPLE_PATTERN; | ||||
|    bps.header.length = sizeof(bps)/4-2; | ||||
|  | ||||
|    for (i = 0; i < 32; i++) | ||||
|       bps.stipple[i] = brw->attribs.PolygonStipple[31 - i]; /* invert */ | ||||
|    /* Polygon stipple is provided in OpenGL order, i.e. bottom | ||||
|     * row first.  If we're rendering to a window (i.e. the | ||||
|     * default frame buffer object, 0), then we need to invert | ||||
|     * it to match our pixel layout.  But if we're rendering | ||||
|     * to a FBO (i.e. any named frame buffer object), we *don't* | ||||
|     * need to invert - we already match the layout. | ||||
|     */ | ||||
|    if (ctx->DrawBuffer->Name == 0) { | ||||
|       for (i = 0; i < 32; i++) | ||||
|          bps.stipple[i] = ctx->PolygonStipple[31 - i]; /* invert */ | ||||
|    } | ||||
|    else { | ||||
|       for (i = 0; i < 32; i++) | ||||
|          bps.stipple[i] = ctx->PolygonStipple[i]; /* don't invert */ | ||||
|    } | ||||
|  | ||||
|    BRW_CACHED_BATCH_STRUCT(brw, &bps); | ||||
| } | ||||
| @@ -320,8 +332,22 @@ static void upload_polygon_stipple_offset(struct brw_context *brw) | ||||
|    bpso.header.opcode = CMD_POLY_STIPPLE_OFFSET; | ||||
|    bpso.header.length = sizeof(bpso)/4-2; | ||||
|  | ||||
|    bpso.bits0.x_offset = (32 - (dPriv->x & 31)) & 31; | ||||
|    bpso.bits0.y_offset = (32 - ((dPriv->y + dPriv->h) & 31)) & 31; | ||||
|    /* If we're drawing to a system window (ctx->DrawBuffer->Name == 0), | ||||
|     * we have to invert the Y axis in order to match the OpenGL | ||||
|     * pixel coordinate system, and our offset must be matched | ||||
|     * to the window position.  If we're drawing to a FBO | ||||
|     * (ctx->DrawBuffer->Name != 0), then our native pixel coordinate | ||||
|     * system works just fine, and there's no window system to | ||||
|     * worry about. | ||||
|     */ | ||||
|    if (brw->intel.ctx.DrawBuffer->Name == 0) { | ||||
|       bpso.bits0.x_offset = (32 - (dPriv->x & 31)) & 31; | ||||
|       bpso.bits0.y_offset = (32 - ((dPriv->y + dPriv->h) & 31)) & 31; | ||||
|    } | ||||
|    else { | ||||
|       bpso.bits0.y_offset = 0; | ||||
|       bpso.bits0.x_offset = 0; | ||||
|    } | ||||
|  | ||||
|    BRW_CACHED_BATCH_STRUCT(brw, &bpso); | ||||
| } | ||||
| @@ -370,6 +396,7 @@ const struct brw_tracked_state brw_aa_line_parameters = { | ||||
|  | ||||
| static void upload_line_stipple(struct brw_context *brw) | ||||
| { | ||||
|    GLcontext *ctx = &brw->intel.ctx; | ||||
|    struct brw_line_stipple bls; | ||||
|    GLfloat tmp; | ||||
|    GLint tmpi; | ||||
| @@ -378,10 +405,10 @@ static void upload_line_stipple(struct brw_context *brw) | ||||
|    bls.header.opcode = CMD_LINE_STIPPLE_PATTERN; | ||||
|    bls.header.length = sizeof(bls)/4 - 2; | ||||
|  | ||||
|    bls.bits0.pattern = brw->attribs.Line->StipplePattern; | ||||
|    bls.bits1.repeat_count = brw->attribs.Line->StippleFactor; | ||||
|    bls.bits0.pattern = ctx->Line.StipplePattern; | ||||
|    bls.bits1.repeat_count = ctx->Line.StippleFactor; | ||||
|  | ||||
|    tmp = 1.0 / (GLfloat) brw->attribs.Line->StippleFactor; | ||||
|    tmp = 1.0 / (GLfloat) ctx->Line.StippleFactor; | ||||
|    tmpi = tmp * (1<<13); | ||||
|  | ||||
|  | ||||
|   | ||||
| @@ -46,6 +46,7 @@ | ||||
| static void compile_sf_prog( struct brw_context *brw, | ||||
| 			     struct brw_sf_prog_key *key ) | ||||
| { | ||||
|    GLcontext *ctx = &brw->intel.ctx; | ||||
|    struct brw_sf_compile c; | ||||
|    const GLuint *program; | ||||
|    GLuint program_size; | ||||
| @@ -74,7 +75,7 @@ static void compile_sf_prog( struct brw_context *brw, | ||||
| 	 c.idx_to_attr[idx] = i; | ||||
| 	 if (i >= VERT_RESULT_TEX0 && i <= VERT_RESULT_TEX7) { | ||||
|             c.point_attrs[i].CoordReplace =  | ||||
|                brw->attribs.Point->CoordReplace[i - VERT_RESULT_TEX0]; | ||||
|                ctx->Point.CoordReplace[i - VERT_RESULT_TEX0]; | ||||
| 	 } | ||||
|          else { | ||||
|             c.point_attrs[i].CoordReplace = GL_FALSE; | ||||
| @@ -128,6 +129,7 @@ static void compile_sf_prog( struct brw_context *brw, | ||||
|  */ | ||||
| static void upload_sf_prog(struct brw_context *brw) | ||||
| { | ||||
|    GLcontext *ctx = &brw->intel.ctx; | ||||
|    struct brw_sf_prog_key key; | ||||
|  | ||||
|    memset(&key, 0, sizeof(key)); | ||||
| @@ -158,15 +160,21 @@ static void upload_sf_prog(struct brw_context *brw) | ||||
|       break; | ||||
|    } | ||||
|  | ||||
|    key.do_point_sprite = brw->attribs.Point->PointSprite; | ||||
|    key.SpriteOrigin = brw->attribs.Point->SpriteOrigin; | ||||
|    key.do_point_sprite = ctx->Point.PointSprite; | ||||
|    key.SpriteOrigin = ctx->Point.SpriteOrigin; | ||||
|    /* _NEW_LIGHT */ | ||||
|    key.do_flat_shading = (brw->attribs.Light->ShadeModel == GL_FLAT); | ||||
|    key.do_twoside_color = (brw->attribs.Light->Enabled && brw->attribs.Light->Model.TwoSide); | ||||
|    key.do_flat_shading = (ctx->Light.ShadeModel == GL_FLAT); | ||||
|    key.do_twoside_color = (ctx->Light.Enabled && ctx->Light.Model.TwoSide); | ||||
|  | ||||
|    /* _NEW_POLYGON */ | ||||
|    if (key.do_twoside_color) | ||||
|       key.frontface_ccw = (brw->attribs.Polygon->FrontFace == GL_CCW); | ||||
|    if (key.do_twoside_color) { | ||||
|       /* If we're rendering to a FBO, we have to invert the polygon | ||||
|        * face orientation, just as we invert the viewport in | ||||
|        * sf_unit_create_from_key().  ctx->DrawBuffer->Name will be | ||||
|        * nonzero if we're rendering to such an FBO. | ||||
|        */ | ||||
|       key.frontface_ccw = (ctx->Polygon.FrontFace == GL_CCW) ^ (ctx->DrawBuffer->Name != 0); | ||||
|    } | ||||
|  | ||||
|    dri_bo_unreference(brw->sf.prog_bo); | ||||
|    brw->sf.prog_bo = brw_search_cache(&brw->cache, BRW_SF_PROG, | ||||
|   | ||||
| @@ -59,37 +59,6 @@ static GLboolean have_attr(struct brw_sf_compile *c, | ||||
|    return (c->key.attrs & (1<<attr)) ? 1 : 0; | ||||
| } | ||||
|  | ||||
| /** | ||||
|  * Sets VERT_RESULT_FOGC.Y  for gl_FrontFacing | ||||
|  * | ||||
|  * This is currently executed if the fragment program uses VERT_RESULT_FOGC | ||||
|  * at all, but this could be eliminated with a scan of the FP contents. | ||||
|  */ | ||||
| static void | ||||
| do_front_facing( struct brw_sf_compile *c ) | ||||
| { | ||||
|    struct brw_compile *p = &c->func;  | ||||
|    int i; | ||||
|  | ||||
|    if (!have_attr(c, VERT_RESULT_FOGC)) | ||||
|       return; | ||||
|  | ||||
|    brw_push_insn_state(p); | ||||
|    brw_CMP(p, brw_null_reg(),  | ||||
|         c->key.frontface_ccw ? BRW_CONDITIONAL_G : BRW_CONDITIONAL_L, | ||||
|         c->det, brw_imm_f(0)); | ||||
|    brw_set_predicate_control(p, BRW_PREDICATE_NONE); | ||||
|    for (i = 0; i < 3; i++) { | ||||
|        struct brw_reg fogc = get_vert_attr(c, c->vert[i],FRAG_ATTRIB_FOGC); | ||||
|        brw_MOV(p, get_element(fogc, 1), brw_imm_f(0)); | ||||
|        brw_set_predicate_control(p, BRW_PREDICATE_NORMAL); | ||||
|        brw_MOV(p, get_element(fogc, 1), brw_imm_f(1)); | ||||
|        brw_set_predicate_control(p, BRW_PREDICATE_NONE); | ||||
|    } | ||||
|    brw_pop_insn_state(p); | ||||
| } | ||||
|  | ||||
| 			  | ||||
| /***********************************************************************  | ||||
|  * Twoside lighting | ||||
|  */ | ||||
| @@ -384,7 +353,6 @@ void brw_emit_tri_setup( struct brw_sf_compile *c, GLboolean allocate) | ||||
|  | ||||
|    invert_det(c); | ||||
|    copy_z_inv_w(c); | ||||
|    do_front_facing(c); | ||||
|  | ||||
|    if (c->key.do_twoside_color)  | ||||
|       do_twoside_color(c); | ||||
|   | ||||
| @@ -43,10 +43,11 @@ static void upload_sf_vp(struct brw_context *brw) | ||||
|    const GLfloat depth_scale = 1.0F / ctx->DrawBuffer->_DepthMaxF; | ||||
|    struct brw_sf_viewport sfv; | ||||
|    GLfloat y_scale, y_bias; | ||||
|    const GLboolean render_to_fbo = (ctx->DrawBuffer->Name != 0); | ||||
|  | ||||
|    memset(&sfv, 0, sizeof(sfv)); | ||||
|  | ||||
|    if (intel_rendering_to_texture(ctx)) { | ||||
|    if (render_to_fbo) { | ||||
|       y_scale = 1.0; | ||||
|       y_bias = 0; | ||||
|    } | ||||
| @@ -55,25 +56,16 @@ static void upload_sf_vp(struct brw_context *brw) | ||||
|       y_bias = ctx->DrawBuffer->Height; | ||||
|    } | ||||
|  | ||||
|    /* _NEW_VIEWPORT, BRW_NEW_METAOPS */ | ||||
|    /* _NEW_VIEWPORT */ | ||||
|  | ||||
|    if (!brw->metaops.active) { | ||||
|       const GLfloat *v = ctx->Viewport._WindowMap.m; | ||||
|    const GLfloat *v = ctx->Viewport._WindowMap.m; | ||||
|  | ||||
|       sfv.viewport.m00 = v[MAT_SX]; | ||||
|       sfv.viewport.m11 = v[MAT_SY] * y_scale; | ||||
|       sfv.viewport.m22 = v[MAT_SZ] * depth_scale; | ||||
|       sfv.viewport.m30 = v[MAT_TX]; | ||||
|       sfv.viewport.m31 = v[MAT_TY] * y_scale + y_bias; | ||||
|       sfv.viewport.m32 = v[MAT_TZ] * depth_scale; | ||||
|    } else { | ||||
|       sfv.viewport.m00 =   1; | ||||
|       sfv.viewport.m11 = - 1; | ||||
|       sfv.viewport.m22 =   1; | ||||
|       sfv.viewport.m30 =   0; | ||||
|       sfv.viewport.m31 =   ctx->DrawBuffer->Height; | ||||
|       sfv.viewport.m32 =   0; | ||||
|    } | ||||
|    sfv.viewport.m00 = v[MAT_SX]; | ||||
|    sfv.viewport.m11 = v[MAT_SY] * y_scale; | ||||
|    sfv.viewport.m22 = v[MAT_SZ] * depth_scale; | ||||
|    sfv.viewport.m30 = v[MAT_TX]; | ||||
|    sfv.viewport.m31 = v[MAT_TY] * y_scale + y_bias; | ||||
|    sfv.viewport.m32 = v[MAT_TZ] * depth_scale; | ||||
|  | ||||
|    /* _NEW_SCISSOR */ | ||||
|  | ||||
| @@ -84,10 +76,20 @@ static void upload_sf_vp(struct brw_context *brw) | ||||
|     * Note that the hardware's coordinates are inclusive, while Mesa's min is | ||||
|     * inclusive but max is exclusive. | ||||
|     */ | ||||
|    sfv.scissor.xmin = ctx->DrawBuffer->_Xmin; | ||||
|    sfv.scissor.xmax = ctx->DrawBuffer->_Xmax - 1; | ||||
|    sfv.scissor.ymin = ctx->DrawBuffer->Height - ctx->DrawBuffer->_Ymax; | ||||
|    sfv.scissor.ymax = ctx->DrawBuffer->Height - ctx->DrawBuffer->_Ymin - 1; | ||||
|    if (render_to_fbo) { | ||||
|       /* texmemory: Y=0=bottom */ | ||||
|       sfv.scissor.xmin = ctx->DrawBuffer->_Xmin; | ||||
|       sfv.scissor.xmax = ctx->DrawBuffer->_Xmax - 1; | ||||
|       sfv.scissor.ymin = ctx->DrawBuffer->_Ymin; | ||||
|       sfv.scissor.ymax = ctx->DrawBuffer->_Ymax - 1; | ||||
|    } | ||||
|    else { | ||||
|       /* memory: Y=0=top */ | ||||
|       sfv.scissor.xmin = ctx->DrawBuffer->_Xmin; | ||||
|       sfv.scissor.xmax = ctx->DrawBuffer->_Xmax - 1; | ||||
|       sfv.scissor.ymin = ctx->DrawBuffer->Height - ctx->DrawBuffer->_Ymax; | ||||
|       sfv.scissor.ymax = ctx->DrawBuffer->Height - ctx->DrawBuffer->_Ymin - 1; | ||||
|    } | ||||
|  | ||||
|    dri_bo_unreference(brw->sf.vp_bo); | ||||
|    brw->sf.vp_bo = brw_cache_data( &brw->cache, BRW_SF_VP, &sfv, NULL, 0 ); | ||||
| @@ -97,7 +99,7 @@ const struct brw_tracked_state brw_sf_vp = { | ||||
|    .dirty = { | ||||
|       .mesa  = (_NEW_VIEWPORT |  | ||||
| 		_NEW_SCISSOR), | ||||
|       .brw   = BRW_NEW_METAOPS, | ||||
|       .brw   = 0, | ||||
|       .cache = 0 | ||||
|    }, | ||||
|    .prepare = upload_sf_vp | ||||
| @@ -113,12 +115,13 @@ struct brw_sf_unit_key { | ||||
|    GLboolean scissor, line_smooth, point_sprite, point_attenuated; | ||||
|    float line_width; | ||||
|    float point_size; | ||||
|    GLboolean render_to_texture; | ||||
|    GLboolean render_to_fbo; | ||||
| }; | ||||
|  | ||||
| static void | ||||
| sf_unit_populate_key(struct brw_context *brw, struct brw_sf_unit_key *key) | ||||
| { | ||||
|    GLcontext *ctx = &brw->intel.ctx; | ||||
|    memset(key, 0, sizeof(*key)); | ||||
|  | ||||
|    /* CACHE_NEW_SF_PROG */ | ||||
| @@ -130,22 +133,22 @@ sf_unit_populate_key(struct brw_context *brw, struct brw_sf_unit_key *key) | ||||
|    key->urb_size = brw->urb.vsize; | ||||
|    key->sfsize = brw->urb.sfsize; | ||||
|  | ||||
|    key->scissor = brw->attribs.Scissor->Enabled; | ||||
|    key->front_face = brw->attribs.Polygon->FrontFace; | ||||
|    key->scissor = ctx->Scissor.Enabled; | ||||
|    key->front_face = ctx->Polygon.FrontFace; | ||||
|  | ||||
|    if (brw->attribs.Polygon->CullFlag) | ||||
|       key->cull_face = brw->attribs.Polygon->CullFaceMode; | ||||
|    if (ctx->Polygon.CullFlag) | ||||
|       key->cull_face = ctx->Polygon.CullFaceMode; | ||||
|    else | ||||
|       key->cull_face = GL_NONE; | ||||
|  | ||||
|    key->line_width = brw->attribs.Line->Width; | ||||
|    key->line_smooth = brw->attribs.Line->SmoothFlag; | ||||
|    key->line_width = ctx->Line.Width; | ||||
|    key->line_smooth = ctx->Line.SmoothFlag; | ||||
|  | ||||
|    key->point_sprite = brw->attribs.Point->PointSprite; | ||||
|    key->point_size = brw->attribs.Point->Size; | ||||
|    key->point_attenuated = brw->attribs.Point->_Attenuated; | ||||
|    key->point_sprite = ctx->Point.PointSprite; | ||||
|    key->point_size = ctx->Point.Size; | ||||
|    key->point_attenuated = ctx->Point._Attenuated; | ||||
|  | ||||
|    key->render_to_texture = intel_rendering_to_texture(&brw->intel.ctx); | ||||
|    key->render_to_fbo = brw->intel.ctx.DrawBuffer->Name != 0; | ||||
| } | ||||
|  | ||||
| static dri_bo * | ||||
| @@ -192,10 +195,10 @@ sf_unit_create_from_key(struct brw_context *brw, struct brw_sf_unit_key *key, | ||||
|    else | ||||
|       sf.sf5.front_winding = BRW_FRONTWINDING_CW; | ||||
|  | ||||
|    /* The viewport is inverted for rendering to texture, and that inverts | ||||
|    /* The viewport is inverted for rendering to a FBO, and that inverts | ||||
|     * polygon front/back orientation. | ||||
|     */ | ||||
|    sf.sf5.front_winding ^= key->render_to_texture; | ||||
|    sf.sf5.front_winding ^= key->render_to_fbo; | ||||
|  | ||||
|    switch (key->cull_face) { | ||||
|    case GL_FRONT: | ||||
| @@ -295,8 +298,7 @@ const struct brw_tracked_state brw_sf_unit = { | ||||
| 		_NEW_LINE |  | ||||
| 		_NEW_POINT |  | ||||
| 		_NEW_SCISSOR), | ||||
|       .brw   = (BRW_NEW_URB_FENCE | | ||||
| 		BRW_NEW_METAOPS), | ||||
|       .brw   = BRW_NEW_URB_FENCE, | ||||
|       .cache = (CACHE_NEW_SF_VP | | ||||
| 		CACHE_NEW_SF_PROG) | ||||
|    }, | ||||
|   | ||||
| @@ -233,7 +233,6 @@ static struct dirty_bit_map brw_bits[] = { | ||||
|    DEFINE_BIT(BRW_NEW_WM_INPUT_DIMENSIONS), | ||||
|    DEFINE_BIT(BRW_NEW_INPUT_VARYING), | ||||
|    DEFINE_BIT(BRW_NEW_PSP), | ||||
|    DEFINE_BIT(BRW_NEW_METAOPS), | ||||
|    DEFINE_BIT(BRW_NEW_FENCE), | ||||
|    DEFINE_BIT(BRW_NEW_INDICES), | ||||
|    DEFINE_BIT(BRW_NEW_VERTICES), | ||||
| @@ -298,6 +297,7 @@ brw_print_dirty_count(struct dirty_bit_map *bit_map, int32_t bits) | ||||
|  */ | ||||
| void brw_validate_state( struct brw_context *brw ) | ||||
| { | ||||
|    GLcontext *ctx = &brw->intel.ctx; | ||||
|    struct intel_context *intel = &brw->intel; | ||||
|    struct brw_state_flags *state = &brw->state.dirty; | ||||
|    GLuint i; | ||||
| @@ -314,13 +314,13 @@ void brw_validate_state( struct brw_context *brw ) | ||||
|       state->brw |= ~0; | ||||
|    } | ||||
|  | ||||
|    if (brw->fragment_program != brw->attribs.FragmentProgram->_Current) { | ||||
|       brw->fragment_program = brw->attribs.FragmentProgram->_Current; | ||||
|    if (brw->fragment_program != ctx->FragmentProgram._Current) { | ||||
|       brw->fragment_program = ctx->FragmentProgram._Current; | ||||
|       brw->state.dirty.brw |= BRW_NEW_FRAGMENT_PROGRAM; | ||||
|    } | ||||
|  | ||||
|    if (brw->vertex_program != brw->attribs.VertexProgram->_Current) { | ||||
|       brw->vertex_program = brw->attribs.VertexProgram->_Current; | ||||
|    if (brw->vertex_program != ctx->VertexProgram._Current) { | ||||
|       brw->vertex_program = ctx->VertexProgram._Current; | ||||
|       brw->state.dirty.brw |= BRW_NEW_VERTEX_PROGRAM; | ||||
|    } | ||||
|  | ||||
|   | ||||
| @@ -86,11 +86,12 @@ void brw_FrameBufferTexDestroy( struct brw_context *brw ) | ||||
|  */ | ||||
| void brw_validate_textures( struct brw_context *brw ) | ||||
| { | ||||
|    GLcontext *ctx = &brw->intel.ctx; | ||||
|    struct intel_context *intel = &brw->intel; | ||||
|    int i; | ||||
|  | ||||
|    for (i = 0; i < BRW_MAX_TEX_UNIT; i++) { | ||||
|       struct gl_texture_unit *texUnit = &brw->attribs.Texture->Unit[i]; | ||||
|       struct gl_texture_unit *texUnit = &ctx->Texture.Unit[i]; | ||||
|  | ||||
|       if (texUnit->_ReallyEnabled) { | ||||
| 	 intel_finalize_mipmap_tree(intel, i); | ||||
|   | ||||
| @@ -85,6 +85,7 @@ static void do_vs_prog( struct brw_context *brw, | ||||
|  | ||||
| static void brw_upload_vs_prog(struct brw_context *brw) | ||||
| { | ||||
|    GLcontext *ctx = &brw->intel.ctx; | ||||
|    struct brw_vs_prog_key key; | ||||
|    struct brw_vertex_program *vp =  | ||||
|       (struct brw_vertex_program *)brw->vertex_program; | ||||
| @@ -97,14 +98,9 @@ static void brw_upload_vs_prog(struct brw_context *brw) | ||||
|     * the inputs it asks for, whether they are varying or not. | ||||
|     */ | ||||
|    key.program_string_id = vp->id; | ||||
|    key.nr_userclip = brw_count_bits(brw->attribs.Transform->ClipPlanesEnabled); | ||||
|    key.copy_edgeflag = (brw->attribs.Polygon->FrontMode != GL_FILL || | ||||
| 			brw->attribs.Polygon->BackMode != GL_FILL); | ||||
|  | ||||
|    /* BRW_NEW_METAOPS | ||||
|     */ | ||||
|    if (brw->metaops.active) | ||||
|       key.know_w_is_one = 1; | ||||
|    key.nr_userclip = brw_count_bits(ctx->Transform.ClipPlanesEnabled); | ||||
|    key.copy_edgeflag = (ctx->Polygon.FrontMode != GL_FILL || | ||||
| 			ctx->Polygon.BackMode != GL_FILL); | ||||
|  | ||||
|    /* Make an early check for the key. | ||||
|     */ | ||||
| @@ -123,7 +119,7 @@ static void brw_upload_vs_prog(struct brw_context *brw) | ||||
| const struct brw_tracked_state brw_vs_prog = { | ||||
|    .dirty = { | ||||
|       .mesa  = _NEW_TRANSFORM | _NEW_POLYGON, | ||||
|       .brw   = BRW_NEW_VERTEX_PROGRAM | BRW_NEW_METAOPS, | ||||
|       .brw   = BRW_NEW_VERTEX_PROGRAM, | ||||
|       .cache = 0 | ||||
|    }, | ||||
|    .prepare = brw_upload_vs_prog | ||||
|   | ||||
| @@ -43,7 +43,6 @@ struct brw_vs_prog_key { | ||||
|    GLuint program_string_id; | ||||
|    GLuint nr_userclip:4; | ||||
|    GLuint copy_edgeflag:1; | ||||
|    GLuint know_w_is_one:1; | ||||
|    GLuint pad:26; | ||||
| }; | ||||
|  | ||||
|   | ||||
| @@ -168,6 +168,7 @@ static GLuint get_input_size(struct brw_context *brw, | ||||
|  */ | ||||
| static void calc_wm_input_sizes( struct brw_context *brw ) | ||||
| { | ||||
|    GLcontext *ctx = &brw->intel.ctx; | ||||
|    /* BRW_NEW_VERTEX_PROGRAM */ | ||||
|    struct brw_vertex_program *vp =  | ||||
|       (struct brw_vertex_program *)brw->vertex_program; | ||||
| @@ -179,7 +180,7 @@ static void calc_wm_input_sizes( struct brw_context *brw ) | ||||
|    memset(&t, 0, sizeof(t)); | ||||
|  | ||||
|    /* _NEW_LIGHT */ | ||||
|    if (brw->attribs.Light->Model.TwoSide) | ||||
|    if (ctx->Light.Model.TwoSide) | ||||
|       t.twoside = 1; | ||||
|  | ||||
|    for (i = 0; i < VERT_ATTRIB_MAX; i++)  | ||||
|   | ||||
| @@ -871,21 +871,15 @@ static void emit_vertex_write( struct brw_vs_compile *c) | ||||
|    } | ||||
|  | ||||
|    /* Build ndc coords */ | ||||
|    if (!c->key.know_w_is_one) { | ||||
|       ndc = get_tmp(c); | ||||
|       emit_math1(c, BRW_MATH_FUNCTION_INV, ndc, brw_swizzle1(pos, 3), BRW_MATH_PRECISION_FULL); | ||||
|       brw_MUL(p, brw_writemask(ndc, WRITEMASK_XYZ), pos, ndc); | ||||
|    } | ||||
|    else { | ||||
|       ndc = pos; | ||||
|    } | ||||
|    ndc = get_tmp(c); | ||||
|    emit_math1(c, BRW_MATH_FUNCTION_INV, ndc, brw_swizzle1(pos, 3), BRW_MATH_PRECISION_FULL); | ||||
|    brw_MUL(p, brw_writemask(ndc, WRITEMASK_XYZ), pos, ndc); | ||||
|  | ||||
|    /* Update the header for point size, user clipping flags, and -ve rhw | ||||
|     * workaround. | ||||
|     */ | ||||
|    if ((c->prog_data.outputs_written & (1<<VERT_RESULT_PSIZ)) || | ||||
|        c->key.nr_userclip || | ||||
|        (!BRW_IS_G4X(p->brw) && !c->key.know_w_is_one)) | ||||
|        c->key.nr_userclip || !BRW_IS_G4X(p->brw)) | ||||
|    { | ||||
|       struct brw_reg header1 = retype(get_tmp(c), BRW_REGISTER_TYPE_UD); | ||||
|       GLuint i; | ||||
| @@ -916,7 +910,7 @@ static void emit_vertex_write( struct brw_vs_compile *c) | ||||
|        * Later, clipping will detect ucp[6] and ensure the primitive is | ||||
|        * clipped against all fixed planes. | ||||
|        */ | ||||
|       if (!BRW_IS_G4X(p->brw) && !c->key.know_w_is_one) { | ||||
|       if (!BRW_IS_G4X(p->brw)) { | ||||
| 	 brw_CMP(p, | ||||
| 		 vec8(brw_null_reg()), | ||||
| 		 BRW_CONDITIONAL_L, | ||||
| @@ -960,36 +954,27 @@ static void emit_vertex_write( struct brw_vs_compile *c) | ||||
| } | ||||
|  | ||||
|  | ||||
| /** | ||||
|  * Called after code generation to resolve subroutine calls and the | ||||
|  * END instruction. | ||||
|  * \param end_inst  points to brw code for END instruction | ||||
|  * \param last_inst  points to last instruction emitted before vertex write | ||||
|  */ | ||||
| static void  | ||||
| post_vs_emit( struct brw_vs_compile *c, struct brw_instruction *end_inst ) | ||||
| post_vs_emit( struct brw_vs_compile *c, | ||||
|               struct brw_instruction *end_inst, | ||||
|               struct brw_instruction *last_inst ) | ||||
| { | ||||
|    GLuint nr_insns = c->vp->program.Base.NumInstructions; | ||||
|    GLuint insn, target_insn; | ||||
|    struct prog_instruction *inst1, *inst2; | ||||
|    struct brw_instruction *brw_inst1, *brw_inst2; | ||||
|    int offset; | ||||
|    for (insn = 0; insn < nr_insns; insn++) { | ||||
|        inst1 = &c->vp->program.Base.Instructions[insn]; | ||||
|        brw_inst1 = inst1->Data; | ||||
|        switch (inst1->Opcode) { | ||||
| 	   case OPCODE_CAL: | ||||
| 	   case OPCODE_BRA: | ||||
| 	       target_insn = inst1->BranchTarget; | ||||
| 	       inst2 = &c->vp->program.Base.Instructions[target_insn]; | ||||
| 	       brw_inst2 = inst2->Data; | ||||
| 	       offset = brw_inst2 - brw_inst1; | ||||
| 	       brw_set_src1(brw_inst1, brw_imm_d(offset*16)); | ||||
| 	       break; | ||||
| 	   case OPCODE_END: | ||||
| 	       offset = end_inst - brw_inst1; | ||||
| 	       brw_set_src1(brw_inst1, brw_imm_d(offset*16)); | ||||
| 	       break; | ||||
| 	   default: | ||||
| 	       break; | ||||
|        } | ||||
|    } | ||||
|    GLint offset; | ||||
|  | ||||
|    brw_resolve_cals(&c->func); | ||||
|  | ||||
|    /* patch up the END code to jump past subroutines, etc */ | ||||
|    offset = last_inst - end_inst; | ||||
|    brw_set_src1(end_inst, brw_imm_d(offset * 16)); | ||||
| } | ||||
|  | ||||
|  | ||||
| /* Emit the fragment program instructions here. | ||||
|  */ | ||||
| void brw_vs_emit(struct brw_vs_compile *c ) | ||||
| @@ -998,7 +983,8 @@ void brw_vs_emit(struct brw_vs_compile *c ) | ||||
|    struct brw_compile *p = &c->func; | ||||
|    GLuint nr_insns = c->vp->program.Base.NumInstructions; | ||||
|    GLuint insn, if_insn = 0; | ||||
|    struct brw_instruction *end_inst; | ||||
|    GLuint end_offset = 0; | ||||
|    struct brw_instruction *end_inst, *last_inst; | ||||
|    struct brw_instruction *if_inst[MAX_IFSN]; | ||||
|    struct brw_indirect stack_index = brw_indirect(0, 0);    | ||||
|  | ||||
| @@ -1041,7 +1027,6 @@ void brw_vs_emit(struct brw_vs_compile *c ) | ||||
|        | ||||
|       /* Get argument regs.  SWZ is special and does this itself. | ||||
|        */ | ||||
|       inst->Data = &p->store[p->nr_insn]; | ||||
|       if (inst->Opcode != OPCODE_SWZ) | ||||
| 	  for (i = 0; i < 3; i++) { | ||||
| 	      struct prog_src_register *src = &inst->SrcReg[i]; | ||||
| @@ -1209,7 +1194,7 @@ void brw_vs_emit(struct brw_vs_compile *c ) | ||||
| 	 brw_set_access_mode(p, BRW_ALIGN_16); | ||||
| 	 brw_ADD(p, get_addr_reg(stack_index), | ||||
| 			 get_addr_reg(stack_index), brw_imm_d(4)); | ||||
| 	 inst->Data = &p->store[p->nr_insn]; | ||||
|          brw_save_call(p, inst->Comment, p->nr_insn); | ||||
| 	 brw_ADD(p, brw_ip_reg(), brw_ip_reg(), brw_imm_d(1*16)); | ||||
|          break; | ||||
|       case OPCODE_RET: | ||||
| @@ -1218,14 +1203,23 @@ void brw_vs_emit(struct brw_vs_compile *c ) | ||||
| 	 brw_set_access_mode(p, BRW_ALIGN_1); | ||||
|          brw_MOV(p, brw_ip_reg(), deref_1d(stack_index, 0)); | ||||
| 	 brw_set_access_mode(p, BRW_ALIGN_16); | ||||
| 	 break; | ||||
|       case OPCODE_END:	 | ||||
|          end_offset = p->nr_insn; | ||||
|          /* this instruction will get patched later to jump past subroutine | ||||
|           * code, etc. | ||||
|           */ | ||||
|          brw_ADD(p, brw_ip_reg(), brw_ip_reg(), brw_imm_d(1*16)); | ||||
|          break; | ||||
|       case OPCODE_PRINT: | ||||
|          /* no-op */ | ||||
|          break; | ||||
|       case OPCODE_BGNSUB: | ||||
|          brw_save_label(p, inst->Comment, p->nr_insn); | ||||
|          break; | ||||
|       case OPCODE_ENDSUB: | ||||
|          /* no-op instructions */ | ||||
| 	 break; | ||||
|          /* no-op */ | ||||
|          break; | ||||
|       default: | ||||
| 	 _mesa_problem(NULL, "Unsupported opcode %i (%s) in vertex shader", | ||||
|                        inst->Opcode, inst->Opcode < MAX_OPCODE ? | ||||
| @@ -1263,9 +1257,11 @@ void brw_vs_emit(struct brw_vs_compile *c ) | ||||
|       release_tmps(c); | ||||
|    } | ||||
|  | ||||
|    end_inst = &p->store[p->nr_insn]; | ||||
|    end_inst = &p->store[end_offset]; | ||||
|    last_inst = &p->store[p->nr_insn]; | ||||
|  | ||||
|    /* The END instruction will be patched to jump to this code */ | ||||
|    emit_vertex_write(c); | ||||
|    post_vs_emit(c, end_inst); | ||||
|    for (insn = 0; insn < nr_insns; insn++) | ||||
|        c->vp->program.Base.Instructions[insn].Data = NULL; | ||||
|  | ||||
|    post_vs_emit(c, end_inst, last_inst); | ||||
| } | ||||
|   | ||||
| @@ -49,6 +49,8 @@ struct brw_vs_unit_key { | ||||
| static void | ||||
| vs_unit_populate_key(struct brw_context *brw, struct brw_vs_unit_key *key) | ||||
| { | ||||
|    GLcontext *ctx = &brw->intel.ctx; | ||||
|  | ||||
|    memset(key, 0, sizeof(*key)); | ||||
|  | ||||
|    /* CACHE_NEW_VS_PROG */ | ||||
| @@ -61,7 +63,7 @@ vs_unit_populate_key(struct brw_context *brw, struct brw_vs_unit_key *key) | ||||
|    key->urb_size = brw->urb.vsize; | ||||
|  | ||||
|    /* BRW_NEW_CURBE_OFFSETS, _NEW_TRANSFORM */ | ||||
|    if (brw->attribs.Transform->ClipPlanesEnabled) { | ||||
|    if (ctx->Transform.ClipPlanesEnabled) { | ||||
|       /* Note that we read in the userclip planes as well, hence | ||||
|        * clip_start: | ||||
|        */ | ||||
|   | ||||
| @@ -65,7 +65,6 @@ static void brw_destroy_context( struct intel_context *intel ) | ||||
|    struct brw_context *brw = brw_context(&intel->ctx); | ||||
|    int i; | ||||
|  | ||||
|    brw_destroy_metaops(brw); | ||||
|    brw_destroy_state(brw); | ||||
|    brw_draw_destroy( brw ); | ||||
|  | ||||
|   | ||||
| @@ -40,6 +40,8 @@ | ||||
| GLuint brw_wm_nr_args( GLuint opcode ) | ||||
| { | ||||
|    switch (opcode) { | ||||
|    case WM_FRONTFACING: | ||||
|       return 0; | ||||
|    case WM_PIXELXY: | ||||
|    case WM_CINTERP: | ||||
|    case WM_WPOSXY: | ||||
| @@ -157,6 +159,7 @@ static void do_wm_prog( struct brw_context *brw, | ||||
| static void brw_wm_populate_key( struct brw_context *brw, | ||||
| 				 struct brw_wm_prog_key *key ) | ||||
| { | ||||
|    GLcontext *ctx = &brw->intel.ctx; | ||||
|    /* BRW_NEW_FRAGMENT_PROGRAM */ | ||||
|    struct brw_fragment_program *fp =  | ||||
|       (struct brw_fragment_program *)brw->fragment_program; | ||||
| @@ -170,51 +173,50 @@ static void brw_wm_populate_key( struct brw_context *brw, | ||||
|     */ | ||||
|    /* _NEW_COLOR */ | ||||
|    if (fp->program.UsesKill || | ||||
|        brw->attribs.Color->AlphaEnabled) | ||||
|        ctx->Color.AlphaEnabled) | ||||
|       lookup |= IZ_PS_KILL_ALPHATEST_BIT; | ||||
|  | ||||
|    if (fp->program.Base.OutputsWritten & (1<<FRAG_RESULT_DEPR)) | ||||
|       lookup |= IZ_PS_COMPUTES_DEPTH_BIT; | ||||
|  | ||||
|    /* _NEW_DEPTH */ | ||||
|    if (brw->attribs.Depth->Test) | ||||
|    if (ctx->Depth.Test) | ||||
|       lookup |= IZ_DEPTH_TEST_ENABLE_BIT; | ||||
|  | ||||
|    if (brw->attribs.Depth->Test &&   | ||||
|        brw->attribs.Depth->Mask) /* ?? */ | ||||
|    if (ctx->Depth.Test &&   | ||||
|        ctx->Depth.Mask) /* ?? */ | ||||
|       lookup |= IZ_DEPTH_WRITE_ENABLE_BIT; | ||||
|  | ||||
|    /* _NEW_STENCIL */ | ||||
|    if (brw->attribs.Stencil->Enabled) { | ||||
|    if (ctx->Stencil.Enabled) { | ||||
|       lookup |= IZ_STENCIL_TEST_ENABLE_BIT; | ||||
|  | ||||
|       if (brw->attribs.Stencil->WriteMask[0] || | ||||
| 	  (brw->attribs.Stencil->_TestTwoSide && | ||||
| 	   brw->attribs.Stencil->WriteMask[1])) | ||||
|       if (ctx->Stencil.WriteMask[0] || | ||||
| 	  ctx->Stencil.WriteMask[ctx->Stencil._BackFace]) | ||||
| 	 lookup |= IZ_STENCIL_WRITE_ENABLE_BIT; | ||||
|    } | ||||
|  | ||||
|    line_aa = AA_NEVER; | ||||
|  | ||||
|    /* _NEW_LINE, _NEW_POLYGON, BRW_NEW_REDUCED_PRIMITIVE */ | ||||
|    if (brw->attribs.Line->SmoothFlag) { | ||||
|    if (ctx->Line.SmoothFlag) { | ||||
|       if (brw->intel.reduced_primitive == GL_LINES) { | ||||
| 	 line_aa = AA_ALWAYS; | ||||
|       } | ||||
|       else if (brw->intel.reduced_primitive == GL_TRIANGLES) { | ||||
| 	 if (brw->attribs.Polygon->FrontMode == GL_LINE) { | ||||
| 	 if (ctx->Polygon.FrontMode == GL_LINE) { | ||||
| 	    line_aa = AA_SOMETIMES; | ||||
|  | ||||
| 	    if (brw->attribs.Polygon->BackMode == GL_LINE || | ||||
| 		(brw->attribs.Polygon->CullFlag && | ||||
| 		 brw->attribs.Polygon->CullFaceMode == GL_BACK)) | ||||
| 	    if (ctx->Polygon.BackMode == GL_LINE || | ||||
| 		(ctx->Polygon.CullFlag && | ||||
| 		 ctx->Polygon.CullFaceMode == GL_BACK)) | ||||
| 	       line_aa = AA_ALWAYS; | ||||
| 	 } | ||||
| 	 else if (brw->attribs.Polygon->BackMode == GL_LINE) { | ||||
| 	 else if (ctx->Polygon.BackMode == GL_LINE) { | ||||
| 	    line_aa = AA_SOMETIMES; | ||||
|  | ||||
| 	    if ((brw->attribs.Polygon->CullFlag && | ||||
| 		 brw->attribs.Polygon->CullFaceMode == GL_FRONT)) | ||||
| 	    if ((ctx->Polygon.CullFlag && | ||||
| 		 ctx->Polygon.CullFaceMode == GL_FRONT)) | ||||
| 	       line_aa = AA_ALWAYS; | ||||
| 	 } | ||||
|       } | ||||
| @@ -229,19 +231,19 @@ static void brw_wm_populate_key( struct brw_context *brw, | ||||
|    key->projtex_mask = brw->wm.input_size_masks[4-1] >> (FRAG_ATTRIB_TEX0 - FRAG_ATTRIB_WPOS);  | ||||
|  | ||||
|    /* _NEW_LIGHT */ | ||||
|    key->flat_shade = (brw->attribs.Light->ShadeModel == GL_FLAT); | ||||
|    key->flat_shade = (ctx->Light.ShadeModel == GL_FLAT); | ||||
|  | ||||
|    /* _NEW_TEXTURE */ | ||||
|    for (i = 0; i < BRW_MAX_TEX_UNIT; i++) { | ||||
|       const struct gl_texture_unit *unit = &brw->attribs.Texture->Unit[i]; | ||||
|       const struct gl_texture_object *t = unit->_Current; | ||||
|       const struct gl_texture_unit *unit = &ctx->Texture.Unit[i]; | ||||
|  | ||||
|       if (unit->_ReallyEnabled) { | ||||
| 	 if (t->Image[0][t->BaseLevel]->InternalFormat == GL_YCBCR_MESA) { | ||||
| 	    key->yuvtex_mask |= 1<<i; | ||||
| 	    if (t->Image[0][t->BaseLevel]->TexFormat->MesaFormat ==  | ||||
| 		    MESA_FORMAT_YCBCR) | ||||
| 		key->yuvtex_swap_mask |= 1<< i; | ||||
|          const struct gl_texture_object *t = unit->_Current; | ||||
|          const struct gl_texture_image *img = t->Image[0][t->BaseLevel]; | ||||
| 	 if (img->InternalFormat == GL_YCBCR_MESA) { | ||||
| 	    key->yuvtex_mask |= 1 << i; | ||||
| 	    if (img->TexFormat->MesaFormat == MESA_FORMAT_YCBCR) | ||||
| 		key->yuvtex_swap_mask |= 1 << i; | ||||
| 	 } | ||||
|       } | ||||
|    } | ||||
|   | ||||
| @@ -60,16 +60,16 @@ struct brw_wm_prog_key { | ||||
|    GLuint aa_dest_stencil_reg:3; | ||||
|    GLuint dest_depth_reg:3; | ||||
|    GLuint nr_depth_regs:3; | ||||
|    GLuint projtex_mask:8; | ||||
|    GLuint shadowtex_mask:8; | ||||
|    GLuint computes_depth:1;	/* could be derived from program string */ | ||||
|    GLuint source_depth_to_render_target:1; | ||||
|    GLuint flat_shade:1; | ||||
|    GLuint runtime_check_aads_emit:1; | ||||
|     | ||||
|    GLuint yuvtex_mask:8; | ||||
|    GLuint yuvtex_swap_mask:8;	/* UV swaped */ | ||||
|    GLuint pad1:16; | ||||
|    GLuint projtex_mask:16; | ||||
|    GLuint shadowtex_mask:16; | ||||
|    GLuint yuvtex_mask:16; | ||||
|    GLuint yuvtex_swap_mask:16;	/* UV swaped */ | ||||
|    //   GLuint pad1:16; | ||||
|  | ||||
|    GLuint program_string_id:32; | ||||
|    GLuint origin_x, origin_y; | ||||
| @@ -172,7 +172,8 @@ struct brw_wm_instruction { | ||||
| #define WM_CINTERP        (MAX_OPCODE + 5) | ||||
| #define WM_WPOSXY         (MAX_OPCODE + 6) | ||||
| #define WM_FB_WRITE       (MAX_OPCODE + 7) | ||||
| #define MAX_WM_OPCODE     (MAX_OPCODE + 8) | ||||
| #define WM_FRONTFACING    (MAX_OPCODE + 8) | ||||
| #define MAX_WM_OPCODE     (MAX_OPCODE + 9) | ||||
|  | ||||
| #define PROGRAM_PAYLOAD   (PROGRAM_FILE_MAX) | ||||
| #define PAYLOAD_DEPTH     (FRAG_ATTRIB_MAX) | ||||
| @@ -280,4 +281,6 @@ void brw_wm_lookup_iz( GLuint line_aa, | ||||
|  | ||||
| GLboolean brw_wm_is_glsl(const struct gl_fragment_program *fp); | ||||
| void brw_wm_glsl_emit(struct brw_context *brw, struct brw_wm_compile *c); | ||||
|  | ||||
|  | ||||
| #endif | ||||
|   | ||||
| @@ -130,6 +130,9 @@ void brw_wm_print_insn( struct brw_wm_compile *c, | ||||
|    case WM_FB_WRITE: | ||||
|       _mesa_printf(" = FB_WRITE"); | ||||
|       break; | ||||
|    case WM_FRONTFACING: | ||||
|       _mesa_printf(" = FRONTFACING"); | ||||
|       break; | ||||
|    default: | ||||
|       _mesa_printf(" = %s", _mesa_opcode_string(inst->opcode)); | ||||
|       break; | ||||
|   | ||||
| @@ -254,6 +254,34 @@ static void emit_cinterp( struct brw_compile *p, | ||||
|    } | ||||
| } | ||||
|  | ||||
| /* Sets the destination channels to 1.0 or 0.0 according to glFrontFacing. */ | ||||
| static void emit_frontfacing( struct brw_compile *p, | ||||
| 			      const struct brw_reg *dst, | ||||
| 			      GLuint mask ) | ||||
| { | ||||
|    struct brw_reg r1_6ud = retype(brw_vec1_grf(1, 6), BRW_REGISTER_TYPE_UD); | ||||
|    GLuint i; | ||||
|  | ||||
|    if (!(mask & WRITEMASK_XYZW)) | ||||
|       return; | ||||
|  | ||||
|    for (i = 0; i < 4; i++) { | ||||
|       if (mask & (1<<i)) { | ||||
| 	 brw_MOV(p, dst[i], brw_imm_f(0.0)); | ||||
|       } | ||||
|    } | ||||
|  | ||||
|    /* bit 31 is "primitive is back face", so checking < (1 << 31) gives | ||||
|     * us front face | ||||
|     */ | ||||
|    brw_CMP(p, brw_null_reg(), BRW_CONDITIONAL_L, r1_6ud, brw_imm_ud(1 << 31)); | ||||
|    for (i = 0; i < 4; i++) { | ||||
|       if (mask & (1<<i)) { | ||||
| 	 brw_MOV(p, dst[i], brw_imm_f(1.0)); | ||||
|       } | ||||
|    } | ||||
|    brw_set_predicate_control_flag_value(p, 0xff); | ||||
| } | ||||
|  | ||||
| static void emit_alu1( struct brw_compile *p,  | ||||
| 		       struct brw_instruction *(*func)(struct brw_compile *,  | ||||
| @@ -1158,6 +1186,10 @@ void brw_wm_emit( struct brw_wm_compile *c ) | ||||
| 	 emit_fb_write(c, args[0], args[1], args[2], inst->target, inst->eot); | ||||
| 	 break; | ||||
|  | ||||
|       case WM_FRONTFACING: | ||||
| 	 emit_frontfacing(p, dst, dst_flags); | ||||
| 	 break; | ||||
|  | ||||
| 	 /* Straightforward arithmetic: | ||||
| 	  */ | ||||
|       case OPCODE_ADD: | ||||
|   | ||||
| @@ -58,7 +58,8 @@ static const char *wm_opcode_strings[] = { | ||||
|    "PINTERP", | ||||
|    "CINTERP", | ||||
|    "WPOSXY", | ||||
|    "FB_WRITE" | ||||
|    "FB_WRITE", | ||||
|    "FRONTFACING", | ||||
| }; | ||||
|  | ||||
| #if 0 | ||||
| @@ -123,7 +124,7 @@ static struct prog_dst_register dst_reg(GLuint file, GLuint idx) | ||||
|    reg.Index = idx; | ||||
|    reg.WriteMask = WRITEMASK_XYZW; | ||||
|    reg.RelAddr = 0; | ||||
|    reg.CondMask = 0; | ||||
|    reg.CondMask = COND_TR; | ||||
|    reg.CondSwizzle = 0; | ||||
|    reg.CondSrc = 0; | ||||
|    reg.pad = 0; | ||||
| @@ -177,11 +178,10 @@ static struct prog_instruction *emit_insn(struct brw_wm_compile *c, | ||||
| { | ||||
|    struct prog_instruction *inst = get_fp_inst(c); | ||||
|    *inst = *inst0; | ||||
|    inst->Data = (void *)inst0; | ||||
|    return inst; | ||||
| } | ||||
|  | ||||
| static struct prog_instruction * emit_op(struct brw_wm_compile *c, | ||||
| static struct prog_instruction * emit_tex_op(struct brw_wm_compile *c, | ||||
| 				       GLuint op, | ||||
| 				       struct prog_dst_register dest, | ||||
| 				       GLuint saturate, | ||||
| @@ -207,6 +207,20 @@ static struct prog_instruction * emit_op(struct brw_wm_compile *c, | ||||
| } | ||||
|     | ||||
|  | ||||
| static struct prog_instruction * emit_op(struct brw_wm_compile *c, | ||||
| 				       GLuint op, | ||||
| 				       struct prog_dst_register dest, | ||||
| 				       GLuint saturate, | ||||
| 				       struct prog_src_register src0, | ||||
| 				       struct prog_src_register src1, | ||||
| 				       struct prog_src_register src2 ) | ||||
| { | ||||
|    return emit_tex_op(c, op, dest, saturate, | ||||
|                       0, 0,  /* tex unit, target */ | ||||
|                       src0, src1, src2); | ||||
| } | ||||
|     | ||||
|  | ||||
|  | ||||
|  | ||||
| /*********************************************************************** | ||||
| @@ -228,7 +242,7 @@ static struct prog_src_register get_pixel_xy( struct brw_wm_compile *c ) | ||||
|       emit_op(c, | ||||
| 	      WM_PIXELXY, | ||||
| 	      dst_mask(pixel_xy, WRITEMASK_XY), | ||||
| 	      0, 0, 0, | ||||
| 	      0, | ||||
| 	      payload_r0_depth, | ||||
| 	      src_undef(), | ||||
| 	      src_undef()); | ||||
| @@ -251,7 +265,7 @@ static struct prog_src_register get_delta_xy( struct brw_wm_compile *c ) | ||||
|       emit_op(c, | ||||
| 	      WM_DELTAXY, | ||||
| 	      dst_mask(delta_xy, WRITEMASK_XY), | ||||
| 	      0, 0, 0, | ||||
| 	      0, | ||||
| 	      pixel_xy,  | ||||
| 	      payload_r0_depth, | ||||
| 	      src_undef()); | ||||
| @@ -275,7 +289,7 @@ static struct prog_src_register get_pixel_w( struct brw_wm_compile *c ) | ||||
|       emit_op(c, | ||||
| 	      WM_PIXELW, | ||||
| 	      dst_mask(pixel_w, WRITEMASK_W), | ||||
| 	      0, 0, 0, | ||||
| 	      0, | ||||
| 	      interp_wpos, | ||||
| 	      deltas,  | ||||
| 	      src_undef()); | ||||
| @@ -293,24 +307,19 @@ static void emit_interp( struct brw_wm_compile *c, | ||||
|    struct prog_dst_register dst = dst_reg(PROGRAM_INPUT, idx); | ||||
|    struct prog_src_register interp = src_reg(PROGRAM_PAYLOAD, idx); | ||||
|    struct prog_src_register deltas = get_delta_xy(c); | ||||
|    struct prog_src_register arg2; | ||||
|    GLuint opcode; | ||||
|     | ||||
|  | ||||
|    /* Need to use PINTERP on attributes which have been | ||||
|     * multiplied by 1/W in the SF program, and LINTERP on those | ||||
|     * which have not: | ||||
|     */ | ||||
|    switch (idx) { | ||||
|    case FRAG_ATTRIB_WPOS: | ||||
|       opcode = WM_LINTERP; | ||||
|       arg2 = src_undef(); | ||||
|  | ||||
|       /* Have to treat wpos.xy specially: | ||||
|        */ | ||||
|       emit_op(c, | ||||
| 	      WM_WPOSXY, | ||||
| 	      dst_mask(dst, WRITEMASK_XY), | ||||
| 	      0, 0, 0, | ||||
| 	      0, | ||||
| 	      get_pixel_xy(c), | ||||
| 	      src_undef(), | ||||
| 	      src_undef()); | ||||
| @@ -322,10 +331,10 @@ static void emit_interp( struct brw_wm_compile *c, | ||||
|       emit_op(c, | ||||
| 	      WM_LINTERP, | ||||
| 	      dst, | ||||
| 	      0, 0, 0, | ||||
| 	      0, | ||||
| 	      interp, | ||||
| 	      deltas, | ||||
| 	      arg2); | ||||
| 	      src_undef()); | ||||
|       break; | ||||
|    case FRAG_ATTRIB_COL0: | ||||
|    case FRAG_ATTRIB_COL1: | ||||
| @@ -333,7 +342,7 @@ static void emit_interp( struct brw_wm_compile *c, | ||||
| 	 emit_op(c, | ||||
| 		 WM_CINTERP, | ||||
| 		 dst, | ||||
| 		 0, 0, 0, | ||||
| 		 0, | ||||
| 		 interp, | ||||
| 		 src_undef(), | ||||
| 		 src_undef()); | ||||
| @@ -342,17 +351,67 @@ static void emit_interp( struct brw_wm_compile *c, | ||||
| 	 emit_op(c, | ||||
| 		 WM_LINTERP, | ||||
| 		 dst, | ||||
| 		 0, 0, 0, | ||||
| 		 0, | ||||
| 		 interp, | ||||
| 		 deltas, | ||||
| 		 src_undef()); | ||||
|       } | ||||
|       break; | ||||
|    case FRAG_ATTRIB_FOGC: | ||||
|       /* The FOGC input is really special.  When a program uses glFogFragCoord, | ||||
|        * the results returned are supposed to be (f,0,0,1).  But for Mesa GLSL, | ||||
|        * the glFrontFacing and glPointCoord values are also stashed in FOGC. | ||||
|        * So, write the interpolated fog value to X, then either 0, 1, or the | ||||
|        * stashed values to Y, Z, W.  Note that this means that | ||||
|        * glFogFragCoord.yzw can be wrong in those cases! | ||||
|        */ | ||||
|  | ||||
|       /* Interpolate the fog coordinate */ | ||||
|       emit_op(c, | ||||
| 	      WM_PINTERP, | ||||
| 	      dst_mask(dst, WRITEMASK_X), | ||||
| 	      0, | ||||
| 	      interp, | ||||
| 	      deltas, | ||||
| 	      get_pixel_w(c)); | ||||
|  | ||||
|       /* Move the front facing value into FOGC.y if it's needed. */ | ||||
|       if (c->fp->program.UsesFrontFacing) { | ||||
| 	 emit_op(c, | ||||
| 		 WM_FRONTFACING, | ||||
| 		 dst_mask(dst, WRITEMASK_Y), | ||||
| 		 0, | ||||
| 		 src_undef(), | ||||
| 		 src_undef(), | ||||
| 		 src_undef()); | ||||
|       } else { | ||||
| 	 emit_op(c, | ||||
| 		 OPCODE_MOV, | ||||
| 		 dst_mask(dst, WRITEMASK_Y), | ||||
| 		 0, | ||||
| 		 src_swizzle1(interp, SWIZZLE_ZERO), | ||||
| 		 src_undef(), | ||||
| 		 src_undef()); | ||||
|       } | ||||
|  | ||||
|       /* Should do the PointCoord thing here. */ | ||||
|       emit_op(c, | ||||
| 	      OPCODE_MOV, | ||||
| 	      dst_mask(dst, WRITEMASK_ZW), | ||||
| 	      0, | ||||
| 	      src_swizzle(interp, | ||||
| 			  SWIZZLE_ZERO, | ||||
| 			  SWIZZLE_ZERO, | ||||
| 			  SWIZZLE_ZERO, | ||||
| 			  SWIZZLE_ONE), | ||||
| 	      src_undef(), | ||||
| 	      src_undef()); | ||||
|       break; | ||||
|    default: | ||||
|       emit_op(c, | ||||
| 	      WM_PINTERP, | ||||
| 	      dst, | ||||
| 	      0, 0, 0, | ||||
| 	      0, | ||||
| 	      interp, | ||||
| 	      deltas, | ||||
| 	      get_pixel_w(c)); | ||||
| @@ -372,7 +431,7 @@ static void emit_ddx( struct brw_wm_compile *c, | ||||
|     emit_op(c, | ||||
|             OPCODE_DDX, | ||||
|             inst->DstReg, | ||||
|             0, 0, 0, | ||||
|             0, | ||||
|             interp, | ||||
|             get_pixel_w(c), | ||||
|             src_undef()); | ||||
| @@ -388,7 +447,7 @@ static void emit_ddy( struct brw_wm_compile *c, | ||||
|     emit_op(c, | ||||
|             OPCODE_DDY, | ||||
|             inst->DstReg, | ||||
|             0, 0, 0, | ||||
|             0, | ||||
|             interp, | ||||
|             get_pixel_w(c), | ||||
|             src_undef()); | ||||
| @@ -483,7 +542,7 @@ static void precalc_dst( struct brw_wm_compile *c, | ||||
|       emit_op(c, | ||||
| 	      OPCODE_MUL, | ||||
| 	      dst_mask(dst, WRITEMASK_Y), | ||||
| 	      inst->SaturateMode, 0, 0, | ||||
| 	      inst->SaturateMode, | ||||
| 	      src0, | ||||
| 	      src1, | ||||
| 	      src_undef()); | ||||
| @@ -499,7 +558,7 @@ static void precalc_dst( struct brw_wm_compile *c, | ||||
|       swz = emit_op(c, | ||||
| 		    OPCODE_SWZ, | ||||
| 		    dst_mask(dst, WRITEMASK_XZ), | ||||
| 		    inst->SaturateMode, 0, 0, | ||||
| 		    inst->SaturateMode, | ||||
| 		    src_swizzle(src0, SWIZZLE_ONE, z, z, z), | ||||
| 		    src_undef(), | ||||
| 		    src_undef()); | ||||
| @@ -512,7 +571,7 @@ static void precalc_dst( struct brw_wm_compile *c, | ||||
|       emit_op(c, | ||||
| 	      OPCODE_MOV, | ||||
| 	      dst_mask(dst, WRITEMASK_W), | ||||
| 	      inst->SaturateMode, 0, 0, | ||||
| 	      inst->SaturateMode, | ||||
| 	      src1, | ||||
| 	      src_undef(), | ||||
| 	      src_undef()); | ||||
| @@ -534,7 +593,7 @@ static void precalc_lit( struct brw_wm_compile *c, | ||||
|       swz = emit_op(c, | ||||
| 		    OPCODE_SWZ, | ||||
| 		    dst_mask(dst, WRITEMASK_XW), | ||||
| 		    0, 0, 0, | ||||
| 		    0, | ||||
| 		    src_swizzle1(src0, SWIZZLE_ONE), | ||||
| 		    src_undef(), | ||||
| 		    src_undef()); | ||||
| @@ -547,19 +606,26 @@ static void precalc_lit( struct brw_wm_compile *c, | ||||
|       emit_op(c, | ||||
| 	      OPCODE_LIT, | ||||
| 	      dst_mask(dst, WRITEMASK_YZ), | ||||
| 	      inst->SaturateMode, 0, 0, | ||||
| 	      inst->SaturateMode, | ||||
| 	      src0, | ||||
| 	      src_undef(), | ||||
| 	      src_undef()); | ||||
|    } | ||||
| } | ||||
|  | ||||
|  | ||||
| /** | ||||
|  * Some TEX instructions require extra code, cube map coordinate | ||||
|  * normalization, or coordinate scaling for RECT textures, etc. | ||||
|  * This function emits those extra instructions and the TEX | ||||
|  * instruction itself. | ||||
|  */ | ||||
| static void precalc_tex( struct brw_wm_compile *c, | ||||
| 			 const struct prog_instruction *inst ) | ||||
| { | ||||
|    struct prog_src_register coord; | ||||
|    struct prog_dst_register tmpcoord; | ||||
|    GLuint unit = c->fp->program.Base.SamplerUnits[inst->TexSrcUnit]; | ||||
|    const GLuint unit = c->fp->program.Base.SamplerUnits[inst->TexSrcUnit]; | ||||
|  | ||||
|    if (inst->TexSrcTarget == TEXTURE_CUBE_INDEX) { | ||||
|        struct prog_instruction *out; | ||||
| @@ -569,49 +635,56 @@ static void precalc_tex( struct brw_wm_compile *c, | ||||
|        struct prog_src_register tmp1src = src_reg_from_dst(tmp1); | ||||
|        struct prog_src_register src0 = inst->SrcReg[0]; | ||||
|  | ||||
|        /* find longest component of coord vector and normalize it */ | ||||
|        tmpcoord = get_temp(c); | ||||
|        coord = src_reg_from_dst(tmpcoord); | ||||
|  | ||||
|        /* tmpcoord = src0 (i.e.: coord = src0) */ | ||||
|        out = emit_op(c, OPCODE_MOV, | ||||
|                      tmpcoord, | ||||
|                      0, 0, 0, | ||||
|                      0, | ||||
|                      src0, | ||||
|                      src_undef(), | ||||
|                      src_undef()); | ||||
|        out->SrcReg[0].NegateBase = 0; | ||||
|        out->SrcReg[0].Abs = 1; | ||||
|  | ||||
|        /* tmp0 = MAX(coord.X, coord.Y) */ | ||||
|        emit_op(c, OPCODE_MAX, | ||||
|                tmp0, | ||||
|                0, 0, 0, | ||||
|                0, | ||||
|                src_swizzle1(coord, X), | ||||
|                src_swizzle1(coord, Y), | ||||
|                src_undef()); | ||||
|  | ||||
|        /* tmp1 = MAX(tmp0, coord.Z) */ | ||||
|        emit_op(c, OPCODE_MAX, | ||||
|                tmp1, | ||||
|                0, 0, 0, | ||||
|                0, | ||||
|                tmp0src, | ||||
|                src_swizzle1(coord, Z), | ||||
|                src_undef()); | ||||
|  | ||||
|        /* tmp0 = 1 / tmp1 */ | ||||
|        emit_op(c, OPCODE_RCP, | ||||
|                tmp0, | ||||
|                0, 0, 0, | ||||
|                0, | ||||
|                tmp1src, | ||||
|                src_undef(), | ||||
|                src_undef()); | ||||
|  | ||||
|        /* tmpCoord = src0 * tmp0 */ | ||||
|        emit_op(c, OPCODE_MUL, | ||||
|                tmpcoord, | ||||
|                0, 0, 0, | ||||
|                0, | ||||
|                src0, | ||||
|                tmp0src, | ||||
|                src_undef()); | ||||
|  | ||||
|        release_temp(c, tmp0); | ||||
|        release_temp(c, tmp1); | ||||
|    } else if (inst->TexSrcTarget == TEXTURE_RECT_INDEX) { | ||||
|    } | ||||
|    else if (inst->TexSrcTarget == TEXTURE_RECT_INDEX) { | ||||
|       struct prog_src_register scale =  | ||||
| 	 search_or_add_param5( c,  | ||||
| 			       STATE_INTERNAL,  | ||||
| @@ -626,7 +699,7 @@ static void precalc_tex( struct brw_wm_compile *c, | ||||
|       emit_op(c, | ||||
| 	      OPCODE_MUL, | ||||
| 	      tmpcoord, | ||||
| 	      0, 0, 0, | ||||
| 	      0, | ||||
| 	      inst->SrcReg[0], | ||||
| 	      scale, | ||||
| 	      src_undef()); | ||||
| @@ -642,19 +715,9 @@ static void precalc_tex( struct brw_wm_compile *c, | ||||
|     * conversion requires allocating a temporary variable which we | ||||
|     * don't have the facility to do that late in the compilation. | ||||
|     */ | ||||
|    if (!(c->key.yuvtex_mask & (1<<unit))) { | ||||
|       emit_op(c,  | ||||
| 	      OPCODE_TEX, | ||||
| 	      inst->DstReg, | ||||
| 	      inst->SaturateMode, | ||||
| 	      unit, | ||||
| 	      inst->TexSrcTarget, | ||||
| 	      coord, | ||||
| 	      src_undef(), | ||||
| 	      src_undef()); | ||||
|    } | ||||
|    else { | ||||
|        GLboolean  swap_uv = c->key.yuvtex_swap_mask & (1<<unit); | ||||
|    if (c->key.yuvtex_mask & (1 << unit)) { | ||||
|       /* convert ycbcr to RGBA */ | ||||
|       GLboolean  swap_uv = c->key.yuvtex_swap_mask & (1<<unit); | ||||
|  | ||||
|       /*  | ||||
| 	 CONST C0 = { -.5, -.0625,  -.5, 1.164 } | ||||
| @@ -676,22 +739,22 @@ static void precalc_tex( struct brw_wm_compile *c, | ||||
|       | ||||
|       /* tmp     = TEX ... | ||||
|        */ | ||||
|       emit_op(c,  | ||||
| 	      OPCODE_TEX, | ||||
| 	      tmp, | ||||
| 	      inst->SaturateMode, | ||||
| 	      unit, | ||||
| 	      inst->TexSrcTarget, | ||||
| 	      coord, | ||||
| 	      src_undef(), | ||||
| 	      src_undef()); | ||||
|       emit_tex_op(c,  | ||||
|                   OPCODE_TEX, | ||||
|                   tmp, | ||||
|                   inst->SaturateMode, | ||||
|                   unit, | ||||
|                   inst->TexSrcTarget, | ||||
|                   coord, | ||||
|                   src_undef(), | ||||
|                   src_undef()); | ||||
|  | ||||
|       /* tmp.xyz =  ADD TMP, C0 | ||||
|        */ | ||||
|       emit_op(c, | ||||
| 	      OPCODE_ADD, | ||||
| 	      dst_mask(tmp, WRITEMASK_XYZ), | ||||
| 	      0, 0, 0, | ||||
| 	      0, | ||||
| 	      tmpsrc, | ||||
| 	      C0, | ||||
| 	      src_undef()); | ||||
| @@ -702,7 +765,7 @@ static void precalc_tex( struct brw_wm_compile *c, | ||||
|       emit_op(c, | ||||
| 	      OPCODE_MUL, | ||||
| 	      dst_mask(tmp, WRITEMASK_Y), | ||||
| 	      0, 0, 0, | ||||
| 	      0, | ||||
| 	      tmpsrc, | ||||
| 	      src_swizzle1(C0, W), | ||||
| 	      src_undef()); | ||||
| @@ -717,7 +780,7 @@ static void precalc_tex( struct brw_wm_compile *c, | ||||
|       emit_op(c, | ||||
| 	      OPCODE_MAD, | ||||
| 	      dst_mask(dst, WRITEMASK_XYZ), | ||||
| 	      0, 0, 0, | ||||
| 	      0, | ||||
| 	      swap_uv?src_swizzle(tmpsrc, Z,Z,X,X):src_swizzle(tmpsrc, X,X,Z,Z), | ||||
| 	      C1, | ||||
| 	      src_swizzle1(tmpsrc, Y)); | ||||
| @@ -727,13 +790,25 @@ static void precalc_tex( struct brw_wm_compile *c, | ||||
|       emit_op(c, | ||||
| 	      OPCODE_MAD, | ||||
| 	      dst_mask(dst, WRITEMASK_Y), | ||||
| 	      0, 0, 0, | ||||
| 	      0, | ||||
| 	      src_swizzle1(tmpsrc, Z), | ||||
| 	      src_swizzle1(C1, W), | ||||
| 	      src_swizzle1(src_reg_from_dst(dst), Y)); | ||||
|  | ||||
|       release_temp(c, tmp); | ||||
|    } | ||||
|    else { | ||||
|       /* ordinary RGBA tex instruction */ | ||||
|       emit_tex_op(c,  | ||||
|                   OPCODE_TEX, | ||||
|                   inst->DstReg, | ||||
|                   inst->SaturateMode, | ||||
|                   unit, | ||||
|                   inst->TexSrcTarget, | ||||
|                   coord, | ||||
|                   src_undef(), | ||||
|                   src_undef()); | ||||
|    } | ||||
|  | ||||
|    if ((inst->TexSrcTarget == TEXTURE_RECT_INDEX) || | ||||
|        (inst->TexSrcTarget == TEXTURE_CUBE_INDEX)) | ||||
| @@ -778,7 +853,7 @@ static void precalc_txp( struct brw_wm_compile *c, | ||||
|       emit_op(c, | ||||
| 	      OPCODE_RCP, | ||||
| 	      dst_mask(tmp, WRITEMASK_W), | ||||
| 	      0, 0, 0, | ||||
| 	      0, | ||||
| 	      src_swizzle1(src0, GET_SWZ(src0.Swizzle, W)), | ||||
| 	      src_undef(), | ||||
| 	      src_undef()); | ||||
| @@ -788,7 +863,7 @@ static void precalc_txp( struct brw_wm_compile *c, | ||||
|       emit_op(c, | ||||
| 	      OPCODE_MUL, | ||||
| 	      dst_mask(tmp, WRITEMASK_XYZ), | ||||
| 	      0, 0, 0, | ||||
| 	      0, | ||||
| 	      src0, | ||||
| 	      src_swizzle1(src_reg_from_dst(tmp), W), | ||||
| 	      src_undef()); | ||||
| @@ -828,13 +903,13 @@ static void emit_fb_write( struct brw_wm_compile *c ) | ||||
|        for (i = 0 ; i < brw->state.nr_draw_regions; i++) { | ||||
| 	   outcolor = src_reg(PROGRAM_OUTPUT, FRAG_RESULT_DATA0 + i); | ||||
| 	   last_inst = inst = emit_op(c, | ||||
| 		   WM_FB_WRITE, dst_mask(dst_undef(),0), 0, 0, 0, | ||||
| 		   WM_FB_WRITE, dst_mask(dst_undef(),0), 0, | ||||
| 		   outcolor, payload_r0_depth, outdepth); | ||||
| 	   inst->Sampler = (i<<1); | ||||
| 	   if (c->fp_fragcolor_emitted) { | ||||
| 	       outcolor = src_reg(PROGRAM_OUTPUT, FRAG_RESULT_COLR); | ||||
| 	       last_inst = inst = emit_op(c, WM_FB_WRITE, dst_mask(dst_undef(),0), | ||||
| 		       0, 0, 0, outcolor, payload_r0_depth, outdepth); | ||||
| 		       0, outcolor, payload_r0_depth, outdepth); | ||||
| 	       inst->Sampler = (i<<1); | ||||
| 	   } | ||||
|        } | ||||
| @@ -848,7 +923,7 @@ static void emit_fb_write( struct brw_wm_compile *c ) | ||||
|          outcolor = src_reg(PROGRAM_OUTPUT, FRAG_RESULT_COLR); | ||||
|  | ||||
|        inst = emit_op(c, WM_FB_WRITE, dst_mask(dst_undef(),0), | ||||
| 	       0, 0, 0, outcolor, payload_r0_depth, outdepth); | ||||
| 	       0, outcolor, payload_r0_depth, outdepth); | ||||
|        inst->Sampler = 1|(0<<1); | ||||
|    } | ||||
| } | ||||
| @@ -902,8 +977,7 @@ static void print_insns( const struct prog_instruction *insn, | ||||
| 				     3); | ||||
|       } | ||||
|       else  | ||||
| 	 _mesa_printf("UNKNOWN\n"); | ||||
| 	    | ||||
| 	 _mesa_printf("965 Opcode %d\n", insn->Opcode); | ||||
|    } | ||||
| } | ||||
|  | ||||
|   | ||||
| @@ -89,8 +89,14 @@ get_reg(struct brw_wm_compile *c, int file, int index, int component, int nr, GL | ||||
| 	    break; | ||||
| 	case PROGRAM_UNDEFINED: | ||||
| 	    return brw_null_reg();	 | ||||
| 	default: | ||||
| 	case PROGRAM_TEMPORARY: | ||||
| 	case PROGRAM_INPUT: | ||||
| 	case PROGRAM_OUTPUT: | ||||
| 	case PROGRAM_PAYLOAD: | ||||
| 	    break; | ||||
| 	default: | ||||
| 	    _mesa_problem(NULL, "Unexpected file in get_reg()"); | ||||
| 	    return brw_null_reg(); | ||||
|     } | ||||
|  | ||||
|     if(c->wm_regs[file][index][component].inited) | ||||
| @@ -103,7 +109,20 @@ get_reg(struct brw_wm_compile *c, int file, int index, int component, int nr, GL | ||||
| 	c->reg_index++; | ||||
|     } | ||||
|  | ||||
|     if (neg & (1<< component)) { | ||||
|     if (c->reg_index >= BRW_WM_MAX_GRF - 12) { | ||||
| 	/* ran out of temporary registers! */ | ||||
| #if 1 | ||||
|         /* This is a big hack for now. | ||||
|          * Return bad register index, but don't just crash hange the GPU. | ||||
|          */ | ||||
|         _mesa_fprintf(stderr, "out of regs %d\n", c->reg_index); | ||||
|         c->reg_index = BRW_WM_MAX_GRF - 13; | ||||
| #else | ||||
| 	return brw_null_reg(); | ||||
| #endif | ||||
|     } | ||||
|   | ||||
|     if (neg & (1 << component)) { | ||||
| 	reg = negate(reg); | ||||
|     } | ||||
|     if (abs) | ||||
| @@ -545,6 +564,36 @@ static void emit_pinterp(struct brw_wm_compile *c, | ||||
|     } | ||||
| } | ||||
|  | ||||
| /* Sets the destination channels to 1.0 or 0.0 according to glFrontFacing. */ | ||||
| static void emit_frontfacing(struct brw_wm_compile *c, | ||||
| 			     struct prog_instruction *inst) | ||||
| { | ||||
|     struct brw_compile *p = &c->func; | ||||
|     struct brw_reg r1_6ud = retype(brw_vec1_grf(1, 6), BRW_REGISTER_TYPE_UD); | ||||
|     struct brw_reg dst; | ||||
|     GLuint mask = inst->DstReg.WriteMask; | ||||
|     int i; | ||||
|  | ||||
|     for (i = 0; i < 4; i++) { | ||||
| 	if (mask & (1<<i)) { | ||||
| 	    dst = get_dst_reg(c, inst, i, 1); | ||||
| 	    brw_MOV(p, dst, brw_imm_f(0.0)); | ||||
| 	} | ||||
|     } | ||||
|  | ||||
|     /* bit 31 is "primitive is back face", so checking < (1 << 31) gives | ||||
|      * us front face | ||||
|      */ | ||||
|     brw_CMP(p, brw_null_reg(), BRW_CONDITIONAL_L, r1_6ud, brw_imm_ud(1 << 31)); | ||||
|     for (i = 0; i < 4; i++) { | ||||
| 	if (mask & (1<<i)) { | ||||
| 	    dst = get_dst_reg(c, inst, i, 1); | ||||
| 	    brw_MOV(p, dst, brw_imm_f(1.0)); | ||||
| 	} | ||||
|     } | ||||
|     brw_set_predicate_control_flag_value(p, 0xff); | ||||
| } | ||||
|  | ||||
| static void emit_xpd(struct brw_wm_compile *c, | ||||
| 		struct prog_instruction *inst) | ||||
| { | ||||
| @@ -627,23 +676,46 @@ static void emit_dph(struct brw_wm_compile *c, | ||||
|     brw_set_saturate(p, 0); | ||||
| } | ||||
|  | ||||
| /** | ||||
|  * Emit a scalar instruction, like RCP, RSQ, LOG, EXP. | ||||
|  * Note that the result of the function is smeared across the dest | ||||
|  * register's X, Y, Z and W channels (subject to writemasking of course). | ||||
|  */ | ||||
| static void emit_math1(struct brw_wm_compile *c, | ||||
| 		struct prog_instruction *inst, GLuint func) | ||||
| { | ||||
|     struct brw_compile *p = &c->func; | ||||
|     struct brw_reg src0, dst; | ||||
|     struct brw_reg src0, dst, tmp; | ||||
|     const int mark = mark_tmps( c ); | ||||
|     int i; | ||||
|  | ||||
|     tmp = alloc_tmp(c); | ||||
|  | ||||
|     /* Get first component of source register */ | ||||
|     src0 = get_src_reg(c, &inst->SrcReg[0], 0, 1); | ||||
|     dst = get_dst_reg(c, inst, get_scalar_dst_index(inst), 1); | ||||
|  | ||||
|     /* tmp = func(src0) */ | ||||
|     brw_MOV(p, brw_message_reg(2), src0); | ||||
|     brw_math(p, | ||||
| 	    dst, | ||||
| 	    func, | ||||
| 	    (inst->SaturateMode != SATURATE_OFF) ? BRW_MATH_SATURATE_SATURATE : BRW_MATH_SATURATE_NONE, | ||||
| 	    2, | ||||
| 	    brw_null_reg(), | ||||
| 	    BRW_MATH_DATA_VECTOR, | ||||
| 	    BRW_MATH_PRECISION_FULL); | ||||
|              tmp, | ||||
|              func, | ||||
|              (inst->SaturateMode != SATURATE_OFF) ? BRW_MATH_SATURATE_SATURATE : BRW_MATH_SATURATE_NONE, | ||||
|              2, | ||||
|              brw_null_reg(), | ||||
|              BRW_MATH_DATA_VECTOR, | ||||
|              BRW_MATH_PRECISION_FULL); | ||||
|  | ||||
|     /*tmp.dw1.bits.swizzle = SWIZZLE_XXXX;*/ | ||||
|  | ||||
|     /* replicate tmp value across enabled dest channels */ | ||||
|     for (i = 0; i < 4; i++) { | ||||
|        if (inst->DstReg.WriteMask & (1 << i)) { | ||||
|           dst = get_dst_reg(c, inst, i, 1);     | ||||
|           brw_MOV(p, dst, tmp); | ||||
|        } | ||||
|     } | ||||
|  | ||||
|     release_tmps(c, mark); | ||||
| } | ||||
|  | ||||
| static void emit_rcp(struct brw_wm_compile *c, | ||||
| @@ -2244,28 +2316,12 @@ static void emit_tex(struct brw_wm_compile *c, | ||||
| 	brw_MOV(p, dst[3], brw_imm_f(1.0)); | ||||
| } | ||||
|  | ||||
| /** | ||||
|  * Resolve subroutine calls after code emit is done. | ||||
|  */ | ||||
| static void post_wm_emit( struct brw_wm_compile *c ) | ||||
| { | ||||
|     GLuint nr_insns = c->fp->program.Base.NumInstructions; | ||||
|     GLuint insn, target_insn; | ||||
|     struct prog_instruction *inst1, *inst2; | ||||
|     struct brw_instruction *brw_inst1, *brw_inst2; | ||||
|     int offset; | ||||
|     for (insn = 0; insn < nr_insns; insn++) { | ||||
| 	inst1 = &c->fp->program.Base.Instructions[insn]; | ||||
| 	brw_inst1 = inst1->Data; | ||||
| 	switch (inst1->Opcode) { | ||||
| 	    case OPCODE_CAL: | ||||
| 		target_insn = inst1->BranchTarget; | ||||
| 		inst2 = &c->fp->program.Base.Instructions[target_insn]; | ||||
| 		brw_inst2 = inst2->Data; | ||||
| 		offset = brw_inst2 - brw_inst1; | ||||
| 		brw_set_src1(brw_inst1, brw_imm_d(offset*16)); | ||||
| 		break; | ||||
| 	    default: | ||||
| 		break; | ||||
| 	} | ||||
|     } | ||||
|     brw_resolve_cals(&c->func); | ||||
| } | ||||
|  | ||||
| static void brw_wm_emit_glsl(struct brw_context *brw, struct brw_wm_compile *c) | ||||
| @@ -2285,10 +2341,6 @@ static void brw_wm_emit_glsl(struct brw_context *brw, struct brw_wm_compile *c) | ||||
|  | ||||
|     for (i = 0; i < c->nr_fp_insns; i++) { | ||||
| 	struct prog_instruction *inst = &c->prog_instructions[i]; | ||||
| 	struct prog_instruction *orig_inst; | ||||
|  | ||||
| 	if ((orig_inst = inst->Data) != 0) | ||||
| 	    orig_inst->Data = current_insn(p); | ||||
|  | ||||
| 	if (inst->CondUpdate) | ||||
| 	    brw_set_conditionalmod(p, BRW_CONDITIONAL_NZ); | ||||
| @@ -2320,6 +2372,9 @@ static void brw_wm_emit_glsl(struct brw_context *brw, struct brw_wm_compile *c) | ||||
| 	    case WM_FB_WRITE: | ||||
| 		emit_fb_write(c, inst); | ||||
| 		break; | ||||
| 	    case WM_FRONTFACING: | ||||
| 		emit_frontfacing(c, inst); | ||||
| 		break; | ||||
| 	    case OPCODE_ABS: | ||||
| 		emit_abs(c, inst); | ||||
| 		break; | ||||
| @@ -2446,7 +2501,10 @@ static void brw_wm_emit_glsl(struct brw_context *brw, struct brw_wm_compile *c) | ||||
| 		brw_ENDIF(p, if_inst[--if_insn]); | ||||
| 		break; | ||||
| 	    case OPCODE_BGNSUB: | ||||
| 		brw_save_label(p, inst->Comment, p->nr_insn); | ||||
| 		break; | ||||
| 	    case OPCODE_ENDSUB: | ||||
| 		/* no-op */ | ||||
| 		break; | ||||
| 	    case OPCODE_CAL:  | ||||
| 		brw_push_insn_state(p); | ||||
| @@ -2456,8 +2514,7 @@ static void brw_wm_emit_glsl(struct brw_context *brw, struct brw_wm_compile *c) | ||||
|                 brw_set_access_mode(p, BRW_ALIGN_16); | ||||
|                 brw_ADD(p, get_addr_reg(stack_index), | ||||
|                          get_addr_reg(stack_index), brw_imm_d(4)); | ||||
|                 orig_inst = inst->Data; | ||||
|                 orig_inst->Data = &p->store[p->nr_insn]; | ||||
| 		brw_save_call(&c->func, inst->Comment, p->nr_insn); | ||||
|                 brw_ADD(p, brw_ip_reg(), brw_ip_reg(), brw_imm_d(1*16)); | ||||
|                 brw_pop_insn_state(p); | ||||
| 		break; | ||||
| @@ -2510,8 +2567,11 @@ static void brw_wm_emit_glsl(struct brw_context *brw, struct brw_wm_compile *c) | ||||
| 	    brw_set_predicate_control(p, BRW_PREDICATE_NONE); | ||||
|     } | ||||
|     post_wm_emit(c); | ||||
|     for (i = 0; i < c->fp->program.Base.NumInstructions; i++) | ||||
| 	c->fp->program.Base.Instructions[i].Data = NULL; | ||||
|  | ||||
|     if (c->reg_index >= BRW_WM_MAX_GRF) { | ||||
|         _mesa_problem(NULL, "Ran out of registers in brw_wm_emit_glsl()"); | ||||
|         /* XXX we need to do some proper error recovery here */ | ||||
|     } | ||||
| } | ||||
|  | ||||
| void brw_wm_glsl_emit(struct brw_context *brw, struct brw_wm_compile *c) | ||||
|   | ||||
| @@ -379,14 +379,22 @@ static void pass0_precalc_mov( struct brw_wm_compile *c, | ||||
| { | ||||
|    const struct prog_dst_register *dst = &inst->DstReg; | ||||
|    GLuint writemask = inst->DstReg.WriteMask; | ||||
|    struct brw_wm_ref *refs[4]; | ||||
|    GLuint i; | ||||
|  | ||||
|    /* Get the effect of a MOV by manipulating our register table: | ||||
|     * First get all refs, then assign refs.  This ensures that "in-place" | ||||
|     * swizzles such as: | ||||
|     *   MOV t, t.xxyx | ||||
|     * are handled correctly.  Previously, these two steps were done in | ||||
|     * one loop and the above case was incorrectly handled. | ||||
|     */ | ||||
|    for (i = 0; i < 4; i++) { | ||||
|       if (writemask & (1<<i)) {	     | ||||
| 	 pass0_set_fpreg_ref( c, dst->File, dst->Index, i,  | ||||
| 			      get_new_ref(c, inst->SrcReg[0], i, NULL)); | ||||
|       refs[i] = get_new_ref(c, inst->SrcReg[0], i, NULL); | ||||
|    } | ||||
|    for (i = 0; i < 4; i++) { | ||||
|       if (writemask & (1 << i)) {	     | ||||
|          pass0_set_fpreg_ref( c, dst->File, dst->Index, i, refs[i]); | ||||
|       } | ||||
|    } | ||||
| } | ||||
|   | ||||
| @@ -260,6 +260,7 @@ void brw_wm_pass1( struct brw_wm_compile *c ) | ||||
|  | ||||
|       case OPCODE_DST: | ||||
|       case OPCODE_TXP: | ||||
|       case WM_FRONTFACING: | ||||
|       default: | ||||
| 	 break; | ||||
|       } | ||||
|   | ||||
| @@ -95,6 +95,7 @@ struct wm_sampler_key { | ||||
|    int sampler_count; | ||||
|  | ||||
|    struct wm_sampler_entry { | ||||
|       GLenum tex_target; | ||||
|       GLenum wrap_r, wrap_s, wrap_t; | ||||
|       float maxlod, minlod; | ||||
|       float lod_bias; | ||||
| @@ -168,19 +169,20 @@ static void brw_update_sampler_state(struct wm_sampler_entry *key, | ||||
|       }   | ||||
|    } | ||||
|  | ||||
|    sampler->ss1.r_wrap_mode = translate_wrap_mode(key->wrap_r); | ||||
|    sampler->ss1.s_wrap_mode = translate_wrap_mode(key->wrap_s); | ||||
|    sampler->ss1.t_wrap_mode = translate_wrap_mode(key->wrap_t); | ||||
|  | ||||
|    /* Fulsim complains if I don't do this.  Hardware doesn't mind: | ||||
|     */ | ||||
| #if 0 | ||||
|    if (texObj->Target == GL_TEXTURE_CUBE_MAP_ARB) { | ||||
|    if (key->tex_target == GL_TEXTURE_CUBE_MAP && | ||||
|        (key->minfilter != GL_NEAREST || key->magfilter != GL_NEAREST)) { | ||||
|       /* If we're using anything but nearest sampling for a cube map, we | ||||
|        * need to set this wrap mode to avoid GPU lock-ups. | ||||
|        */ | ||||
|       sampler->ss1.r_wrap_mode = BRW_TEXCOORDMODE_CUBE; | ||||
|       sampler->ss1.s_wrap_mode = BRW_TEXCOORDMODE_CUBE; | ||||
|       sampler->ss1.t_wrap_mode = BRW_TEXCOORDMODE_CUBE; | ||||
|    } | ||||
| #endif | ||||
|    else { | ||||
|       sampler->ss1.r_wrap_mode = translate_wrap_mode(key->wrap_r); | ||||
|       sampler->ss1.s_wrap_mode = translate_wrap_mode(key->wrap_s); | ||||
|       sampler->ss1.t_wrap_mode = translate_wrap_mode(key->wrap_t); | ||||
|    } | ||||
|  | ||||
|    /* Set shadow function:  | ||||
|     */ | ||||
| @@ -220,19 +222,22 @@ static void | ||||
| brw_wm_sampler_populate_key(struct brw_context *brw, | ||||
| 			    struct wm_sampler_key *key) | ||||
| { | ||||
|    GLcontext *ctx = &brw->intel.ctx; | ||||
|    int unit; | ||||
|  | ||||
|    memset(key, 0, sizeof(*key)); | ||||
|  | ||||
|    for (unit = 0; unit < BRW_MAX_TEX_UNIT; unit++) { | ||||
|       if (brw->attribs.Texture->Unit[unit]._ReallyEnabled) { | ||||
|       if (ctx->Texture.Unit[unit]._ReallyEnabled) { | ||||
| 	 struct wm_sampler_entry *entry = &key->sampler[unit]; | ||||
| 	 struct gl_texture_unit *texUnit = &brw->attribs.Texture->Unit[unit]; | ||||
| 	 struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit]; | ||||
| 	 struct gl_texture_object *texObj = texUnit->_Current; | ||||
| 	 struct intel_texture_object *intelObj = intel_texture_object(texObj); | ||||
| 	 struct gl_texture_image *firstImage = | ||||
| 	    texObj->Image[0][intelObj->firstLevel]; | ||||
|  | ||||
|          entry->tex_target = texObj->Target; | ||||
|  | ||||
| 	 entry->wrap_r = texObj->WrapR; | ||||
| 	 entry->wrap_s = texObj->WrapS; | ||||
| 	 entry->wrap_t = texObj->WrapT; | ||||
| @@ -274,6 +279,7 @@ brw_wm_sampler_populate_key(struct brw_context *brw, | ||||
|  */ | ||||
| static void upload_wm_samplers( struct brw_context *brw ) | ||||
| { | ||||
|    GLcontext *ctx = &brw->intel.ctx; | ||||
|    struct wm_sampler_key key; | ||||
|    int i; | ||||
|  | ||||
| @@ -317,7 +323,7 @@ static void upload_wm_samplers( struct brw_context *brw ) | ||||
|  | ||||
|       /* Emit SDC relocations */ | ||||
|       for (i = 0; i < BRW_MAX_TEX_UNIT; i++) { | ||||
| 	 if (!brw->attribs.Texture->Unit[i]._ReallyEnabled) | ||||
| 	 if (!ctx->Texture.Unit[i]._ReallyEnabled) | ||||
| 	    continue; | ||||
|  | ||||
| 	 dri_bo_emit_reloc(brw->wm.sampler_bo, | ||||
|   | ||||
| @@ -60,6 +60,7 @@ struct brw_wm_unit_key { | ||||
| static void | ||||
| wm_unit_populate_key(struct brw_context *brw, struct brw_wm_unit_key *key) | ||||
| { | ||||
|    GLcontext *ctx = &brw->intel.ctx; | ||||
|    const struct gl_fragment_program *fp = brw->fragment_program; | ||||
|    struct intel_context *intel = &brw->intel; | ||||
|  | ||||
| @@ -95,7 +96,7 @@ wm_unit_populate_key(struct brw_context *brw, struct brw_wm_unit_key *key) | ||||
|    key->sampler_count = brw->wm.sampler_count; | ||||
|  | ||||
|    /* _NEW_POLYGONSTIPPLE */ | ||||
|    key->polygon_stipple = brw->attribs.Polygon->StippleFlag; | ||||
|    key->polygon_stipple = ctx->Polygon.StippleFlag; | ||||
|  | ||||
|    /* BRW_NEW_FRAGMENT_PROGRAM */ | ||||
|    key->uses_depth = (fp->Base.InputsRead & (1 << FRAG_ATTRIB_WPOS)) != 0; | ||||
| @@ -105,19 +106,19 @@ wm_unit_populate_key(struct brw_context *brw, struct brw_wm_unit_key *key) | ||||
|       (fp->Base.OutputsWritten & (1 << FRAG_RESULT_DEPR)) != 0; | ||||
|  | ||||
|    /* _NEW_COLOR */ | ||||
|    key->uses_kill = fp->UsesKill || brw->attribs.Color->AlphaEnabled; | ||||
|    key->uses_kill = fp->UsesKill || ctx->Color.AlphaEnabled; | ||||
|    key->is_glsl = brw_wm_is_glsl(fp); | ||||
|  | ||||
|    /* XXX: This needs a flag to indicate when it changes. */ | ||||
|    /* _NEW_DEPTH */ | ||||
|    key->stats_wm = intel->stats_wm; | ||||
|  | ||||
|    /* _NEW_LINE */ | ||||
|    key->line_stipple = brw->attribs.Line->StippleFlag; | ||||
|    key->line_stipple = ctx->Line.StippleFlag; | ||||
|  | ||||
|    /* _NEW_POLYGON */ | ||||
|    key->offset_enable = brw->attribs.Polygon->OffsetFill; | ||||
|    key->offset_units = brw->attribs.Polygon->OffsetUnits; | ||||
|    key->offset_factor = brw->attribs.Polygon->OffsetFactor; | ||||
|    key->offset_enable = ctx->Polygon.OffsetFill; | ||||
|    key->offset_units = ctx->Polygon.OffsetUnits; | ||||
|    key->offset_factor = ctx->Polygon.OffsetFactor; | ||||
| } | ||||
|  | ||||
| static dri_bo * | ||||
| @@ -277,7 +278,8 @@ const struct brw_tracked_state brw_wm_unit = { | ||||
|       .mesa = (_NEW_POLYGON |  | ||||
| 	       _NEW_POLYGONSTIPPLE |  | ||||
| 	       _NEW_LINE |  | ||||
| 	       _NEW_COLOR), | ||||
| 	       _NEW_COLOR | | ||||
| 	       _NEW_DEPTH), | ||||
|  | ||||
|       .brw = (BRW_NEW_FRAGMENT_PROGRAM |  | ||||
| 	      BRW_NEW_CURBE_OFFSETS | | ||||
|   | ||||
| @@ -253,7 +253,7 @@ static void | ||||
| brw_update_texture_surface( GLcontext *ctx, GLuint unit ) | ||||
| { | ||||
|    struct brw_context *brw = brw_context(ctx); | ||||
|    struct gl_texture_object *tObj = brw->attribs.Texture->Unit[unit]._Current; | ||||
|    struct gl_texture_object *tObj = ctx->Texture.Unit[unit]._Current; | ||||
|    struct intel_texture_object *intelObj = intel_texture_object(tObj); | ||||
|    struct gl_texture_image *firstImage = tObj->Image[0][intelObj->firstLevel]; | ||||
|    struct brw_wm_surface_key key; | ||||
| @@ -301,6 +301,7 @@ static void | ||||
| brw_update_region_surface(struct brw_context *brw, struct intel_region *region, | ||||
| 			  unsigned int unit, GLboolean cached) | ||||
| { | ||||
|    GLcontext *ctx = &brw->intel.ctx; | ||||
|    dri_bo *region_bo = NULL; | ||||
|    struct { | ||||
|       unsigned int surface_type; | ||||
| @@ -309,6 +310,7 @@ brw_update_region_surface(struct brw_context *brw, struct intel_region *region, | ||||
|       GLubyte color_mask[4]; | ||||
|       GLboolean color_blend; | ||||
|       uint32_t tiling; | ||||
|       uint32_t draw_offset; | ||||
|    } key; | ||||
|  | ||||
|    memset(&key, 0, sizeof(key)); | ||||
| @@ -325,6 +327,7 @@ brw_update_region_surface(struct brw_context *brw, struct intel_region *region, | ||||
|       key.width = region->pitch; /* XXX: not really! */ | ||||
|       key.height = region->height; | ||||
|       key.cpp = region->cpp; | ||||
|       key.draw_offset = region->draw_offset; /* cur 3d or cube face offset */ | ||||
|    } else { | ||||
|       key.surface_type = BRW_SURFACE_NULL; | ||||
|       key.surface_format = BRW_SURFACEFORMAT_B8G8R8A8_UNORM; | ||||
| @@ -332,11 +335,12 @@ brw_update_region_surface(struct brw_context *brw, struct intel_region *region, | ||||
|       key.width = 1; | ||||
|       key.height = 1; | ||||
|       key.cpp = 4; | ||||
|       key.draw_offset = 0; | ||||
|    } | ||||
|    memcpy(key.color_mask, brw->attribs.Color->ColorMask, | ||||
|    memcpy(key.color_mask, ctx->Color.ColorMask, | ||||
| 	  sizeof(key.color_mask)); | ||||
|    key.color_blend = (!brw->attribs.Color->_LogicOpEnabled && | ||||
| 		      brw->attribs.Color->BlendEnabled); | ||||
|    key.color_blend = (!ctx->Color._LogicOpEnabled && | ||||
| 		      ctx->Color.BlendEnabled); | ||||
|  | ||||
|    dri_bo_unreference(brw->wm.surf_bo[unit]); | ||||
|    brw->wm.surf_bo[unit] = NULL; | ||||
| @@ -353,8 +357,9 @@ brw_update_region_surface(struct brw_context *brw, struct intel_region *region, | ||||
|  | ||||
|       surf.ss0.surface_format = key.surface_format; | ||||
|       surf.ss0.surface_type = key.surface_type; | ||||
|       surf.ss1.base_addr =  key.draw_offset; | ||||
|       if (region_bo != NULL) | ||||
| 	 surf.ss1.base_addr = region_bo->offset; /* reloc */ | ||||
| 	 surf.ss1.base_addr += region_bo->offset; /* reloc */ | ||||
|  | ||||
|       surf.ss2.width = key.width - 1; | ||||
|       surf.ss2.height = key.height - 1; | ||||
| @@ -379,13 +384,12 @@ brw_update_region_surface(struct brw_context *brw, struct intel_region *region, | ||||
| 	  * them both.  We might be able to figure out from other state | ||||
| 	  * a more restrictive relocation to emit. | ||||
| 	  */ | ||||
| 	 dri_bo_emit_reloc(brw->wm.surf_bo[unit], | ||||
| 			   I915_GEM_DOMAIN_RENDER | | ||||
| 			   I915_GEM_DOMAIN_SAMPLER, | ||||
| 			   I915_GEM_DOMAIN_RENDER, | ||||
| 			   0, | ||||
| 			   offsetof(struct brw_surface_state, ss1), | ||||
| 			   region_bo); | ||||
| 	 drm_intel_bo_emit_reloc(brw->wm.surf_bo[unit], | ||||
| 				 offsetof(struct brw_surface_state, ss1), | ||||
| 				 region_bo, | ||||
| 				 key.draw_offset, | ||||
| 				 I915_GEM_DOMAIN_RENDER, | ||||
| 				 I915_GEM_DOMAIN_RENDER); | ||||
|       } | ||||
|    } | ||||
| } | ||||
| @@ -459,7 +463,7 @@ static void prepare_wm_surfaces(struct brw_context *brw ) | ||||
|    brw->wm.nr_surfaces = MAX_DRAW_BUFFERS; | ||||
|  | ||||
|    for (i = 0; i < BRW_MAX_TEX_UNIT; i++) { | ||||
|       struct gl_texture_unit *texUnit = &brw->attribs.Texture->Unit[i]; | ||||
|       struct gl_texture_unit *texUnit = &ctx->Texture.Unit[i]; | ||||
|  | ||||
|       /* _NEW_TEXTURE, BRW_NEW_TEXDATA */ | ||||
|       if(texUnit->_ReallyEnabled) { | ||||
|   | ||||
							
								
								
									
										1
									
								
								src/mesa/drivers/dri/i965/intel_clear.c
									
									
									
									
									
										Symbolic link
									
								
							
							
						
						
									
										1
									
								
								src/mesa/drivers/dri/i965/intel_clear.c
									
									
									
									
									
										Symbolic link
									
								
							| @@ -0,0 +1 @@ | ||||
| ../intel/intel_clear.c | ||||
| @@ -38,7 +38,8 @@ | ||||
| #include "intel_regions.h" | ||||
| #include "swrast/swrast.h" | ||||
|  | ||||
| int intel_translate_shadow_compare_func( GLenum func ) | ||||
| int | ||||
| intel_translate_shadow_compare_func( GLenum func ) | ||||
| { | ||||
|    switch(func) { | ||||
|    case GL_NEVER:  | ||||
| @@ -63,7 +64,8 @@ int intel_translate_shadow_compare_func( GLenum func ) | ||||
|    return COMPAREFUNC_NEVER;  | ||||
| } | ||||
|  | ||||
| int intel_translate_compare_func( GLenum func ) | ||||
| int | ||||
| intel_translate_compare_func( GLenum func ) | ||||
| { | ||||
|    switch(func) { | ||||
|    case GL_NEVER:  | ||||
| @@ -88,7 +90,8 @@ int intel_translate_compare_func( GLenum func ) | ||||
|    return COMPAREFUNC_ALWAYS;  | ||||
| } | ||||
|  | ||||
| int intel_translate_stencil_op( GLenum op ) | ||||
| int | ||||
| intel_translate_stencil_op( GLenum op ) | ||||
| { | ||||
|    switch(op) { | ||||
|    case GL_KEEP:  | ||||
| @@ -112,7 +115,8 @@ int intel_translate_stencil_op( GLenum op ) | ||||
|    } | ||||
| } | ||||
|  | ||||
| int intel_translate_blend_factor( GLenum factor ) | ||||
| int | ||||
| intel_translate_blend_factor( GLenum factor ) | ||||
| { | ||||
|    switch(factor) { | ||||
|    case GL_ZERO:  | ||||
| @@ -151,7 +155,8 @@ int intel_translate_blend_factor( GLenum factor ) | ||||
|    return BLENDFACT_ZERO; | ||||
| } | ||||
|  | ||||
| int intel_translate_logic_op( GLenum opcode ) | ||||
| int | ||||
| intel_translate_logic_op( GLenum opcode ) | ||||
| { | ||||
|    switch(opcode) { | ||||
|    case GL_CLEAR:  | ||||
| @@ -192,33 +197,36 @@ int intel_translate_logic_op( GLenum opcode ) | ||||
| } | ||||
|  | ||||
|  | ||||
| static void intelClearColor(GLcontext *ctx, const GLfloat color[4]) | ||||
| static void | ||||
| intelClearColor(GLcontext *ctx, const GLfloat color[4]) | ||||
| { | ||||
|    struct intel_context *intel = intel_context(ctx); | ||||
|    GLubyte clear[4]; | ||||
|  | ||||
|    UNCLAMPED_FLOAT_TO_RGBA_CHAN(intel->clear_chan, color); | ||||
|    CLAMPED_FLOAT_TO_UBYTE(clear[0], color[0]); | ||||
|    CLAMPED_FLOAT_TO_UBYTE(clear[1], color[1]); | ||||
|    CLAMPED_FLOAT_TO_UBYTE(clear[2], color[2]); | ||||
|    CLAMPED_FLOAT_TO_UBYTE(clear[3], color[3]); | ||||
|  | ||||
|    intel->ClearColor8888 = INTEL_PACKCOLOR8888(intel->clear_chan[0], | ||||
| 					       intel->clear_chan[1], | ||||
| 					       intel->clear_chan[2], | ||||
| 					       intel->clear_chan[3]); | ||||
|    intel->ClearColor565 = INTEL_PACKCOLOR565(intel->clear_chan[0], | ||||
| 					     intel->clear_chan[1], | ||||
| 					     intel->clear_chan[2]); | ||||
|    /* compute both 32 and 16-bit clear values */ | ||||
|    intel->ClearColor8888 = INTEL_PACKCOLOR8888(clear[0], clear[1], | ||||
|                                                clear[2], clear[3]); | ||||
|    intel->ClearColor565 = INTEL_PACKCOLOR565(clear[0], clear[1], clear[2]); | ||||
| } | ||||
|  | ||||
|  | ||||
|  | ||||
| /* Fallback to swrast for select and feedback. | ||||
|  */ | ||||
| static void intelRenderMode( GLcontext *ctx, GLenum mode ) | ||||
| static void | ||||
| intelRenderMode( GLcontext *ctx, GLenum mode ) | ||||
| { | ||||
|    struct intel_context *intel = intel_context(ctx); | ||||
|    FALLBACK( intel, INTEL_FALLBACK_RENDERMODE, (mode != GL_RENDER) ); | ||||
| } | ||||
|  | ||||
|  | ||||
| void intelInitStateFuncs( struct dd_function_table *functions ) | ||||
| void | ||||
| intelInitStateFuncs( struct dd_function_table *functions ) | ||||
| { | ||||
|    functions->RenderMode = intelRenderMode; | ||||
|    functions->ClearColor = intelClearColor; | ||||
|   | ||||
							
								
								
									
										1
									
								
								src/mesa/drivers/dri/i965/intel_swapbuffers.c
									
									
									
									
									
										Symbolic link
									
								
							
							
						
						
									
										1
									
								
								src/mesa/drivers/dri/i965/intel_swapbuffers.c
									
									
									
									
									
										Symbolic link
									
								
							| @@ -0,0 +1 @@ | ||||
| ../intel/intel_swapbuffers.c | ||||
| @@ -332,6 +332,8 @@ intelEmitCopyBlit(struct intel_context *intel, | ||||
|  | ||||
|    switch (cpp) { | ||||
|    case 1: | ||||
|       CMD = XY_SRC_COPY_BLT_CMD; | ||||
|       break; | ||||
|    case 2: | ||||
|    case 3: | ||||
|       BR13 |= (1 << 24); | ||||
|   | ||||
| @@ -25,25 +25,14 @@ | ||||
|  *  | ||||
|  **************************************************************************/ | ||||
|  | ||||
| #include "intel_screen.h" | ||||
| #include "intel_context.h" | ||||
| #include "intel_blit.h" | ||||
| #include "intel_buffers.h" | ||||
| #include "intel_chipset.h" | ||||
| #include "intel_depthstencil.h" | ||||
| #include "intel_fbo.h" | ||||
| #include "intel_regions.h" | ||||
| #include "intel_batchbuffer.h" | ||||
| #include "intel_reg.h" | ||||
| #include "main/context.h" | ||||
| #include "main/framebuffer.h" | ||||
| #include "swrast/swrast.h" | ||||
| #include "utils.h" | ||||
| #include "drirenderbuffer.h" | ||||
| #include "vblank.h" | ||||
| #include "i915_drm.h" | ||||
|  | ||||
| #define FILE_DEBUG_FLAG DEBUG_BLIT | ||||
|  | ||||
| /** | ||||
|  * XXX move this into a new dri/common/cliprects.c file. | ||||
| @@ -114,7 +103,6 @@ intel_get_cliprects(struct intel_context *intel, | ||||
| 		    int *x_off, int *y_off) | ||||
| { | ||||
|    __DRIdrawablePrivate *dPriv = intel->driDrawable; | ||||
|    struct intel_framebuffer *intel_fb = dPriv->driverPrivate; | ||||
|  | ||||
|    if (intel->constant_cliprect) { | ||||
|       /* FBO or DRI2 rendering, which can just use the fb's size. */ | ||||
| @@ -143,399 +131,6 @@ intel_get_cliprects(struct intel_context *intel, | ||||
|    } | ||||
| } | ||||
|  | ||||
| /** | ||||
|  * This will be called whenever the currently bound window is moved/resized. | ||||
|  * XXX: actually, it seems to NOT be called when the window is only moved (BP). | ||||
|  */ | ||||
| void | ||||
| intelWindowMoved(struct intel_context *intel) | ||||
| { | ||||
|    GLcontext *ctx = &intel->ctx; | ||||
|    __DRIdrawablePrivate *dPriv = intel->driDrawable; | ||||
|    struct intel_framebuffer *intel_fb = dPriv->driverPrivate; | ||||
|  | ||||
|    if (!intel->intelScreen->driScrnPriv->dri2.enabled && | ||||
|        intel->intelScreen->driScrnPriv->ddx_version.minor >= 7) { | ||||
|       volatile drm_i915_sarea_t *sarea = intel->sarea; | ||||
|       drm_clip_rect_t drw_rect = { .x1 = dPriv->x, .x2 = dPriv->x + dPriv->w, | ||||
| 				   .y1 = dPriv->y, .y2 = dPriv->y + dPriv->h }; | ||||
|       drm_clip_rect_t planeA_rect = { .x1 = sarea->planeA_x, .y1 = sarea->planeA_y, | ||||
| 				     .x2 = sarea->planeA_x + sarea->planeA_w, | ||||
| 				     .y2 = sarea->planeA_y + sarea->planeA_h }; | ||||
|       drm_clip_rect_t planeB_rect = { .x1 = sarea->planeB_x, .y1 = sarea->planeB_y, | ||||
| 				     .x2 = sarea->planeB_x + sarea->planeB_w, | ||||
| 				     .y2 = sarea->planeB_y + sarea->planeB_h }; | ||||
|       GLint areaA = driIntersectArea( drw_rect, planeA_rect ); | ||||
|       GLint areaB = driIntersectArea( drw_rect, planeB_rect ); | ||||
|       GLuint flags = dPriv->vblFlags; | ||||
|  | ||||
|       /* Update vblank info | ||||
|        */ | ||||
|       if (areaB > areaA || (areaA == areaB && areaB > 0)) { | ||||
| 	 flags = dPriv->vblFlags | VBLANK_FLAG_SECONDARY; | ||||
|       } else { | ||||
| 	 flags = dPriv->vblFlags & ~VBLANK_FLAG_SECONDARY; | ||||
|       } | ||||
|  | ||||
|       /* Check to see if we changed pipes */ | ||||
|       if (flags != dPriv->vblFlags && dPriv->vblFlags && | ||||
| 	  !(dPriv->vblFlags & VBLANK_FLAG_NO_IRQ)) { | ||||
| 	 int64_t count; | ||||
| 	 drmVBlank vbl; | ||||
| 	 int i; | ||||
|  | ||||
| 	 /* | ||||
| 	  * Deal with page flipping | ||||
| 	  */ | ||||
| 	 vbl.request.type = DRM_VBLANK_ABSOLUTE; | ||||
|  | ||||
| 	 if ( dPriv->vblFlags & VBLANK_FLAG_SECONDARY ) { | ||||
| 	    vbl.request.type |= DRM_VBLANK_SECONDARY; | ||||
| 	 } | ||||
|  | ||||
| 	 for (i = 0; i < 2; i++) { | ||||
| 	    if (!intel_fb->color_rb[i] || | ||||
| 		(intel_fb->vbl_waited - intel_fb->color_rb[i]->vbl_pending) <= | ||||
| 		(1<<23)) | ||||
| 	       continue; | ||||
|  | ||||
| 	    vbl.request.sequence = intel_fb->color_rb[i]->vbl_pending; | ||||
| 	    drmWaitVBlank(intel->driFd, &vbl); | ||||
| 	 } | ||||
|  | ||||
| 	 /* | ||||
| 	  * Update msc_base from old pipe | ||||
| 	  */ | ||||
| 	 driDrawableGetMSC32(dPriv->driScreenPriv, dPriv, &count); | ||||
| 	 dPriv->msc_base = count; | ||||
| 	 /* | ||||
| 	  * Then get new vblank_base and vblSeq values | ||||
| 	  */ | ||||
| 	 dPriv->vblFlags = flags; | ||||
| 	 driGetCurrentVBlank(dPriv); | ||||
| 	 dPriv->vblank_base = dPriv->vblSeq; | ||||
|  | ||||
| 	 intel_fb->vbl_waited = dPriv->vblSeq; | ||||
|  | ||||
| 	 for (i = 0; i < 2; i++) { | ||||
| 	    if (intel_fb->color_rb[i]) | ||||
| 	       intel_fb->color_rb[i]->vbl_pending = intel_fb->vbl_waited; | ||||
| 	 } | ||||
|       } | ||||
|    } else { | ||||
|       dPriv->vblFlags &= ~VBLANK_FLAG_SECONDARY; | ||||
|    } | ||||
|  | ||||
|    /* Update Mesa's notion of window size */ | ||||
|    driUpdateFramebufferSize(ctx, dPriv); | ||||
|    intel_fb->Base.Initialized = GL_TRUE; /* XXX remove someday */ | ||||
|  | ||||
|    /* Update hardware scissor */ | ||||
|    if (ctx->Driver.Scissor != NULL) { | ||||
|       ctx->Driver.Scissor(ctx, ctx->Scissor.X, ctx->Scissor.Y, | ||||
| 			  ctx->Scissor.Width, ctx->Scissor.Height); | ||||
|    } | ||||
|  | ||||
|    /* Re-calculate viewport related state */ | ||||
|    if (ctx->Driver.DepthRange != NULL) | ||||
|       ctx->Driver.DepthRange( ctx, ctx->Viewport.Near, ctx->Viewport.Far ); | ||||
| } | ||||
|  | ||||
|  | ||||
|  | ||||
| /* A true meta version of this would be very simple and additionally | ||||
|  * machine independent.  Maybe we'll get there one day. | ||||
|  */ | ||||
| static void | ||||
| intelClearWithTris(struct intel_context *intel, GLbitfield mask) | ||||
| { | ||||
|    GLcontext *ctx = &intel->ctx; | ||||
|    struct gl_framebuffer *fb = ctx->DrawBuffer; | ||||
|    GLuint buf; | ||||
|  | ||||
|    intel->vtbl.install_meta_state(intel); | ||||
|  | ||||
|    /* Back and stencil cliprects are the same.  Try and do both | ||||
|     * buffers at once: | ||||
|     */ | ||||
|    if (mask & (BUFFER_BIT_BACK_LEFT | BUFFER_BIT_STENCIL | BUFFER_BIT_DEPTH)) { | ||||
|       struct intel_region *backRegion = | ||||
| 	 intel_get_rb_region(fb, BUFFER_BACK_LEFT); | ||||
|       struct intel_region *depthRegion = | ||||
| 	 intel_get_rb_region(fb, BUFFER_DEPTH); | ||||
|  | ||||
|       intel->vtbl.meta_draw_region(intel, backRegion, depthRegion); | ||||
|  | ||||
|       if (mask & BUFFER_BIT_BACK_LEFT) | ||||
| 	 intel->vtbl.meta_color_mask(intel, GL_TRUE); | ||||
|       else | ||||
| 	 intel->vtbl.meta_color_mask(intel, GL_FALSE); | ||||
|  | ||||
|       if (mask & BUFFER_BIT_STENCIL) | ||||
| 	 intel->vtbl.meta_stencil_replace(intel, | ||||
| 					  intel->ctx.Stencil.WriteMask[0], | ||||
| 					  intel->ctx.Stencil.Clear); | ||||
|       else | ||||
| 	 intel->vtbl.meta_no_stencil_write(intel); | ||||
|  | ||||
|       if (mask & BUFFER_BIT_DEPTH) | ||||
| 	 intel->vtbl.meta_depth_replace(intel); | ||||
|       else | ||||
| 	 intel->vtbl.meta_no_depth_write(intel); | ||||
|  | ||||
|       intel->vtbl.meta_draw_quad(intel, | ||||
| 				 fb->_Xmin, | ||||
| 				 fb->_Xmax, | ||||
| 				 fb->_Ymin, | ||||
| 				 fb->_Ymax, | ||||
| 				 intel->ctx.Depth.Clear, | ||||
| 				 intel->ClearColor8888, | ||||
| 				 0, 0, 0, 0);   /* texcoords */ | ||||
|  | ||||
|       mask &= ~(BUFFER_BIT_BACK_LEFT | BUFFER_BIT_STENCIL | BUFFER_BIT_DEPTH); | ||||
|    } | ||||
|  | ||||
|    /* clear the remaining (color) renderbuffers */ | ||||
|    for (buf = 0; buf < BUFFER_COUNT && mask; buf++) { | ||||
|       const GLuint bufBit = 1 << buf; | ||||
|       if (mask & bufBit) { | ||||
| 	 struct intel_renderbuffer *irbColor = | ||||
| 	    intel_renderbuffer(fb->Attachment[buf].Renderbuffer); | ||||
|  | ||||
| 	 ASSERT(irbColor); | ||||
|  | ||||
| 	 intel->vtbl.meta_no_depth_write(intel); | ||||
| 	 intel->vtbl.meta_no_stencil_write(intel); | ||||
| 	 intel->vtbl.meta_color_mask(intel, GL_TRUE); | ||||
| 	 intel->vtbl.meta_draw_region(intel, irbColor->region, NULL); | ||||
|  | ||||
| 	 intel->vtbl.meta_draw_quad(intel, | ||||
| 				    fb->_Xmin, | ||||
| 				    fb->_Xmax, | ||||
| 				    fb->_Ymin, | ||||
| 				    fb->_Ymax, | ||||
| 				    0, intel->ClearColor8888, | ||||
| 				    0, 0, 0, 0);   /* texcoords */ | ||||
|  | ||||
| 	 mask &= ~bufBit; | ||||
|       } | ||||
|    } | ||||
|  | ||||
|    intel->vtbl.leave_meta_state(intel); | ||||
| } | ||||
|  | ||||
| static const char *buffer_names[] = { | ||||
|    [BUFFER_FRONT_LEFT] = "front", | ||||
|    [BUFFER_BACK_LEFT] = "back", | ||||
|    [BUFFER_FRONT_RIGHT] = "front right", | ||||
|    [BUFFER_BACK_RIGHT] = "back right", | ||||
|    [BUFFER_AUX0] = "aux0", | ||||
|    [BUFFER_AUX1] = "aux1", | ||||
|    [BUFFER_AUX2] = "aux2", | ||||
|    [BUFFER_AUX3] = "aux3", | ||||
|    [BUFFER_DEPTH] = "depth", | ||||
|    [BUFFER_STENCIL] = "stencil", | ||||
|    [BUFFER_ACCUM] = "accum", | ||||
|    [BUFFER_COLOR0] = "color0", | ||||
|    [BUFFER_COLOR1] = "color1", | ||||
|    [BUFFER_COLOR2] = "color2", | ||||
|    [BUFFER_COLOR3] = "color3", | ||||
|    [BUFFER_COLOR4] = "color4", | ||||
|    [BUFFER_COLOR5] = "color5", | ||||
|    [BUFFER_COLOR6] = "color6", | ||||
|    [BUFFER_COLOR7] = "color7", | ||||
| }; | ||||
|  | ||||
| /** | ||||
|  * Called by ctx->Driver.Clear. | ||||
|  */ | ||||
| static void | ||||
| intelClear(GLcontext *ctx, GLbitfield mask) | ||||
| { | ||||
|    struct intel_context *intel = intel_context(ctx); | ||||
|    const GLuint colorMask = *((GLuint *) & ctx->Color.ColorMask); | ||||
|    GLbitfield tri_mask = 0; | ||||
|    GLbitfield blit_mask = 0; | ||||
|    GLbitfield swrast_mask = 0; | ||||
|    struct gl_framebuffer *fb = ctx->DrawBuffer; | ||||
|    GLuint i; | ||||
|  | ||||
|    if (0) | ||||
|       fprintf(stderr, "%s\n", __FUNCTION__); | ||||
|  | ||||
|    /* HW color buffers (front, back, aux, generic FBO, etc) */ | ||||
|    if (colorMask == ~0) { | ||||
|       /* clear all R,G,B,A */ | ||||
|       /* XXX FBO: need to check if colorbuffers are software RBOs! */ | ||||
|       blit_mask |= (mask & BUFFER_BITS_COLOR); | ||||
|    } | ||||
|    else { | ||||
|       /* glColorMask in effect */ | ||||
|       tri_mask |= (mask & BUFFER_BITS_COLOR); | ||||
|    } | ||||
|  | ||||
|    /* HW stencil */ | ||||
|    if (mask & BUFFER_BIT_STENCIL) { | ||||
|       const struct intel_region *stencilRegion | ||||
|          = intel_get_rb_region(fb, BUFFER_STENCIL); | ||||
|       if (stencilRegion) { | ||||
|          /* have hw stencil */ | ||||
|          if (IS_965(intel->intelScreen->deviceID) || | ||||
| 	     (ctx->Stencil.WriteMask[0] & 0xff) != 0xff) { | ||||
| 	    /* We have to use the 3D engine if we're clearing a partial mask | ||||
| 	     * of the stencil buffer, or if we're on a 965 which has a tiled | ||||
| 	     * depth/stencil buffer in a layout we can't blit to. | ||||
| 	     */ | ||||
|             tri_mask |= BUFFER_BIT_STENCIL; | ||||
|          } | ||||
|          else { | ||||
|             /* clearing all stencil bits, use blitting */ | ||||
|             blit_mask |= BUFFER_BIT_STENCIL; | ||||
|          } | ||||
|       } | ||||
|    } | ||||
|  | ||||
|    /* HW depth */ | ||||
|    if (mask & BUFFER_BIT_DEPTH) { | ||||
|       /* clear depth with whatever method is used for stencil (see above) */ | ||||
|       if (IS_965(intel->intelScreen->deviceID) || | ||||
| 	  tri_mask & BUFFER_BIT_STENCIL) | ||||
|          tri_mask |= BUFFER_BIT_DEPTH; | ||||
|       else | ||||
|          blit_mask |= BUFFER_BIT_DEPTH; | ||||
|    } | ||||
|  | ||||
|    /* SW fallback clearing */ | ||||
|    swrast_mask = mask & ~tri_mask & ~blit_mask; | ||||
|  | ||||
|    for (i = 0; i < BUFFER_COUNT; i++) { | ||||
|       GLuint bufBit = 1 << i; | ||||
|       if ((blit_mask | tri_mask) & bufBit) { | ||||
|          if (!fb->Attachment[i].Renderbuffer->ClassID) { | ||||
|             blit_mask &= ~bufBit; | ||||
|             tri_mask &= ~bufBit; | ||||
|             swrast_mask |= bufBit; | ||||
|          } | ||||
|       } | ||||
|    } | ||||
|  | ||||
|    if (blit_mask) { | ||||
|       if (INTEL_DEBUG & DEBUG_BLIT) { | ||||
| 	 DBG("blit clear:"); | ||||
| 	 for (i = 0; i < BUFFER_COUNT; i++) { | ||||
| 	    if (blit_mask & (1 << i)) | ||||
| 	       DBG(" %s", buffer_names[i]); | ||||
| 	 } | ||||
| 	 DBG("\n"); | ||||
|       } | ||||
|       intelClearWithBlit(ctx, blit_mask); | ||||
|    } | ||||
|  | ||||
|    if (tri_mask) { | ||||
|       if (INTEL_DEBUG & DEBUG_BLIT) { | ||||
| 	 DBG("tri clear:"); | ||||
| 	 for (i = 0; i < BUFFER_COUNT; i++) { | ||||
| 	    if (tri_mask & (1 << i)) | ||||
| 	       DBG(" %s", buffer_names[i]); | ||||
| 	 } | ||||
| 	 DBG("\n"); | ||||
|       } | ||||
|       intelClearWithTris(intel, tri_mask); | ||||
|    } | ||||
|  | ||||
|    if (swrast_mask) { | ||||
|       if (INTEL_DEBUG & DEBUG_BLIT) { | ||||
| 	 DBG("swrast clear:"); | ||||
| 	 for (i = 0; i < BUFFER_COUNT; i++) { | ||||
| 	    if (swrast_mask & (1 << i)) | ||||
| 	       DBG(" %s", buffer_names[i]); | ||||
| 	 } | ||||
| 	 DBG("\n"); | ||||
|       } | ||||
|       _swrast_Clear(ctx, swrast_mask); | ||||
|    } | ||||
| } | ||||
|  | ||||
| void | ||||
| intelSwapBuffers(__DRIdrawablePrivate * dPriv) | ||||
| { | ||||
|    __DRIscreenPrivate *psp = dPriv->driScreenPriv; | ||||
|  | ||||
|    if (dPriv->driContextPriv && dPriv->driContextPriv->driverPrivate) { | ||||
|       GET_CURRENT_CONTEXT(ctx); | ||||
|       struct intel_context *intel; | ||||
|  | ||||
|       if (ctx == NULL) | ||||
| 	 return; | ||||
|  | ||||
|       intel = intel_context(ctx); | ||||
|  | ||||
|       if (ctx->Visual.doubleBufferMode) { | ||||
| 	 GLboolean missed_target; | ||||
| 	 struct intel_framebuffer *intel_fb = dPriv->driverPrivate; | ||||
| 	 int64_t ust; | ||||
|           | ||||
| 	 _mesa_notifySwapBuffers(ctx);  /* flush pending rendering comands */ | ||||
|  | ||||
| 	/* | ||||
| 	 * The old swapping ioctl was incredibly racy, just wait for vblank | ||||
| 	 * and do the swap ourselves. | ||||
| 	 */ | ||||
| 	 driWaitForVBlank(dPriv, &missed_target); | ||||
|  | ||||
| 	 /* | ||||
| 	  * Update each buffer's vbl_pending so we don't get too out of | ||||
| 	  * sync | ||||
| 	  */ | ||||
| 	 intel_get_renderbuffer(&intel_fb->Base, | ||||
| 		   		BUFFER_BACK_LEFT)->vbl_pending = dPriv->vblSeq; | ||||
|          intel_get_renderbuffer(&intel_fb->Base, | ||||
| 		   		BUFFER_FRONT_LEFT)->vbl_pending = dPriv->vblSeq; | ||||
|  | ||||
| 	 intelCopyBuffer(dPriv, NULL); | ||||
|  | ||||
| 	 intel_fb->swap_count++; | ||||
| 	 (*psp->systemTime->getUST) (&ust); | ||||
| 	 if (missed_target) { | ||||
| 	    intel_fb->swap_missed_count++; | ||||
| 	    intel_fb->swap_missed_ust = ust - intel_fb->swap_ust; | ||||
| 	 } | ||||
|  | ||||
| 	 intel_fb->swap_ust = ust; | ||||
|       } | ||||
|       drmCommandNone(intel->driFd, DRM_I915_GEM_THROTTLE); | ||||
|  | ||||
|    } | ||||
|    else { | ||||
|       /* XXX this shouldn't be an error but we can't handle it for now */ | ||||
|       fprintf(stderr, "%s: drawable has no context!\n", __FUNCTION__); | ||||
|    } | ||||
| } | ||||
|  | ||||
| void | ||||
| intelCopySubBuffer(__DRIdrawablePrivate * dPriv, int x, int y, int w, int h) | ||||
| { | ||||
|    if (dPriv->driContextPriv && dPriv->driContextPriv->driverPrivate) { | ||||
|       struct intel_context *intel = | ||||
|          (struct intel_context *) dPriv->driContextPriv->driverPrivate; | ||||
|       GLcontext *ctx = &intel->ctx; | ||||
|  | ||||
|       if (ctx->Visual.doubleBufferMode) { | ||||
|          drm_clip_rect_t rect; | ||||
|          rect.x1 = x + dPriv->x; | ||||
|          rect.y1 = (dPriv->h - y - h) + dPriv->y; | ||||
|          rect.x2 = rect.x1 + w; | ||||
|          rect.y2 = rect.y1 + h; | ||||
|          _mesa_notifySwapBuffers(ctx);  /* flush pending rendering comands */ | ||||
|          intelCopyBuffer(dPriv, &rect); | ||||
|       } | ||||
|    } | ||||
|    else { | ||||
|       /* XXX this shouldn't be an error but we can't handle it for now */ | ||||
|       fprintf(stderr, "%s: drawable has no context!\n", __FUNCTION__); | ||||
|    } | ||||
| } | ||||
|  | ||||
|  | ||||
| /** | ||||
|  * Update the hardware state for drawing into a window or framebuffer object. | ||||
| @@ -609,6 +204,8 @@ intel_draw_buffer(GLcontext * ctx, struct gl_framebuffer *fb) | ||||
| 	       intel_batchbuffer_flush(intel->batch); | ||||
| 	    intel->front_cliprects = GL_TRUE; | ||||
| 	    colorRegions[0] = intel_get_rb_region(fb, BUFFER_FRONT_LEFT); | ||||
|  | ||||
| 	    intel->front_buffer_dirty = GL_TRUE; | ||||
| 	 } | ||||
| 	 else { | ||||
| 	    if (!intel->constant_cliprect && intel->front_cliprects) | ||||
| @@ -711,13 +308,11 @@ intel_draw_buffer(GLcontext * ctx, struct gl_framebuffer *fb) | ||||
| 	fb->_NumColorDrawBuffers); | ||||
|  | ||||
|    /* update viewport since it depends on window size */ | ||||
|    if (ctx->Driver.Viewport) { | ||||
|       ctx->Driver.Viewport(ctx, ctx->Viewport.X, ctx->Viewport.Y, | ||||
| 			   ctx->Viewport.Width, ctx->Viewport.Height); | ||||
|    } else { | ||||
|       ctx->NewState |= _NEW_VIEWPORT; | ||||
|    } | ||||
|  | ||||
| #ifdef I915 | ||||
|    intelCalcViewport(ctx); | ||||
| #else | ||||
|    ctx->NewState |= _NEW_VIEWPORT; | ||||
| #endif | ||||
|    /* Set state we know depends on drawable parameters: | ||||
|     */ | ||||
|    if (ctx->Driver.Scissor) | ||||
| @@ -735,6 +330,12 @@ intel_draw_buffer(GLcontext * ctx, struct gl_framebuffer *fb) | ||||
| static void | ||||
| intelDrawBuffer(GLcontext * ctx, GLenum mode) | ||||
| { | ||||
|    if ((ctx->DrawBuffer != NULL) && (ctx->DrawBuffer->Name == 0)) { | ||||
|       struct intel_context *const intel = intel_context(ctx); | ||||
|  | ||||
|       intel->is_front_buffer_rendering = (mode == GL_FRONT_LEFT); | ||||
|    } | ||||
|  | ||||
|    intel_draw_buffer(ctx, ctx->DrawBuffer); | ||||
| } | ||||
|  | ||||
| @@ -759,7 +360,6 @@ intelReadBuffer(GLcontext * ctx, GLenum mode) | ||||
| void | ||||
| intelInitBufferFuncs(struct dd_function_table *functions) | ||||
| { | ||||
|    functions->Clear = intelClear; | ||||
|    functions->DrawBuffer = intelDrawBuffer; | ||||
|    functions->ReadBuffer = intelReadBuffer; | ||||
| } | ||||
|   | ||||
| @@ -45,10 +45,6 @@ extern struct intel_region *intel_readbuf_region(struct intel_context *intel); | ||||
|  | ||||
| extern struct intel_region *intel_drawbuf_region(struct intel_context *intel); | ||||
|  | ||||
| extern void intelSwapBuffers(__DRIdrawablePrivate * dPriv); | ||||
|  | ||||
| extern void intelWindowMoved(struct intel_context *intel); | ||||
|  | ||||
| extern void intel_draw_buffer(GLcontext * ctx, struct gl_framebuffer *fb); | ||||
|  | ||||
| extern void intelInitBufferFuncs(struct dd_function_table *functions); | ||||
| @@ -57,5 +53,8 @@ void intel_get_cliprects(struct intel_context *intel, | ||||
| 			 struct drm_clip_rect **cliprects, | ||||
| 			 unsigned int *num_cliprects, | ||||
| 			 int *x_off, int *y_off); | ||||
| #ifdef I915 | ||||
| void intelCalcViewport(GLcontext * ctx); | ||||
| #endif | ||||
|  | ||||
| #endif /* INTEL_BUFFERS_H */ | ||||
|   | ||||
| @@ -46,6 +46,13 @@ | ||||
| #define PCI_CHIP_G33_G			0x29C2 | ||||
| #define PCI_CHIP_Q33_G			0x29D2 | ||||
|  | ||||
| #define PCI_CHIP_IGD_GM			0xA011 | ||||
| #define PCI_CHIP_IGD_G			0xA001 | ||||
|  | ||||
| #define IS_IGDGM(devid)	(devid == PCI_CHIP_IGD_GM) | ||||
| #define IS_IGDG(devid)	(devid == PCI_CHIP_IGD_G) | ||||
| #define IS_IGD(devid) (IS_IGDG(devid) || IS_IGDGM(devid)) | ||||
|  | ||||
| #define PCI_CHIP_I965_G			0x29A2 | ||||
| #define PCI_CHIP_I965_Q			0x2992 | ||||
| #define PCI_CHIP_I965_G_1		0x2982 | ||||
| @@ -66,7 +73,7 @@ | ||||
| 				 devid == PCI_CHIP_I945_GME || \ | ||||
| 				 devid == PCI_CHIP_I965_GM || \ | ||||
| 				 devid == PCI_CHIP_I965_GME || \ | ||||
| 				 devid == PCI_CHIP_GM45_GM) | ||||
| 				 devid == PCI_CHIP_GM45_GM || IS_IGD(devid)) | ||||
|  | ||||
| #define IS_G45(devid)           (devid == PCI_CHIP_IGD_E_G || \ | ||||
|                                  devid == PCI_CHIP_Q45_G || \ | ||||
| @@ -84,7 +91,7 @@ | ||||
| 				 devid == PCI_CHIP_I945_GME || \ | ||||
| 				 devid == PCI_CHIP_G33_G || \ | ||||
| 				 devid == PCI_CHIP_Q33_G || \ | ||||
| 				 devid == PCI_CHIP_Q35_G) | ||||
| 				 devid == PCI_CHIP_Q35_G || IS_IGD(devid)) | ||||
|  | ||||
| #define IS_965(devid)		(devid == PCI_CHIP_I965_G || \ | ||||
| 				 devid == PCI_CHIP_I965_Q || \ | ||||
|   | ||||
							
								
								
									
										400
									
								
								src/mesa/drivers/dri/intel/intel_clear.c
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										400
									
								
								src/mesa/drivers/dri/intel/intel_clear.c
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,400 @@ | ||||
| /************************************************************************** | ||||
|  *  | ||||
|  * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas. | ||||
|  * Copyright 2009 Intel Corporation. | ||||
|  * 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 TUNGSTEN 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. | ||||
|  *  | ||||
|  **************************************************************************/ | ||||
|  | ||||
| #include "main/glheader.h" | ||||
| #include "main/enums.h" | ||||
| #include "main/image.h" | ||||
| #include "main/mtypes.h" | ||||
| #include "main/attrib.h" | ||||
| #include "main/blend.h" | ||||
| #include "main/bufferobj.h" | ||||
| #include "main/buffers.h" | ||||
| #include "main/depth.h" | ||||
| #include "main/enable.h" | ||||
| #include "main/macros.h" | ||||
| #include "main/matrix.h" | ||||
| #include "main/texstate.h" | ||||
| #include "main/shaders.h" | ||||
| #include "main/stencil.h" | ||||
| #include "main/varray.h" | ||||
| #include "glapi/dispatch.h" | ||||
| #include "swrast/swrast.h" | ||||
|  | ||||
| #include "intel_context.h" | ||||
| #include "intel_blit.h" | ||||
| #include "intel_chipset.h" | ||||
| #include "intel_clear.h" | ||||
| #include "intel_fbo.h" | ||||
| #include "intel_pixel.h" | ||||
|  | ||||
| #define FILE_DEBUG_FLAG DEBUG_BLIT | ||||
|  | ||||
| #define TRI_CLEAR_COLOR_BITS (BUFFER_BIT_BACK_LEFT |			\ | ||||
| 			      BUFFER_BIT_FRONT_LEFT |			\ | ||||
| 			      BUFFER_BIT_COLOR0 |			\ | ||||
| 			      BUFFER_BIT_COLOR1 |			\ | ||||
| 			      BUFFER_BIT_COLOR2 |			\ | ||||
| 			      BUFFER_BIT_COLOR3 |			\ | ||||
| 			      BUFFER_BIT_COLOR4 |			\ | ||||
| 			      BUFFER_BIT_COLOR5 |			\ | ||||
| 			      BUFFER_BIT_COLOR6 |			\ | ||||
| 			      BUFFER_BIT_COLOR7) | ||||
|  | ||||
| /** | ||||
|  * Perform glClear where mask contains only color, depth, and/or stencil. | ||||
|  * | ||||
|  * The implementation is based on calling into Mesa to set GL state and | ||||
|  * performing normal triangle rendering.  The intent of this path is to | ||||
|  * have as generic a path as possible, so that any driver could make use of | ||||
|  * it. | ||||
|  */ | ||||
| void | ||||
| intel_clear_tris(GLcontext *ctx, GLbitfield mask) | ||||
| { | ||||
|    struct intel_context *intel = intel_context(ctx); | ||||
|    GLfloat vertices[4][3]; | ||||
|    GLfloat color[4][4]; | ||||
|    GLfloat dst_z; | ||||
|    struct gl_framebuffer *fb = ctx->DrawBuffer; | ||||
|    int i; | ||||
|    GLboolean saved_fp_enable = GL_FALSE, saved_vp_enable = GL_FALSE; | ||||
|    GLuint saved_shader_program = 0; | ||||
|    unsigned int saved_active_texture; | ||||
|  | ||||
|    assert((mask & ~(TRI_CLEAR_COLOR_BITS | BUFFER_BIT_DEPTH | | ||||
| 		    BUFFER_BIT_STENCIL)) == 0); | ||||
|  | ||||
|    _mesa_PushAttrib(GL_COLOR_BUFFER_BIT | | ||||
| 		    GL_CURRENT_BIT | | ||||
| 		    GL_DEPTH_BUFFER_BIT | | ||||
| 		    GL_ENABLE_BIT | | ||||
| 		    GL_POLYGON_BIT | | ||||
| 		    GL_STENCIL_BUFFER_BIT | | ||||
| 		    GL_TRANSFORM_BIT | | ||||
| 		    GL_CURRENT_BIT); | ||||
|    _mesa_PushClientAttrib(GL_CLIENT_VERTEX_ARRAY_BIT); | ||||
|    saved_active_texture = ctx->Texture.CurrentUnit; | ||||
|  | ||||
|    /* Disable existing GL state we don't want to apply to a clear. */ | ||||
|    _mesa_Disable(GL_ALPHA_TEST); | ||||
|    _mesa_Disable(GL_BLEND); | ||||
|    _mesa_Disable(GL_CULL_FACE); | ||||
|    _mesa_Disable(GL_FOG); | ||||
|    _mesa_Disable(GL_POLYGON_SMOOTH); | ||||
|    _mesa_Disable(GL_POLYGON_STIPPLE); | ||||
|    _mesa_Disable(GL_POLYGON_OFFSET_FILL); | ||||
|    _mesa_Disable(GL_LIGHTING); | ||||
|    _mesa_Disable(GL_CLIP_PLANE0); | ||||
|    _mesa_Disable(GL_CLIP_PLANE1); | ||||
|    _mesa_Disable(GL_CLIP_PLANE2); | ||||
|    _mesa_Disable(GL_CLIP_PLANE3); | ||||
|    _mesa_Disable(GL_CLIP_PLANE4); | ||||
|    _mesa_Disable(GL_CLIP_PLANE5); | ||||
|    _mesa_PolygonMode(GL_FRONT_AND_BACK, GL_FILL); | ||||
|    if (ctx->Extensions.ARB_fragment_program && ctx->FragmentProgram.Enabled) { | ||||
|       saved_fp_enable = GL_TRUE; | ||||
|       _mesa_Disable(GL_FRAGMENT_PROGRAM_ARB); | ||||
|    } | ||||
|    if (ctx->Extensions.ARB_vertex_program && ctx->VertexProgram.Enabled) { | ||||
|       saved_vp_enable = GL_TRUE; | ||||
|       _mesa_Disable(GL_VERTEX_PROGRAM_ARB); | ||||
|    } | ||||
|    if (ctx->Extensions.ARB_shader_objects && ctx->Shader.CurrentProgram) { | ||||
|       saved_shader_program = ctx->Shader.CurrentProgram->Name; | ||||
|       _mesa_UseProgramObjectARB(0); | ||||
|    } | ||||
|  | ||||
|    if (ctx->Texture._EnabledUnits != 0) { | ||||
|       int i; | ||||
|  | ||||
|       for (i = 0; i < ctx->Const.MaxTextureUnits; i++) { | ||||
| 	 _mesa_ActiveTextureARB(GL_TEXTURE0 + i); | ||||
| 	 _mesa_Disable(GL_TEXTURE_1D); | ||||
| 	 _mesa_Disable(GL_TEXTURE_2D); | ||||
| 	 _mesa_Disable(GL_TEXTURE_3D); | ||||
| 	 if (ctx->Extensions.ARB_texture_cube_map) | ||||
| 	    _mesa_Disable(GL_TEXTURE_CUBE_MAP_ARB); | ||||
| 	 if (ctx->Extensions.NV_texture_rectangle) | ||||
| 	    _mesa_Disable(GL_TEXTURE_RECTANGLE_NV); | ||||
| 	 if (ctx->Extensions.MESA_texture_array) { | ||||
| 	    _mesa_Disable(GL_TEXTURE_1D_ARRAY_EXT); | ||||
| 	    _mesa_Disable(GL_TEXTURE_2D_ARRAY_EXT); | ||||
| 	 } | ||||
|       } | ||||
|    } | ||||
|  | ||||
| #if FEATURE_ARB_vertex_buffer_object | ||||
|    _mesa_BindBufferARB(GL_ARRAY_BUFFER_ARB, 0); | ||||
|    _mesa_BindBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, 0); | ||||
| #endif | ||||
|  | ||||
|    intel_meta_set_passthrough_transform(intel); | ||||
|  | ||||
|    for (i = 0; i < 4; i++) { | ||||
|       color[i][0] = ctx->Color.ClearColor[0]; | ||||
|       color[i][1] = ctx->Color.ClearColor[1]; | ||||
|       color[i][2] = ctx->Color.ClearColor[2]; | ||||
|       color[i][3] = ctx->Color.ClearColor[3]; | ||||
|    } | ||||
|  | ||||
|    /* convert clear Z from [0,1] to NDC coord in [-1,1] */ | ||||
|    dst_z = -1.0 + 2.0 * ctx->Depth.Clear; | ||||
|  | ||||
|    /* Prepare the vertices, which are the same regardless of which buffer we're | ||||
|     * drawing to. | ||||
|     */ | ||||
|    vertices[0][0] = fb->_Xmin; | ||||
|    vertices[0][1] = fb->_Ymin; | ||||
|    vertices[0][2] = dst_z; | ||||
|    vertices[1][0] = fb->_Xmax; | ||||
|    vertices[1][1] = fb->_Ymin; | ||||
|    vertices[1][2] = dst_z; | ||||
|    vertices[2][0] = fb->_Xmax; | ||||
|    vertices[2][1] = fb->_Ymax; | ||||
|    vertices[2][2] = dst_z; | ||||
|    vertices[3][0] = fb->_Xmin; | ||||
|    vertices[3][1] = fb->_Ymax; | ||||
|    vertices[3][2] = dst_z; | ||||
|  | ||||
|    _mesa_ColorPointer(4, GL_FLOAT, 4 * sizeof(GLfloat), &color); | ||||
|    _mesa_VertexPointer(3, GL_FLOAT, 3 * sizeof(GLfloat), &vertices); | ||||
|    _mesa_Enable(GL_COLOR_ARRAY); | ||||
|    _mesa_Enable(GL_VERTEX_ARRAY); | ||||
|  | ||||
|    while (mask != 0) { | ||||
|       GLuint this_mask = 0; | ||||
|       GLuint color_bit; | ||||
|  | ||||
|       color_bit = _mesa_ffs(mask & TRI_CLEAR_COLOR_BITS); | ||||
|       if (color_bit != 0) | ||||
| 	 this_mask |= (1 << (color_bit - 1)); | ||||
|  | ||||
|       /* Clear depth/stencil in the same pass as color. */ | ||||
|       this_mask |= (mask & (BUFFER_BIT_DEPTH | BUFFER_BIT_STENCIL)); | ||||
|  | ||||
|       /* Select the current color buffer and use the color write mask if | ||||
|        * we have one, otherwise don't write any color channels. | ||||
|        */ | ||||
|       if (this_mask & BUFFER_BIT_FRONT_LEFT) | ||||
| 	 _mesa_DrawBuffer(GL_FRONT_LEFT); | ||||
|       else if (this_mask & BUFFER_BIT_BACK_LEFT) | ||||
| 	 _mesa_DrawBuffer(GL_BACK_LEFT); | ||||
|       else if (color_bit != 0) | ||||
| 	 _mesa_DrawBuffer(GL_COLOR_ATTACHMENT0 + | ||||
| 			  (color_bit - BUFFER_COLOR0 - 1)); | ||||
|       else | ||||
| 	 _mesa_ColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE); | ||||
|  | ||||
|       /* Control writing of the depth clear value to depth. */ | ||||
|       if (this_mask & BUFFER_BIT_DEPTH) { | ||||
| 	 _mesa_DepthFunc(GL_ALWAYS); | ||||
| 	 _mesa_Enable(GL_DEPTH_TEST); | ||||
|       } else { | ||||
| 	 _mesa_Disable(GL_DEPTH_TEST); | ||||
| 	 _mesa_DepthMask(GL_FALSE); | ||||
|       } | ||||
|  | ||||
|       /* Control writing of the stencil clear value to stencil. */ | ||||
|       if (this_mask & BUFFER_BIT_STENCIL) { | ||||
| 	 _mesa_Enable(GL_STENCIL_TEST); | ||||
| 	 _mesa_StencilOp(GL_REPLACE, GL_REPLACE, GL_REPLACE); | ||||
| 	 _mesa_StencilFuncSeparate(GL_FRONT, GL_ALWAYS, ctx->Stencil.Clear, | ||||
| 				   ctx->Stencil.WriteMask[0]); | ||||
|       } else { | ||||
| 	 _mesa_Disable(GL_STENCIL_TEST); | ||||
|       } | ||||
|  | ||||
|       CALL_DrawArrays(ctx->Exec, (GL_TRIANGLE_FAN, 0, 4)); | ||||
|  | ||||
|       mask &= ~this_mask; | ||||
|    } | ||||
|  | ||||
|    intel_meta_restore_transform(intel); | ||||
|  | ||||
|    _mesa_ActiveTextureARB(GL_TEXTURE0 + saved_active_texture); | ||||
|    if (saved_fp_enable) | ||||
|       _mesa_Enable(GL_FRAGMENT_PROGRAM_ARB); | ||||
|    if (saved_vp_enable) | ||||
|       _mesa_Enable(GL_VERTEX_PROGRAM_ARB); | ||||
|  | ||||
|    if (saved_shader_program) | ||||
|       _mesa_UseProgramObjectARB(saved_shader_program); | ||||
|  | ||||
|    _mesa_PopClientAttrib(); | ||||
|    _mesa_PopAttrib(); | ||||
| } | ||||
|  | ||||
| static const char *buffer_names[] = { | ||||
|    [BUFFER_FRONT_LEFT] = "front", | ||||
|    [BUFFER_BACK_LEFT] = "back", | ||||
|    [BUFFER_FRONT_RIGHT] = "front right", | ||||
|    [BUFFER_BACK_RIGHT] = "back right", | ||||
|    [BUFFER_AUX0] = "aux0", | ||||
|    [BUFFER_AUX1] = "aux1", | ||||
|    [BUFFER_AUX2] = "aux2", | ||||
|    [BUFFER_AUX3] = "aux3", | ||||
|    [BUFFER_DEPTH] = "depth", | ||||
|    [BUFFER_STENCIL] = "stencil", | ||||
|    [BUFFER_ACCUM] = "accum", | ||||
|    [BUFFER_COLOR0] = "color0", | ||||
|    [BUFFER_COLOR1] = "color1", | ||||
|    [BUFFER_COLOR2] = "color2", | ||||
|    [BUFFER_COLOR3] = "color3", | ||||
|    [BUFFER_COLOR4] = "color4", | ||||
|    [BUFFER_COLOR5] = "color5", | ||||
|    [BUFFER_COLOR6] = "color6", | ||||
|    [BUFFER_COLOR7] = "color7", | ||||
| }; | ||||
|  | ||||
| /** | ||||
|  * Called by ctx->Driver.Clear. | ||||
|  */ | ||||
| static void | ||||
| intelClear(GLcontext *ctx, GLbitfield mask) | ||||
| { | ||||
|    struct intel_context *intel = intel_context(ctx); | ||||
|    const GLuint colorMask = *((GLuint *) & ctx->Color.ColorMask); | ||||
|    GLbitfield tri_mask = 0; | ||||
|    GLbitfield blit_mask = 0; | ||||
|    GLbitfield swrast_mask = 0; | ||||
|    struct gl_framebuffer *fb = ctx->DrawBuffer; | ||||
|    GLuint i; | ||||
|  | ||||
|    if (0) | ||||
|       fprintf(stderr, "%s\n", __FUNCTION__); | ||||
|  | ||||
|    /* HW color buffers (front, back, aux, generic FBO, etc) */ | ||||
|    if (colorMask == ~0) { | ||||
|       /* clear all R,G,B,A */ | ||||
|       /* XXX FBO: need to check if colorbuffers are software RBOs! */ | ||||
|       blit_mask |= (mask & BUFFER_BITS_COLOR); | ||||
|    } | ||||
|    else { | ||||
|       /* glColorMask in effect */ | ||||
|       tri_mask |= (mask & (BUFFER_BIT_FRONT_LEFT | BUFFER_BIT_BACK_LEFT)); | ||||
|    } | ||||
|  | ||||
|    /* HW stencil */ | ||||
|    if (mask & BUFFER_BIT_STENCIL) { | ||||
|       const struct intel_region *stencilRegion | ||||
|          = intel_get_rb_region(fb, BUFFER_STENCIL); | ||||
|       if (stencilRegion) { | ||||
|          /* have hw stencil */ | ||||
|          if (IS_965(intel->intelScreen->deviceID) || | ||||
| 	     (ctx->Stencil.WriteMask[0] & 0xff) != 0xff) { | ||||
| 	    /* We have to use the 3D engine if we're clearing a partial mask | ||||
| 	     * of the stencil buffer, or if we're on a 965 which has a tiled | ||||
| 	     * depth/stencil buffer in a layout we can't blit to. | ||||
| 	     */ | ||||
|             tri_mask |= BUFFER_BIT_STENCIL; | ||||
|          } | ||||
|          else { | ||||
|             /* clearing all stencil bits, use blitting */ | ||||
|             blit_mask |= BUFFER_BIT_STENCIL; | ||||
|          } | ||||
|       } | ||||
|    } | ||||
|  | ||||
|    /* HW depth */ | ||||
|    if (mask & BUFFER_BIT_DEPTH) { | ||||
|       /* clear depth with whatever method is used for stencil (see above) */ | ||||
|       if (IS_965(intel->intelScreen->deviceID) || | ||||
| 	  tri_mask & BUFFER_BIT_STENCIL) | ||||
|          tri_mask |= BUFFER_BIT_DEPTH; | ||||
|       else | ||||
|          blit_mask |= BUFFER_BIT_DEPTH; | ||||
|    } | ||||
|  | ||||
|    /* If we're doing a tri pass for depth/stencil, include a likely color | ||||
|     * buffer with it. | ||||
|     */ | ||||
|    if (mask & (BUFFER_BIT_DEPTH | BUFFER_BIT_STENCIL)) { | ||||
|       int color_bit = _mesa_ffs(mask & TRI_CLEAR_COLOR_BITS); | ||||
|       if (color_bit != 0) { | ||||
| 	 tri_mask |= blit_mask & (1 << (color_bit - 1)); | ||||
| 	 blit_mask &= ~(1 << (color_bit - 1)); | ||||
|       } | ||||
|    } | ||||
|  | ||||
|    /* SW fallback clearing */ | ||||
|    swrast_mask = mask & ~tri_mask & ~blit_mask; | ||||
|  | ||||
|    for (i = 0; i < BUFFER_COUNT; i++) { | ||||
|       GLuint bufBit = 1 << i; | ||||
|       if ((blit_mask | tri_mask) & bufBit) { | ||||
|          if (!fb->Attachment[i].Renderbuffer->ClassID) { | ||||
|             blit_mask &= ~bufBit; | ||||
|             tri_mask &= ~bufBit; | ||||
|             swrast_mask |= bufBit; | ||||
|          } | ||||
|       } | ||||
|    } | ||||
|  | ||||
|    if (blit_mask) { | ||||
|       if (INTEL_DEBUG & DEBUG_BLIT) { | ||||
| 	 DBG("blit clear:"); | ||||
| 	 for (i = 0; i < BUFFER_COUNT; i++) { | ||||
| 	    if (blit_mask & (1 << i)) | ||||
| 	       DBG(" %s", buffer_names[i]); | ||||
| 	 } | ||||
| 	 DBG("\n"); | ||||
|       } | ||||
|       intelClearWithBlit(ctx, blit_mask); | ||||
|    } | ||||
|  | ||||
|    if (tri_mask) { | ||||
|       if (INTEL_DEBUG & DEBUG_BLIT) { | ||||
| 	 DBG("tri clear:"); | ||||
| 	 for (i = 0; i < BUFFER_COUNT; i++) { | ||||
| 	    if (tri_mask & (1 << i)) | ||||
| 	       DBG(" %s", buffer_names[i]); | ||||
| 	 } | ||||
| 	 DBG("\n"); | ||||
|       } | ||||
|       intel_clear_tris(ctx, tri_mask); | ||||
|    } | ||||
|  | ||||
|    if (swrast_mask) { | ||||
|       if (INTEL_DEBUG & DEBUG_BLIT) { | ||||
| 	 DBG("swrast clear:"); | ||||
| 	 for (i = 0; i < BUFFER_COUNT; i++) { | ||||
| 	    if (swrast_mask & (1 << i)) | ||||
| 	       DBG(" %s", buffer_names[i]); | ||||
| 	 } | ||||
| 	 DBG("\n"); | ||||
|       } | ||||
|       _swrast_Clear(ctx, swrast_mask); | ||||
|    } | ||||
| } | ||||
|  | ||||
|  | ||||
| void | ||||
| intelInitClearFuncs(struct dd_function_table *functions) | ||||
| { | ||||
|    functions->Clear = intelClear; | ||||
| } | ||||
							
								
								
									
										38
									
								
								src/mesa/drivers/dri/intel/intel_clear.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										38
									
								
								src/mesa/drivers/dri/intel/intel_clear.h
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,38 @@ | ||||
|  | ||||
| /************************************************************************** | ||||
|  *  | ||||
|  * Copyright 2006 Tungsten Graphics, Inc., Cedar Park, Texas. | ||||
|  * 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 TUNGSTEN 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 INTEL_CLEAR_H | ||||
| #define INTEL_CLEAR_H | ||||
|  | ||||
| struct dd_function_table; | ||||
|  | ||||
| extern void | ||||
| intelInitClearFuncs(struct dd_function_table *functions); | ||||
|  | ||||
|  | ||||
| #endif /* INTEL_CLEAR_H */ | ||||
| @@ -53,12 +53,14 @@ | ||||
| #include "intel_tex.h" | ||||
| #include "intel_batchbuffer.h" | ||||
| #include "intel_blit.h" | ||||
| #include "intel_clear.h" | ||||
| #include "intel_pixel.h" | ||||
| #include "intel_regions.h" | ||||
| #include "intel_buffer_objects.h" | ||||
| #include "intel_fbo.h" | ||||
| #include "intel_decode.h" | ||||
| #include "intel_bufmgr.h" | ||||
| #include "intel_swapbuffers.h" | ||||
|  | ||||
| #include "drirenderbuffer.h" | ||||
| #include "vblank.h" | ||||
| @@ -95,7 +97,7 @@ int INTEL_DEBUG = (0); | ||||
|  | ||||
| #include "extension_helper.h" | ||||
|  | ||||
| #define DRIVER_DATE                     "20090114" | ||||
| #define DRIVER_DATE                     "20090418 2009Q1" | ||||
| #define DRIVER_DATE_GEM                 "GEM " DRIVER_DATE | ||||
|  | ||||
| static const GLubyte * | ||||
| @@ -151,6 +153,10 @@ intelGetString(GLcontext * ctx, GLenum name) | ||||
|       case PCI_CHIP_Q33_G: | ||||
| 	 chipset = "Intel(R) Q33"; | ||||
| 	 break; | ||||
|       case PCI_CHIP_IGD_GM: | ||||
|       case PCI_CHIP_IGD_G: | ||||
| 	 chipset = "Intel(R) IGD"; | ||||
| 	 break; | ||||
|       case PCI_CHIP_I965_Q: | ||||
| 	 chipset = "Intel(R) 965Q"; | ||||
| 	 break; | ||||
| @@ -259,6 +265,11 @@ intel_update_renderbuffers(__DRIcontext *context, __DRIdrawable *drawable) | ||||
| 	   region_name = "dri2 front buffer"; | ||||
| 	   break; | ||||
|  | ||||
|        case __DRI_BUFFER_FAKE_FRONT_LEFT: | ||||
| 	   rb = intel_fb->color_rb[0]; | ||||
| 	   region_name = "dri2 fake front buffer"; | ||||
| 	   break; | ||||
|  | ||||
|        case __DRI_BUFFER_BACK_LEFT: | ||||
| 	   rb = intel_fb->color_rb[1]; | ||||
| 	   region_name = "dri2 back buffer"; | ||||
| @@ -282,6 +293,9 @@ intel_update_renderbuffers(__DRIcontext *context, __DRIdrawable *drawable) | ||||
| 	   return; | ||||
|        } | ||||
|  | ||||
|        if (rb == NULL) | ||||
| 	  continue; | ||||
|  | ||||
|        if (rb->region) { | ||||
| 	  dri_bo_flink(rb->region->buffer, &name); | ||||
| 	  if (name == buffers[i].name) | ||||
| @@ -496,9 +510,8 @@ intelInvalidateState(GLcontext * ctx, GLuint new_state) | ||||
|       intel->vtbl.invalidate_state( intel, new_state ); | ||||
| } | ||||
|  | ||||
|  | ||||
| void | ||||
| intelFlush(GLcontext * ctx) | ||||
| static void | ||||
| intel_flush(GLcontext *ctx, GLboolean needs_mi_flush) | ||||
| { | ||||
|    struct intel_context *intel = intel_context(ctx); | ||||
|  | ||||
| @@ -512,10 +525,44 @@ intelFlush(GLcontext * ctx) | ||||
|     * lands onscreen in a timely manner, even if the X Server doesn't trigger | ||||
|     * a flush for us. | ||||
|     */ | ||||
|    intel_batchbuffer_emit_mi_flush(intel->batch); | ||||
|    if (needs_mi_flush) | ||||
|       intel_batchbuffer_emit_mi_flush(intel->batch); | ||||
|  | ||||
|    if (intel->batch->map != intel->batch->ptr) | ||||
|       intel_batchbuffer_flush(intel->batch); | ||||
|  | ||||
|    if ((ctx->DrawBuffer->Name == 0) && intel->front_buffer_dirty) { | ||||
|       __DRIscreen *const screen = intel->intelScreen->driScrnPriv; | ||||
|  | ||||
|       if (screen->dri2.loader | ||||
|           && (screen->dri2.loader->base.version >= 2) | ||||
| 	  && (screen->dri2.loader->flushFrontBuffer != NULL)) { | ||||
| 	 (*screen->dri2.loader->flushFrontBuffer)(intel->driDrawable, | ||||
| 						  intel->driDrawable->loaderPrivate); | ||||
|  | ||||
| 	 /* Only clear the dirty bit if front-buffer rendering is no longer | ||||
| 	  * enabled.  This is done so that the dirty bit can only be set in | ||||
| 	  * glDrawBuffer.  Otherwise the dirty bit would have to be set at | ||||
| 	  * each of N places that do rendering.  This has worse performances, | ||||
| 	  * but it is much easier to get correct. | ||||
| 	  */ | ||||
| 	 if (intel->is_front_buffer_rendering) { | ||||
| 	    intel->front_buffer_dirty = GL_FALSE; | ||||
| 	 } | ||||
|       } | ||||
|    } | ||||
| } | ||||
|  | ||||
| void | ||||
| intelFlush(GLcontext * ctx) | ||||
| { | ||||
|    intel_flush(ctx, GL_FALSE); | ||||
| } | ||||
|  | ||||
| void | ||||
| intel_glFlush(GLcontext *ctx) | ||||
| { | ||||
|    intel_flush(ctx, GL_TRUE); | ||||
| } | ||||
|  | ||||
| void | ||||
| @@ -544,7 +591,7 @@ intelInitDriverFunctions(struct dd_function_table *functions) | ||||
| { | ||||
|    _mesa_init_driver_functions(functions); | ||||
|  | ||||
|    functions->Flush = intelFlush; | ||||
|    functions->Flush = intel_glFlush; | ||||
|    functions->Finish = intelFinish; | ||||
|    functions->GetString = intelGetString; | ||||
|    functions->UpdateState = intelInvalidateState; | ||||
| @@ -556,6 +603,7 @@ intelInitDriverFunctions(struct dd_function_table *functions) | ||||
|  | ||||
|    intelInitTextureFuncs(functions); | ||||
|    intelInitStateFuncs(functions); | ||||
|    intelInitClearFuncs(functions); | ||||
|    intelInitBufferFuncs(functions); | ||||
|    intelInitPixelFuncs(functions); | ||||
| } | ||||
| @@ -620,10 +668,16 @@ intelInitContext(struct intel_context *intel, | ||||
|     * start. | ||||
|     */ | ||||
|    if (getenv("INTEL_STRICT_CONFORMANCE")) { | ||||
|       intel->strict_conformance = 1; | ||||
|       unsigned int value = atoi(getenv("INTEL_STRICT_CONFORMANCE")); | ||||
|       if (value > 0) { | ||||
|          intel->conformance_mode = value; | ||||
|       } | ||||
|       else { | ||||
|          intel->conformance_mode = 1; | ||||
|       } | ||||
|    } | ||||
|  | ||||
|    if (intel->strict_conformance) { | ||||
|    if (intel->conformance_mode > 0) { | ||||
|       ctx->Const.MinLineWidth = 1.0; | ||||
|       ctx->Const.MinLineWidthAA = 1.0; | ||||
|       ctx->Const.MaxLineWidth = 1.0; | ||||
| @@ -858,6 +912,11 @@ intelMakeCurrent(__DRIcontextPrivate * driContextPriv, | ||||
| 		  ? driGetDefaultVBlankFlags(&intel->optionCache) | ||||
| 		 : VBLANK_FLAG_NO_IRQ; | ||||
|  | ||||
| 	       /* Prevent error printf if one crtc is disabled, this will | ||||
| 		* be properly calculated in intelWindowMoved() next. | ||||
| 		*/ | ||||
| 		driDrawPriv->vblFlags = intelFixupVblank(intel, driDrawPriv); | ||||
|  | ||||
| 	       (*psp->systemTime->getUST) (&intel_fb->swap_ust); | ||||
| 	       driDrawableInitVBlank(driDrawPriv); | ||||
| 	       intel_fb->vbl_waited = driDrawPriv->vblSeq; | ||||
|   | ||||
| @@ -168,6 +168,7 @@ struct intel_context | ||||
|  | ||||
|       GLint saved_vp_x, saved_vp_y; | ||||
|       GLsizei saved_vp_width, saved_vp_height; | ||||
|       GLenum saved_matrix_mode; | ||||
|    } meta; | ||||
|  | ||||
|    GLint refcount; | ||||
| @@ -209,7 +210,6 @@ struct intel_context | ||||
|    char *prevLockFile; | ||||
|    int prevLockLine; | ||||
|  | ||||
|    GLubyte clear_chan[4]; | ||||
|    GLuint ClearColor565; | ||||
|    GLuint ClearColor8888; | ||||
|  | ||||
| @@ -229,7 +229,12 @@ struct intel_context | ||||
|    GLboolean hw_stipple; | ||||
|    GLboolean depth_buffer_is_float; | ||||
|    GLboolean no_rast; | ||||
|    GLboolean strict_conformance; | ||||
|  | ||||
|    /* 0 - nonconformant, best performance; | ||||
|     * 1 - fallback to sw for known conformance bugs | ||||
|     * 2 - always fallback to sw | ||||
|     */ | ||||
|    GLuint conformance_mode; | ||||
|  | ||||
|    /* State for intelvb.c and inteltris.c. | ||||
|     */ | ||||
| @@ -255,11 +260,29 @@ struct intel_context | ||||
|     * flush time while the lock is held. | ||||
|     */ | ||||
|    GLboolean constant_cliprect; | ||||
|  | ||||
|    /** | ||||
|     * In !constant_cliprect mode, set to true if the front cliprects should be | ||||
|     * used instead of back. | ||||
|     */ | ||||
|    GLboolean front_cliprects; | ||||
|  | ||||
|    /** | ||||
|     * Set if rendering has occured to the drawable's front buffer. | ||||
|     * | ||||
|     * This is used in the DRI2 case to detect that glFlush should also copy | ||||
|     * the contents of the fake front buffer to the real front buffer. | ||||
|     */ | ||||
|    GLboolean front_buffer_dirty; | ||||
|  | ||||
|    /** | ||||
|     * Track whether front-buffer rendering is currently enabled | ||||
|     * | ||||
|     * A separate flag is used to track this in order to support MRT more | ||||
|     * easily. | ||||
|     */ | ||||
|    GLboolean is_front_buffer_rendering; | ||||
|  | ||||
|    drm_clip_rect_t fboRect;     /**< cliprect for FBO rendering */ | ||||
|  | ||||
|    int perf_boxes; | ||||
| @@ -435,6 +458,7 @@ extern void intelGetLock(struct intel_context *intel, GLuint flags); | ||||
|  | ||||
| extern void intelFinish(GLcontext * ctx); | ||||
| extern void intelFlush(GLcontext * ctx); | ||||
| extern void intel_glFlush(GLcontext *ctx); | ||||
|  | ||||
| extern void intelInitDriverFunctions(struct dd_function_table *functions); | ||||
| extern void intelInitExtensions(GLcontext *ctx, GLboolean enable_imaging); | ||||
|   | ||||
| @@ -87,27 +87,28 @@ decode_mi(uint32_t *data, int count, uint32_t hw_offset, int *failures) | ||||
|  | ||||
|     struct { | ||||
| 	uint32_t opcode; | ||||
| 	int len_mask; | ||||
| 	int min_len; | ||||
| 	int max_len; | ||||
| 	char *name; | ||||
|     } opcodes_mi[] = { | ||||
| 	{ 0x08, 1, 1, "MI_ARB_ON_OFF" }, | ||||
| 	{ 0x0a, 1, 1, "MI_BATCH_BUFFER_END" }, | ||||
| 	{ 0x31, 2, 2, "MI_BATCH_BUFFER_START" }, | ||||
| 	{ 0x14, 3, 3, "MI_DISPLAY_BUFFER_INFO" }, | ||||
| 	{ 0x04, 1, 1, "MI_FLUSH" }, | ||||
| 	{ 0x22, 3, 3, "MI_LOAD_REGISTER_IMM" }, | ||||
| 	{ 0x13, 2, 2, "MI_LOAD_SCAN_LINES_EXCL" }, | ||||
| 	{ 0x12, 2, 2, "MI_LOAD_SCAN_LINES_INCL" }, | ||||
| 	{ 0x00, 1, 1, "MI_NOOP" }, | ||||
| 	{ 0x11, 2, 2, "MI_OVERLAY_FLIP" }, | ||||
| 	{ 0x07, 1, 1, "MI_REPORT_HEAD" }, | ||||
| 	{ 0x18, 2, 2, "MI_SET_CONTEXT" }, | ||||
| 	{ 0x20, 3, 4, "MI_STORE_DATA_IMM" }, | ||||
| 	{ 0x21, 3, 4, "MI_STORE_DATA_INDEX" }, | ||||
| 	{ 0x24, 3, 3, "MI_STORE_REGISTER_MEM" }, | ||||
| 	{ 0x02, 1, 1, "MI_USER_INTERRUPT" }, | ||||
| 	{ 0x03, 1, 1, "MI_WAIT_FOR_EVENT" }, | ||||
| 	{ 0x08, 0, 1, 1, "MI_ARB_ON_OFF" }, | ||||
| 	{ 0x0a, 0, 1, 1, "MI_BATCH_BUFFER_END" }, | ||||
| 	{ 0x31, 0x3f, 2, 2, "MI_BATCH_BUFFER_START" }, | ||||
| 	{ 0x14, 0x3f, 3, 3, "MI_DISPLAY_BUFFER_INFO" }, | ||||
| 	{ 0x04, 0, 1, 1, "MI_FLUSH" }, | ||||
| 	{ 0x22, 0, 3, 3, "MI_LOAD_REGISTER_IMM" }, | ||||
| 	{ 0x13, 0x3f, 2, 2, "MI_LOAD_SCAN_LINES_EXCL" }, | ||||
| 	{ 0x12, 0x3f, 2, 2, "MI_LOAD_SCAN_LINES_INCL" }, | ||||
| 	{ 0x00, 0, 1, 1, "MI_NOOP" }, | ||||
| 	{ 0x11, 0x3f, 2, 2, "MI_OVERLAY_FLIP" }, | ||||
| 	{ 0x07, 0, 1, 1, "MI_REPORT_HEAD" }, | ||||
| 	{ 0x18, 0x3f, 2, 2, "MI_SET_CONTEXT" }, | ||||
| 	{ 0x20, 0x3f, 3, 4, "MI_STORE_DATA_IMM" }, | ||||
| 	{ 0x21, 0x3f, 3, 4, "MI_STORE_DATA_INDEX" }, | ||||
| 	{ 0x24, 0x3f, 3, 3, "MI_STORE_REGISTER_MEM" }, | ||||
| 	{ 0x02, 0, 1, 1, "MI_USER_INTERRUPT" }, | ||||
| 	{ 0x03, 0, 1, 1, "MI_WAIT_FOR_EVENT" }, | ||||
|     }; | ||||
|  | ||||
|  | ||||
| @@ -118,12 +119,14 @@ decode_mi(uint32_t *data, int count, uint32_t hw_offset, int *failures) | ||||
|  | ||||
| 	    instr_out(data, hw_offset, 0, "%s\n", opcodes_mi[opcode].name); | ||||
| 	    if (opcodes_mi[opcode].max_len > 1) { | ||||
| 		len = (data[0] & 0x000000ff) + 2; | ||||
| 		len = (data[0] & opcodes_mi[opcode].len_mask) + 2; | ||||
| 		if (len < opcodes_mi[opcode].min_len || | ||||
| 		    len > opcodes_mi[opcode].max_len) | ||||
| 		{ | ||||
| 		    fprintf(out, "Bad length in %s\n", | ||||
| 			    opcodes_mi[opcode].name); | ||||
| 		    fprintf(out, "Bad length (%d) in %s, [%d, %d]\n", | ||||
| 			    len, opcodes_mi[opcode].name, | ||||
| 			    opcodes_mi[opcode].min_len, | ||||
| 			    opcodes_mi[opcode].max_len); | ||||
| 		} | ||||
| 	    } | ||||
|  | ||||
| @@ -932,7 +935,7 @@ decode_3d_1d(uint32_t *data, int count, uint32_t hw_offset, int *failures, int i | ||||
| 	instr_out(data, hw_offset, 0, "3DSTATE_PIXEL_SHADER_CONSTANTS\n"); | ||||
| 	len = (data[0] & 0x000000ff) + 2; | ||||
|  | ||||
| 	i = 1; | ||||
| 	i = 2; | ||||
| 	for (c = 0; c <= 31; c++) { | ||||
| 	    if (data[1] & (1 << c)) { | ||||
| 		if (i + 4 >= count) | ||||
| @@ -952,7 +955,7 @@ decode_3d_1d(uint32_t *data, int count, uint32_t hw_offset, int *failures, int i | ||||
| 	    } | ||||
| 	} | ||||
| 	if (len != i) { | ||||
| 	    fprintf(out, "Bad count in 3DSTATE_MAP_STATE\n"); | ||||
| 	    fprintf(out, "Bad count in 3DSTATE_PIXEL_SHADER_CONSTANTS\n"); | ||||
| 	    (*failures)++; | ||||
| 	} | ||||
| 	return len; | ||||
|   | ||||
| @@ -266,7 +266,8 @@ intel_alloc_renderbuffer_storage(GLcontext * ctx, struct gl_renderbuffer *rb, | ||||
|       DBG("Allocating %d x %d Intel RBO (pitch %d)\n", width, | ||||
| 	  height, pitch); | ||||
|  | ||||
|       irb->region = intel_region_alloc(intel, cpp, width, height, pitch); | ||||
|       irb->region = intel_region_alloc(intel, cpp, width, height, pitch, | ||||
| 				       GL_TRUE); | ||||
|       if (!irb->region) | ||||
|          return GL_FALSE;       /* out of memory? */ | ||||
|  | ||||
| @@ -344,7 +345,8 @@ intel_renderbuffer_set_region(struct intel_renderbuffer *rb, | ||||
|    intel_region_reference(&rb->region, region); | ||||
|    intel_region_release(&old); | ||||
|  | ||||
|    rb->pfPitch = region->pitch; | ||||
|    if (region) | ||||
|       rb->pfPitch = region->pitch; | ||||
| } | ||||
|  | ||||
| /** | ||||
|   | ||||
| @@ -103,7 +103,8 @@ intel_miptree_create(struct intel_context *intel, | ||||
| 		     GLuint last_level, | ||||
| 		     GLuint width0, | ||||
| 		     GLuint height0, | ||||
| 		     GLuint depth0, GLuint cpp, GLuint compress_byte) | ||||
| 		     GLuint depth0, GLuint cpp, GLuint compress_byte, | ||||
| 		     GLboolean expect_accelerated_upload) | ||||
| { | ||||
|    struct intel_mipmap_tree *mt; | ||||
|  | ||||
| @@ -120,7 +121,8 @@ intel_miptree_create(struct intel_context *intel, | ||||
| 				   mt->cpp, | ||||
| 				   mt->pitch, | ||||
| 				   mt->total_height, | ||||
| 				   mt->pitch); | ||||
| 				   mt->pitch, | ||||
| 				   expect_accelerated_upload); | ||||
|  | ||||
|    if (!mt->region) { | ||||
|        free(mt); | ||||
|   | ||||
| @@ -133,7 +133,8 @@ struct intel_mipmap_tree *intel_miptree_create(struct intel_context *intel, | ||||
|                                                GLuint height0, | ||||
|                                                GLuint depth0, | ||||
|                                                GLuint cpp, | ||||
|                                                GLuint compress_byte); | ||||
|                                                GLuint compress_byte, | ||||
| 					       GLboolean expect_accelerated_upload); | ||||
|  | ||||
| struct intel_mipmap_tree * | ||||
| intel_miptree_create_for_region(struct intel_context *intel, | ||||
|   | ||||
| @@ -181,6 +181,7 @@ intel_meta_set_passthrough_transform(struct intel_context *intel) | ||||
|    intel->meta.saved_vp_y = ctx->Viewport.Y; | ||||
|    intel->meta.saved_vp_width = ctx->Viewport.Width; | ||||
|    intel->meta.saved_vp_height = ctx->Viewport.Height; | ||||
|    intel->meta.saved_matrix_mode = ctx->Transform.MatrixMode; | ||||
|  | ||||
|    _mesa_Viewport(0, 0, ctx->DrawBuffer->Width, ctx->DrawBuffer->Height); | ||||
|  | ||||
| @@ -202,6 +203,8 @@ intel_meta_restore_transform(struct intel_context *intel) | ||||
|    _mesa_MatrixMode(GL_MODELVIEW); | ||||
|    _mesa_PopMatrix(); | ||||
|  | ||||
|    _mesa_MatrixMode(intel->meta.saved_matrix_mode); | ||||
|  | ||||
|    _mesa_Viewport(intel->meta.saved_vp_x, intel->meta.saved_vp_y, | ||||
| 		  intel->meta.saved_vp_width, intel->meta.saved_vp_height); | ||||
| } | ||||
|   | ||||
| @@ -76,4 +76,6 @@ void intelBitmap(GLcontext * ctx, | ||||
| 		 const struct gl_pixelstore_attrib *unpack, | ||||
| 		 const GLubyte * pixels); | ||||
|  | ||||
| void intel_clear_tris(GLcontext *ctx, GLbitfield mask); | ||||
|  | ||||
| #endif | ||||
|   | ||||
Some files were not shown because too many files have changed in this diff Show More
		Reference in New Issue
	
	Block a user