Compare commits
	
		
			106 Commits
		
	
	
		
			mesa-7.4-1
			...
			mesa_7_4_3
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 
						 | 
					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 | 
							
								
								
									
										8
									
								
								Makefile
									
									
									
									
									
								
							
							
						
						
									
										8
									
								
								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,7 +178,7 @@ ultrix-gcc:
 | 
			
		||||
 | 
			
		||||
# Rules for making release tarballs
 | 
			
		||||
 | 
			
		||||
VERSION=7.4
 | 
			
		||||
VERSION=7.4.3
 | 
			
		||||
DIRECTORY = Mesa-$(VERSION)
 | 
			
		||||
LIB_NAME = MesaLib-$(VERSION)
 | 
			
		||||
DEMO_NAME = MesaDemos-$(VERSION)
 | 
			
		||||
 
 | 
			
		||||
@@ -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=2
 | 
			
		||||
MESA_VERSION = $(MESA_MAJOR).$(MESA_MINOR).$(MESA_TINY)
 | 
			
		||||
 | 
			
		||||
# external projects.  This should be useless now that we use libdrm.
 | 
			
		||||
 
 | 
			
		||||
@@ -786,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
 | 
			
		||||
@@ -805,9 +805,6 @@ osmesa)
 | 
			
		||||
    OSMESA_PC_REQ="gl"
 | 
			
		||||
    ;;
 | 
			
		||||
esac
 | 
			
		||||
if test "$enable_static" = no; then
 | 
			
		||||
    OSMESA_LIB_DEPS="$OSMESA_LIB_DEPS"
 | 
			
		||||
fi
 | 
			
		||||
OSMESA_PC_LIB_PRIV="$OSMESA_PC_LIB_PRIV"
 | 
			
		||||
AC_SUBST([OSMESA_LIB_DEPS])
 | 
			
		||||
AC_SUBST([OSMESA_MESA_DEPS])
 | 
			
		||||
 
 | 
			
		||||
@@ -9,9 +9,7 @@
 | 
			
		||||
<H1>Downloading</H1>
 | 
			
		||||
 | 
			
		||||
<p>
 | 
			
		||||
Current stable release: <b>7.4</b>
 | 
			
		||||
<br>
 | 
			
		||||
Last unstable/development release: <b>7.3</b>
 | 
			
		||||
Current stable release: <b>7.4.3</b>
 | 
			
		||||
</p>
 | 
			
		||||
 | 
			
		||||
<p>
 | 
			
		||||
 
 | 
			
		||||
@@ -11,6 +11,27 @@
 | 
			
		||||
<H1>News</H1>
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
<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.
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										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>
 | 
			
		||||
							
								
								
									
										70
									
								
								docs/relnotes-7.4.3.html
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										70
									
								
								docs/relnotes-7.4.3.html
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,70 @@
 | 
			
		||||
<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>
 | 
			
		||||
</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>
 | 
			
		||||
@@ -20,13 +20,21 @@ 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>
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -20,6 +20,9 @@ The release notes summarize what's new or changed in each Mesa release.
 | 
			
		||||
</p>
 | 
			
		||||
 | 
			
		||||
<UL>
 | 
			
		||||
<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>
 | 
			
		||||
 
 | 
			
		||||
@@ -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);
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 
 | 
			
		||||
@@ -271,9 +271,24 @@ 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");
 | 
			
		||||
   VertCoord_attr = glGetAttribLocation_func(program, "VertCoord");
 | 
			
		||||
 | 
			
		||||
   printf("TexCoord0_attr = %d\n", TexCoord0_attr);
 | 
			
		||||
   printf("TexCoord1_attr = %d\n", TexCoord1_attr);
 | 
			
		||||
   printf("VertCoord_attr = %d\n", VertCoord_attr);
 | 
			
		||||
 
 | 
			
		||||
@@ -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;
 | 
			
		||||
 
 | 
			
		||||
@@ -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);
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -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);
 | 
			
		||||
 
 | 
			
		||||
@@ -74,7 +74,6 @@ struct __GLXDRIdrawablePrivateRec {
 | 
			
		||||
    int bufferCount;
 | 
			
		||||
    int width, height;
 | 
			
		||||
    int have_back;
 | 
			
		||||
    int have_front;
 | 
			
		||||
    int have_fake_front;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
@@ -195,7 +194,7 @@ static void dri2CopySubBuffer(__GLXDRIdrawable *pdraw,
 | 
			
		||||
    XserverRegion region;
 | 
			
		||||
 | 
			
		||||
    /* Check we have the right attachments */
 | 
			
		||||
    if (!(priv->have_front && priv->have_back))
 | 
			
		||||
    if (!priv->have_back)
 | 
			
		||||
    	return;
 | 
			
		||||
 | 
			
		||||
    xrect.x = x;
 | 
			
		||||
@@ -223,7 +222,7 @@ static void dri2WaitX(__GLXDRIdrawable *pdraw)
 | 
			
		||||
    XserverRegion region;
 | 
			
		||||
 | 
			
		||||
    /* Check we have the right attachments */
 | 
			
		||||
    if (!(priv->have_fake_front && priv->have_front))
 | 
			
		||||
    if (!priv->have_fake_front)
 | 
			
		||||
    	return;
 | 
			
		||||
 | 
			
		||||
    xrect.x = 0;
 | 
			
		||||
@@ -243,7 +242,7 @@ static void dri2WaitGL(__GLXDRIdrawable *pdraw)
 | 
			
		||||
    XRectangle xrect;
 | 
			
		||||
    XserverRegion region;
 | 
			
		||||
 | 
			
		||||
    if (!(priv->have_fake_front && priv->have_front))
 | 
			
		||||
    if (!priv->have_fake_front)
 | 
			
		||||
    	return;
 | 
			
		||||
 | 
			
		||||
    xrect.x = 0;
 | 
			
		||||
@@ -257,6 +256,15 @@ static void dri2WaitGL(__GLXDRIdrawable *pdraw)
 | 
			
		||||
    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 */
 | 
			
		||||
@@ -283,7 +291,6 @@ dri2GetBuffers(__DRIdrawable *driDrawable,
 | 
			
		||||
    pdraw->width = *width;
 | 
			
		||||
    pdraw->height = *height;
 | 
			
		||||
    pdraw->bufferCount = *out_count;
 | 
			
		||||
    pdraw->have_front = 0;
 | 
			
		||||
    pdraw->have_fake_front = 0;
 | 
			
		||||
    pdraw->have_back = 0;
 | 
			
		||||
 | 
			
		||||
@@ -295,8 +302,6 @@ 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_FRONT_LEFT)
 | 
			
		||||
	    pdraw->have_front = 1;
 | 
			
		||||
	if (pdraw->buffers[i].attachment == __DRI_BUFFER_FAKE_FRONT_LEFT)
 | 
			
		||||
	    pdraw->have_fake_front = 1;
 | 
			
		||||
	if (pdraw->buffers[i].attachment == __DRI_BUFFER_BACK_LEFT)
 | 
			
		||||
@@ -311,6 +316,7 @@ dri2GetBuffers(__DRIdrawable *driDrawable,
 | 
			
		||||
static const __DRIdri2LoaderExtension dri2LoaderExtension = {
 | 
			
		||||
    { __DRI_DRI2_LOADER, __DRI_DRI2_LOADER_VERSION },
 | 
			
		||||
    dri2GetBuffers,
 | 
			
		||||
    dri2FlushFrontBuffer
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
static const __DRIextension *loader_extensions[] = {
 | 
			
		||||
 
 | 
			
		||||
@@ -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;
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -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;
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -1702,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;
 | 
			
		||||
 
 | 
			
		||||
@@ -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
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -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;
 | 
			
		||||
   }
 | 
			
		||||
@@ -75,7 +76,7 @@ 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.
 | 
			
		||||
    */
 | 
			
		||||
   if (intel_rendering_to_texture(ctx)) {
 | 
			
		||||
   if (render_to_fbo) {
 | 
			
		||||
      /* texmemory: Y=0=bottom */
 | 
			
		||||
      sfv.scissor.xmin = ctx->DrawBuffer->_Xmin;
 | 
			
		||||
      sfv.scissor.xmax = ctx->DrawBuffer->_Xmax - 1;
 | 
			
		||||
@@ -114,7 +115,7 @@ 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
 | 
			
		||||
@@ -147,7 +148,7 @@ sf_unit_populate_key(struct brw_context *brw, struct brw_sf_unit_key *key)
 | 
			
		||||
   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 *
 | 
			
		||||
@@ -194,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:
 | 
			
		||||
 
 | 
			
		||||
@@ -310,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));
 | 
			
		||||
@@ -326,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;
 | 
			
		||||
@@ -333,6 +335,7 @@ 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, ctx->Color.ColorMask,
 | 
			
		||||
	  sizeof(key.color_mask));
 | 
			
		||||
@@ -354,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;
 | 
			
		||||
@@ -380,12 +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_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);
 | 
			
		||||
      }
 | 
			
		||||
   }
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -204,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)
 | 
			
		||||
@@ -328,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);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -93,6 +93,7 @@ intel_clear_tris(GLcontext *ctx, GLbitfield mask)
 | 
			
		||||
		    GL_CURRENT_BIT |
 | 
			
		||||
		    GL_DEPTH_BUFFER_BIT |
 | 
			
		||||
		    GL_ENABLE_BIT |
 | 
			
		||||
		    GL_POLYGON_BIT |
 | 
			
		||||
		    GL_STENCIL_BUFFER_BIT |
 | 
			
		||||
		    GL_TRANSFORM_BIT |
 | 
			
		||||
		    GL_CURRENT_BIT);
 | 
			
		||||
@@ -114,6 +115,7 @@ intel_clear_tris(GLcontext *ctx, GLbitfield mask)
 | 
			
		||||
   _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);
 | 
			
		||||
@@ -146,6 +148,11 @@ intel_clear_tris(GLcontext *ctx, GLbitfield mask)
 | 
			
		||||
      }
 | 
			
		||||
   }
 | 
			
		||||
 | 
			
		||||
#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++) {
 | 
			
		||||
 
 | 
			
		||||
@@ -97,7 +97,7 @@ int INTEL_DEBUG = (0);
 | 
			
		||||
 | 
			
		||||
#include "extension_helper.h"
 | 
			
		||||
 | 
			
		||||
#define DRIVER_DATE                     "20090326 2009Q1 RC2"
 | 
			
		||||
#define DRIVER_DATE                     "20090418 2009Q1"
 | 
			
		||||
#define DRIVER_DATE_GEM                 "GEM " DRIVER_DATE
 | 
			
		||||
 | 
			
		||||
static const GLubyte *
 | 
			
		||||
@@ -265,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";
 | 
			
		||||
@@ -525,6 +530,27 @@ intel_flush(GLcontext *ctx, GLboolean needs_mi_flush)
 | 
			
		||||
 | 
			
		||||
   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
 | 
			
		||||
 
 | 
			
		||||
@@ -260,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;
 | 
			
		||||
 
 | 
			
		||||
@@ -183,7 +183,7 @@ intel_meta_set_passthrough_transform(struct intel_context *intel)
 | 
			
		||||
   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);*/
 | 
			
		||||
   _mesa_Viewport(0, 0, ctx->DrawBuffer->Width, ctx->DrawBuffer->Height);
 | 
			
		||||
 | 
			
		||||
   _mesa_MatrixMode(GL_PROJECTION);
 | 
			
		||||
   _mesa_PushMatrix();
 | 
			
		||||
@@ -205,8 +205,8 @@ intel_meta_restore_transform(struct intel_context *intel)
 | 
			
		||||
 | 
			
		||||
   _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);*/
 | 
			
		||||
   _mesa_Viewport(intel->meta.saved_vp_x, intel->meta.saved_vp_y,
 | 
			
		||||
		  intel->meta.saved_vp_width, intel->meta.saved_vp_height);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 
 | 
			
		||||
@@ -385,7 +385,31 @@ intelCreateBuffer(__DRIscreenPrivate * driScrnPriv,
 | 
			
		||||
static void
 | 
			
		||||
intelDestroyBuffer(__DRIdrawablePrivate * driDrawPriv)
 | 
			
		||||
{
 | 
			
		||||
   _mesa_unreference_framebuffer((GLframebuffer **)(&(driDrawPriv->driverPrivate)));
 | 
			
		||||
   struct intel_framebuffer *intel_fb = driDrawPriv->driverPrivate;
 | 
			
		||||
   struct intel_renderbuffer *depth_rb;
 | 
			
		||||
   struct intel_renderbuffer *stencil_rb;
 | 
			
		||||
 | 
			
		||||
   if (intel_fb) {
 | 
			
		||||
      if (intel_fb->color_rb[0]) {
 | 
			
		||||
         intel_renderbuffer_set_region(intel_fb->color_rb[0], NULL);
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
      if (intel_fb->color_rb[1]) {
 | 
			
		||||
         intel_renderbuffer_set_region(intel_fb->color_rb[1], NULL);
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
      depth_rb = intel_get_renderbuffer(&intel_fb->Base, BUFFER_DEPTH);
 | 
			
		||||
      if (depth_rb) {
 | 
			
		||||
         intel_renderbuffer_set_region(depth_rb, NULL);
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
      stencil_rb = intel_get_renderbuffer(&intel_fb->Base, BUFFER_STENCIL);
 | 
			
		||||
      if (stencil_rb) {
 | 
			
		||||
         intel_renderbuffer_set_region(stencil_rb, NULL);
 | 
			
		||||
      }
 | 
			
		||||
   }
 | 
			
		||||
 | 
			
		||||
   _mesa_reference_framebuffer((GLframebuffer **)(&(driDrawPriv->driverPrivate)), NULL);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -211,7 +211,7 @@ struct r300_tex_obj {
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
struct r300_texture_env_state {
 | 
			
		||||
	r300TexObjPtr texobj;
 | 
			
		||||
	struct gl_texture_object *texobj;
 | 
			
		||||
	GLenum format;
 | 
			
		||||
	GLenum envMode;
 | 
			
		||||
};
 | 
			
		||||
 
 | 
			
		||||
@@ -1487,7 +1487,7 @@ static void r300SetupTextures(GLcontext * ctx)
 | 
			
		||||
#endif
 | 
			
		||||
			tmu_mappings[i] = hw_tmu;
 | 
			
		||||
 | 
			
		||||
			t = r300->state.texture.unit[i].texobj;
 | 
			
		||||
			t = (r300TexObjPtr) r300->state.texture.unit[i].texobj->DriverData;
 | 
			
		||||
			/* XXX questionable fix for bug 9170: */
 | 
			
		||||
			if (!t)
 | 
			
		||||
				continue;
 | 
			
		||||
 
 | 
			
		||||
@@ -44,6 +44,7 @@ SOFTWARE.
 | 
			
		||||
#include "main/colormac.h"
 | 
			
		||||
#include "main/macros.h"
 | 
			
		||||
#include "main/simple_list.h"
 | 
			
		||||
#include "main/texobj.h"
 | 
			
		||||
#include "radeon_reg.h"		/* gets definition for usleep */
 | 
			
		||||
#include "r300_context.h"
 | 
			
		||||
#include "r300_state.h"
 | 
			
		||||
@@ -71,8 +72,8 @@ void r300DestroyTexObj(r300ContextPtr rmesa, r300TexObjPtr t)
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	for (i = 0; i < rmesa->radeon.glCtx->Const.MaxTextureUnits; i++) {
 | 
			
		||||
		if (rmesa->state.texture.unit[i].texobj == t) {
 | 
			
		||||
			rmesa->state.texture.unit[i].texobj = NULL;
 | 
			
		||||
		if (rmesa->state.texture.unit[i].texobj == t->base.tObj) {
 | 
			
		||||
			_mesa_reference_texobj(&rmesa->state.texture.unit[i].texobj, NULL);
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -567,19 +567,20 @@ static GLboolean r300UpdateTexture(GLcontext * ctx, int unit)
 | 
			
		||||
	/* Update state if this is a different texture object to last
 | 
			
		||||
	 * time.
 | 
			
		||||
	 */
 | 
			
		||||
	if (rmesa->state.texture.unit[unit].texobj != t) {
 | 
			
		||||
	if (rmesa->state.texture.unit[unit].texobj != tObj) {
 | 
			
		||||
		if (rmesa->state.texture.unit[unit].texobj != NULL) {
 | 
			
		||||
			r300TexObjPtr t_old = (r300TexObjPtr) rmesa->state.texture.unit[unit].texobj->DriverData;
 | 
			
		||||
 | 
			
		||||
			/* The old texture is no longer bound to this texture unit.
 | 
			
		||||
			 * Mark it as such.
 | 
			
		||||
			 */
 | 
			
		||||
 | 
			
		||||
			rmesa->state.texture.unit[unit].texobj->base.bound &=
 | 
			
		||||
			    ~(1 << unit);
 | 
			
		||||
			t_old->base.bound &= ~(1 << unit);
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		rmesa->state.texture.unit[unit].texobj = t;
 | 
			
		||||
		_mesa_reference_texobj(&rmesa->state.texture.unit[unit].texobj, tObj);
 | 
			
		||||
		t->base.bound |= (1 << unit);
 | 
			
		||||
		driUpdateTextureLRU((driTextureObject *) t);	/* XXX: should be locked! */
 | 
			
		||||
		driUpdateTextureLRU(&t->base);	/* XXX: should be locked! */
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	return !t->border_fallback;
 | 
			
		||||
 
 | 
			
		||||
@@ -259,8 +259,6 @@ radeonFillInModes( __DRIscreenPrivate *psp,
 | 
			
		||||
    __GLcontextModes *m;
 | 
			
		||||
    unsigned depth_buffer_factor;
 | 
			
		||||
    unsigned back_buffer_factor;
 | 
			
		||||
    GLenum fb_format;
 | 
			
		||||
    GLenum fb_type;
 | 
			
		||||
    int i;
 | 
			
		||||
 | 
			
		||||
    /* Right now GLX_SWAP_COPY_OML isn't supported, but it would be easy
 | 
			
		||||
@@ -289,19 +287,24 @@ radeonFillInModes( __DRIscreenPrivate *psp,
 | 
			
		||||
    depth_buffer_factor = ((depth_bits != 0) || (stencil_bits != 0)) ? 2 : 1;
 | 
			
		||||
    back_buffer_factor  = (have_back_buffer) ? 2 : 1;
 | 
			
		||||
 | 
			
		||||
    if ( pixel_bits == 16 ) {
 | 
			
		||||
        fb_format = GL_RGB;
 | 
			
		||||
        fb_type = GL_UNSIGNED_SHORT_5_6_5;
 | 
			
		||||
    }
 | 
			
		||||
    else {
 | 
			
		||||
        fb_format = GL_BGRA;
 | 
			
		||||
        fb_type = GL_UNSIGNED_INT_8_8_8_8_REV;
 | 
			
		||||
    }
 | 
			
		||||
    if (pixel_bits == 16) {
 | 
			
		||||
	__DRIconfig **configs_a8r8g8b8;
 | 
			
		||||
	__DRIconfig **configs_r5g6b5;
 | 
			
		||||
 | 
			
		||||
	configs_r5g6b5 = driCreateConfigs(GL_RGB, GL_UNSIGNED_SHORT_5_6_5,
 | 
			
		||||
					  depth_bits_array, stencil_bits_array,
 | 
			
		||||
					  depth_buffer_factor, back_buffer_modes,
 | 
			
		||||
					  back_buffer_factor);
 | 
			
		||||
	configs_a8r8g8b8 = driCreateConfigs(GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV,
 | 
			
		||||
					    depth_bits_array, stencil_bits_array,
 | 
			
		||||
					    1, back_buffer_modes, 1);
 | 
			
		||||
	configs = driConcatConfigs(configs_r5g6b5, configs_a8r8g8b8);
 | 
			
		||||
   } else
 | 
			
		||||
	configs = driCreateConfigs(GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV,
 | 
			
		||||
				   depth_bits_array, stencil_bits_array,
 | 
			
		||||
				   depth_buffer_factor,
 | 
			
		||||
				   back_buffer_modes, back_buffer_factor);
 | 
			
		||||
 | 
			
		||||
    configs = driCreateConfigs(fb_format, fb_type,
 | 
			
		||||
			       depth_bits_array, stencil_bits_array,
 | 
			
		||||
			       depth_buffer_factor,
 | 
			
		||||
			       back_buffer_modes, back_buffer_factor);
 | 
			
		||||
    if (configs == NULL) {
 | 
			
		||||
	fprintf( stderr, "[%s:%u] Error creating FBConfig!\n",
 | 
			
		||||
		 __func__, __LINE__ );
 | 
			
		||||
@@ -551,11 +554,8 @@ radeonCreateScreen( __DRIscreenPrivate *sPriv )
 | 
			
		||||
      screen->chip_family = CHIP_FAMILY_RS300;
 | 
			
		||||
      break;
 | 
			
		||||
 | 
			
		||||
      /* 9500 with 1 pipe verified by: Reid Linnemann <lreid@cs.okstate.edu> */
 | 
			
		||||
 | 
			
		||||
   case PCI_CHIP_R300_AD:
 | 
			
		||||
      screen->chip_family = CHIP_FAMILY_RV350;
 | 
			
		||||
      screen->chip_flags = RADEON_CHIPSET_TCL;
 | 
			
		||||
      break;
 | 
			
		||||
   case PCI_CHIP_R300_AE:
 | 
			
		||||
   case PCI_CHIP_R300_AF:
 | 
			
		||||
   case PCI_CHIP_R300_AG:
 | 
			
		||||
@@ -883,6 +883,18 @@ radeonCreateScreen( __DRIscreenPrivate *sPriv )
 | 
			
		||||
       } else {
 | 
			
		||||
	   screen->num_gb_pipes = temp;
 | 
			
		||||
       }
 | 
			
		||||
 | 
			
		||||
       /* pipe overrides */
 | 
			
		||||
       switch (dri_priv->deviceID) {
 | 
			
		||||
       case PCI_CHIP_R300_AD: /* 9500 with 1 quadpipe verified by: Reid Linnemann <lreid@cs.okstate.edu> */
 | 
			
		||||
       case PCI_CHIP_RV410_5E4C: /* RV410 SE only have 1 quadpipe */
 | 
			
		||||
       case PCI_CHIP_RV410_5E4F: /* RV410 SE only have 1 quadpipe */
 | 
			
		||||
	   screen->num_gb_pipes = 1;
 | 
			
		||||
	   break;
 | 
			
		||||
       default:
 | 
			
		||||
	   break;
 | 
			
		||||
       }
 | 
			
		||||
 | 
			
		||||
   }
 | 
			
		||||
 | 
			
		||||
   if ( sPriv->drm_version.minor >= 10 ) {
 | 
			
		||||
 
 | 
			
		||||
@@ -19,11 +19,12 @@ INCLUDE_DIRS = \
 | 
			
		||||
	-I$(TOP)/src/mesa \
 | 
			
		||||
	-I$(TOP)/src/mesa/main
 | 
			
		||||
 | 
			
		||||
# Standalone osmesa needs to be linked with core Mesa APIs
 | 
			
		||||
ifeq ($(DRIVER_DIRS), osmesa)
 | 
			
		||||
CORE_MESA = $(TOP)/src/mesa/libmesa.a $(TOP)/src/mesa/libglapi.a
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
.PHONY: osmesa8
 | 
			
		||||
.PHONY: osmesa16
 | 
			
		||||
else
 | 
			
		||||
CORE_MESA =
 | 
			
		||||
endif
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
.c.o:
 | 
			
		||||
@@ -31,31 +32,12 @@ CORE_MESA = $(TOP)/src/mesa/libmesa.a $(TOP)/src/mesa/libglapi.a
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
default: $(TOP)/$(LIB_DIR)/$(OSMESA_LIB_NAME)
 | 
			
		||||
	@ if [ "${DRIVER_DIRS}" = "osmesa" ] ; then \
 | 
			
		||||
		$(MAKE) osmesa16 ; \
 | 
			
		||||
	else \
 | 
			
		||||
		$(MAKE) osmesa8 ; \
 | 
			
		||||
	fi
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# The normal libOSMesa is used in conjuction with libGL
 | 
			
		||||
osmesa8: $(TOP)/$(LIB_DIR)/$(OSMESA_LIB_NAME)
 | 
			
		||||
 | 
			
		||||
$(TOP)/$(LIB_DIR)/$(OSMESA_LIB_NAME): $(OBJECTS)
 | 
			
		||||
	$(MKLIB) -o $(OSMESA_LIB) -linker '$(CC)' -ldflags '$(LDFLAGS)' \
 | 
			
		||||
		-major $(MESA_MAJOR) -minor $(MESA_MINOR) -patch $(MESA_TINY) \
 | 
			
		||||
		-install $(TOP)/$(LIB_DIR) $(MKLIB_OPTIONS) \
 | 
			
		||||
		-id $(INSTALL_LIB_DIR)/lib$(OSMESA_LIB).$(MESA_MAJOR).dylib \
 | 
			
		||||
		$(OSMESA_LIB_DEPS) $(OBJECTS)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# The libOSMesa16/libOSMesa32 libraries do not use libGL but rather are built
 | 
			
		||||
# with all the other Mesa sources (compiled with -DCHAN_BITS=16/32
 | 
			
		||||
osmesa16: $(OBJECTS) $(CORE_MESA)
 | 
			
		||||
# libOSMesa can be used in conjuction with libGL or with all other Mesa
 | 
			
		||||
# sources. We can also build libOSMesa16/libOSMesa32 by setting
 | 
			
		||||
# -DCHAN_BITS=16/32.
 | 
			
		||||
$(TOP)/$(LIB_DIR)/$(OSMESA_LIB_NAME): $(OBJECTS) $(CORE_MESA)
 | 
			
		||||
	$(MKLIB) -o $(OSMESA_LIB) -linker '$(CC)' -ldflags '$(LDFLAGS)' \
 | 
			
		||||
		-major $(MESA_MAJOR) -minor $(MESA_MINOR) -patch $(MESA_TINY) \
 | 
			
		||||
		-install $(TOP)/$(LIB_DIR) $(MKLIB_OPTIONS) \
 | 
			
		||||
 
 | 
			
		||||
@@ -2218,7 +2218,7 @@ Fake_glXCreatePixmap( Display *dpy, GLXFBConfig config, Pixmap pixmap,
 | 
			
		||||
   if (!dpy || !config || !pixmap)
 | 
			
		||||
      return 0;
 | 
			
		||||
 | 
			
		||||
   for (attr = attribList; *attr; attr++) {
 | 
			
		||||
   for (attr = attribList; attr && *attr; attr++) {
 | 
			
		||||
      switch (*attr) {
 | 
			
		||||
      case GLX_TEXTURE_FORMAT_EXT:
 | 
			
		||||
         attr++;
 | 
			
		||||
 
 | 
			
		||||
@@ -1176,7 +1176,7 @@ _mesa_PopAttrib(void)
 | 
			
		||||
 | 
			
		||||
               /* restore clip planes */
 | 
			
		||||
               for (i = 0; i < MAX_CLIP_PLANES; i++) {
 | 
			
		||||
                  const GLuint mask = 1 << 1;
 | 
			
		||||
                  const GLuint mask = 1 << i;
 | 
			
		||||
                  const GLfloat *eyePlane = xform->EyeUserPlane[i];
 | 
			
		||||
                  COPY_4V(ctx->Transform.EyeUserPlane[i], eyePlane);
 | 
			
		||||
                  if (xform->ClipPlanesEnabled & mask) {
 | 
			
		||||
 
 | 
			
		||||
@@ -1549,6 +1549,24 @@ initialize_framebuffer_size(GLcontext *ctx, GLframebuffer *fb)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Check if the viewport/scissor size has not yet been initialized.
 | 
			
		||||
 * Initialize the size if the given width and height are non-zero.
 | 
			
		||||
 */
 | 
			
		||||
void
 | 
			
		||||
_mesa_check_init_viewport(GLcontext *ctx, GLuint width, GLuint height)
 | 
			
		||||
{
 | 
			
		||||
   if (!ctx->ViewportInitialized && width > 0 && height > 0) {
 | 
			
		||||
      /* Note: set flag here, before calling _mesa_set_viewport(), to prevent
 | 
			
		||||
       * potential infinite recursion.
 | 
			
		||||
       */
 | 
			
		||||
      ctx->ViewportInitialized = GL_TRUE;
 | 
			
		||||
      _mesa_set_viewport(ctx, 0, 0, width, height);
 | 
			
		||||
      _mesa_set_scissor(ctx, 0, 0, width, height);
 | 
			
		||||
   }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Bind the given context to the given drawBuffer and readBuffer and
 | 
			
		||||
 * make it the current context for the calling thread.
 | 
			
		||||
@@ -1651,25 +1669,24 @@ _mesa_make_current( GLcontext *newCtx, GLframebuffer *drawBuffer,
 | 
			
		||||
         ASSERT(drawBuffer->Height > 0);
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
         if (newCtx->FirstTimeCurrent) {
 | 
			
		||||
            /* set initial viewport and scissor size now */
 | 
			
		||||
            _mesa_set_viewport(newCtx, 0, 0,
 | 
			
		||||
                               drawBuffer->Width, drawBuffer->Height);
 | 
			
		||||
	    _mesa_set_scissor(newCtx, 0, 0,
 | 
			
		||||
			      drawBuffer->Width, drawBuffer->Height );
 | 
			
		||||
            check_context_limits(newCtx);
 | 
			
		||||
         if (drawBuffer) {
 | 
			
		||||
            _mesa_check_init_viewport(newCtx,
 | 
			
		||||
                                      drawBuffer->Width, drawBuffer->Height);
 | 
			
		||||
         }
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
      /* We can use this to help debug user's problems.  Tell them to set
 | 
			
		||||
       * the MESA_INFO env variable before running their app.  Then the
 | 
			
		||||
       * first time each context is made current we'll print some useful
 | 
			
		||||
       * information.
 | 
			
		||||
       */
 | 
			
		||||
      if (newCtx->FirstTimeCurrent) {
 | 
			
		||||
         check_context_limits(newCtx);
 | 
			
		||||
 | 
			
		||||
         /* We can use this to help debug user's problems.  Tell them to set
 | 
			
		||||
          * the MESA_INFO env variable before running their app.  Then the
 | 
			
		||||
          * first time each context is made current we'll print some useful
 | 
			
		||||
          * information.
 | 
			
		||||
          */
 | 
			
		||||
	 if (_mesa_getenv("MESA_INFO")) {
 | 
			
		||||
	    _mesa_print_info();
 | 
			
		||||
	 }
 | 
			
		||||
 | 
			
		||||
	 newCtx->FirstTimeCurrent = GL_FALSE;
 | 
			
		||||
      }
 | 
			
		||||
   }
 | 
			
		||||
 
 | 
			
		||||
@@ -132,6 +132,9 @@ extern void
 | 
			
		||||
_mesa_make_current( GLcontext *ctx, GLframebuffer *drawBuffer,
 | 
			
		||||
                    GLframebuffer *readBuffer );
 | 
			
		||||
 | 
			
		||||
extern void
 | 
			
		||||
_mesa_check_init_viewport(GLcontext *ctx, GLuint width, GLuint height);
 | 
			
		||||
 | 
			
		||||
extern GLboolean
 | 
			
		||||
_mesa_share_state(GLcontext *ctx, GLcontext *ctxToShare);
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -77,28 +77,30 @@ _mesa_DrawPixels( GLsizei width, GLsizei height,
 | 
			
		||||
   }
 | 
			
		||||
 | 
			
		||||
   if (ctx->RenderMode == GL_RENDER) {
 | 
			
		||||
      /* Round, to satisfy conformance tests (matches SGI's OpenGL) */
 | 
			
		||||
      GLint x = IROUND(ctx->Current.RasterPos[0]);
 | 
			
		||||
      GLint y = IROUND(ctx->Current.RasterPos[1]);
 | 
			
		||||
      if (width > 0 && height > 0) {
 | 
			
		||||
         /* Round, to satisfy conformance tests (matches SGI's OpenGL) */
 | 
			
		||||
         GLint x = IROUND(ctx->Current.RasterPos[0]);
 | 
			
		||||
         GLint y = IROUND(ctx->Current.RasterPos[1]);
 | 
			
		||||
 | 
			
		||||
      if (ctx->Unpack.BufferObj->Name) {
 | 
			
		||||
         /* unpack from PBO */
 | 
			
		||||
         if (!_mesa_validate_pbo_access(2, &ctx->Unpack, width, height, 1,
 | 
			
		||||
                                        format, type, pixels)) {
 | 
			
		||||
            _mesa_error(ctx, GL_INVALID_OPERATION,
 | 
			
		||||
                        "glDrawPixels(invalid PBO access)");
 | 
			
		||||
            return;
 | 
			
		||||
         }
 | 
			
		||||
         if (ctx->Unpack.BufferObj->Pointer) {
 | 
			
		||||
            /* buffer is mapped - that's an error */
 | 
			
		||||
            _mesa_error(ctx, GL_INVALID_OPERATION,
 | 
			
		||||
                        "glDrawPixels(PBO is mapped)");
 | 
			
		||||
            return;
 | 
			
		||||
         if (ctx->Unpack.BufferObj->Name) {
 | 
			
		||||
            /* unpack from PBO */
 | 
			
		||||
            if (!_mesa_validate_pbo_access(2, &ctx->Unpack, width, height, 1,
 | 
			
		||||
                                           format, type, pixels)) {
 | 
			
		||||
               _mesa_error(ctx, GL_INVALID_OPERATION,
 | 
			
		||||
                           "glDrawPixels(invalid PBO access)");
 | 
			
		||||
               return;
 | 
			
		||||
            }
 | 
			
		||||
            if (ctx->Unpack.BufferObj->Pointer) {
 | 
			
		||||
               /* buffer is mapped - that's an error */
 | 
			
		||||
               _mesa_error(ctx, GL_INVALID_OPERATION,
 | 
			
		||||
                           "glDrawPixels(PBO is mapped)");
 | 
			
		||||
               return;
 | 
			
		||||
            }
 | 
			
		||||
         }
 | 
			
		||||
 | 
			
		||||
         ctx->Driver.DrawPixels(ctx, x, y, width, height, format, type,
 | 
			
		||||
                                &ctx->Unpack, pixels);
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
      ctx->Driver.DrawPixels(ctx, x, y, width, height, format, type,
 | 
			
		||||
			     &ctx->Unpack, pixels);
 | 
			
		||||
   }
 | 
			
		||||
   else if (ctx->RenderMode == GL_FEEDBACK) {
 | 
			
		||||
      /* Feedback the current raster pos info */
 | 
			
		||||
@@ -159,10 +161,12 @@ _mesa_CopyPixels( GLint srcx, GLint srcy, GLsizei width, GLsizei height,
 | 
			
		||||
 | 
			
		||||
   if (ctx->RenderMode == GL_RENDER) {
 | 
			
		||||
      /* Round to satisfy conformance tests (matches SGI's OpenGL) */
 | 
			
		||||
      GLint destx = IROUND(ctx->Current.RasterPos[0]);
 | 
			
		||||
      GLint desty = IROUND(ctx->Current.RasterPos[1]);
 | 
			
		||||
      ctx->Driver.CopyPixels( ctx, srcx, srcy, width, height, destx, desty,
 | 
			
		||||
			      type );
 | 
			
		||||
      if (width > 0 && height > 0) {
 | 
			
		||||
         GLint destx = IROUND(ctx->Current.RasterPos[0]);
 | 
			
		||||
         GLint desty = IROUND(ctx->Current.RasterPos[1]);
 | 
			
		||||
         ctx->Driver.CopyPixels( ctx, srcx, srcy, width, height, destx, desty,
 | 
			
		||||
                                 type );
 | 
			
		||||
      }
 | 
			
		||||
   }
 | 
			
		||||
   else if (ctx->RenderMode == GL_FEEDBACK) {
 | 
			
		||||
      FLUSH_CURRENT( ctx, 0 );
 | 
			
		||||
 
 | 
			
		||||
@@ -323,6 +323,7 @@ test_attachment_completeness(const GLcontext *ctx, GLenum format,
 | 
			
		||||
            /* OK */
 | 
			
		||||
         }
 | 
			
		||||
         else if (ctx->Extensions.EXT_packed_depth_stencil &&
 | 
			
		||||
                  ctx->Extensions.ARB_depth_texture &&
 | 
			
		||||
                  texImage->TexFormat->BaseFormat == GL_DEPTH_STENCIL_EXT) {
 | 
			
		||||
            /* OK */
 | 
			
		||||
         }
 | 
			
		||||
@@ -332,9 +333,18 @@ test_attachment_completeness(const GLcontext *ctx, GLenum format,
 | 
			
		||||
         }
 | 
			
		||||
      }
 | 
			
		||||
      else {
 | 
			
		||||
         /* no such thing as stencil textures */
 | 
			
		||||
         att->Complete = GL_FALSE;
 | 
			
		||||
         return;
 | 
			
		||||
         ASSERT(format == GL_STENCIL);
 | 
			
		||||
         ASSERT(att->Renderbuffer->StencilBits);
 | 
			
		||||
         if (ctx->Extensions.EXT_packed_depth_stencil &&
 | 
			
		||||
             ctx->Extensions.ARB_depth_texture &&
 | 
			
		||||
             att->Renderbuffer->_BaseFormat == GL_DEPTH_STENCIL_EXT) {
 | 
			
		||||
            /* OK */
 | 
			
		||||
         }
 | 
			
		||||
         else {
 | 
			
		||||
            /* no such thing as stencil-only textures */
 | 
			
		||||
            att->Complete = GL_FALSE;
 | 
			
		||||
            return;
 | 
			
		||||
         }
 | 
			
		||||
      }
 | 
			
		||||
   }
 | 
			
		||||
   else if (att->Type == GL_RENDERBUFFER_EXT) {
 | 
			
		||||
 
 | 
			
		||||
@@ -1104,6 +1104,9 @@ static void build_lighting( struct tnl_program *p )
 | 
			
		||||
 | 
			
		||||
   if (twoside) {
 | 
			
		||||
      if (!p->state->material_shininess_is_zero) {
 | 
			
		||||
         /* Note that we negate the back-face specular exponent here.
 | 
			
		||||
          * The negation will be un-done later in the back-face code below.
 | 
			
		||||
          */
 | 
			
		||||
         struct ureg shininess = get_material(p, 1, STATE_SHININESS);
 | 
			
		||||
         emit_op1(p, OPCODE_MOV, dots, WRITEMASK_Z, 
 | 
			
		||||
                  negate(swizzle1(shininess,X)));
 | 
			
		||||
@@ -1309,6 +1312,11 @@ static void build_lighting( struct tnl_program *p )
 | 
			
		||||
	       mask1 = 0;
 | 
			
		||||
	    }
 | 
			
		||||
 | 
			
		||||
            /* For the back face we need to negate the X and Y component
 | 
			
		||||
             * dot products.  dots.Z has the negated back-face specular
 | 
			
		||||
             * exponent.  We swizzle that into the W position.  This
 | 
			
		||||
             * negation makes the back-face specular term positive again.
 | 
			
		||||
             */
 | 
			
		||||
            dots = negate(swizzle(dots,X,Y,W,Z));
 | 
			
		||||
 | 
			
		||||
	    if (!is_undef(att)) {
 | 
			
		||||
@@ -1327,8 +1335,10 @@ static void build_lighting( struct tnl_program *p )
 | 
			
		||||
 | 
			
		||||
	    emit_op3(p, OPCODE_MAD, res0, mask0, swizzle1(lit,Y), diffuse, _bfc0);
 | 
			
		||||
	    emit_op3(p, OPCODE_MAD, res1, mask1, swizzle1(lit,Z), specular, _bfc1);
 | 
			
		||||
            /* restore negate flag for next lighting */
 | 
			
		||||
            dots = negate(dots);
 | 
			
		||||
            /* restore dots to its original state for subsequent lights
 | 
			
		||||
             * by negating and swizzling again.
 | 
			
		||||
             */
 | 
			
		||||
            dots = negate(swizzle(dots,X,Y,W,Z));
 | 
			
		||||
 | 
			
		||||
	    release_temp(p, ambient);
 | 
			
		||||
	    release_temp(p, diffuse);
 | 
			
		||||
 
 | 
			
		||||
@@ -1905,6 +1905,10 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params )
 | 
			
		||||
         CHECK_EXT1(ARB_shader_objects, "GetBooleanv");
 | 
			
		||||
         params[0] = INT_TO_BOOLEAN(ctx->Shader.CurrentProgram ? ctx->Shader.CurrentProgram->Name : 0);
 | 
			
		||||
         break;
 | 
			
		||||
      case GL_VERTEX_ARRAY_BINDING_APPLE:
 | 
			
		||||
         CHECK_EXT1(APPLE_vertex_array_object, "GetBooleanv");
 | 
			
		||||
         params[0] = INT_TO_BOOLEAN(ctx->Array.ArrayObj->Name);
 | 
			
		||||
         break;
 | 
			
		||||
      default:
 | 
			
		||||
         _mesa_error(ctx, GL_INVALID_ENUM, "glGetBooleanv(pname=0x%x)", pname);
 | 
			
		||||
   }
 | 
			
		||||
@@ -3753,6 +3757,10 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params )
 | 
			
		||||
         CHECK_EXT1(ARB_shader_objects, "GetFloatv");
 | 
			
		||||
         params[0] = (GLfloat)(ctx->Shader.CurrentProgram ? ctx->Shader.CurrentProgram->Name : 0);
 | 
			
		||||
         break;
 | 
			
		||||
      case GL_VERTEX_ARRAY_BINDING_APPLE:
 | 
			
		||||
         CHECK_EXT1(APPLE_vertex_array_object, "GetFloatv");
 | 
			
		||||
         params[0] = (GLfloat)(ctx->Array.ArrayObj->Name);
 | 
			
		||||
         break;
 | 
			
		||||
      default:
 | 
			
		||||
         _mesa_error(ctx, GL_INVALID_ENUM, "glGetFloatv(pname=0x%x)", pname);
 | 
			
		||||
   }
 | 
			
		||||
@@ -5601,6 +5609,10 @@ _mesa_GetIntegerv( GLenum pname, GLint *params )
 | 
			
		||||
         CHECK_EXT1(ARB_shader_objects, "GetIntegerv");
 | 
			
		||||
         params[0] = ctx->Shader.CurrentProgram ? ctx->Shader.CurrentProgram->Name : 0;
 | 
			
		||||
         break;
 | 
			
		||||
      case GL_VERTEX_ARRAY_BINDING_APPLE:
 | 
			
		||||
         CHECK_EXT1(APPLE_vertex_array_object, "GetIntegerv");
 | 
			
		||||
         params[0] = ctx->Array.ArrayObj->Name;
 | 
			
		||||
         break;
 | 
			
		||||
      default:
 | 
			
		||||
         _mesa_error(ctx, GL_INVALID_ENUM, "glGetIntegerv(pname=0x%x)", pname);
 | 
			
		||||
   }
 | 
			
		||||
 
 | 
			
		||||
@@ -1009,7 +1009,10 @@ StateVars = [
 | 
			
		||||
	# close enough for now.
 | 
			
		||||
	( "GL_CURRENT_PROGRAM", GLint,
 | 
			
		||||
	  ["ctx->Shader.CurrentProgram ? ctx->Shader.CurrentProgram->Name : 0"],
 | 
			
		||||
	  "", ["ARB_shader_objects"] )
 | 
			
		||||
	  "", ["ARB_shader_objects"] ),
 | 
			
		||||
 | 
			
		||||
	( "GL_VERTEX_ARRAY_BINDING_APPLE", GLint, ["ctx->Array.ArrayObj->Name"], "",
 | 
			
		||||
	  ["APPLE_vertex_array_object"] ),
 | 
			
		||||
]
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -145,7 +145,10 @@
 | 
			
		||||
#if defined(__linux__)
 | 
			
		||||
#include <byteswap.h>
 | 
			
		||||
#define CPU_TO_LE32( x )	bswap_32( x )
 | 
			
		||||
#else /*__linux__*/
 | 
			
		||||
#elif defined(__APPLE__)
 | 
			
		||||
#include <CoreFoundation/CFByteOrder.h>
 | 
			
		||||
#define CPU_TO_LE32( x )	CFSwapInt32HostToLittle( x )
 | 
			
		||||
#else /*__linux__ __APPLE__*/
 | 
			
		||||
#include <sys/endian.h>
 | 
			
		||||
#define CPU_TO_LE32( x )	bswap32( x )
 | 
			
		||||
#endif /*__linux__*/
 | 
			
		||||
 
 | 
			
		||||
@@ -63,6 +63,7 @@ struct _mesa_HashTable {
 | 
			
		||||
   struct HashEntry *Table[TABLE_SIZE];  /**< the lookup table */
 | 
			
		||||
   GLuint MaxKey;                        /**< highest key inserted so far */
 | 
			
		||||
   _glthread_Mutex Mutex;                /**< mutual exclusion lock */
 | 
			
		||||
   _glthread_Mutex WalkMutex;            /**< for _mesa_HashWalk() */
 | 
			
		||||
   GLboolean InDeleteAll;                /**< Debug check */
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
@@ -79,6 +80,7 @@ _mesa_NewHashTable(void)
 | 
			
		||||
   struct _mesa_HashTable *table = CALLOC_STRUCT(_mesa_HashTable);
 | 
			
		||||
   if (table) {
 | 
			
		||||
      _glthread_INIT_MUTEX(table->Mutex);
 | 
			
		||||
      _glthread_INIT_MUTEX(table->WalkMutex);
 | 
			
		||||
   }
 | 
			
		||||
   return table;
 | 
			
		||||
}
 | 
			
		||||
@@ -111,6 +113,7 @@ _mesa_DeleteHashTable(struct _mesa_HashTable *table)
 | 
			
		||||
      }
 | 
			
		||||
   }
 | 
			
		||||
   _glthread_DESTROY_MUTEX(table->Mutex);
 | 
			
		||||
   _glthread_DESTROY_MUTEX(table->WalkMutex);
 | 
			
		||||
   _mesa_free(table);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@@ -285,6 +288,11 @@ _mesa_HashDeleteAll(struct _mesa_HashTable *table,
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Walk over all entries in a hash table, calling callback function for each.
 | 
			
		||||
 * Note: we use a separate mutex in this function to avoid a recursive
 | 
			
		||||
 * locking deadlock (in case the callback calls _mesa_HashRemove()) and to
 | 
			
		||||
 * prevent multiple threads/contexts from getting tangled up.
 | 
			
		||||
 * A lock-less version of this function could be used when the table will
 | 
			
		||||
 * not be modified.
 | 
			
		||||
 * \param table  the hash table to walk
 | 
			
		||||
 * \param callback  the callback function
 | 
			
		||||
 * \param userData  arbitrary pointer to pass along to the callback
 | 
			
		||||
@@ -300,14 +308,16 @@ _mesa_HashWalk(const struct _mesa_HashTable *table,
 | 
			
		||||
   GLuint pos;
 | 
			
		||||
   ASSERT(table);
 | 
			
		||||
   ASSERT(callback);
 | 
			
		||||
   _glthread_LOCK_MUTEX(table2->Mutex);
 | 
			
		||||
   _glthread_LOCK_MUTEX(table2->WalkMutex);
 | 
			
		||||
   for (pos = 0; pos < TABLE_SIZE; pos++) {
 | 
			
		||||
      struct HashEntry *entry;
 | 
			
		||||
      for (entry = table->Table[pos]; entry; entry = entry->Next) {
 | 
			
		||||
      struct HashEntry *entry, *next;
 | 
			
		||||
      for (entry = table->Table[pos]; entry; entry = next) {
 | 
			
		||||
         /* save 'next' pointer now in case the callback deletes the entry */
 | 
			
		||||
         next = entry->Next;
 | 
			
		||||
         callback(entry->Key, entry->Data, userData);
 | 
			
		||||
      }
 | 
			
		||||
   }
 | 
			
		||||
   _glthread_UNLOCK_MUTEX(table2->Mutex);
 | 
			
		||||
   _glthread_UNLOCK_MUTEX(table2->WalkMutex);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -1,8 +1,9 @@
 | 
			
		||||
/*
 | 
			
		||||
 * Mesa 3-D graphics library
 | 
			
		||||
 * Version:  7.1
 | 
			
		||||
 * Version:  7.5
 | 
			
		||||
 *
 | 
			
		||||
 * Copyright (C) 1999-2008  Brian Paul   All Rights Reserved.
 | 
			
		||||
 * Copyright (C) 2009  VMware, Inc.  All Rights Reserved.
 | 
			
		||||
 *
 | 
			
		||||
 * Permission is hereby granted, free of charge, to any person obtaining a
 | 
			
		||||
 * copy of this software and associated documentation files (the "Software"),
 | 
			
		||||
@@ -738,12 +739,20 @@ _mesa_image_image_stride( const struct gl_pixelstore_attrib *packing,
 | 
			
		||||
                          GLint width, GLint height,
 | 
			
		||||
                          GLenum format, GLenum type )
 | 
			
		||||
{
 | 
			
		||||
   ASSERT(packing);
 | 
			
		||||
   ASSERT(type != GL_BITMAP);
 | 
			
		||||
   GLint bytesPerRow, bytesPerImage, remainder;
 | 
			
		||||
 | 
			
		||||
   {
 | 
			
		||||
   ASSERT(packing);
 | 
			
		||||
 | 
			
		||||
   if (type == GL_BITMAP) {
 | 
			
		||||
      if (packing->RowLength == 0) {
 | 
			
		||||
         bytesPerRow = (width + 7) / 8;
 | 
			
		||||
      }
 | 
			
		||||
      else {
 | 
			
		||||
         bytesPerRow = (packing->RowLength + 7) / 8;
 | 
			
		||||
      }
 | 
			
		||||
   }
 | 
			
		||||
   else {
 | 
			
		||||
      const GLint bytesPerPixel = _mesa_bytes_per_pixel(format, type);
 | 
			
		||||
      GLint bytesPerRow, bytesPerImage, remainder;
 | 
			
		||||
 | 
			
		||||
      if (bytesPerPixel <= 0)
 | 
			
		||||
         return -1;  /* error */
 | 
			
		||||
@@ -753,17 +762,18 @@ _mesa_image_image_stride( const struct gl_pixelstore_attrib *packing,
 | 
			
		||||
      else {
 | 
			
		||||
         bytesPerRow = bytesPerPixel * packing->RowLength;
 | 
			
		||||
      }
 | 
			
		||||
      remainder = bytesPerRow % packing->Alignment;
 | 
			
		||||
      if (remainder > 0)
 | 
			
		||||
         bytesPerRow += (packing->Alignment - remainder);
 | 
			
		||||
 | 
			
		||||
      if (packing->ImageHeight == 0)
 | 
			
		||||
         bytesPerImage = bytesPerRow * height;
 | 
			
		||||
      else
 | 
			
		||||
         bytesPerImage = bytesPerRow * packing->ImageHeight;
 | 
			
		||||
 | 
			
		||||
      return bytesPerImage;
 | 
			
		||||
   }
 | 
			
		||||
 | 
			
		||||
   remainder = bytesPerRow % packing->Alignment;
 | 
			
		||||
   if (remainder > 0)
 | 
			
		||||
      bytesPerRow += (packing->Alignment - remainder);
 | 
			
		||||
 | 
			
		||||
   if (packing->ImageHeight == 0)
 | 
			
		||||
      bytesPerImage = bytesPerRow * height;
 | 
			
		||||
   else
 | 
			
		||||
      bytesPerImage = bytesPerRow * packing->ImageHeight;
 | 
			
		||||
 | 
			
		||||
   return bytesPerImage;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -209,7 +209,6 @@ _mesa_Lightfv( GLenum light, GLenum pname, const GLfloat *params )
 | 
			
		||||
	 _math_matrix_analyse(ctx->ModelviewMatrixStack.Top);
 | 
			
		||||
      }
 | 
			
		||||
      TRANSFORM_DIRECTION(temp, params, ctx->ModelviewMatrixStack.Top->m);
 | 
			
		||||
      NORMALIZE_3FV(temp);
 | 
			
		||||
      params = temp;
 | 
			
		||||
      break;
 | 
			
		||||
   case GL_SPOT_EXPONENT:
 | 
			
		||||
@@ -1137,12 +1136,18 @@ compute_light_positions( GLcontext *ctx )
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
      if (light->_Flags & LIGHT_SPOT) {
 | 
			
		||||
         /* Note: we normalize the spot direction now */
 | 
			
		||||
 | 
			
		||||
	 if (ctx->_NeedEyeCoords) {
 | 
			
		||||
	    COPY_3V( light->_NormDirection, light->EyeDirection );
 | 
			
		||||
            NORMALIZE_3FV( light->_NormDirection );
 | 
			
		||||
	 }
 | 
			
		||||
         else {
 | 
			
		||||
            GLfloat spotDir[3];
 | 
			
		||||
            COPY_3V(spotDir, light->EyeDirection);
 | 
			
		||||
            NORMALIZE_3FV(spotDir);
 | 
			
		||||
	    TRANSFORM_NORMAL( light->_NormDirection,
 | 
			
		||||
			      light->EyeDirection,
 | 
			
		||||
			      spotDir,
 | 
			
		||||
			      ctx->ModelviewMatrixStack.Top->m);
 | 
			
		||||
	 }
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -580,8 +580,8 @@ _mesa_set_viewport( GLcontext *ctx, GLint x, GLint y,
 | 
			
		||||
   }
 | 
			
		||||
 | 
			
		||||
   /* clamp width and height to the implementation dependent range */
 | 
			
		||||
   width  = CLAMP(width,  1, (GLsizei) ctx->Const.MaxViewportWidth);
 | 
			
		||||
   height = CLAMP(height, 1, (GLsizei) ctx->Const.MaxViewportHeight);
 | 
			
		||||
   width  = MIN2(width, (GLsizei) ctx->Const.MaxViewportWidth);
 | 
			
		||||
   height = MIN2(height, (GLsizei) ctx->Const.MaxViewportHeight);
 | 
			
		||||
 | 
			
		||||
   ctx->Viewport.X = x;
 | 
			
		||||
   ctx->Viewport.Width = width;
 | 
			
		||||
 
 | 
			
		||||
@@ -3063,6 +3063,8 @@ struct __GLcontextRec
 | 
			
		||||
   GLenum RenderMode;        /**< either GL_RENDER, GL_SELECT, GL_FEEDBACK */
 | 
			
		||||
   GLbitfield NewState;      /**< bitwise-or of _NEW_* flags */
 | 
			
		||||
 | 
			
		||||
   GLboolean ViewportInitialized;  /**< has viewport size been initialized? */
 | 
			
		||||
 | 
			
		||||
   /** \name Derived state */
 | 
			
		||||
   /*@{*/
 | 
			
		||||
   /** Bitwise-or of DD_* flags.  Note that this bitfield may be used before
 | 
			
		||||
 
 | 
			
		||||
@@ -170,6 +170,9 @@ _mesa_ReadPixels( GLint x, GLint y, GLsizei width, GLsizei height,
 | 
			
		||||
      return;
 | 
			
		||||
   }
 | 
			
		||||
 | 
			
		||||
   if (width == 0 || height == 0)
 | 
			
		||||
      return; /* nothing to do */
 | 
			
		||||
 | 
			
		||||
   if (ctx->Pack.BufferObj->Name) {
 | 
			
		||||
      if (!_mesa_validate_pbo_access(2, &ctx->Pack, width, height, 1,
 | 
			
		||||
                                     format, type, pixels)) {
 | 
			
		||||
 
 | 
			
		||||
@@ -157,7 +157,7 @@ update_arrays( GLcontext *ctx )
 | 
			
		||||
 | 
			
		||||
   /* 16..31 */
 | 
			
		||||
   if (ctx->VertexProgram._Current) {
 | 
			
		||||
      for (i = VERT_ATTRIB_GENERIC0; i < VERT_ATTRIB_MAX; i++) {
 | 
			
		||||
      for (i = 0; i < Elements(ctx->Array.ArrayObj->VertexAttrib); i++) {
 | 
			
		||||
         if (ctx->Array.ArrayObj->VertexAttrib[i].Enabled) {
 | 
			
		||||
            min = MIN2(min, ctx->Array.ArrayObj->VertexAttrib[i]._MaxElement);
 | 
			
		||||
         }
 | 
			
		||||
 
 | 
			
		||||
@@ -49,6 +49,17 @@
 | 
			
		||||
#include "mtypes.h"
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * State changes which we care about for glCopyTex[Sub]Image() calls.
 | 
			
		||||
 * In particular, we care about pixel transfer state and buffer state
 | 
			
		||||
 * (such as glReadBuffer to make sure we read from the right renderbuffer).
 | 
			
		||||
 */
 | 
			
		||||
#define NEW_COPY_TEX_STATE (_IMAGE_NEW_TRANSFER_STATE | \
 | 
			
		||||
                            _NEW_BUFFERS | \
 | 
			
		||||
                            _NEW_PIXEL)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * We allocate texture memory on 512-byte boundaries so we can use MMX/SSE
 | 
			
		||||
 * elsewhere.
 | 
			
		||||
@@ -2918,7 +2929,7 @@ _mesa_CopyTexImage1D( GLenum target, GLint level,
 | 
			
		||||
   GET_CURRENT_CONTEXT(ctx);
 | 
			
		||||
   ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
 | 
			
		||||
 | 
			
		||||
   if (ctx->NewState & _IMAGE_NEW_TRANSFER_STATE)
 | 
			
		||||
   if (ctx->NewState & NEW_COPY_TEX_STATE)
 | 
			
		||||
      _mesa_update_state(ctx);
 | 
			
		||||
 | 
			
		||||
#if FEATURE_convolve
 | 
			
		||||
@@ -2983,7 +2994,7 @@ _mesa_CopyTexImage2D( GLenum target, GLint level, GLenum internalFormat,
 | 
			
		||||
   GET_CURRENT_CONTEXT(ctx);
 | 
			
		||||
   ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
 | 
			
		||||
 | 
			
		||||
   if (ctx->NewState & _IMAGE_NEW_TRANSFER_STATE)
 | 
			
		||||
   if (ctx->NewState & NEW_COPY_TEX_STATE)
 | 
			
		||||
      _mesa_update_state(ctx);
 | 
			
		||||
 | 
			
		||||
#if FEATURE_convolve
 | 
			
		||||
@@ -3051,7 +3062,7 @@ _mesa_CopyTexSubImage1D( GLenum target, GLint level,
 | 
			
		||||
   GET_CURRENT_CONTEXT(ctx);
 | 
			
		||||
   ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
 | 
			
		||||
 | 
			
		||||
   if (ctx->NewState & _IMAGE_NEW_TRANSFER_STATE)
 | 
			
		||||
   if (ctx->NewState & NEW_COPY_TEX_STATE)
 | 
			
		||||
      _mesa_update_state(ctx);
 | 
			
		||||
 | 
			
		||||
   if (copytexsubimage_error_check1(ctx, 1, target, level))
 | 
			
		||||
@@ -3106,7 +3117,7 @@ _mesa_CopyTexSubImage2D( GLenum target, GLint level,
 | 
			
		||||
   GET_CURRENT_CONTEXT(ctx);
 | 
			
		||||
   ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
 | 
			
		||||
 | 
			
		||||
   if (ctx->NewState & _IMAGE_NEW_TRANSFER_STATE)
 | 
			
		||||
   if (ctx->NewState & NEW_COPY_TEX_STATE)
 | 
			
		||||
      _mesa_update_state(ctx);
 | 
			
		||||
 | 
			
		||||
   if (copytexsubimage_error_check1(ctx, 2, target, level))
 | 
			
		||||
@@ -3161,7 +3172,7 @@ _mesa_CopyTexSubImage3D( GLenum target, GLint level,
 | 
			
		||||
   GET_CURRENT_CONTEXT(ctx);
 | 
			
		||||
   ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
 | 
			
		||||
 | 
			
		||||
   if (ctx->NewState & _IMAGE_NEW_TRANSFER_STATE)
 | 
			
		||||
   if (ctx->NewState & NEW_COPY_TEX_STATE)
 | 
			
		||||
      _mesa_update_state(ctx);
 | 
			
		||||
 | 
			
		||||
   if (copytexsubimage_error_check1(ctx, 3, target, level))
 | 
			
		||||
 
 | 
			
		||||
@@ -139,8 +139,11 @@ flush(GLcontext *ctx, struct gl_texture_object *texObj)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/** Set an integer-valued texture parameter */
 | 
			
		||||
static void
 | 
			
		||||
/**
 | 
			
		||||
 * Set an integer-valued texture parameter
 | 
			
		||||
 * \return GL_TRUE if legal AND the value changed, GL_FALSE otherwise
 | 
			
		||||
 */
 | 
			
		||||
static GLboolean
 | 
			
		||||
set_tex_parameteri(GLcontext *ctx,
 | 
			
		||||
                   struct gl_texture_object *texObj,
 | 
			
		||||
                   GLenum pname, const GLint *params)
 | 
			
		||||
@@ -148,13 +151,13 @@ set_tex_parameteri(GLcontext *ctx,
 | 
			
		||||
   switch (pname) {
 | 
			
		||||
   case GL_TEXTURE_MIN_FILTER:
 | 
			
		||||
      if (texObj->MinFilter == params[0])
 | 
			
		||||
         return;
 | 
			
		||||
         return GL_FALSE;
 | 
			
		||||
      switch (params[0]) {
 | 
			
		||||
      case GL_NEAREST:
 | 
			
		||||
      case GL_LINEAR:
 | 
			
		||||
         flush(ctx, texObj);
 | 
			
		||||
         texObj->MinFilter = params[0];
 | 
			
		||||
         return;
 | 
			
		||||
         return GL_TRUE;
 | 
			
		||||
      case GL_NEAREST_MIPMAP_NEAREST:
 | 
			
		||||
      case GL_LINEAR_MIPMAP_NEAREST:
 | 
			
		||||
      case GL_NEAREST_MIPMAP_LINEAR:
 | 
			
		||||
@@ -162,77 +165,80 @@ set_tex_parameteri(GLcontext *ctx,
 | 
			
		||||
         if (texObj->Target != GL_TEXTURE_RECTANGLE_NV) {
 | 
			
		||||
            flush(ctx, texObj);
 | 
			
		||||
            texObj->MinFilter = params[0];
 | 
			
		||||
            return;
 | 
			
		||||
            return GL_TRUE;
 | 
			
		||||
         }
 | 
			
		||||
         /* fall-through */
 | 
			
		||||
      default:
 | 
			
		||||
         _mesa_error( ctx, GL_INVALID_VALUE, "glTexParameter(param)" );
 | 
			
		||||
      }
 | 
			
		||||
      return;
 | 
			
		||||
      return GL_FALSE;
 | 
			
		||||
 | 
			
		||||
   case GL_TEXTURE_MAG_FILTER:
 | 
			
		||||
      if (texObj->MagFilter == params[0])
 | 
			
		||||
         return;
 | 
			
		||||
         return GL_FALSE;
 | 
			
		||||
      switch (params[0]) {
 | 
			
		||||
      case GL_NEAREST:
 | 
			
		||||
      case GL_LINEAR:
 | 
			
		||||
         flush(ctx, texObj);
 | 
			
		||||
         texObj->MagFilter = params[0];
 | 
			
		||||
         return;
 | 
			
		||||
         return GL_TRUE;
 | 
			
		||||
      default:
 | 
			
		||||
         _mesa_error( ctx, GL_INVALID_VALUE, "glTexParameter(param)" );
 | 
			
		||||
      }
 | 
			
		||||
      return;
 | 
			
		||||
      return GL_FALSE;
 | 
			
		||||
 | 
			
		||||
   case GL_TEXTURE_WRAP_S:
 | 
			
		||||
      if (texObj->WrapS == params[0])
 | 
			
		||||
         return;
 | 
			
		||||
         return GL_FALSE;
 | 
			
		||||
      if (validate_texture_wrap_mode(ctx, texObj->Target, params[0])) {
 | 
			
		||||
         flush(ctx, texObj);
 | 
			
		||||
         texObj->WrapS = params[0];
 | 
			
		||||
         return GL_TRUE;
 | 
			
		||||
      }
 | 
			
		||||
      return;
 | 
			
		||||
      return GL_FALSE;
 | 
			
		||||
 | 
			
		||||
   case GL_TEXTURE_WRAP_T:
 | 
			
		||||
      if (texObj->WrapT == params[0])
 | 
			
		||||
         return;
 | 
			
		||||
         return GL_FALSE;
 | 
			
		||||
      if (validate_texture_wrap_mode(ctx, texObj->Target, params[0])) {
 | 
			
		||||
         flush(ctx, texObj);
 | 
			
		||||
         texObj->WrapT = params[0];
 | 
			
		||||
         return GL_TRUE;
 | 
			
		||||
      }
 | 
			
		||||
      return;
 | 
			
		||||
      return GL_FALSE;
 | 
			
		||||
 | 
			
		||||
   case GL_TEXTURE_WRAP_R:
 | 
			
		||||
      if (texObj->WrapR == params[0])
 | 
			
		||||
         return;
 | 
			
		||||
         return GL_FALSE;
 | 
			
		||||
      if (validate_texture_wrap_mode(ctx, texObj->Target, params[0])) {
 | 
			
		||||
         flush(ctx, texObj);
 | 
			
		||||
         texObj->WrapR = params[0];
 | 
			
		||||
         return GL_TRUE;
 | 
			
		||||
      }
 | 
			
		||||
      return;
 | 
			
		||||
      return GL_FALSE;
 | 
			
		||||
 | 
			
		||||
   case GL_TEXTURE_BASE_LEVEL:
 | 
			
		||||
      if (texObj->BaseLevel == params[0])
 | 
			
		||||
         return;
 | 
			
		||||
         return GL_FALSE;
 | 
			
		||||
      if (params[0] < 0 ||
 | 
			
		||||
          (texObj->Target == GL_TEXTURE_RECTANGLE_ARB && params[0] != 0)) {
 | 
			
		||||
         _mesa_error(ctx, GL_INVALID_VALUE, "glTexParameter(param)");
 | 
			
		||||
         return;
 | 
			
		||||
         return GL_FALSE;
 | 
			
		||||
      }
 | 
			
		||||
      flush(ctx, texObj);
 | 
			
		||||
      texObj->BaseLevel = params[0];
 | 
			
		||||
      return;
 | 
			
		||||
      return GL_TRUE;
 | 
			
		||||
 | 
			
		||||
   case GL_TEXTURE_MAX_LEVEL:
 | 
			
		||||
      if (texObj->MaxLevel == params[0])
 | 
			
		||||
         return;
 | 
			
		||||
         return GL_FALSE;
 | 
			
		||||
      if (params[0] < 0 || texObj->Target == GL_TEXTURE_RECTANGLE_ARB) {
 | 
			
		||||
         _mesa_error(ctx, GL_INVALID_OPERATION, "glTexParameter(param)");
 | 
			
		||||
         return;
 | 
			
		||||
         return GL_FALSE;
 | 
			
		||||
      }
 | 
			
		||||
      flush(ctx, texObj);
 | 
			
		||||
      texObj->MaxLevel = params[0];
 | 
			
		||||
      return;
 | 
			
		||||
      return GL_TRUE;
 | 
			
		||||
 | 
			
		||||
   case GL_TEXTURE_COMPARE_SGIX:
 | 
			
		||||
      if (ctx->Extensions.SGIX_shadow) {
 | 
			
		||||
@@ -243,7 +249,7 @@ set_tex_parameteri(GLcontext *ctx,
 | 
			
		||||
         _mesa_error(ctx, GL_INVALID_ENUM,
 | 
			
		||||
                     "glTexParameter(pname=GL_TEXTURE_COMPARE_SGIX)");
 | 
			
		||||
      }
 | 
			
		||||
      return;
 | 
			
		||||
      return GL_TRUE;
 | 
			
		||||
 | 
			
		||||
   case GL_TEXTURE_COMPARE_OPERATOR_SGIX:
 | 
			
		||||
      if (ctx->Extensions.SGIX_shadow &&
 | 
			
		||||
@@ -256,20 +262,22 @@ set_tex_parameteri(GLcontext *ctx,
 | 
			
		||||
         _mesa_error(ctx, GL_INVALID_ENUM,
 | 
			
		||||
                     "glTexParameter(GL_TEXTURE_COMPARE_OPERATOR_SGIX)");
 | 
			
		||||
      }
 | 
			
		||||
      return;
 | 
			
		||||
      return GL_TRUE;
 | 
			
		||||
 | 
			
		||||
   case GL_GENERATE_MIPMAP_SGIS:
 | 
			
		||||
      if (ctx->Extensions.SGIS_generate_mipmap) {
 | 
			
		||||
         if (texObj->GenerateMipmap != params[0]) {
 | 
			
		||||
            flush(ctx, texObj);
 | 
			
		||||
            texObj->GenerateMipmap = params[0] ? GL_TRUE : GL_FALSE;
 | 
			
		||||
            return GL_TRUE;
 | 
			
		||||
         }
 | 
			
		||||
         return GL_FALSE;
 | 
			
		||||
      }
 | 
			
		||||
      else {
 | 
			
		||||
         _mesa_error(ctx, GL_INVALID_ENUM,
 | 
			
		||||
                     "glTexParameter(pname=GL_GENERATE_MIPMAP_SGIS)");
 | 
			
		||||
      }
 | 
			
		||||
      return;
 | 
			
		||||
      return GL_FALSE;
 | 
			
		||||
 | 
			
		||||
   case GL_TEXTURE_COMPARE_MODE_ARB:
 | 
			
		||||
      if (ctx->Extensions.ARB_shadow &&
 | 
			
		||||
@@ -278,24 +286,26 @@ set_tex_parameteri(GLcontext *ctx,
 | 
			
		||||
         if (texObj->CompareMode != params[0]) {
 | 
			
		||||
            flush(ctx, texObj);
 | 
			
		||||
            texObj->CompareMode = params[0];
 | 
			
		||||
            return GL_TRUE;
 | 
			
		||||
         }
 | 
			
		||||
         return GL_FALSE;
 | 
			
		||||
      }
 | 
			
		||||
      else {
 | 
			
		||||
         _mesa_error(ctx, GL_INVALID_ENUM,
 | 
			
		||||
                     "glTexParameter(GL_TEXTURE_COMPARE_MODE_ARB)");
 | 
			
		||||
      }
 | 
			
		||||
      return;
 | 
			
		||||
      return GL_FALSE;
 | 
			
		||||
 | 
			
		||||
   case GL_TEXTURE_COMPARE_FUNC_ARB:
 | 
			
		||||
      if (ctx->Extensions.ARB_shadow) {
 | 
			
		||||
         if (texObj->CompareFunc == params[0])
 | 
			
		||||
            return;
 | 
			
		||||
            return GL_FALSE;
 | 
			
		||||
         switch (params[0]) {
 | 
			
		||||
         case GL_LEQUAL:
 | 
			
		||||
         case GL_GEQUAL:
 | 
			
		||||
            flush(ctx, texObj);
 | 
			
		||||
            texObj->CompareFunc = params[0];
 | 
			
		||||
            return;
 | 
			
		||||
            return GL_TRUE;
 | 
			
		||||
         case GL_EQUAL:
 | 
			
		||||
         case GL_NOTEQUAL:
 | 
			
		||||
         case GL_LESS:
 | 
			
		||||
@@ -305,7 +315,7 @@ set_tex_parameteri(GLcontext *ctx,
 | 
			
		||||
            if (ctx->Extensions.EXT_shadow_funcs) {
 | 
			
		||||
               flush(ctx, texObj);
 | 
			
		||||
               texObj->CompareFunc = params[0];
 | 
			
		||||
               return;
 | 
			
		||||
               return GL_TRUE;
 | 
			
		||||
            }
 | 
			
		||||
            /* fall-through */
 | 
			
		||||
         default:
 | 
			
		||||
@@ -316,7 +326,7 @@ set_tex_parameteri(GLcontext *ctx,
 | 
			
		||||
      else {
 | 
			
		||||
         _mesa_error(ctx, GL_INVALID_ENUM, "glTexParameter(param)");
 | 
			
		||||
      }
 | 
			
		||||
      return;
 | 
			
		||||
      return GL_FALSE;
 | 
			
		||||
 | 
			
		||||
   case GL_DEPTH_TEXTURE_MODE_ARB:
 | 
			
		||||
      if (ctx->Extensions.ARB_depth_texture &&
 | 
			
		||||
@@ -326,13 +336,14 @@ set_tex_parameteri(GLcontext *ctx,
 | 
			
		||||
         if (texObj->DepthMode != params[0]) {
 | 
			
		||||
            flush(ctx, texObj);
 | 
			
		||||
            texObj->DepthMode = params[0];
 | 
			
		||||
            return GL_TRUE;
 | 
			
		||||
         }
 | 
			
		||||
      }
 | 
			
		||||
      else {
 | 
			
		||||
         _mesa_error(ctx, GL_INVALID_ENUM,
 | 
			
		||||
                     "glTexParameter(GL_DEPTH_TEXTURE_MODE_ARB)");
 | 
			
		||||
      }
 | 
			
		||||
      return;
 | 
			
		||||
      return GL_FALSE;
 | 
			
		||||
 | 
			
		||||
#ifdef FEATURE_OES_draw_texture
 | 
			
		||||
   case GL_TEXTURE_CROP_RECT_OES:
 | 
			
		||||
@@ -340,17 +351,21 @@ set_tex_parameteri(GLcontext *ctx,
 | 
			
		||||
      texObj->CropRect[1] = params[1];
 | 
			
		||||
      texObj->CropRect[2] = params[2];
 | 
			
		||||
      texObj->CropRect[3] = params[3];
 | 
			
		||||
      break;
 | 
			
		||||
      return GL_TRUE;
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
   default:
 | 
			
		||||
      _mesa_error(ctx, GL_INVALID_ENUM, "glTexParameter(pname=0x%x)", pname);
 | 
			
		||||
   }
 | 
			
		||||
   return GL_FALSE;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/** Set a float-valued texture parameter */
 | 
			
		||||
static void
 | 
			
		||||
/**
 | 
			
		||||
 * Set a float-valued texture parameter
 | 
			
		||||
 * \return GL_TRUE if legal AND the value changed, GL_FALSE otherwise
 | 
			
		||||
 */
 | 
			
		||||
static GLboolean
 | 
			
		||||
set_tex_parameterf(GLcontext *ctx,
 | 
			
		||||
                   struct gl_texture_object *texObj,
 | 
			
		||||
                   GLenum pname, const GLfloat *params)
 | 
			
		||||
@@ -358,54 +373,56 @@ set_tex_parameterf(GLcontext *ctx,
 | 
			
		||||
   switch (pname) {
 | 
			
		||||
   case GL_TEXTURE_MIN_LOD:
 | 
			
		||||
      if (texObj->MinLod == params[0])
 | 
			
		||||
         return;
 | 
			
		||||
         return GL_FALSE;
 | 
			
		||||
      flush(ctx, texObj);
 | 
			
		||||
      texObj->MinLod = params[0];
 | 
			
		||||
      return;
 | 
			
		||||
      return GL_TRUE;
 | 
			
		||||
 | 
			
		||||
   case GL_TEXTURE_MAX_LOD:
 | 
			
		||||
      if (texObj->MaxLod == params[0])
 | 
			
		||||
         return;
 | 
			
		||||
         return GL_FALSE;
 | 
			
		||||
      flush(ctx, texObj);
 | 
			
		||||
      texObj->MaxLod = params[0];
 | 
			
		||||
      return;
 | 
			
		||||
      return GL_TRUE;
 | 
			
		||||
 | 
			
		||||
   case GL_TEXTURE_PRIORITY:
 | 
			
		||||
      flush(ctx, texObj);
 | 
			
		||||
      texObj->Priority = CLAMP(params[0], 0.0F, 1.0F);
 | 
			
		||||
      return;
 | 
			
		||||
      return GL_TRUE;
 | 
			
		||||
 | 
			
		||||
   case GL_TEXTURE_MAX_ANISOTROPY_EXT:
 | 
			
		||||
      if (ctx->Extensions.EXT_texture_filter_anisotropic) {
 | 
			
		||||
         if (texObj->MaxAnisotropy == params[0])
 | 
			
		||||
            return;
 | 
			
		||||
            return GL_FALSE;
 | 
			
		||||
         if (params[0] < 1.0) {
 | 
			
		||||
            _mesa_error(ctx, GL_INVALID_VALUE, "glTexParameter(param)" );
 | 
			
		||||
            return;
 | 
			
		||||
            return GL_FALSE;
 | 
			
		||||
         }
 | 
			
		||||
         flush(ctx, texObj);
 | 
			
		||||
         /* clamp to max, that's what NVIDIA does */
 | 
			
		||||
         texObj->MaxAnisotropy = MIN2(params[0],
 | 
			
		||||
                                      ctx->Const.MaxTextureMaxAnisotropy);
 | 
			
		||||
         return GL_TRUE;
 | 
			
		||||
      }
 | 
			
		||||
      else {
 | 
			
		||||
         _mesa_error(ctx, GL_INVALID_ENUM,
 | 
			
		||||
                     "glTexParameter(pname=GL_TEXTURE_MAX_ANISOTROPY_EXT)");
 | 
			
		||||
      }
 | 
			
		||||
      return;
 | 
			
		||||
      return GL_FALSE;
 | 
			
		||||
 | 
			
		||||
   case GL_TEXTURE_COMPARE_FAIL_VALUE_ARB:
 | 
			
		||||
      if (ctx->Extensions.SGIX_shadow_ambient) {
 | 
			
		||||
         if (texObj->ShadowAmbient != params[0]) {
 | 
			
		||||
            flush(ctx, texObj);
 | 
			
		||||
            texObj->ShadowAmbient = CLAMP(params[0], 0.0F, 1.0F);
 | 
			
		||||
            return GL_TRUE;
 | 
			
		||||
         }
 | 
			
		||||
      }
 | 
			
		||||
      else {
 | 
			
		||||
         _mesa_error(ctx, GL_INVALID_ENUM,
 | 
			
		||||
                     "glTexParameter(pname=GL_SHADOW_AMBIENT_SGIX)");
 | 
			
		||||
      }
 | 
			
		||||
      return;
 | 
			
		||||
      return GL_FALSE;
 | 
			
		||||
 | 
			
		||||
   case GL_TEXTURE_LOD_BIAS:
 | 
			
		||||
      /* NOTE: this is really part of OpenGL 1.4, not EXT_texture_lod_bias */
 | 
			
		||||
@@ -413,7 +430,9 @@ set_tex_parameterf(GLcontext *ctx,
 | 
			
		||||
         if (texObj->LodBias != params[0]) {
 | 
			
		||||
            flush(ctx, texObj);
 | 
			
		||||
            texObj->LodBias = params[0];
 | 
			
		||||
            return GL_TRUE;
 | 
			
		||||
         }
 | 
			
		||||
         return GL_FALSE;
 | 
			
		||||
      }
 | 
			
		||||
      break;
 | 
			
		||||
 | 
			
		||||
@@ -427,17 +446,19 @@ set_tex_parameterf(GLcontext *ctx,
 | 
			
		||||
      UNCLAMPED_FLOAT_TO_CHAN(texObj->_BorderChan[GCOMP], params[1]);
 | 
			
		||||
      UNCLAMPED_FLOAT_TO_CHAN(texObj->_BorderChan[BCOMP], params[2]);
 | 
			
		||||
      UNCLAMPED_FLOAT_TO_CHAN(texObj->_BorderChan[ACOMP], params[3]);
 | 
			
		||||
      return;
 | 
			
		||||
      return GL_TRUE;
 | 
			
		||||
 | 
			
		||||
   default:
 | 
			
		||||
      _mesa_error(ctx, GL_INVALID_ENUM, "glTexParameter(pname=0x%x)", pname);
 | 
			
		||||
   }
 | 
			
		||||
   return GL_FALSE;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
void GLAPIENTRY
 | 
			
		||||
_mesa_TexParameterf(GLenum target, GLenum pname, GLfloat param)
 | 
			
		||||
{
 | 
			
		||||
   GLboolean need_update;
 | 
			
		||||
   struct gl_texture_object *texObj;
 | 
			
		||||
   GET_CURRENT_CONTEXT(ctx);
 | 
			
		||||
   ASSERT_OUTSIDE_BEGIN_END(ctx);
 | 
			
		||||
@@ -463,15 +484,15 @@ _mesa_TexParameterf(GLenum target, GLenum pname, GLfloat param)
 | 
			
		||||
      {
 | 
			
		||||
         /* convert float param to int */
 | 
			
		||||
         GLint p = (GLint) param;
 | 
			
		||||
         set_tex_parameteri(ctx, texObj, pname, &p);
 | 
			
		||||
         need_update = set_tex_parameteri(ctx, texObj, pname, &p);
 | 
			
		||||
      }
 | 
			
		||||
      return;
 | 
			
		||||
      break;
 | 
			
		||||
   default:
 | 
			
		||||
      /* this will generate an error if pname is illegal */
 | 
			
		||||
      set_tex_parameterf(ctx, texObj, pname, ¶m);
 | 
			
		||||
      need_update = set_tex_parameterf(ctx, texObj, pname, ¶m);
 | 
			
		||||
   }
 | 
			
		||||
 | 
			
		||||
   if (ctx->Driver.TexParameter && ctx->ErrorValue == GL_NO_ERROR) {
 | 
			
		||||
   if (ctx->Driver.TexParameter && need_update) {
 | 
			
		||||
      ctx->Driver.TexParameter(ctx, target, texObj, pname, ¶m);
 | 
			
		||||
   }
 | 
			
		||||
}
 | 
			
		||||
@@ -480,6 +501,7 @@ _mesa_TexParameterf(GLenum target, GLenum pname, GLfloat param)
 | 
			
		||||
void GLAPIENTRY
 | 
			
		||||
_mesa_TexParameterfv(GLenum target, GLenum pname, const GLfloat *params)
 | 
			
		||||
{
 | 
			
		||||
   GLboolean need_update;
 | 
			
		||||
   struct gl_texture_object *texObj;
 | 
			
		||||
   GET_CURRENT_CONTEXT(ctx);
 | 
			
		||||
   ASSERT_OUTSIDE_BEGIN_END(ctx);
 | 
			
		||||
@@ -505,7 +527,7 @@ _mesa_TexParameterfv(GLenum target, GLenum pname, const GLfloat *params)
 | 
			
		||||
      {
 | 
			
		||||
         /* convert float param to int */
 | 
			
		||||
         GLint p = (GLint) params[0];
 | 
			
		||||
         set_tex_parameteri(ctx, texObj, pname, &p);
 | 
			
		||||
         need_update = set_tex_parameteri(ctx, texObj, pname, &p);
 | 
			
		||||
      }
 | 
			
		||||
      break;
 | 
			
		||||
 | 
			
		||||
@@ -518,17 +540,17 @@ _mesa_TexParameterfv(GLenum target, GLenum pname, const GLfloat *params)
 | 
			
		||||
         iparams[1] = (GLint) params[1];
 | 
			
		||||
         iparams[2] = (GLint) params[2];
 | 
			
		||||
         iparams[3] = (GLint) params[3];
 | 
			
		||||
         set_tex_parameteri(ctx, target, iparams);
 | 
			
		||||
         need_update = set_tex_parameteri(ctx, target, iparams);
 | 
			
		||||
      }
 | 
			
		||||
      break;
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
   default:
 | 
			
		||||
      /* this will generate an error if pname is illegal */
 | 
			
		||||
      set_tex_parameterf(ctx, texObj, pname, params);
 | 
			
		||||
      need_update = set_tex_parameterf(ctx, texObj, pname, params);
 | 
			
		||||
   }
 | 
			
		||||
 | 
			
		||||
   if (ctx->Driver.TexParameter && ctx->ErrorValue == GL_NO_ERROR) {
 | 
			
		||||
   if (ctx->Driver.TexParameter && need_update) {
 | 
			
		||||
      ctx->Driver.TexParameter(ctx, target, texObj, pname, params);
 | 
			
		||||
   }
 | 
			
		||||
}
 | 
			
		||||
@@ -537,6 +559,7 @@ _mesa_TexParameterfv(GLenum target, GLenum pname, const GLfloat *params)
 | 
			
		||||
void GLAPIENTRY
 | 
			
		||||
_mesa_TexParameteri(GLenum target, GLenum pname, GLint param)
 | 
			
		||||
{
 | 
			
		||||
   GLboolean need_update;
 | 
			
		||||
   struct gl_texture_object *texObj;
 | 
			
		||||
   GET_CURRENT_CONTEXT(ctx);
 | 
			
		||||
   ASSERT_OUTSIDE_BEGIN_END(ctx);
 | 
			
		||||
@@ -555,15 +578,15 @@ _mesa_TexParameteri(GLenum target, GLenum pname, GLint param)
 | 
			
		||||
      {
 | 
			
		||||
         GLfloat fparam = (GLfloat) param;
 | 
			
		||||
         /* convert int param to float */
 | 
			
		||||
         set_tex_parameterf(ctx, texObj, pname, &fparam);
 | 
			
		||||
         need_update = set_tex_parameterf(ctx, texObj, pname, &fparam);
 | 
			
		||||
      }
 | 
			
		||||
      break;
 | 
			
		||||
   default:
 | 
			
		||||
      /* this will generate an error if pname is illegal */
 | 
			
		||||
      set_tex_parameteri(ctx, texObj, pname, ¶m);
 | 
			
		||||
      need_update = set_tex_parameteri(ctx, texObj, pname, ¶m);
 | 
			
		||||
   }
 | 
			
		||||
 | 
			
		||||
   if (ctx->Driver.TexParameter && ctx->ErrorValue == GL_NO_ERROR) {
 | 
			
		||||
   if (ctx->Driver.TexParameter && need_update) {
 | 
			
		||||
      GLfloat fparam = (GLfloat) param;
 | 
			
		||||
      ctx->Driver.TexParameter(ctx, target, texObj, pname, &fparam);
 | 
			
		||||
   }
 | 
			
		||||
@@ -573,6 +596,7 @@ _mesa_TexParameteri(GLenum target, GLenum pname, GLint param)
 | 
			
		||||
void GLAPIENTRY
 | 
			
		||||
_mesa_TexParameteriv(GLenum target, GLenum pname, const GLint *params)
 | 
			
		||||
{
 | 
			
		||||
   GLboolean need_update;
 | 
			
		||||
   struct gl_texture_object *texObj;
 | 
			
		||||
   GET_CURRENT_CONTEXT(ctx);
 | 
			
		||||
   ASSERT_OUTSIDE_BEGIN_END(ctx);
 | 
			
		||||
@@ -590,7 +614,7 @@ _mesa_TexParameteriv(GLenum target, GLenum pname, const GLint *params)
 | 
			
		||||
         fparams[1] = INT_TO_FLOAT(params[1]);
 | 
			
		||||
         fparams[2] = INT_TO_FLOAT(params[2]);
 | 
			
		||||
         fparams[3] = INT_TO_FLOAT(params[3]);
 | 
			
		||||
         set_tex_parameterf(ctx, texObj, pname, fparams);
 | 
			
		||||
         need_update = set_tex_parameterf(ctx, texObj, pname, fparams);
 | 
			
		||||
      }
 | 
			
		||||
      break;
 | 
			
		||||
   case GL_TEXTURE_MIN_LOD:
 | 
			
		||||
@@ -602,15 +626,15 @@ _mesa_TexParameteriv(GLenum target, GLenum pname, const GLint *params)
 | 
			
		||||
      {
 | 
			
		||||
         /* convert int param to float */
 | 
			
		||||
         GLfloat fparam = (GLfloat) params[0];
 | 
			
		||||
         set_tex_parameterf(ctx, texObj, pname, &fparam);
 | 
			
		||||
         need_update = set_tex_parameterf(ctx, texObj, pname, &fparam);
 | 
			
		||||
      }
 | 
			
		||||
      break;
 | 
			
		||||
   default:
 | 
			
		||||
      /* this will generate an error if pname is illegal */
 | 
			
		||||
      set_tex_parameteri(ctx, texObj, pname, params);
 | 
			
		||||
      need_update = set_tex_parameteri(ctx, texObj, pname, params);
 | 
			
		||||
   }
 | 
			
		||||
 | 
			
		||||
   if (ctx->Driver.TexParameter && ctx->ErrorValue == GL_NO_ERROR) {
 | 
			
		||||
   if (ctx->Driver.TexParameter && need_update) {
 | 
			
		||||
      GLfloat fparams[4];
 | 
			
		||||
      fparams[0] = INT_TO_FLOAT(params[0]);
 | 
			
		||||
      if (pname == GL_TEXTURE_BORDER_COLOR ||
 | 
			
		||||
 
 | 
			
		||||
@@ -507,6 +507,7 @@ update_wrapper(GLcontext *ctx, const struct gl_renderbuffer_attachment *att)
 | 
			
		||||
   trb->Base.BlueBits = trb->TexImage->TexFormat->BlueBits;
 | 
			
		||||
   trb->Base.AlphaBits = trb->TexImage->TexFormat->AlphaBits;
 | 
			
		||||
   trb->Base.DepthBits = trb->TexImage->TexFormat->DepthBits;
 | 
			
		||||
   trb->Base.StencilBits = trb->TexImage->TexFormat->StencilBits;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -429,7 +429,7 @@ texture_override(GLcontext *ctx,
 | 
			
		||||
      }
 | 
			
		||||
      if (texObj->_Complete) {
 | 
			
		||||
         texUnit->_ReallyEnabled = textureBit;
 | 
			
		||||
         texUnit->_Current = texObj;
 | 
			
		||||
         _mesa_reference_texobj(&texUnit->_Current, texObj);
 | 
			
		||||
         update_texture_compare_function(ctx, texObj);
 | 
			
		||||
      }
 | 
			
		||||
   }
 | 
			
		||||
@@ -485,7 +485,6 @@ update_texture_state( GLcontext *ctx )
 | 
			
		||||
      GLbitfield enableBits;
 | 
			
		||||
      GLuint tex;
 | 
			
		||||
 | 
			
		||||
      texUnit->_Current = NULL;
 | 
			
		||||
      texUnit->_ReallyEnabled = 0;
 | 
			
		||||
      texUnit->_GenFlags = 0;
 | 
			
		||||
 | 
			
		||||
@@ -802,6 +801,9 @@ _mesa_free_texture_data(GLcontext *ctx)
 | 
			
		||||
   /* unreference current textures */
 | 
			
		||||
   for (u = 0; u < MAX_TEXTURE_IMAGE_UNITS; u++) {
 | 
			
		||||
      struct gl_texture_unit *unit = ctx->Texture.Unit + u;
 | 
			
		||||
      /* The _Current texture could account for another reference */
 | 
			
		||||
      _mesa_reference_texobj(&ctx->Texture.Unit[u]._Current, NULL);
 | 
			
		||||
 | 
			
		||||
      for (tgt = 0; tgt < NUM_TEXTURE_TARGETS; tgt++) {
 | 
			
		||||
         _mesa_reference_texobj(&unit->CurrentTex[tgt], NULL);
 | 
			
		||||
      }
 | 
			
		||||
 
 | 
			
		||||
@@ -1,8 +1,9 @@
 | 
			
		||||
/*
 | 
			
		||||
 * Mesa 3-D graphics library
 | 
			
		||||
 * Version:  7.4
 | 
			
		||||
 * Version:  7.4.3
 | 
			
		||||
 *
 | 
			
		||||
 * Copyright (C) 1999-2008  Brian Paul   All Rights Reserved.
 | 
			
		||||
 * Copyright (C) 2009  VMware, Inc.  All Rights Reserved.
 | 
			
		||||
 *
 | 
			
		||||
 * Permission is hereby granted, free of charge, to any person obtaining a
 | 
			
		||||
 * copy of this software and associated documentation files (the "Software"),
 | 
			
		||||
@@ -30,8 +31,8 @@
 | 
			
		||||
/* Mesa version */
 | 
			
		||||
#define MESA_MAJOR 7
 | 
			
		||||
#define MESA_MINOR 4
 | 
			
		||||
#define MESA_PATCH 0
 | 
			
		||||
#define MESA_VERSION_STRING "7.4"
 | 
			
		||||
#define MESA_PATCH 3
 | 
			
		||||
#define MESA_VERSION_STRING "7.4.3"
 | 
			
		||||
 | 
			
		||||
/* To make version comparison easy */
 | 
			
		||||
#define MESA_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))
 | 
			
		||||
 
 | 
			
		||||
@@ -1379,11 +1379,10 @@ _math_matrix_analyse( GLmatrix *mat )
 | 
			
		||||
 | 
			
		||||
   if (mat->inv && (mat->flags & MAT_DIRTY_INVERSE)) {
 | 
			
		||||
      matrix_invert( mat );
 | 
			
		||||
      mat->flags &= ~MAT_DIRTY_INVERSE;
 | 
			
		||||
   }
 | 
			
		||||
 | 
			
		||||
   mat->flags &= ~(MAT_DIRTY_FLAGS|
 | 
			
		||||
		   MAT_DIRTY_TYPE|
 | 
			
		||||
		   MAT_DIRTY_INVERSE);
 | 
			
		||||
   mat->flags &= ~(MAT_DIRTY_FLAGS | MAT_DIRTY_TYPE);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/*@}*/
 | 
			
		||||
 
 | 
			
		||||
@@ -1496,10 +1496,16 @@ generic_attrib_check(struct var_cache *vc_head)
 | 
			
		||||
   curr = vc_head;
 | 
			
		||||
   while (curr) {
 | 
			
		||||
      if (curr->type == vt_attrib) {
 | 
			
		||||
         if (curr->attrib_is_generic)
 | 
			
		||||
            genericAttrib[ curr->attrib_binding ] = GL_TRUE;
 | 
			
		||||
         else
 | 
			
		||||
         if (curr->attrib_is_generic) {
 | 
			
		||||
            GLuint attr = (curr->attrib_binding == 0)
 | 
			
		||||
               ? 0 : (curr->attrib_binding - VERT_ATTRIB_GENERIC0);
 | 
			
		||||
            assert(attr < MAX_VERTEX_PROGRAM_ATTRIBS);
 | 
			
		||||
            genericAttrib[attr] = GL_TRUE;
 | 
			
		||||
         }
 | 
			
		||||
         else {
 | 
			
		||||
            assert(curr->attrib_binding < MAX_VERTEX_PROGRAM_ATTRIBS);
 | 
			
		||||
            explicitAttrib[ curr->attrib_binding ] = GL_TRUE;
 | 
			
		||||
         }
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
      curr = curr->next;
 | 
			
		||||
@@ -1823,7 +1829,6 @@ parse_param_elements (GLcontext * ctx, const GLubyte ** inst,
 | 
			
		||||
               if (param_var->param_binding_begin == ~0U)
 | 
			
		||||
                  param_var->param_binding_begin = idx;
 | 
			
		||||
               param_var->param_binding_length++;
 | 
			
		||||
               Program->Base.NumParameters++;
 | 
			
		||||
            }
 | 
			
		||||
         }
 | 
			
		||||
         else {
 | 
			
		||||
@@ -1832,7 +1837,6 @@ parse_param_elements (GLcontext * ctx, const GLubyte ** inst,
 | 
			
		||||
            if (param_var->param_binding_begin == ~0U)
 | 
			
		||||
               param_var->param_binding_begin = idx;
 | 
			
		||||
            param_var->param_binding_length++;
 | 
			
		||||
            Program->Base.NumParameters++;
 | 
			
		||||
         }
 | 
			
		||||
         break;
 | 
			
		||||
 | 
			
		||||
@@ -1843,7 +1847,6 @@ parse_param_elements (GLcontext * ctx, const GLubyte ** inst,
 | 
			
		||||
         if (param_var->param_binding_begin == ~0U)
 | 
			
		||||
            param_var->param_binding_begin = idx;
 | 
			
		||||
         param_var->param_binding_length++;
 | 
			
		||||
         Program->Base.NumParameters++;
 | 
			
		||||
 | 
			
		||||
         /* Check if there is more: 0 -> we're done, else its an integer */
 | 
			
		||||
         if (**inst) {
 | 
			
		||||
@@ -1879,7 +1882,6 @@ parse_param_elements (GLcontext * ctx, const GLubyte ** inst,
 | 
			
		||||
               idx = _mesa_add_state_reference(Program->Base.Parameters,
 | 
			
		||||
                                               state_tokens);
 | 
			
		||||
               param_var->param_binding_length++;
 | 
			
		||||
               Program->Base.NumParameters++;
 | 
			
		||||
            }
 | 
			
		||||
         }
 | 
			
		||||
         else {
 | 
			
		||||
@@ -1897,7 +1899,6 @@ parse_param_elements (GLcontext * ctx, const GLubyte ** inst,
 | 
			
		||||
            param_var->param_binding_begin = idx;
 | 
			
		||||
         param_var->param_binding_type = PROGRAM_CONSTANT;
 | 
			
		||||
         param_var->param_binding_length++;
 | 
			
		||||
         Program->Base.NumParameters++;
 | 
			
		||||
         break;
 | 
			
		||||
 | 
			
		||||
      default:
 | 
			
		||||
@@ -1906,12 +1907,14 @@ parse_param_elements (GLcontext * ctx, const GLubyte ** inst,
 | 
			
		||||
         return 1;
 | 
			
		||||
   }
 | 
			
		||||
 | 
			
		||||
   Program->Base.NumParameters = Program->Base.Parameters->NumParameters;
 | 
			
		||||
 | 
			
		||||
   /* Make sure we haven't blown past our parameter limits */
 | 
			
		||||
   if (((Program->Base.Target == GL_VERTEX_PROGRAM_ARB) &&
 | 
			
		||||
        (Program->Base.NumParameters >=
 | 
			
		||||
        (Program->Base.NumParameters >
 | 
			
		||||
         ctx->Const.VertexProgram.MaxLocalParams))
 | 
			
		||||
       || ((Program->Base.Target == GL_FRAGMENT_PROGRAM_ARB)
 | 
			
		||||
           && (Program->Base.NumParameters >=
 | 
			
		||||
           && (Program->Base.NumParameters >
 | 
			
		||||
               ctx->Const.FragmentProgram.MaxLocalParams))) {
 | 
			
		||||
      program_error(ctx, Program->Position, "Too many parameter variables");
 | 
			
		||||
      return 1;
 | 
			
		||||
 
 | 
			
		||||
@@ -873,7 +873,7 @@ _mesa_execute_program(GLcontext * ctx,
 | 
			
		||||
                * result.z = result.x * APPX(result.y)
 | 
			
		||||
                * We do what the ARB extension says.
 | 
			
		||||
                */
 | 
			
		||||
               q[2] = (GLfloat) pow(2.0, t[0]);
 | 
			
		||||
               q[2] = (GLfloat) _mesa_pow(2.0, t[0]);
 | 
			
		||||
            }
 | 
			
		||||
            q[1] = t[0] - floor_t0;
 | 
			
		||||
            q[3] = 1.0F;
 | 
			
		||||
@@ -986,7 +986,7 @@ _mesa_execute_program(GLcontext * ctx,
 | 
			
		||||
               if (a[1] == 0.0 && a[3] == 0.0)
 | 
			
		||||
                  result[2] = 1.0;
 | 
			
		||||
               else
 | 
			
		||||
                  result[2] = EXPF(a[3] * LOGF(a[1]));
 | 
			
		||||
                  result[2] = (GLfloat) _mesa_pow(a[1], a[3]);
 | 
			
		||||
            }
 | 
			
		||||
            else {
 | 
			
		||||
               result[2] = 0.0;
 | 
			
		||||
@@ -1577,8 +1577,8 @@ _mesa_execute_program(GLcontext * ctx,
 | 
			
		||||
      case OPCODE_TXB:         /* GL_ARB_fragment_program only */
 | 
			
		||||
         /* Texel lookup with LOD bias */
 | 
			
		||||
         {
 | 
			
		||||
            const struct gl_texture_unit *texUnit
 | 
			
		||||
               = &ctx->Texture.Unit[inst->TexSrcUnit];
 | 
			
		||||
            const GLuint unit = machine->Samplers[inst->TexSrcUnit];
 | 
			
		||||
            const struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit];
 | 
			
		||||
            GLfloat texcoord[4], color[4], lodBias;
 | 
			
		||||
 | 
			
		||||
            fetch_vector4(&inst->SrcReg[0], machine, texcoord);
 | 
			
		||||
 
 | 
			
		||||
@@ -178,15 +178,20 @@ _mesa_add_named_constant(struct gl_program_parameter_list *paramList,
 | 
			
		||||
                         const char *name, const GLfloat values[4],
 | 
			
		||||
                         GLuint size)
 | 
			
		||||
{
 | 
			
		||||
#if 0 /* disable this for now -- we need to save the name! */
 | 
			
		||||
   /* first check if this is a duplicate constant */
 | 
			
		||||
   GLint pos;
 | 
			
		||||
   GLuint swizzle;
 | 
			
		||||
   ASSERT(size == 4); /* XXX future feature */
 | 
			
		||||
   /* check if we already have this constant */
 | 
			
		||||
   if (_mesa_lookup_parameter_constant(paramList, values, 4, &pos, &swizzle)) {
 | 
			
		||||
      return pos;
 | 
			
		||||
   for (pos = 0; pos < paramList->NumParameters; pos++) {
 | 
			
		||||
      const GLfloat *pvals = paramList->ParameterValues[pos];
 | 
			
		||||
      if (pvals[0] == values[0] &&
 | 
			
		||||
          pvals[1] == values[1] &&
 | 
			
		||||
          pvals[2] == values[2] &&
 | 
			
		||||
          pvals[3] == values[3] &&
 | 
			
		||||
          _mesa_strcmp(paramList->Parameters[pos].Name, name) == 0) {
 | 
			
		||||
         /* Same name and value is already in the param list - reuse it */
 | 
			
		||||
         return pos;
 | 
			
		||||
      }
 | 
			
		||||
   }
 | 
			
		||||
#endif
 | 
			
		||||
   /* not found, add new parameter */
 | 
			
		||||
   return _mesa_add_parameter(paramList, PROGRAM_CONSTANT, name,
 | 
			
		||||
                              size, GL_NONE, values, NULL, 0x0);
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -296,6 +296,7 @@ _mesa_new_program(GLcontext *ctx, GLenum target, GLuint id)
 | 
			
		||||
   struct gl_program *prog;
 | 
			
		||||
   switch (target) {
 | 
			
		||||
   case GL_VERTEX_PROGRAM_ARB: /* == GL_VERTEX_PROGRAM_NV */
 | 
			
		||||
   case GL_VERTEX_STATE_PROGRAM_NV:
 | 
			
		||||
      prog = _mesa_init_vertex_program(ctx, CALLOC_STRUCT(gl_vertex_program),
 | 
			
		||||
                                       target, id );
 | 
			
		||||
      break;
 | 
			
		||||
 
 | 
			
		||||
@@ -457,28 +457,36 @@ emit_statevars(const char *name, int array_len,
 | 
			
		||||
         tokens[0] = STATE_TEXENV_COLOR;
 | 
			
		||||
      }
 | 
			
		||||
      else if (strcmp(name, "gl_EyePlaneS") == 0) {
 | 
			
		||||
         tokens[0] = STATE_TEXGEN_EYE_S;
 | 
			
		||||
         tokens[0] = STATE_TEXGEN;
 | 
			
		||||
         tokens[2] = STATE_TEXGEN_EYE_S;
 | 
			
		||||
      }
 | 
			
		||||
      else if (strcmp(name, "gl_EyePlaneT") == 0) {
 | 
			
		||||
         tokens[0] = STATE_TEXGEN_EYE_T;
 | 
			
		||||
         tokens[0] = STATE_TEXGEN;
 | 
			
		||||
         tokens[2] = STATE_TEXGEN_EYE_T;
 | 
			
		||||
      }
 | 
			
		||||
      else if (strcmp(name, "gl_EyePlaneR") == 0) {
 | 
			
		||||
         tokens[0] = STATE_TEXGEN_EYE_R;
 | 
			
		||||
         tokens[0] = STATE_TEXGEN;
 | 
			
		||||
         tokens[2] = STATE_TEXGEN_EYE_R;
 | 
			
		||||
      }
 | 
			
		||||
      else if (strcmp(name, "gl_EyePlaneQ") == 0) {
 | 
			
		||||
         tokens[0] = STATE_TEXGEN_EYE_Q;
 | 
			
		||||
         tokens[0] = STATE_TEXGEN;
 | 
			
		||||
         tokens[2] = STATE_TEXGEN_EYE_Q;
 | 
			
		||||
      }
 | 
			
		||||
      else if (strcmp(name, "gl_ObjectPlaneS") == 0) {
 | 
			
		||||
         tokens[0] = STATE_TEXGEN_OBJECT_S;
 | 
			
		||||
         tokens[0] = STATE_TEXGEN;
 | 
			
		||||
         tokens[2] = STATE_TEXGEN_OBJECT_S;
 | 
			
		||||
      }
 | 
			
		||||
      else if (strcmp(name, "gl_ObjectPlaneT") == 0) {
 | 
			
		||||
         tokens[0] = STATE_TEXGEN_OBJECT_T;
 | 
			
		||||
         tokens[0] = STATE_TEXGEN;
 | 
			
		||||
         tokens[2] = STATE_TEXGEN_OBJECT_T;
 | 
			
		||||
      }
 | 
			
		||||
      else if (strcmp(name, "gl_ObjectPlaneR") == 0) {
 | 
			
		||||
         tokens[0] = STATE_TEXGEN_OBJECT_R;
 | 
			
		||||
         tokens[0] = STATE_TEXGEN;
 | 
			
		||||
         tokens[2] = STATE_TEXGEN_OBJECT_R;
 | 
			
		||||
      }
 | 
			
		||||
      else if (strcmp(name, "gl_ObjectPlaneQ") == 0) {
 | 
			
		||||
         tokens[0] = STATE_TEXGEN_OBJECT_Q;
 | 
			
		||||
         tokens[0] = STATE_TEXGEN;
 | 
			
		||||
         tokens[2] = STATE_TEXGEN_OBJECT_Q;
 | 
			
		||||
      }
 | 
			
		||||
      else {
 | 
			
		||||
         return -1; /* invalid array name */
 | 
			
		||||
 
 | 
			
		||||
@@ -249,6 +249,11 @@ link_uniform_vars(GLcontext *ctx,
 | 
			
		||||
            _mesa_append_uniform(shProg->Uniforms, p->Name, prog->Target, i);
 | 
			
		||||
         if (uniform)
 | 
			
		||||
            uniform->Initialized = p->Initialized;
 | 
			
		||||
 | 
			
		||||
	 /* Add the flag indicating that the program is dependent on constant
 | 
			
		||||
	  * state.
 | 
			
		||||
	  */
 | 
			
		||||
	 prog->Parameters->StateFlags |= _NEW_PROGRAM;
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
      /* The samplerMap[] table we build here is used to remap/re-index
 | 
			
		||||
 
 | 
			
		||||
@@ -1041,11 +1041,11 @@ preprocess_source (slang_string *output, const char *source,
 | 
			
		||||
 | 
			
		||||
               /* Parse optional macro parameters. */
 | 
			
		||||
               while (prod[i++] != PARAM_END) {
 | 
			
		||||
                  if (state.cond.top->effective) {
 | 
			
		||||
                     pp_symbol *param;
 | 
			
		||||
                  pp_symbol *param;
 | 
			
		||||
 | 
			
		||||
                     id = (const char *) (&prod[i]);
 | 
			
		||||
                     idlen = _mesa_strlen (id);
 | 
			
		||||
                  id = (const char *) (&prod[i]);
 | 
			
		||||
                  idlen = _mesa_strlen (id);
 | 
			
		||||
                  if (state.cond.top->effective) {
 | 
			
		||||
                     pp_annotate (output, "%s, ", id);
 | 
			
		||||
                     param = pp_symbols_push (&symbol->parameters);
 | 
			
		||||
                     if (param == NULL)
 | 
			
		||||
@@ -1059,8 +1059,23 @@ preprocess_source (slang_string *output, const char *source,
 | 
			
		||||
               id = (const char *) (&prod[i]);
 | 
			
		||||
               idlen = _mesa_strlen (id);
 | 
			
		||||
               if (state.cond.top->effective) {
 | 
			
		||||
                  slang_string replacement;
 | 
			
		||||
                  expand_state es;
 | 
			
		||||
 | 
			
		||||
                  pp_annotate (output, ") %s", id);
 | 
			
		||||
                  slang_string_pushs (&symbol->replacement, id, idlen);
 | 
			
		||||
 | 
			
		||||
                  slang_string_init(&replacement);
 | 
			
		||||
                  slang_string_pushs(&replacement, id, idlen);
 | 
			
		||||
 | 
			
		||||
                  /* Expand macro replacement. */
 | 
			
		||||
                  es.output = &symbol->replacement;
 | 
			
		||||
                  es.input = slang_string_cstr(&replacement);
 | 
			
		||||
                  es.state = &state;
 | 
			
		||||
                  if (!expand(&es, &state.symbols)) {
 | 
			
		||||
                     slang_string_free(&replacement);
 | 
			
		||||
                     goto error;
 | 
			
		||||
                  }
 | 
			
		||||
                  slang_string_free(&replacement);
 | 
			
		||||
               }
 | 
			
		||||
               i += idlen + 1;
 | 
			
		||||
            }
 | 
			
		||||
@@ -1291,6 +1306,45 @@ error:
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Remove the continuation characters from the input string.
 | 
			
		||||
 * This is the very first step in preprocessing and is effective
 | 
			
		||||
 * even inside comment blocks.
 | 
			
		||||
 * If there is a whitespace between a backslash and a newline,
 | 
			
		||||
 * this is not considered as a line continuation.
 | 
			
		||||
 * \return GL_TRUE for success, GL_FALSE otherwise.
 | 
			
		||||
 */
 | 
			
		||||
static GLboolean
 | 
			
		||||
_slang_preprocess_backslashes(slang_string *output,
 | 
			
		||||
                              const char *input)
 | 
			
		||||
{
 | 
			
		||||
   while (*input) {
 | 
			
		||||
      if (input[0] == '\\') {
 | 
			
		||||
         /* If a newline follows, eat the backslash and the newline. */
 | 
			
		||||
         if (input[1] == '\r') {
 | 
			
		||||
            if (input[2] == '\n') {
 | 
			
		||||
               input += 3;
 | 
			
		||||
            } else {
 | 
			
		||||
               input += 2;
 | 
			
		||||
            }
 | 
			
		||||
         } else if (input[1] == '\n') {
 | 
			
		||||
            if (input[2] == '\r') {
 | 
			
		||||
               input += 3;
 | 
			
		||||
            } else {
 | 
			
		||||
               input += 2;
 | 
			
		||||
            }
 | 
			
		||||
         } else {
 | 
			
		||||
            /* Leave the backslash alone. */
 | 
			
		||||
            slang_string_pushc(output, *input++);
 | 
			
		||||
         }
 | 
			
		||||
      } else {
 | 
			
		||||
         slang_string_pushc(output, *input++);
 | 
			
		||||
      }
 | 
			
		||||
   }
 | 
			
		||||
   return GL_TRUE;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Run preprocessor on source code.
 | 
			
		||||
 * \param extensions  indicates which GL extensions are enabled
 | 
			
		||||
@@ -1308,6 +1362,7 @@ _slang_preprocess_directives(slang_string *output,
 | 
			
		||||
{
 | 
			
		||||
   grammar pid, eid;
 | 
			
		||||
   GLboolean success;
 | 
			
		||||
   slang_string without_backslashes;
 | 
			
		||||
 | 
			
		||||
   pid = grammar_load_from_text ((const byte *) (slang_pp_directives_syn));
 | 
			
		||||
   if (pid == 0) {
 | 
			
		||||
@@ -1320,9 +1375,36 @@ _slang_preprocess_directives(slang_string *output,
 | 
			
		||||
      grammar_destroy (pid);
 | 
			
		||||
      return GL_FALSE;
 | 
			
		||||
   }
 | 
			
		||||
   success = preprocess_source (output, input, pid, eid, elog, extensions, pragmas);
 | 
			
		||||
 | 
			
		||||
   slang_string_init(&without_backslashes);
 | 
			
		||||
   success = _slang_preprocess_backslashes(&without_backslashes, input);
 | 
			
		||||
 | 
			
		||||
   if (0) {
 | 
			
		||||
      _mesa_printf("Pre-processed shader:\n");
 | 
			
		||||
      _mesa_printf("%s", slang_string_cstr(&without_backslashes));
 | 
			
		||||
      _mesa_printf("----------------------\n");
 | 
			
		||||
   }
 | 
			
		||||
 | 
			
		||||
   if (success) {
 | 
			
		||||
      success = preprocess_source(output,
 | 
			
		||||
                                  slang_string_cstr(&without_backslashes),
 | 
			
		||||
                                  pid,
 | 
			
		||||
                                  eid,
 | 
			
		||||
                                  elog,
 | 
			
		||||
                                  extensions,
 | 
			
		||||
                                  pragmas);
 | 
			
		||||
   }
 | 
			
		||||
 | 
			
		||||
   slang_string_free(&without_backslashes);
 | 
			
		||||
   grammar_destroy (eid);
 | 
			
		||||
   grammar_destroy (pid);
 | 
			
		||||
 | 
			
		||||
   if (0) {
 | 
			
		||||
      _mesa_printf("Post-processed shader:\n");
 | 
			
		||||
      _mesa_printf("%s", slang_string_cstr(output));
 | 
			
		||||
      _mesa_printf("----------------------\n");
 | 
			
		||||
   }
 | 
			
		||||
 | 
			
		||||
   return success;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -570,6 +570,9 @@ void
 | 
			
		||||
_swrast_choose_point(GLcontext *ctx)
 | 
			
		||||
{
 | 
			
		||||
   SWcontext *swrast = SWRAST_CONTEXT(ctx);
 | 
			
		||||
   const GLfloat size = CLAMP(ctx->Point.Size,
 | 
			
		||||
                              ctx->Point.MinSize,
 | 
			
		||||
                              ctx->Point.MaxSize);
 | 
			
		||||
 | 
			
		||||
   if (ctx->RenderMode == GL_RENDER) {
 | 
			
		||||
      if (ctx->Point.PointSprite) {
 | 
			
		||||
@@ -578,7 +581,7 @@ _swrast_choose_point(GLcontext *ctx)
 | 
			
		||||
      else if (ctx->Point.SmoothFlag) {
 | 
			
		||||
         swrast->Point = smooth_point;
 | 
			
		||||
      }
 | 
			
		||||
      else if (ctx->Point.Size > 1.0 ||
 | 
			
		||||
      else if (size > 1.0 ||
 | 
			
		||||
               ctx->Point._Attenuated ||
 | 
			
		||||
               ctx->VertexProgram.PointSizeEnabled) {
 | 
			
		||||
         swrast->Point = large_point;
 | 
			
		||||
 
 | 
			
		||||
@@ -1399,11 +1399,17 @@ _swrast_write_rgba_span( GLcontext *ctx, SWspan *span)
 | 
			
		||||
   }
 | 
			
		||||
 | 
			
		||||
   /*
 | 
			
		||||
    * Write to renderbuffers
 | 
			
		||||
    * Write to renderbuffers.
 | 
			
		||||
    * Depending on glDrawBuffer() state and the which color outputs are
 | 
			
		||||
    * written by the fragment shader, we may either replicate one color to
 | 
			
		||||
    * all renderbuffers or write a different color to each renderbuffer.
 | 
			
		||||
    * multiFragOutputs=TRUE for the later case.
 | 
			
		||||
    */
 | 
			
		||||
   {
 | 
			
		||||
      const GLuint numBuffers = fb->_NumColorDrawBuffers;
 | 
			
		||||
      const GLboolean multiFragOutputs = numBuffers > 1;
 | 
			
		||||
      const struct gl_fragment_program *fp = ctx->FragmentProgram._Current;
 | 
			
		||||
      const GLboolean multiFragOutputs = 
 | 
			
		||||
         (fp && fp->Base.OutputsWritten >= (1 << FRAG_RESULT_DATA0));
 | 
			
		||||
      GLuint buf;
 | 
			
		||||
 | 
			
		||||
      for (buf = 0; buf < numBuffers; buf++) {
 | 
			
		||||
 
 | 
			
		||||
@@ -226,7 +226,7 @@ lerp_rgba_3d(GLchan result[4], GLfloat a, GLfloat b, GLfloat c,
 | 
			
		||||
 * If A is a signed integer, A % B doesn't give the right value for A < 0
 | 
			
		||||
 * (in terms of texture repeat).  Just casting to unsigned fixes that.
 | 
			
		||||
 */
 | 
			
		||||
#define REMAINDER(A, B) ((unsigned) (A) % (unsigned) (B))
 | 
			
		||||
#define REMAINDER(A, B) (((A) + (B) * 1024) % (B))
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
@@ -2061,6 +2061,7 @@ clamp_rect_coord_linear(GLenum wrapMode, GLfloat coord, GLint max,
 | 
			
		||||
      fcol -= 0.5F;
 | 
			
		||||
      i0 = IFLOOR(fcol);
 | 
			
		||||
      i1 = i0 + 1;
 | 
			
		||||
      break;
 | 
			
		||||
   default:
 | 
			
		||||
      _mesa_problem(NULL, "bad wrapMode in clamp_rect_coord_linear");
 | 
			
		||||
      i0 = i1 = 0;
 | 
			
		||||
 
 | 
			
		||||
@@ -114,8 +114,11 @@ static void bind_array_obj( GLcontext *ctx )
 | 
			
		||||
   for (i = 0; i < 8; i++)
 | 
			
		||||
      exec->array.legacy_array[VERT_ATTRIB_TEX0 + i] = &ctx->Array.ArrayObj->TexCoord[i];
 | 
			
		||||
 | 
			
		||||
   for (i = 0; i < VERT_ATTRIB_MAX; i++)
 | 
			
		||||
   for (i = 0; i < MAX_VERTEX_ATTRIBS; i++) {
 | 
			
		||||
      assert(i < Elements(ctx->Array.ArrayObj->VertexAttrib));
 | 
			
		||||
      assert(i < Elements(exec->array.generic_array));
 | 
			
		||||
      exec->array.generic_array[i] = &ctx->Array.ArrayObj->VertexAttrib[i];
 | 
			
		||||
   }
 | 
			
		||||
   
 | 
			
		||||
   exec->array.array_obj = ctx->Array.ArrayObj->Name;
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -184,6 +184,7 @@ static void vbo_exec_bind_arrays( GLcontext *ctx )
 | 
			
		||||
          (ctx->VertexProgram._Current->Base.InputsRead & VERT_BIT_GENERIC0)) {
 | 
			
		||||
         exec->vtx.inputs[16] = exec->vtx.inputs[0];
 | 
			
		||||
         exec->vtx.attrsz[16] = exec->vtx.attrsz[0];
 | 
			
		||||
         exec->vtx.attrptr[16] = exec->vtx.attrptr[0];
 | 
			
		||||
         exec->vtx.attrsz[0] = 0;
 | 
			
		||||
      }
 | 
			
		||||
      break;
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user