From 7a2af605c2c2b0d2e9bbb0b161eba8842acefbcb Mon Sep 17 00:00:00 2001 From: marha Date: Fri, 15 Jun 2012 08:28:24 +0200 Subject: fontconfig mesa pixman xserver git update 15 juni 2012 --- fontconfig/.gitignore | 1 + fontconfig/configure.in | 1 + fontconfig/src/Makefile.am | 2 + fontconfig/src/fcatomic.c | 7 +- fontconfig/src/fccfg.c | 18 +- fontconfig/src/fcint.h | 4 +- fontconfig/src/fcstat.c | 16 +- fontconfig/src/fcstr.c | 6 +- fontconfig/src/fcxml.c | 24 +- mesalib/Makefile.am | 7 +- mesalib/bin/shortlog_mesa.sh | 23 + mesalib/configure.ac | 7 +- mesalib/docs/autoconf.html | 15 +- mesalib/docs/banner.html | 52 +- mesalib/docs/bugs.html | 22 +- mesalib/docs/conform.html | 19 +- mesalib/docs/contents.html | 74 +-- mesalib/docs/debugging.html | 21 +- mesalib/docs/developers.html | 19 +- mesalib/docs/devinfo.html | 38 +- mesalib/docs/dispatch.html | 50 +- mesalib/docs/download.html | 25 +- mesalib/docs/egl.html | 13 +- mesalib/docs/envvars.html | 34 +- mesalib/docs/extensions.html | 54 +- mesalib/docs/faq.html | 87 ++- mesalib/docs/games.html | 25 +- mesalib/docs/glu.html | 19 +- mesalib/docs/helpwanted.html | 25 +- mesalib/docs/index.html | 8 +- mesalib/docs/install.html | 59 +-- mesalib/docs/intro.html | 35 +- mesalib/docs/libraries.html | 20 +- mesalib/docs/license.html | 23 +- mesalib/docs/lists.html | 42 +- mesalib/docs/llvmpipe.html | 37 +- mesalib/docs/mangling.html | 23 +- mesalib/docs/modelers.html | 20 +- mesalib/docs/news.html | 214 ++++---- mesalib/docs/opengles.html | 13 +- mesalib/docs/openvg.html | 21 +- mesalib/docs/osmesa.html | 25 +- mesalib/docs/perf.html | 23 +- mesalib/docs/postprocess.html | 23 +- mesalib/docs/precompiled.html | 21 +- mesalib/docs/relnotes-6.4.1.html | 2 +- mesalib/docs/relnotes-6.5.2.html | 2 +- mesalib/docs/relnotes-7.1.html | 2 +- mesalib/docs/relnotes-7.10.1.html | 4 +- mesalib/docs/relnotes-7.10.3.html | 6 +- mesalib/docs/relnotes-7.10.html | 12 +- mesalib/docs/relnotes-7.11.html | 2 +- mesalib/docs/relnotes-7.9.1.html | 8 +- mesalib/docs/relnotes-7.9.2.html | 1 - mesalib/docs/relnotes-8.0.2.html | 2 +- mesalib/docs/relnotes-8.0.3.html | 4 +- mesalib/docs/relnotes.html | 161 +++--- mesalib/docs/repository.html | 37 +- mesalib/docs/science.html | 24 +- mesalib/docs/shading.html | 55 +- mesalib/docs/sourcedocs.html | 29 +- mesalib/docs/sourcetree.html | 19 +- mesalib/docs/subset-A.html | 18 +- mesalib/docs/subset.html | 21 +- mesalib/docs/systems.html | 23 +- mesalib/docs/thanks.html | 35 +- mesalib/docs/utilities.html | 19 +- mesalib/docs/utility.html | 19 +- mesalib/docs/versions.html | 89 ++-- mesalib/docs/viewperf.html | 19 +- mesalib/docs/vmware-guest.html | 18 +- mesalib/docs/webmaster.html | 19 +- mesalib/docs/xlibdriver.html | 35 +- mesalib/scons/gallium.py | 11 +- mesalib/src/gallium/auxiliary/util/u_blit.c | 6 +- mesalib/src/glsl/TODO | 3 - mesalib/src/glsl/ir.cpp | 48 ++ mesalib/src/glsl/ir.h | 26 +- mesalib/src/glsl/opt_algebraic.cpp | 31 ++ mesalib/src/mapi/glapi/gen/ARB_texture_storage.xml | 2 +- mesalib/src/mapi/glapi/gen/GL3x.xml | 40 ++ mesalib/src/mapi/glapi/gen/gl_API.xml | 218 ++++++-- mesalib/src/mesa/Makefile | 2 +- mesalib/src/mesa/drivers/common/meta.c | 72 ++- mesalib/src/mesa/drivers/windows/gdi/mesa.def | 15 - mesalib/src/mesa/main/shaderobj.c | 4 +- mesalib/src/mesa/program/hash_table.c | 5 +- mesalib/src/mesa/program/hash_table.h | 17 +- mesalib/src/mesa/sources.mak | 1 + mesalib/src/mesa/state_tracker/st_atom.c | 27 +- mesalib/src/mesa/state_tracker/st_atom.h | 5 + mesalib/src/mesa/state_tracker/st_atom_array.c | 588 +++++++++++++++++++++ mesalib/src/mesa/state_tracker/st_cb_drawpixels.c | 13 +- mesalib/src/mesa/state_tracker/st_context.h | 2 + mesalib/src/mesa/state_tracker/st_draw.c | 573 +------------------- mesalib/src/mesa/state_tracker/st_draw.h | 7 - pixman/test/stress-test.c | 1 + xorg-server/Xi/exevents.c | 25 +- xorg-server/Xi/xichangehierarchy.c | 6 - xorg-server/configure.ac | 2 +- xorg-server/dix/devices.c | 61 ++- xorg-server/dix/events.c | 12 + xorg-server/dix/getevents.c | 5 +- xorg-server/dix/main.c | 4 + xorg-server/dix/touch.c | 23 +- xorg-server/glx/clientinfo.c | 49 +- xorg-server/glx/createcontext.c | 213 +++++++- xorg-server/glx/extension_string.c | 38 +- xorg-server/glx/extension_string.h | 4 +- xorg-server/glx/glxcmds.c | 77 +-- xorg-server/glx/glxcontext.h | 13 + xorg-server/glx/glxdri.c | 12 +- xorg-server/glx/glxdri2.c | 161 +++++- xorg-server/glx/glxdriswrast.c | 12 +- xorg-server/glx/glxext.c | 13 +- xorg-server/glx/glxext.h | 2 +- xorg-server/glx/glxscreens.h | 5 +- xorg-server/glx/glxserver.h | 2 - xorg-server/hw/dmx/dmx.c | 3 +- xorg-server/hw/xfree86/common/compiler.h | 17 + xorg-server/hw/xfree86/fbdevhw/fbdevhwstub.c | 2 +- xorg-server/hw/xfree86/int10/generic.c | 8 +- xorg-server/include/dix.h | 2 + xorg-server/include/input.h | 2 +- xorg-server/include/misc.h | 12 + xorg-server/test/touch.c | 5 + xorg-server/xkb/xkbAccessX.c | 9 +- 127 files changed, 2727 insertions(+), 1789 deletions(-) create mode 100644 mesalib/bin/shortlog_mesa.sh create mode 100644 mesalib/src/mesa/state_tracker/st_atom_array.c diff --git a/fontconfig/.gitignore b/fontconfig/.gitignore index 894a6a701..32b9e43e6 100644 --- a/fontconfig/.gitignore +++ b/fontconfig/.gitignore @@ -1,5 +1,6 @@ tags TAGS +*.exe *.tar.gz .libs .deps diff --git a/fontconfig/configure.in b/fontconfig/configure.in index c06ad8900..a8c1f8728 100644 --- a/fontconfig/configure.in +++ b/fontconfig/configure.in @@ -104,6 +104,7 @@ AC_SUBST(WARN_CFLAGS) dnl ========================================================================== AM_CONDITIONAL(CROSS_COMPILING, test $cross_compiling = yes) +AM_CONDITIONAL(ENABLE_SHARED, test "$enable_shared" = "yes") dnl ========================================================================== diff --git a/fontconfig/src/Makefile.am b/fontconfig/src/Makefile.am index 65ec1e3bb..3dd69dde9 100644 --- a/fontconfig/src/Makefile.am +++ b/fontconfig/src/Makefile.am @@ -134,9 +134,11 @@ libfontconfig_la_LIBADD = $(ICONV_LIBS) $(FREETYPE_LIBS) $(LIBXML2_LIBS) $(EXPAT libfontconfig_la_DEPENDENCIES = $(fontconfig_def_dependency) +if ENABLE_SHARED install-data-local: install-ms-import-lib install-libtool-import-lib uninstall-local: uninstall-ms-import-lib uninstall-libtool-import-lib +endif PUBLIC_FILES = \ $(top_srcdir)/fontconfig/fontconfig.h \ diff --git a/fontconfig/src/fcatomic.c b/fontconfig/src/fcatomic.c index 4f6ab01f4..bc7b07bd4 100644 --- a/fontconfig/src/fcatomic.c +++ b/fontconfig/src/fcatomic.c @@ -99,12 +99,13 @@ FcAtomicCreate (const FcChar8 *file) FcBool FcAtomicLock (FcAtomic *atomic) { - int fd = -1; - FILE *f = 0; int ret; struct stat lck_stat; #ifdef HAVE_LINK + int fd = -1; + FILE *f = 0; + strcpy ((char *) atomic->tmp, (char *) atomic->file); strcat ((char *) atomic->tmp, TMP_NAME); fd = mkstemp ((char *) atomic->tmp); @@ -185,7 +186,7 @@ FcBool FcAtomicReplaceOrig (FcAtomic *atomic) { #ifdef _WIN32 - unlink (atomic->file); + unlink ((const char *) atomic->file); #endif if (rename ((char *) atomic->new, (char *) atomic->file) < 0) return FcFalse; diff --git a/fontconfig/src/fccfg.c b/fontconfig/src/fccfg.c index 3f1fa73df..d3752e552 100644 --- a/fontconfig/src/fccfg.c +++ b/fontconfig/src/fccfg.c @@ -1672,7 +1672,7 @@ DllMain (HINSTANCE hinstDLL, switch (fdwReason) { case DLL_PROCESS_ATTACH: - if (!GetModuleFileName ((HMODULE) hinstDLL, fontconfig_path, + if (!GetModuleFileName ((HMODULE) hinstDLL, (LPCH) fontconfig_path, sizeof (fontconfig_path))) break; @@ -1681,15 +1681,15 @@ DllMain (HINSTANCE hinstDLL, * "etc/fonts" in there as FONTCONFIG_PATH. Otherwise use the * folder where the DLL is as FONTCONFIG_PATH. */ - p = strrchr (fontconfig_path, '\\'); + p = (FcChar8 *) strrchr ((const char *) fontconfig_path, '\\'); if (p) { *p = '\0'; - p = strrchr (fontconfig_path, '\\'); - if (p && (FcStrCmpIgnoreCase (p + 1, "bin") == 0 || - FcStrCmpIgnoreCase (p + 1, "lib") == 0)) + p = (FcChar8 *) strrchr ((const char *) fontconfig_path, '\\'); + if (p && (FcStrCmpIgnoreCase (p + 1, (const FcChar8 *) "bin") == 0 || + FcStrCmpIgnoreCase (p + 1, (const FcChar8 *) "lib") == 0)) *p = '\0'; - strcat (fontconfig_path, "\\etc\\fonts"); + strcat ((char *) fontconfig_path, "\\etc\\fonts"); } else fontconfig_path[0] = '\0'; @@ -1804,11 +1804,11 @@ FcConfigGetPath (void) if (fontconfig_path[0] == '\0') { char *p; - if(!GetModuleFileName(NULL, fontconfig_path, sizeof(fontconfig_path))) + if(!GetModuleFileName(NULL, (LPCH) fontconfig_path, sizeof(fontconfig_path))) goto bail1; - p = strrchr (fontconfig_path, '\\'); + p = strrchr ((const char *) fontconfig_path, '\\'); if (p) *p = '\0'; - strcat (fontconfig_path, "\\fonts"); + strcat ((char *) fontconfig_path, "\\fonts"); } #endif dir = (FcChar8 *) FONTCONFIG_PATH; diff --git a/fontconfig/src/fcint.h b/fontconfig/src/fcint.h index 60bc0cca1..ca6b4f209 100644 --- a/fontconfig/src/fcint.h +++ b/fontconfig/src/fcint.h @@ -55,7 +55,9 @@ #endif #ifdef _WIN32 -# define _WIN32_WINNT 0x0500 +# ifndef _WIN32_WINNT +# define _WIN32_WINNT 0x0500 +# endif # define WIN32_LEAN_AND_MEAN # define STRICT # include diff --git a/fontconfig/src/fcstat.c b/fontconfig/src/fcstat.c index d8ede597c..d8663d036 100644 --- a/fontconfig/src/fcstat.c +++ b/fontconfig/src/fcstat.c @@ -82,7 +82,7 @@ FcStat (const FcChar8 *file, struct stat *statb) char *basename; DWORD rc; - if (!GetFileAttributesEx (file, GetFileExInfoStandard, &wfad)) + if (!GetFileAttributesEx ((LPCSTR) file, GetFileExInfoStandard, &wfad)) return -1; statb->st_dev = 0; @@ -91,12 +91,12 @@ FcStat (const FcChar8 *file, struct stat *statb) * Call GetLongPathName() to get the spelling of the path name as it * is on disk. */ - rc = GetFullPathName (file, sizeof (full_path_name), full_path_name, &basename); + rc = GetFullPathName ((LPCSTR) file, sizeof (full_path_name), full_path_name, &basename); if (rc == 0 || rc > sizeof (full_path_name)) return -1; rc = GetLongPathName (full_path_name, full_path_name, sizeof (full_path_name)); - statb->st_ino = FcStringHash (full_path_name); + statb->st_ino = FcStringHash ((const FcChar8 *) full_path_name); statb->st_mode = _S_IREAD | _S_IWRITE; statb->st_mode |= (statb->st_mode >> 3) | (statb->st_mode >> 6); @@ -129,8 +129,6 @@ FcStat (const FcChar8 *file, struct stat *statb) return stat ((char *) file, statb); } -#endif - /* Adler-32 checksum implementation */ struct Adler32 { int a; @@ -238,6 +236,7 @@ FcDirChecksum (const FcChar8 *dir, time_t *checksum) return 0; } +#endif /* _WIN32 */ int FcStatChecksum (const FcChar8 *file, struct stat *statb) @@ -245,11 +244,16 @@ FcStatChecksum (const FcChar8 *file, struct stat *statb) if (FcStat (file, statb) == -1) return -1; +#ifndef _WIN32 + /* We have a workaround of the broken stat() in FcStat() for Win32. + * No need to do something further more. + */ if (FcIsFsMtimeBroken (file)) { if (FcDirChecksum (file, &statb->st_mtime) == -1) return -1; } +#endif return 0; } @@ -258,7 +262,7 @@ static int FcFStatFs (int fd, FcStatFS *statb) { const char *p = NULL; - int ret; + int ret = -1; FcBool flag = FcFalse; memset (statb, 0, sizeof (FcStatFS)); diff --git a/fontconfig/src/fcstr.c b/fontconfig/src/fcstr.c index c446bcd8e..f505ea665 100644 --- a/fontconfig/src/fcstr.c +++ b/fontconfig/src/fcstr.c @@ -1052,13 +1052,13 @@ FcStrCanonFilename (const FcChar8 *s) { #ifdef _WIN32 FcChar8 full[FC_MAX_FILE_LEN + 2]; - int size = GetFullPathName (s, sizeof (full) -1, - full, NULL); + int size = GetFullPathName ((LPCSTR) s, sizeof (full) -1, + (LPSTR) full, NULL); if (size == 0) perror ("GetFullPathName"); - FcConvertDosPath (full); + FcConvertDosPath ((char *) full); return FcStrCanonAbsoluteFilename (full); #else if (s[0] == '/') diff --git a/fontconfig/src/fcxml.c b/fontconfig/src/fcxml.c index d70f70b70..b8e4469a3 100644 --- a/fontconfig/src/fcxml.c +++ b/fontconfig/src/fcxml.c @@ -1882,11 +1882,11 @@ FcParseDir (FcConfigParse *parse) data = prefix; } #ifdef _WIN32 - if (strcmp (data, "CUSTOMFONTDIR") == 0) + if (strcmp ((const char *) data, "CUSTOMFONTDIR") == 0) { char *p; data = buffer; - if (!GetModuleFileName (NULL, buffer, sizeof (buffer) - 20)) + if (!GetModuleFileName (NULL, (LPCH) buffer, sizeof (buffer) - 20)) { FcConfigMessage (parse, FcSevereError, "GetModuleFileName failed"); goto bail; @@ -1901,11 +1901,11 @@ FcParseDir (FcConfigParse *parse) if (p) *p = '\0'; strcat (data, "\\fonts"); } - else if (strcmp (data, "APPSHAREFONTDIR") == 0) + else if (strcmp ((const char *) data, "APPSHAREFONTDIR") == 0) { char *p; data = buffer; - if (!GetModuleFileName (NULL, buffer, sizeof (buffer) - 20)) + if (!GetModuleFileName (NULL, (LPCH) buffer, sizeof (buffer) - 20)) { FcConfigMessage (parse, FcSevereError, "GetModuleFileName failed"); goto bail; @@ -1914,17 +1914,17 @@ FcParseDir (FcConfigParse *parse) if (p) *p = '\0'; strcat (data, "\\..\\share\\fonts"); } - else if (strcmp (data, "WINDOWSFONTDIR") == 0) + else if (strcmp ((const char *) data, "WINDOWSFONTDIR") == 0) { int rc; data = buffer; - rc = pGetSystemWindowsDirectory (buffer, sizeof (buffer) - 20); + rc = pGetSystemWindowsDirectory ((LPSTR) buffer, sizeof (buffer) - 20); if (rc == 0 || rc > sizeof (buffer) - 20) { FcConfigMessage (parse, FcSevereError, "GetSystemWindowsDirectory failed"); goto bail; } - if (data [strlen (data) - 1] != '\\') + if (data [strlen ((const char *) data) - 1] != '\\') strcat (data, "\\"); strcat (data, "fonts"); } @@ -1978,7 +1978,7 @@ FcParseCacheDir (FcConfigParse *parse) data = prefix; } #ifdef _WIN32 - if (strcmp (data, "WINDOWSTEMPDIR_FONTCONFIG_CACHE") == 0) + if (strcmp ((const char *) data, "WINDOWSTEMPDIR_FONTCONFIG_CACHE") == 0) { int rc; FcStrFree (data); @@ -1989,17 +1989,17 @@ FcParseCacheDir (FcConfigParse *parse) goto bail; } FcMemAlloc (FC_MEM_STRING, 1000); - rc = GetTempPath (800, data); + rc = GetTempPath (800, (LPSTR) data); if (rc == 0 || rc > 800) { FcConfigMessage (parse, FcSevereError, "GetTempPath failed"); goto bail; } - if (data [strlen (data) - 1] != '\\') + if (data [strlen ((const char *) data) - 1] != '\\') strcat (data, "\\"); strcat (data, "fontconfig\\cache"); } - else if (strcmp (data, "LOCAL_APPDATA_FONTCONFIG_CACHE") == 0) + else if (strcmp ((const char *) data, "LOCAL_APPDATA_FONTCONFIG_CACHE") == 0) { char szFPath[MAX_PATH + 1]; size_t len; @@ -2019,7 +2019,7 @@ FcParseCacheDir (FcConfigParse *parse) goto bail; } FcMemAlloc (FC_MEM_STRING, len); - strncpy(data, szFPath, len); + strncpy((char *) data, szFPath, len); } #endif if (strlen ((char *) data) == 0) diff --git a/mesalib/Makefile.am b/mesalib/Makefile.am index 59fd9b584..9c9e9f6cf 100644 --- a/mesalib/Makefile.am +++ b/mesalib/Makefile.am @@ -19,13 +19,16 @@ # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS # IN THE SOFTWARE. -SUBDIRS = src tests +SUBDIRS = src doxygen: cd doxygen && $(MAKE) check-local: + $(MAKE) -C src/mapi/glapi/tests check + $(MAKE) -C src/mesa/main/tests check $(MAKE) -C src/glsl/tests check + $(MAKE) -C src/glx/tests check clean-local: -@touch $(top_builddir)/configs/current @@ -56,8 +59,6 @@ PACKAGE_NAME = MesaLib-$(PACKAGE_VERSION) EXTRA_FILES = \ aclocal.m4 \ configure \ - tests/Makefile.in \ - tests/glx/Makefile.in \ src/glsl/glsl_parser.cpp \ src/glsl/glsl_parser.h \ src/glsl/glsl_lexer.cpp \ diff --git a/mesalib/bin/shortlog_mesa.sh b/mesalib/bin/shortlog_mesa.sh new file mode 100644 index 000000000..b20c52fdd --- /dev/null +++ b/mesalib/bin/shortlog_mesa.sh @@ -0,0 +1,23 @@ +#!/bin/bash + +# This script is used to generate the list of changes that +# appears in the release notes files, with HTML formatting. + + +typeset -i in_log=0 + +git shortlog $* | while read l +do + if [ $in_log -eq 0 ]; then + echo '

'$l'

' + echo '' + echo + in_log=0 + else + mesg=$(echo $l | sed 's/ (cherry picked from commit [0-9a-f]\+)//;s/\&/&/g;s//\>/g') + echo '
  • '${mesg}'
  • ' + fi +done diff --git a/mesalib/configure.ac b/mesalib/configure.ac index 29ee87bb0..d5f8cd719 100644 --- a/mesalib/configure.ac +++ b/mesalib/configure.ac @@ -2166,9 +2166,12 @@ AC_CONFIG_FILES([configs/autoconf src/egl/wayland/wayland-drm/Makefile src/glsl/tests/Makefile src/glx/Makefile + src/glx/tests/Makefile src/mapi/shared-glapi/Makefile + src/mapi/glapi/tests/Makefile src/gtest/Makefile src/mesa/libdricore/Makefile + src/mesa/main/tests/Makefile src/mesa/drivers/dri/dri.pc src/mesa/drivers/dri/Makefile src/mesa/drivers/dri/common/Makefile @@ -2177,9 +2180,7 @@ AC_CONFIG_FILES([configs/autoconf src/mesa/drivers/dri/nouveau/Makefile src/mesa/drivers/dri/r200/Makefile src/mesa/drivers/dri/radeon/Makefile - src/mesa/drivers/dri/swrast/Makefile - tests/Makefile - tests/glx/Makefile]) + src/mesa/drivers/dri/swrast/Makefile]) dnl Replace the configs/current symlink AC_CONFIG_COMMANDS([configs],[ diff --git a/mesalib/docs/autoconf.html b/mesalib/docs/autoconf.html index 07a966e05..4f1ad8d64 100644 --- a/mesalib/docs/autoconf.html +++ b/mesalib/docs/autoconf.html @@ -1,12 +1,12 @@ - - -Compilation and Installation using Autoconf - - - + + + + + Compilation and Installation using Autoconf + + -

    Compilation and Installation using Autoconf

      @@ -209,7 +209,6 @@ options are 16- and 32-bit color channels, which will add the bit size to the library name. For example, --with-osmesa-bits=16 will create the libOSMesa16 library with a 16-bit color channel. -

      3. Library Options

      diff --git a/mesalib/docs/banner.html b/mesalib/docs/banner.html index 4f12c7ac6..2ec187bb9 100644 --- a/mesalib/docs/banner.html +++ b/mesalib/docs/banner.html @@ -1,27 +1,33 @@ - - + + - Banner + + Banner + -

      The -Mesa 3D Graphics Library

      + + + +
      +
      +

      The Mesa 3D Graphics Library

      + diff --git a/mesalib/docs/bugs.html b/mesalib/docs/bugs.html index fa7c484cd..c5ed16d42 100644 --- a/mesalib/docs/bugs.html +++ b/mesalib/docs/bugs.html @@ -1,13 +1,13 @@ - - + + + + + Mesa Bug Reporting + + + -Mesa Bug Reporting - - - - - -

      Bug Database

      +

      Bug Database

      The Mesa bug database is hosted on @@ -50,5 +50,5 @@ If your bug report is vague or your test program doesn't compile easily, the problem may not be fixed very quickly.

      - - + + diff --git a/mesalib/docs/conform.html b/mesalib/docs/conform.html index 3611f8c6f..51674e8d4 100644 --- a/mesalib/docs/conform.html +++ b/mesalib/docs/conform.html @@ -1,12 +1,13 @@ - - -Conformance - - - - - -

      Conformance

      + + + + + Conformance + + + + +

      Conformance

      The SGI OpenGL conformance tests verify correct operation of OpenGL diff --git a/mesalib/docs/contents.html b/mesalib/docs/contents.html index 6f556eed9..e7a23a6bc 100644 --- a/mesalib/docs/contents.html +++ b/mesalib/docs/contents.html @@ -1,33 +1,35 @@ - - -Contents - - - - - + + + + + Contents + + + + + Documentation

      Developer Topics @@ -96,9 +98,9 @@ a:visited { Hosted by:
      -Sourceforge.net +Sourceforge.net
      diff --git a/mesalib/docs/debugging.html b/mesalib/docs/debugging.html index 2df62f56e..36d3634ba 100644 --- a/mesalib/docs/debugging.html +++ b/mesalib/docs/debugging.html @@ -1,12 +1,13 @@ - + + + + + Debugging Tips + + + -Debugging Tips - - - - - -

      Debugging Tips

      +

      Debugging Tips

      Normally Mesa (and OpenGL) records but does not notify the user of @@ -34,5 +35,5 @@ src/dlist.c for details.

      - - + + diff --git a/mesalib/docs/developers.html b/mesalib/docs/developers.html index 8960e7cb4..e1c52ac0d 100644 --- a/mesalib/docs/developers.html +++ b/mesalib/docs/developers.html @@ -1,12 +1,13 @@ - - -Developers - - - - - -

      Developers

      + + + + + Developers + + + + +

      Developers

      Both professional and volunteer developers contribute to Mesa. diff --git a/mesalib/docs/devinfo.html b/mesalib/docs/devinfo.html index 678e48c01..4828cc61d 100644 --- a/mesalib/docs/devinfo.html +++ b/mesalib/docs/devinfo.html @@ -1,15 +1,16 @@ - + + + + + Development Notes + + + -Development Notes +

      Development Notes

      - - - -

      Development Notes

      - - -

      Adding Extentions

      +

      Adding Extentions

      To add a new GL extension to Mesa you have to do at least the following. @@ -52,7 +53,7 @@ To add a new GL extension to Mesa you have to do at least the following. -

      Coding Style

      +

      Coding Style

      Mesa's code style has changed over the years. Here's the latest. @@ -148,20 +149,20 @@ src/mesa/state_tracker/st_glsl_to_tgsi.cpp can serve as examples.

      -

      Making a New Mesa Release

      +

      Making a New Mesa Release

      These are the instructions for making a new Mesa release.

      -

      Get latest source files

      +

      Get latest source files

      Use git to get the latest Mesa files from the git repository, from whatever branch is relevant.

      -

      Verify and update version info

      +

      Verify and update version info

      Create/edit the docs/relnotes-x.y.html file to document what's new in the release. Add the new relnotes-x.y.html file to relnotes.html. @@ -182,7 +183,10 @@ Update docs/news.html.

      -Check in all updates to git. +Create a docs/relnotes-x.y.z.html file. +The bin/shortlog_mesa.sh script can be used to create a HTML-formatted list +of changes to include in the file. +Link the new docs/relnotes-x.y.z.html file into the main relnotes.html file.

      @@ -192,7 +196,7 @@ Then: git push origin mesa_X_Y

      -

      Make the tarballs

      +

      Make the tarballs

      Make the distribution files. From inside the Mesa directory:

      @@ -210,7 +214,7 @@ Copy the distribution files to a temporary directory, unpack them,
       compile everything, and run some demos to be sure everything works.
       

      -

      Update the website and announce the release

      +

      Update the website and announce the release

      Follow the directions on SourceForge for creating a new "release" and uploading the tarballs. @@ -242,7 +246,5 @@ and mesa-announce@lists.freedesktop.org

      - - diff --git a/mesalib/docs/dispatch.html b/mesalib/docs/dispatch.html index 620aecd74..e40b41a60 100644 --- a/mesalib/docs/dispatch.html +++ b/mesalib/docs/dispatch.html @@ -1,19 +1,20 @@ - - -GL Dispatch in Mesa - - - - -

      GL Dispatch in Mesa

      + + + + + GL Dispatch in Mesa + + + +

      GL Dispatch in Mesa

      Several factors combine to make efficient dispatch of OpenGL functions fairly complicated. This document attempts to explain some of the issues and introduce the reader to Mesa's implementation. Readers already familiar -with the issues around GL dispatch can safely skip ahead to the overview of Mesa's implementation.

      +with the issues around GL dispatch can safely skip ahead to the overview of Mesa's implementation.

      -

      1. Complexity of GL Dispatch

      +

      1. Complexity of GL Dispatch

      Every GL application has at least one object called a GL context. This object, which is an implicit parameter to ever GL function, stores all @@ -46,8 +47,7 @@ differnt GL context current. This means that poor old glVertex3fv has to know which GL context is current in the thread where it is being called.

      - -

      2. Overview of Mesa's Implementation

      +

      2. Overview of Mesa's Implementation

      Mesa uses two per-thread pointers. The first pointer stores the address of the context current in the thread, and the second pointer stores the @@ -75,7 +75,7 @@ table. void glVertex3f(GLfloat x, GLfloat y, GLfloat z) { const struct _glapi_table * const dispatch = GET_DISPATCH(); - + (*dispatch->Vertex3f)(x, y, z); }

      Sample dispatch function @@ -89,14 +89,14 @@ overhead that it adds to every GL function call.

      similar function. Mesa provides a wrapper function called _glapi_get_dispatch that is used by default.

      -

      3. Optimizations

      +

      3. Optimizations

      A number of optimizations have been made over the years to diminish the performance hit imposed by GL dispatch. This section describes these optimizations. The benefits of each optimization and the situations where each can or cannot be used are listed.

      -

      3.1. Dual dispatch table pointers

      +

      3.1. Dual dispatch table pointers

      The vast majority of OpenGL applications use the API in a single threaded manner. That is, the application has only one thread that makes calls into @@ -131,7 +131,7 @@ the common case.

      Improved GET_DISPATCH Implementation -

      3.2. ELF TLS

      +

      3.2. ELF TLS

      Starting with the 2.4.20 Linux kernel, each thread is allocated an area of per-thread, global storage. Variables can be put in this area using some @@ -161,7 +161,7 @@ extern __thread struct _glapi_table *_glapi_tls_Dispatch GLX_USE_TLS. Any platform capable of using TLS should use this as the default dispatch method.

      -

      3.3. Assembly Language Dispatch Stubs

      +

      3.3. Assembly Language Dispatch Stubs

      Many platforms has difficulty properly optimizing the tail-call in the dispatch stubs. Platforms like x86 that pass parameters on the stack seem @@ -170,7 +170,7 @@ routines are very short, and it is trivial to create optimal assembly language versions. The amount of optimization provided by using assembly stubs varies from platform to platform and application to application. However, by using the assembly stubs, many platforms can use an additional -space optimization (see below).

      +space optimization (see below).

      The biggest hurdle to creating assembly stubs is handling the various ways that the dispatch table pointer can be accessed. There are four @@ -235,7 +235,7 @@ implementation of each function. This makes the assembly file considerably larger (e.g., 29,332 lines for glapi_x86-64.S versus 1,155 lines for glapi_x86.S) and causes simple changes to the function implementation to generate many lines of diffs. Since the assmebly files -are typically generated by scripts (see below), this +are typically generated by scripts (see below), this isn't a significant problem.

      Once a new assembly file is created, it must be inserted in the build @@ -245,8 +245,7 @@ step is to add the correct #ifdef magic to src/mesa/glapi/glapi_dispatch.c to prevent the C version of the dispatch functions from being built.

      - -

      3.4. Fixed-Length Dispatch Stubs

      +

      3.4. Fixed-Length Dispatch Stubs

      To implement glXGetProcAddress, Mesa stores a table that associates function names with pointers to those functions. This table is @@ -265,8 +264,7 @@ dispatch stub.

      src/mesa/glapi/glapi.c just before glprocs.h is included.

      -
      -

      4. Automatic Generation of Dispatch Stubs

      +

      4. Automatic Generation of Dispatch Stubs

      - - + + diff --git a/mesalib/docs/download.html b/mesalib/docs/download.html index 6a9533aae..3d543281f 100644 --- a/mesalib/docs/download.html +++ b/mesalib/docs/download.html @@ -1,12 +1,13 @@ - + + + + + Getting Mesa + + + -Getting Mesa - - - - - -

      Downloading

      +

      Downloading

      Primary Mesa download site: @@ -20,7 +21,7 @@ When a new release is coming, release candidates (betas) may be found

      -

      Unpacking

      +

      Unpacking

      Mesa releases are available in three formats: .tar.bz2, .tar.gz, and .zip @@ -79,7 +80,7 @@ instructions.

      -

      Demos and GLUT

      +

      Demos and GLUT

      A package of Mark Kilgard's GLUT library is available @@ -98,5 +99,5 @@ were split off some time ago.

      - - + + diff --git a/mesalib/docs/egl.html b/mesalib/docs/egl.html index 5b750070c..e374357c9 100644 --- a/mesalib/docs/egl.html +++ b/mesalib/docs/egl.html @@ -1,9 +1,10 @@ - - -Mesa EGL - - - + + + + + Mesa EGL + +

      Mesa EGL

      diff --git a/mesalib/docs/envvars.html b/mesalib/docs/envvars.html index a64e2ee62..fffb50a47 100644 --- a/mesalib/docs/envvars.html +++ b/mesalib/docs/envvars.html @@ -1,12 +1,13 @@ - + + + + + Environment Variables + + + -Environment Variables - - - - - -

      Environment Variables

      +

      Environment Variables

      Normally, no environment variables need to be set. Most of the environment @@ -15,7 +16,7 @@ sometimes be useful for debugging end-user issues.

      -

      LibGL environment variables

      +

      LibGL environment variables

      -

      If you're using a fedora distro the following command should install all the needed dependencies: +

         sudo yum install flex bison imake libtool xorg-x11-proto-devel libdrm-devel \
         gcc-c++ xorg-x11-server-devel libXi-devel libXmu-devel libXdamage-devel git \
      @@ -73,8 +71,7 @@ the needed dependencies:
       
       
       
      -
      -

      2. Building with autoconf (Linux/Unix/X11)

      +

      2. Building with autoconf (Linux/Unix/X11)

      The primary method to build Mesa on Unix systems is with autoconf. @@ -82,19 +79,20 @@ The primary method to build Mesa on Unix systems is with autoconf.

      The general approach is the standard: +

         ./configure
         make
         sudo make install
       
      +

      But please read the detailed autoconf instructions for more details.

      - -

      3. Building with SCons (Windows/Linux)

      +

      3. Building with SCons (Windows/Linux)

      To build Mesa with SCons on Linux or Windows do @@ -119,8 +117,8 @@ To build Mesa with SCons for Windows on Linux using the MinGW crosscompiler tool This will create:

        -
      • build/windows-x86-debug/mesa/drivers/windows/gdi/opengl32.dll — Mesa + swrast, binary compatible with Windows's opengl32.dll -
      • build/windows-x86-debug/gallium/targets/libgl-gdi/opengl32.dll — Mesa + Gallium + softpipe, binary compatible with Windows's opengl32.dll +
      • build/windows-x86-debug/mesa/drivers/windows/gdi/opengl32.dll — Mesa + swrast, binary compatible with Windows's opengl32.dll +
      • build/windows-x86-debug/gallium/targets/libgl-gdi/opengl32.dll — Mesa + Gallium + softpipe, binary compatible with Windows's opengl32.dll

      Put them all in the same directory to test them. @@ -128,23 +126,21 @@ Put them all in the same directory to test them. - -

      4. Building for other systems

      +

      4. Building for other systems

      Documentation for other environments (some may be very out of date):

      -
      + - -

      5. Library Information

      +

      5. Library Information

      When compilation has finished, look in the top-level lib/ @@ -188,8 +184,7 @@ versions of libGL and device drivers.

      -
      -

      6. Building OpenGL programs with pkg-config

      +

      6. Building OpenGL programs with pkg-config

      Running make install will install package configuration files diff --git a/mesalib/docs/intro.html b/mesalib/docs/intro.html index 303f5eb0f..ef04f357e 100644 --- a/mesalib/docs/intro.html +++ b/mesalib/docs/intro.html @@ -1,12 +1,13 @@ - + + + + + Mesa Introduction + + + -Mesa Introduction - - - - - -

      Introduction

      +

      Introduction

      Mesa is an open-source implementation of the @@ -30,7 +31,7 @@ systems. -

      Project History

      +

      Project History

      The Mesa project was originally started by Brian Paul. @@ -156,7 +157,7 @@ of the OpenGL specification. -

      Major Versions

      +

      Major Versions

      This is a summary of the major versions of Mesa. @@ -165,7 +166,7 @@ of the OpenGL specification is implemented.

      -

      Version 8.x features

      +

      Version 8.x features

      Version 8.x of Mesa implements the OpenGL 3.0 API. The developers at Intel deserve a lot of credit for implementing most @@ -174,14 +175,14 @@ the i965 driver.

      -

      Version 7.x features

      +

      Version 7.x features

      Version 7.x of Mesa implements the OpenGL 2.1 API. The main feature of OpenGL 2.x is the OpenGL Shading Language.

      -

      Version 6.x features

      +

      Version 6.x features

      Version 6.x of Mesa implements the OpenGL 1.5 API with the following extensions incorporated as standard features: @@ -221,7 +222,7 @@ OpenGL specification for more details. -

      Version 5.x features

      +

      Version 5.x features

      Version 5.x of Mesa implements the OpenGL 1.4 API with the following extensions incorporated as standard features: @@ -247,7 +248,7 @@ extensions incorporated as standard features: -

      Version 4.x features

      +

      Version 4.x features

      Version 4.x of Mesa implements the OpenGL 1.3 API with the following @@ -266,7 +267,7 @@ extensions incorporated as standard features:

    1. GL_ARB_transpose_matrix -

      Version 3.x features

      +

      Version 3.x features

      Version 3.x of Mesa implements the OpenGL 1.2 API with the following @@ -282,7 +283,7 @@ features: -

      Version 2.x features

      +

      Version 2.x features

      Version 2.x of Mesa implements the OpenGL 1.1 API with the following features. diff --git a/mesalib/docs/libraries.html b/mesalib/docs/libraries.html index 1c425cf1b..e9db42790 100644 --- a/mesalib/docs/libraries.html +++ b/mesalib/docs/libraries.html @@ -1,12 +1,13 @@ - + + + + + Libraries and Toolkits + + + -Libraries and Toolkits - - - - - -

      Libraries and Toolkits

      +

      Libraries and Toolkits

      • Apprentice - free OpenInventor work-alike @@ -53,4 +54,5 @@ Open SG PLUS - a scene-graph library
      - + + diff --git a/mesalib/docs/license.html b/mesalib/docs/license.html index 913dd4109..f0ac28ccf 100644 --- a/mesalib/docs/license.html +++ b/mesalib/docs/license.html @@ -1,12 +1,13 @@ - + + + + + License / Cppyright Information + + + -License / Cppyright Information - - - - - -

      Disclaimer

      +

      Disclaimer

      Mesa is a 3-D graphics library with an API which is very similar to @@ -34,7 +35,7 @@ target="_parent">Silicon Graphics Incorporated. -

      License / Copyright Information

      +

      License / Copyright Information

      The Mesa distribution consists of several components. Different copyrights @@ -73,7 +74,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

    2. -

      Attention, Contributors

      +

      Attention, Contributors

      When contributing to the Mesa project you must agree to the licensing terms @@ -83,7 +84,7 @@ and their respective licenses.

      -

      Mesa Component Licenses

      +

      Mesa Component Licenses

       Component         Location               License
      diff --git a/mesalib/docs/lists.html b/mesalib/docs/lists.html
      index 033b0b70a..d89bcffbd 100644
      --- a/mesalib/docs/lists.html
      +++ b/mesalib/docs/lists.html
      @@ -1,38 +1,36 @@
      -
      +
      +
      +
      +  
      +  Mesa Mailing Lists
      +  
      +
      +
       
      -Mesa Mailing Lists
      -
      -
      -
      -
      -
      -

      Mailing Lists

      +

      Mailing Lists

      There are four Mesa 3D / DRI mailing lists:

        -
      • mesa-users - intended for end-users of Mesa and DRI drivers. Newbie questions are OK, but please try the general OpenGL -resources and Mesa/DRI documentation first. +resources and Mesa/DRI documentation first.

      • -
        -
      • mesa-dev - for Mesa, Gallium and DRI development -discussion. Not for beginners. +discussion. Not for beginners.

      • -
        -
      • mesa-commit - relays git check-in messages (for developers). -In general, people should not post to this list. +In general, people should not post to this list.

      • -
        -
      • mesa-announce - announcements of new Mesa -versions are sent to this list. Very low traffic. +versions are sent to this list. Very low traffic.

      @@ -65,7 +63,7 @@ DRI wiki.
      -

      OpenGL Forums

      +

      OpenGL Forums

      Here are some other OpenGL-related forums you might find useful: @@ -82,5 +80,5 @@ target="_parent">OpenGL discussion forums at www.opengl.org - - + + diff --git a/mesalib/docs/llvmpipe.html b/mesalib/docs/llvmpipe.html index bd9cc26f2..cf4512ffc 100644 --- a/mesalib/docs/llvmpipe.html +++ b/mesalib/docs/llvmpipe.html @@ -1,12 +1,13 @@ - + + + + + llvmpipe + + + -llvmpipe - - - - - -

      Introduction

      +

      Introduction

      The Gallium llvmpipe driver is a software rasterizer that uses LLVM to @@ -24,19 +25,19 @@ It's the fastest software rasterizer for Mesa.

      • -

        An x86 or amd64 processor; 64-bit mode recommended.

        An x86 or amd64 processor; 64-bit mode recommended.

        Support for SSE2 is strongly encouraged. Support for SSSE3 and SSE4.1 will yield the most efficient code. The fewer features the CPU has the more - likely is that you run into underperforming, buggy, or incomplete code. + likely is that you run into underperforming, buggy, or incomplete code.

        See /proc/cpuinfo to know what your CPU supports.

      • -

        LLVM: version 2.9 recommended; 2.6 or later required.

        - NOTE: LLVM 2.8 and earlier will not work on systems that support the +

        LLVM: version 2.9 recommended; 2.6 or later required.

        +

        NOTE: LLVM 2.8 and earlier will not work on systems that support the Intel AVX extensions (e.g. Sandybridge). LLVM's code generator will fail when trying to emit AVX instructions. This was fixed in LLVM 2.9.

        @@ -46,6 +47,7 @@ It's the fastest software rasterizer for Mesa.
              aptitude install llvm-dev
         
        +

        For a RPM-based distribution do:

        @@ -73,8 +75,6 @@ It's the fastest software rasterizer for Mesa.
         
      - -

      Building

      To build everything on Linux invoke scons as: @@ -126,7 +126,7 @@ need to ask, don't even try it. To profile llvmpipe you should pass the options
      -  scons build=profile 
      +  scons build=profile <same-as-before>
       
      This will ensure that frame pointers are used both in C and JIT functions, and @@ -164,7 +164,7 @@ Building will also create several unit tests in build/linux-???-debug/gallium/drivers/llvmpipe:

      - +
      • lp_test_blend: blending
      • lp_test_conv: SIMD vector conversion
      • lp_test_format: pixel unpacking/packing @@ -185,7 +185,7 @@ for posterior analysis, e.g.:
      • When looking to this code by the first time start in lp_state_fs.c, and then skim through the lp_bld_* functions called in there, and the comments - at the top of the lp_bld_*.c functions. + at the top of the lp_bld_*.c functions.
      • The driver-independent parts of the LLVM / Gallium code are found in @@ -200,3 +200,6 @@ for posterior analysis, e.g.: for a stand-alone example. See the llvm-c/Core.h file for reference.
      + + + diff --git a/mesalib/docs/mangling.html b/mesalib/docs/mangling.html index 55071544f..2ff628c34 100644 --- a/mesalib/docs/mangling.html +++ b/mesalib/docs/mangling.html @@ -1,12 +1,13 @@ - + + + + + Function Name Mangling + + + -Function Name Mangling - - - - - -

      Function Name Mangling

      +

      Function Name Mangling

      If you want to use both Mesa and another OpenGL library in the same @@ -20,11 +21,11 @@ This results in all the Mesa functions being prefixed with To do this, recompile Mesa with the compiler flag -DUSE_MGL_NAMESPACE. Add the flag to CFLAGS in the configuration file which you want to use. For example: +

       CFLAGS += -DUSE_MGL_NAMESPACE
       
      -

      - - + + diff --git a/mesalib/docs/modelers.html b/mesalib/docs/modelers.html index 2e90a5268..13a4603fa 100644 --- a/mesalib/docs/modelers.html +++ b/mesalib/docs/modelers.html @@ -1,12 +1,13 @@ - + + + + + Modelers, Renderers and Viewers + + + -Modelers, Renderers and Viewers - - - - - -

      Modelers, Renderers and Viewers

      +

      Modelers, Renderers and Viewers

      • Aqsis - a RenderMan compatible renderer
      • @@ -60,4 +61,5 @@
      - + + diff --git a/mesalib/docs/news.html b/mesalib/docs/news.html index 140f35b47..b6b82671c 100644 --- a/mesalib/docs/news.html +++ b/mesalib/docs/news.html @@ -1,15 +1,13 @@ - - -Mesa News - - - - - - - -

      News

      + + + + + Mesa News + + + +

      News

      May 18, 2012

      @@ -311,7 +309,7 @@ shading language and built-in functions.

      April 2007

      Thomas Hellström of Tungsten Graphics has written a whitepaper -describing the new DRI memory management system. +describing the new DRI memory management system.

      December 5, 2006

      @@ -541,7 +539,7 @@ release). - sampling an incomplete texture in a fragment program would segfault - glTexImage was missing a few error checks - fixed some minor glGetTexParameter glitches - - GL_INTENSITY was mistakenly accepted as a to glTexImage + - GL_INTENSITY was mistakenly accepted as a <format> to glTexImage - fragment program writes to RC/HC register were broken - fixed a few glitches in GL_HP_occlusion_test extension - glBeginQueryARB and glEndQueryARB didn't work inside display lists @@ -549,6 +547,7 @@ release). - fixed triangle color interpolation bug on AIX (Shane Blackett) - fixed a number of minor memory leaks (bug #1002030)
      +

      The MD5 checksums are:

      @@ -578,7 +577,7 @@ This release basically just fixes bugs since the 6.0. release.
       	- fixed build problems on OpenBSD
       	- omit CVS directories from tarballs
       	- glGetTexImage(GL_COLOR_INDEX) was broken
      -	- fixed an infinite loop in t&l module
      +	- fixed an infinite loop in t&l module
       	- silenced some valgrind warnings about using unitialized memory
       	- fixed some compilation/link glitches on IRIX (Mike Stephens)
       	- glBindProgram wasn't getting compiled into display lists
      @@ -600,6 +599,7 @@ This release basically just fixes bugs since the 6.0. release.
       	- fragment program XPD instruction was incorrect
       	- glGetMaterial() didn't work reliably
       
      +

      The MD5 checksums are:

      @@ -612,7 +612,6 @@ eff71d59c211825e949199852f5a2316  MesaDemos-6.0.1.zip
       
      -

      January 16, 2004

      @@ -639,7 +638,6 @@ and primarily just incorporates bug fixes. -

      December 28, 2003

      @@ -663,7 +661,7 @@ OpenGL 1.5 features.

           New features:
       	- reorganized directory tree
      -	- GL_ARB_vertex/fragment_program extensions (Michal Krol & Karl Rasche)
      +	- GL_ARB_vertex/fragment_program extensions (Michal Krol & Karl Rasche)
       	- GL_ATI_texture_env_combine3 extension (Ian Romanick)
       	- GL_SGI_texture_color_table extension (Eric Plante)
       	- GL_NV_fragment_program extension
      @@ -699,7 +697,7 @@ OpenGL 1.5 features.
       	- glTexImage1/2/3D now allows width/height/depth = 0
       	- disable SPARC asm code on Linux (bug 852204)
       
      - +

      The MD5 checksums are:

      @@ -731,7 +729,6 @@ a21be975589e8a2d1871b6bb7874fffa  MesaDemos-5.0.2.zip
       
      -

      September 5, 2003

      @@ -766,7 +763,6 @@ Mesa 5.0.2 has been released. This is a stable, bug-fix release. -

      June 2003

      @@ -780,7 +776,6 @@ holds the Mesa 5.0.x code which will be abandoned at some point.

      -

      March 30, 2003

      @@ -1175,8 +1170,8 @@ Here's what's new:

      Known problems: - NURBS or evaluator surfaces inside display lists don't always work -

      -

      November 3, 2000

      + +

      November 3, 2000

      Mesa 3.4 has been released. Here's what's new since the 3.3 release:

          New:
           - optimized glDrawPixels for glPixelZoom(1,-1)
      @@ -1204,8 +1199,8 @@ Here's what's new:

      Changes: - finished internal support for compressed textures for DRI
      -

      -

      April 24, 2000

      + +

      April 24, 2000

      Mesa 3.2 has been released. Here's what's new since the beta release:

          Bug fixes:
           - fixed memcpy bugs in span.c
      @@ -1220,78 +1215,69 @@ Here's what's new:

      - use bcopy() optimizations on FreeBSD - re-enabled the optimized persp_textured_triangle() function
      -

      -

      March 23, 2000

      + +

      March 23, 2000

      I've just upload the Mesa 3.2 beta 1 files to SourceForge at http://sourceforge.net/project/filelist.php?group_id=3

      3.2 (note even number) is a stabilization release of Mesa 3.1 meaning it's mainly just bug fixes.

      -

      Here's what's changed: - -

        - Bug fixes: -
          - - mixed drawing of lines and bitmaps sometimes had wrong colors
          - - added missing glHintPGI() function
          - - fixed a polygon culling bug
          - - fixed bugs in gluPartialDisk()
          - - Z values in selection mode were wrong
          - - added missing tokens: -
            - GL_SMOOTH_POINT_SIZE_RANGE
            - GL_SMOOTH_POINT_SIZE_GRANULARITY
            - GL_SMOOTH_LINE_WIDTH_RANGE
            - GL_SMOOTH_LINE_WIDTH_GRANULARITY
            - GL_ALIASED_POINT_SIZE_RANGE
            - GL_ALIASED_LINE_WIDTH_RANGE -
          - - fixed glCopyPixels when copying from back to front buffer
          - - GL_EXT_compiled_vertex_array tokens had _SGI suffix instead of _EXT
          - - glDrawRangeElements(GL_LINES, 0, 1, 2, type, indices) was broken
          - - glDeleteTextures() didn't decrement reference count correctly
          - - GL_SRCA_ALPHA_SATURATE blend mode didn't work correctly
          - - Actual depth of transformation matrix stacks was off by one
          - - 24bpp visuals didn't address pixels correctly
          - - mipmap level of detail (lambda) calculation simplified, more accurate
          - - 101691 - Polygon clipping and GL_LINE
          - - 101928 - Polygon clipping and GL_LINE (same fix as above)
          - - 101808 - Non-glVertexArrays tristrip bug
          - - 101971 - find_last_3f on Dec OSF (worked around)
          - - 102369 - segv on dec osf (possibly a duplicate of the above)
          - - 102893 - orientations of modelview cause segfault -
        - New: -
          - - updated SVGA Linux driver
          - - added the MESA_FX_NO_SIGNALS env var, see docs/README.3DFX
          - - build libGLw.a (Xt/OpenGL drawing area widget) library by default
          - - changed -O2 to -O3 for a number of gcc configs -
        - Changes: -
          - - glXCopyContext's mask parameter is now unsigned long, per GLX spec -
        -
      +

      Here's what's changed:

      +
      +    Bug fixes:
      +        - mixed drawing of lines and bitmaps sometimes had wrong colors
      +        - added missing glHintPGI() function
      +        - fixed a polygon culling bug
      +        - fixed bugs in gluPartialDisk()
      +        - Z values in selection mode were wrong
      +        - added missing tokens:
      +            GL_SMOOTH_POINT_SIZE_RANGE
      +            GL_SMOOTH_POINT_SIZE_GRANULARITY
      +            GL_SMOOTH_LINE_WIDTH_RANGE
      +            GL_SMOOTH_LINE_WIDTH_GRANULARITY
      +            GL_ALIASED_POINT_SIZE_RANGE
      +            GL_ALIASED_LINE_WIDTH_RANGE
      +        - fixed glCopyPixels when copying from back to front buffer
      +        - GL_EXT_compiled_vertex_array tokens had _SGI suffix instead of _EXT
      +        - glDrawRangeElements(GL_LINES, 0, 1, 2, type, indices) was broken
      +        - glDeleteTextures() didn't decrement reference count correctly
      +        - GL_SRCA_ALPHA_SATURATE blend mode didn't work correctly
      +        - Actual depth of transformation matrix stacks was off by one
      +        - 24bpp visuals didn't address pixels correctly
      +        - mipmap level of detail (lambda) calculation simplified, more accurate
      +        - 101691 - Polygon clipping and GL_LINE
      +        - 101928 - Polygon clipping and GL_LINE (same fix as above)
      +        - 101808 - Non-glVertexArrays tristrip bug
      +        - 101971 - find_last_3f on Dec OSF (worked around)
      +        - 102369 - segv on dec osf (possibly a duplicate of the above)
      +        - 102893 - orientations of modelview cause segfault
      +    New:
      +        - updated SVGA Linux driver
      +        - added the MESA_FX_NO_SIGNALS env var, see docs/README.3DFX
      +        - build libGLw.a (Xt/OpenGL drawing area widget) library by default
      +        - changed -O2 to -O3 for a number of gcc configs
      +    Changes:
      +        - glXCopyContext's mask parameter is now unsigned long, per GLX spec
      +

      Please report any problems with this release ASAP. Bugs should be filed on the Mesa3D website at sourceforge.
      After 3.2 is wrapped up I hope to release 3.3 beta 1 soon afterward.

      -- Brian

      -

      -

      December 17, 1999

      + +

      December 17, 1999

      A Slashdot interview with Brian about Mesa (questions submitted by Slashdot readers) can be found at http://slashdot.org/interviews/99/12/17/0927212.shtml.

      -

      -

      December 14, 1999

      + +

      December 14, 1999

      Mesa 3.1 is released!

      -

      -

      September 21, 1999

      + +

      September 21, 1999

      There appear to be two new files on the ftp site, MesaLib-3.1beta3.tar.gz and MesaDemos-3.1beta3.tar.gz, that seem to be... yes, I've just received confirmation from the beta center, they are indeed the THIRD beta release of Mesa 3.1! Happy Days. Happy Days. Thanks Keith Whitwell for preparing these for us during Brian's absence.

      -

      -

      August 30, 1999

      + +

      August 30, 1999

      I'm pleased to announce that I've accepted a position with Precision Insight, Inc. effective October, 1999. I'll be leaving Avid Technology in September.

      I've been working on Mesa in my spare time for over five years. With Precision @@ -1301,41 +1287,41 @@ and OpenGL on Linux.

      my work will continue to be open sourced and available to any other programmers who may want to contribute to it, or use it for other projects or platforms

      PS: I'm going to be traveling until Sep 6 and won't be reading email until then.

      -

      -

      August 23, 1999

      + +

      August 23, 1999

      Anonymous CVS access is back online so suck up all the bandwidth you can afford. Note that this is a new archive, so you will need to re-checkout the archive. That means don't cvs update from a previous download.

      -

      -

      August 17, 1999

      + +

      August 17, 1999

      A report from the SIGGRAPH '99 Linux/OpenGL BOF meeting is now available.

      -Brian

      -

      -

      August 14, 1999

      + +

      August 14, 1999

      www.mesa3d.org is having technical problems due to hardware failures at VA Linux systems. The Mac pages, ftp, and CVS services aren't fully restored yet. Please be patient.

      -Brian

      -

      -

      June 7, 1999

      + +

      June 7, 1999

      RPMS of the nVidia RIVA server can be found at ftp://ftp.mesa3d.org/mesa/misc/nVidia/.

      -

      -

      June 2, 1999

      + +

      June 2, 1999

      nVidia has released some Linux binaries for xfree86 3.3.3.1, along with the full source, which includes GLX acceleration based on Mesa 3.0. They can be downloaded from http://www.nvidia.com/Products.nsf/htmlmedia/software_drivers.html.

      -

      -

      May 24, 1999

      + +

      May 24, 1999

      Beta 2 of Mesa 3.1 has been make available at ftp://ftp.mesa3d.org/mesa/beta/. If you are into the quake scene, you may want to try this out, as it contains some optimizations specifically in the Q3A rendering path. -

      -

      May 13, 1999

      + +

      May 13, 1999

      For those interested in the integration of Mesa into XFree86 4.0, Precision Insight has posted their lowlevel design documents at http://www.precisioninsight.com.

      -

      -

      May 13, 1999

      + +

      May 13, 1999

      May 1999 - John Carmack of id Software, Inc. has made a donation of
       US$10,000 to the Mesa project to support its continuing development.
       Mesa is a free implementation of the OpenGL 3D graphics library and id's
      @@ -1356,33 +1342,27 @@ This donation from John/id is very generous.  Keith and I are very
       grateful.
       
       
      -

      -

      May 1, 1999

      -

      John Carmack made an interesting .plan update yesterday: -

        - "I put together a document on optimizing OpenGL drivers for Q3 that - should be helpful to the various Linux 3D teams.
        -
        http://www.quake3arena.com/news/glopt.html" -
      +

      May 1, 1999

      +

      John Carmack made an interesting .plan update yesterday:

      +
      + "I put together a document on optimizing OpenGL drivers for Q3 that + should be helpful to the various Linux 3D teams.
      + http://www.quake3arena.com/news/glopt.html" +
      -

      -

      April 7, 1999

      +

      April 7, 1999

      Updated the Mesa contributors section and added links to RPM Mesa packages.

      -

      -

      March 18, 1999

      + +

      March 18, 1999

      The new webpages are now online. Enjoy, and let me know if you find any errors. -

      -

      February 16, 1999

      + +

      February 16, 1999

      SGI releases its GLX source code.

      -

      -

      January 22, 1999

      -

      www.mesa3d.org established

      - - -

      +

      January 22, 1999

      +

      www.mesa3d.org established


      diff --git a/mesalib/docs/opengles.html b/mesalib/docs/opengles.html index 0fee488e1..d02482589 100644 --- a/mesalib/docs/opengles.html +++ b/mesalib/docs/opengles.html @@ -1,9 +1,10 @@ - - -OpenGL ES - - - + + + + + OpenGL ES + +

      OpenGL ES

      diff --git a/mesalib/docs/openvg.html b/mesalib/docs/openvg.html index 81e50b65f..9c3cc87d9 100644 --- a/mesalib/docs/openvg.html +++ b/mesalib/docs/openvg.html @@ -1,14 +1,13 @@ - - -OpenVG State Tracker - - - - - - - -

      OpenVG State Tracker

      + + + + + OpenVG State Tracker + + + + +

      OpenVG State Tracker

      The current version of the OpenVG state tracker implements OpenVG 1.1. diff --git a/mesalib/docs/osmesa.html b/mesalib/docs/osmesa.html index 525da4d42..2207641ed 100644 --- a/mesalib/docs/osmesa.html +++ b/mesalib/docs/osmesa.html @@ -1,12 +1,13 @@ - + + + + + Off-screen Rendering + + + -Off-screen Rendering - - - - - -

      Off-screen Rendering

      +

      Off-screen Rendering

      @@ -19,7 +20,7 @@ One potential application is to use Mesa as an off-line, batch-style renderer.

      -The OSMesa API provides three basic functions for making off-screen +The OSMesa API provides three basic functions for making off-screen renderings: OSMesaCreateContext(), OSMesaMakeCurrent(), and OSMesaDestroyContext(). See the Mesa/include/GL/osmesa.h header for more information about the API functions. @@ -31,7 +32,7 @@ directory.

      -

      Deep color channels

      +

      Deep color channels

      For some applications 8-bit color channels don't have sufficient @@ -84,5 +85,5 @@ the top-level Makefile. Send a patch to the Mesa developers too, if you're inclined.

      - - + + diff --git a/mesalib/docs/perf.html b/mesalib/docs/perf.html index ee9c4b117..ec400c613 100644 --- a/mesalib/docs/perf.html +++ b/mesalib/docs/perf.html @@ -1,16 +1,17 @@ - + + + + + Performance Tips + + + -Performance Tips - - - - - -

      Performance Tips

      +

      Performance Tips

      Performance tips for software rendering: -

      +

      1. Turn off smooth shading when you don't need it (glShadeModel) @@ -64,5 +65,5 @@ Performance tips for software rendering:
      - - + + diff --git a/mesalib/docs/postprocess.html b/mesalib/docs/postprocess.html index 2a3796942..06a45930e 100644 --- a/mesalib/docs/postprocess.html +++ b/mesalib/docs/postprocess.html @@ -1,12 +1,13 @@ - + + + + + Gallium Post-processing + + + -Gallium Post-processing - - - - - -

      Gallium Post-processing

      +

      Gallium Post-processing

      The Gallium drivers support user-defined image post-processing. @@ -25,7 +26,7 @@ Multiple filters can be used together.

      -

      PP environment variables

      +

      PP environment variables

      • PP_DEBUG - If defined debug information will be printed to stderr. @@ -52,5 +53,5 @@ Numbers higher than 8 see minimizing gains.
        - - + + diff --git a/mesalib/docs/precompiled.html b/mesalib/docs/precompiled.html index 50cb2af60..32aaeb891 100644 --- a/mesalib/docs/precompiled.html +++ b/mesalib/docs/precompiled.html @@ -1,12 +1,13 @@ - + + + + + Precompiled libraries + + + -Precompiled libraries - - - - - -

        Precompiled Libraries

        +

        Precompiled Libraries

        In general, precompiled Mesa libraries are not available. @@ -16,5 +17,5 @@ However, some Linux distros (such as Ubuntu) seem to closely track Mesa and often have the latest Mesa release available as an update.

        - - + + diff --git a/mesalib/docs/relnotes-6.4.1.html b/mesalib/docs/relnotes-6.4.1.html index 3d6ff1c4f..c4451f84f 100644 --- a/mesalib/docs/relnotes-6.4.1.html +++ b/mesalib/docs/relnotes-6.4.1.html @@ -37,7 +37,7 @@ bd003bb4f981a4f91dee4c38644d4f3f MesaGLUT-6.4.1.tar.bz2
      • fragment program fog option didn't work with glDrawPixels, glBitmap
      • USE_MGL_NAMESPACE didn't work for x86-64
      • OSMesa demos were missing from previous release tarballs -
      • fixed problem with float->ushort conversion in glClear (bug 4992) +
      • fixed problem with float->ushort conversion in glClear (bug 4992)
      • popping of GL_EYE_PLANE texgen state was broken (bug 4996)
      • popping of GL_SPOT_DIRECTION light state was broken (bug 5005)
      • fixed occasional triangle color interpolation problem on VMS diff --git a/mesalib/docs/relnotes-6.5.2.html b/mesalib/docs/relnotes-6.5.2.html index db2038ab0..ec220f3ac 100644 --- a/mesalib/docs/relnotes-6.5.2.html +++ b/mesalib/docs/relnotes-6.5.2.html @@ -52,7 +52,7 @@ copy texturing).
      • New minstall script to replace normal install program
      • Faster fragment program execution in software
      • Added (or fixed) support for - GLX_SGI_make_current_read to the following drivers:
      • + GLX_SGI_make_current_read to the following drivers:
        • radeon
        • savage
        • diff --git a/mesalib/docs/relnotes-7.1.html b/mesalib/docs/relnotes-7.1.html index e8a39c8d3..f7a612872 100644 --- a/mesalib/docs/relnotes-7.1.html +++ b/mesalib/docs/relnotes-7.1.html @@ -17,7 +17,7 @@ It should be relatively stable, but those who are especially concerned about stability should wait for Mesa 7.2 or use Mesa 7.0.4 (the previous stable release).

          - +

          Note that this version of Mesa does not use the GEM memory manager. The master branch of git uses GEM.

          diff --git a/mesalib/docs/relnotes-7.10.1.html b/mesalib/docs/relnotes-7.10.1.html index ea605d966..134591e33 100644 --- a/mesalib/docs/relnotes-7.10.1.html +++ b/mesalib/docs/relnotes-7.10.1.html @@ -185,7 +185,7 @@ with in, out, attribute, and varying.
        • mesa: Change OES_standard_derivatives to be stand-alone extension
        • i915: Disable extension OES_standard_derivatives
        • glcpp: Raise error when modulus is zero
        • -
        • glsl: Set operators '%' and '%=' to be reserved when GLSL < 1.30
        • +
        • glsl: Set operators '%' and '%=' to be reserved when GLSL < 1.30
        • glsl: Reinstate constant-folding for division by zero
        • tnl: Add support for datatype GL_FIXED in vertex arrays

        @@ -374,7 +374,5 @@ with in, out, attribute, and varying.
      • glx: Put null check before use

      -

      - diff --git a/mesalib/docs/relnotes-7.10.3.html b/mesalib/docs/relnotes-7.10.3.html index 9ac5ef28e..68cc925e6 100644 --- a/mesalib/docs/relnotes-7.10.3.html +++ b/mesalib/docs/relnotes-7.10.3.html @@ -55,9 +55,9 @@ d77b02034c11d6c2a55c07f82367d780 MesaLib-7.10.3.tar.gz
    3. Bug 32835 - [glsl] recursive #define results in infinite stack recursion
    4. -
    5. Bug 33303 - [glsl] ir_constant_expression.cpp:72: virtual ir_constant* ir_expression::constant_expression_value(): Assertion `op[0]->type->base_type == op[1]->type->base_type' failed.
    6. +
    7. Bug 33303 - [glsl] ir_constant_expression.cpp:72: virtual ir_constant* ir_expression::constant_expression_value(): Assertion `op[0]->type->base_type == op[1]->type->base_type' failed.
    8. -
    9. Bug 33314 - [glsl] ir_constant_expression.cpp:122: virtual ir_constant* ir_expression::constant_expression_value(): Assertion `op[0]->type->base_type == GLSL_TYPE_BOOL' failed.
    10. +
    11. Bug 33314 - [glsl] ir_constant_expression.cpp:122: virtual ir_constant* ir_expression::constant_expression_value(): Assertion `op[0]->type->base_type == GLSL_TYPE_BOOL' failed.
    12. Bug 33512 - [SNB] case ogles2conform/GL/gl_FragCoord/gl_FragCoord_xy_frag.test and gl_FragCoord_w_frag.test fail
    13. @@ -160,7 +160,7 @@ d77b02034c11d6c2a55c07f82367d780 MesaLib-7.10.3.tar.gz
    14. mesa: Use _mesa_get_format_bytes to refactor out the RB get_pointer_*
    15. mesa: Use _mesa_get_format_bytes to refactor out the RB get_row_*
    16. mesa: Add renderbuffer accessors for R8/RG88/R16/RG1616.
    17. -
    18. swrast: Don't try to adjust_colors for <8bpc when handling R16, RG1616.
    19. +
    20. swrast: Don't try to adjust_colors for <8bpc when handling R16, RG1616.
    21. intel: Use mesa core's R8, RG88, R16, RG1616 RB accessors.
    22. Revert "intel: Add spans code for the ARB_texture_rg support."
    23. mesa: Add support for the ARB_fragment_program part of ARB_draw_buffers.
    24. diff --git a/mesalib/docs/relnotes-7.10.html b/mesalib/docs/relnotes-7.10.html index 3f4f229b0..bb5fde502 100644 --- a/mesalib/docs/relnotes-7.10.html +++ b/mesalib/docs/relnotes-7.10.html @@ -79,7 +79,7 @@ bc644be551ed585fc4f66c16b64a91c9 MesaGLUT-7.10.tar.gz
    25. Bug 31194 - The mesa meta save/restore code doesn't ref the current GLSL program
    26. -
    27. Bug 31371 - glslparsertest: ir.cpp:358: ir_constant::ir_constant(const glsl_type*, const ir_constant_data*): Assertion `(type->base_type >= 0) && (type->base_type <= 3)' failed.
    28. +
    29. Bug 31371 - glslparsertest: ir.cpp:358: ir_constant::ir_constant(const glsl_type*, const ir_constant_data*): Assertion `(type->base_type >= 0) && (type->base_type <= 3)' failed.
    30. Bug 31439 - Crash in glBufferSubData() with size == 0
    31. @@ -91,7 +91,7 @@ bc644be551ed585fc4f66c16b64a91c9 MesaGLUT-7.10.tar.gz
    32. Bug 31617 - Radeon/Compiz: 'failed to attach dri2 front buffer', error case not handled
    33. -
    34. Bug 31648 - [GLSL] array-struct-array gets assertion: `(size >= 1) && (size <= 4)' failed.
    35. +
    36. Bug 31648 - [GLSL] array-struct-array gets assertion: `(size >= 1) && (size <= 4)' failed.
    37. Bug 31650 - [GLSL] varying gl_TexCoord fails to be re-declared to different size in the second shader
    38. @@ -527,7 +527,7 @@ bc644be551ed585fc4f66c16b64a91c9 MesaGLUT-7.10.tar.gz
    39. glsl: Add glsl_type::uvecN_type for N=2,3
    40. glsl: Add lexer rules for uint and uvecN (N=2..4)
    41. glsl: Changes in generated file glsl_lexer.cpp
    42. -
    43. glsl: Add lexer rules for << and >> in GLSL 1.30
    44. +
    45. glsl: Add lexer rules for << and >> in GLSL 1.30
    46. glsl: Change generated file glsl_lexer.cpp
    47. glsl: Implement ast-to-hir for binary shifts in GLSL 1.30
    48. glsl: Implement constant expr evaluation for bitwise-not
    49. @@ -1824,7 +1824,7 @@ bc644be551ed585fc4f66c16b64a91c9 MesaGLUT-7.10.tar.gz
    50. llvmpipe: use llvm for attribute interpolant calculation
    51. graw: add frag-face shader
    52. llvmpipe: fix flatshading in new line code
    53. -
    54. draw: don't apply flatshading to clipped tris with <3 verts
    55. +
    56. draw: don't apply flatshading to clipped tris with <3 verts
    57. llvmpipe: handle FACING interpolants in line and point setup
    58. llvmpipe: handle up to 8 planes in triangle binner
    59. llvmpipe: make debug_fs_variant respect variant->nr_samplers
    60. @@ -1968,7 +1968,7 @@ bc644be551ed585fc4f66c16b64a91c9 MesaGLUT-7.10.tar.gz
    61. glsl: Rename various ir_* files to lower_* and opt_*.
    62. glcpp: Define GL_FRAGMENT_PRECISION_HIGH if GLSL version >= 1.30.
    63. Refresh autogenerated glcpp parser.
    64. -
    65. glsl: Fix constant expression handling for <, >, <=, >= on vectors.
    66. +
    67. glsl: Fix constant expression handling for <, >, <=, >= on vectors.
    68. glsl: Unconditionally define GL_FRAGMENT_PRECISION_HIGH in ES2 shaders.
    69. Regenerate glcpp parser.
    70. glsl: Reimplement the "cross" built-in without ir_binop_cross.
    71. @@ -2685,7 +2685,7 @@ bc644be551ed585fc4f66c16b64a91c9 MesaGLUT-7.10.tar.gz
    72. nv50: fix size of outputs_written array
    73. nv50: apply layout_mask to tile_flags
    74. nvfx: only expose one rt on nv30
    75. -
    76. nvfx: fb->nr_cbufs <= 1 on nv30
    77. +
    78. nvfx: fb->nr_cbufs <= 1 on nv30
    79. nvfx: reset nvfx->hw_zeta
    80. nvfx: fixes after array textures merge
    81. init ps->context with util_surfaces_get and do_get
    82. diff --git a/mesalib/docs/relnotes-7.11.html b/mesalib/docs/relnotes-7.11.html index 52033cf1e..10be4c935 100644 --- a/mesalib/docs/relnotes-7.11.html +++ b/mesalib/docs/relnotes-7.11.html @@ -320,7 +320,7 @@ did not exist in the 7.10 release series at all.

    83. Bug 39257 - [bisected SNB]Mesa demos engine causes GPU hang
    84. -
    85. Bug 39487 - [i965] brw_wm_surface_state.c:495: brw_update_renderbuffer_surface: Assertion `brw->>has_surface_tile_offset || (tile_x == 0 && tile_y == 0)' failed.
    86. +
    87. Bug 39487 - [i965] brw_wm_surface_state.c:495: brw_update_renderbuffer_surface: Assertion `brw->has_surface_tile_offset || (tile_x == 0 && tile_y == 0)' failed.
    88. Bug 39515 - FTBFS: libEGL depends on libgbm, but libEGL builds first
    89. diff --git a/mesalib/docs/relnotes-7.9.1.html b/mesalib/docs/relnotes-7.9.1.html index bef4ef1dd..f45fa48bf 100644 --- a/mesalib/docs/relnotes-7.9.1.html +++ b/mesalib/docs/relnotes-7.9.1.html @@ -65,7 +65,7 @@ ee9ecae4ca56fbb2d14dc15e3a0a7640 MesaGLUT-7.9.1.tar.gz
    90. Bug 31194 - The mesa meta save/restore code doesn't ref the current GLSL program
    91. -
    92. Bug 31371 - glslparsertest: ir.cpp:358: ir_constant::ir_constant(const glsl_type*, const ir_constant_data*): Assertion `(type->base_type >= 0) && (type->base_type <= 3)' failed.
    93. +
    94. Bug 31371 - glslparsertest: ir.cpp:358: ir_constant::ir_constant(const glsl_type*, const ir_constant_data*): Assertion `(type->base_type >= 0) && (type->base_type <= 3)' failed.
    95. Bug 31439 - Crash in glBufferSubData() with size == 0
    96. @@ -73,11 +73,11 @@ ee9ecae4ca56fbb2d14dc15e3a0a7640 MesaGLUT-7.9.1.tar.gz
    97. Bug 31514 - isBuffer returns true for unbound buffers
    98. -
    99. Bug 31560 - [tdfx] tdfx_tex.c:702: error: ‘const struct gl_color_table’ has no member named ‘Format’
    100. +
    101. Bug 31560 - [tdfx] tdfx_tex.c:702: error: 'const struct gl_color_table' has no member named 'Format'
    102. Bug 31617 - Radeon/Compiz: 'failed to attach dri2 front buffer', error case not handled
    103. -
    104. Bug 31648 - [GLSL] array-struct-array gets assertion: `(size >= 1) && (size <= 4)' failed.
    105. +
    106. Bug 31648 - [GLSL] array-struct-array gets assertion: `(size >= 1) && (size <= 4)' failed.
    107. Bug 31650 - [GLSL] varying gl_TexCoord fails to be re-declared to different size in the second shader
    108. @@ -293,7 +293,7 @@ ee9ecae4ca56fbb2d14dc15e3a0a7640 MesaGLUT-7.9.1.tar.gz
    109. ir_dead_functions: Actually free dead functions and signatures.
    110. glcpp: Define GL_FRAGMENT_PRECISION_HIGH if GLSL version >= 1.30.
    111. glsl: Unconditionally define GL_FRAGMENT_PRECISION_HIGH in ES2 shaders.
    112. -
    113. glsl: Fix constant expression handling for <, >, <=, >= on vectors.
    114. +
    115. glsl: Fix constant expression handling for <, >, <=, >= on vectors.
    116. glsl: Use do_common_optimization in the standalone compiler.
    117. glsl: Don't inline function prototypes.
    118. glsl: Add a virtual as_discard() method.
    119. diff --git a/mesalib/docs/relnotes-7.9.2.html b/mesalib/docs/relnotes-7.9.2.html index 65929cc2a..82240441b 100644 --- a/mesalib/docs/relnotes-7.9.2.html +++ b/mesalib/docs/relnotes-7.9.2.html @@ -330,7 +330,6 @@ with in, out, attribute, and varying.
      • glx: Put null check before use

      -

      diff --git a/mesalib/docs/relnotes-8.0.2.html b/mesalib/docs/relnotes-8.0.2.html index d73ba9f92..88f730c16 100644 --- a/mesalib/docs/relnotes-8.0.2.html +++ b/mesalib/docs/relnotes-8.0.2.html @@ -86,7 +86,7 @@ d5e5cdb85d2afdbcd1c0623d3ed1c54d MesaLib-8.0.2.zip

      Daniel Vetter (1):

      Versions of Mesa prior to 6.4 are summarized in the versions file and the following release notes.

      - + - - + + diff --git a/mesalib/docs/repository.html b/mesalib/docs/repository.html index bdd2b577b..3e05871fd 100644 --- a/mesalib/docs/repository.html +++ b/mesalib/docs/repository.html @@ -1,10 +1,11 @@ - - -Code Repository - - - - + + + + + Code Repository + + +

      Code Repository

      @@ -13,6 +14,7 @@ Mesa uses git as its source code management system.

      +

      The master git repository is hosted on freedesktop.org.

      @@ -33,8 +35,7 @@ target="_parent">Mesa demos and tests git repository.

      - -

      Anonymous git Access

      +

      Anonymous git Access

      To get the Mesa sources anonymously (read-only): @@ -57,8 +58,7 @@ To get the Mesa sources anonymously (read-only):

    - -

    Developer git Access

    +

    Developer git Access

    Mesa developers need to first have an account on @@ -92,7 +92,7 @@ Once your account is established: -

    Windows Users

    +

    Windows Users

    If you're @@ -113,8 +113,7 @@ Unix users don't need to set this option.
    -
    -

    Development Branches

    +

    Development Branches

    At any given time, there may be several active branches in Mesa's @@ -132,7 +131,7 @@ Questions about branch status/activity should be posted to the mesa3d-dev mailing list.

    -

    Developer Git Tips

    +

    Developer Git Tips

    1. Setting up to edit the master branch @@ -144,6 +143,7 @@ branch, try: git config branch.master.remote origin git config branch.master.merge master +

      Otherwise, you have to say git pull origin master each time you do a pull.

      @@ -162,6 +162,7 @@ If it has been awhile since you've done the initial clone, try
           git pull
       
      +

      to get the latest files before you start working.

      @@ -170,6 +171,7 @@ Make your changes and use git add <files to commit> git commit +

      to get your changes ready to push back into the fd.o repository.

      @@ -185,12 +187,13 @@ To avoid this, git pull --rebase git push +

      If you are familiar with CVS or similar system, this is similar to doing a cvs update in order to update your source tree to the current repository state, instead of the time you did the last update. (CVS doesn't work like git in this respect, but this is easiest way to explain it.) -
      +
      In any case, your repository now looks like you made your changes after all the other changes.

      @@ -212,5 +215,3 @@ See
      - - diff --git a/mesalib/docs/science.html b/mesalib/docs/science.html index 0b3384303..c701db3e3 100644 --- a/mesalib/docs/science.html +++ b/mesalib/docs/science.html @@ -1,12 +1,13 @@ - + + + + + Science and Technical + + + -Science and Technical - - - - - -

      Science and Technical

      +

      Science and Technical

      • Ch - OpenGL bindings for the Ch C/C++ interpreter @@ -48,7 +49,6 @@
      • ORSA - An interactive tool for Celestial Mechanics
      • ParaView - Scientific visualization package -
      • ROOT - Object Oriented Data Analysis Framework
      • SLFFEA - GNU finite element @@ -63,7 +63,9 @@ modeling
      • Webots - 3-D mobile robot simulator -
      +
    2. + - + + diff --git a/mesalib/docs/shading.html b/mesalib/docs/shading.html index aba395974..175e02460 100644 --- a/mesalib/docs/shading.html +++ b/mesalib/docs/shading.html @@ -1,12 +1,13 @@ - + + + + + Shading Language Support + + + -Shading Language Support - - - - - -

      Shading Language Support

      +

      Shading Language Support

      This page describes the features and status of Mesa's support for the @@ -19,7 +20,7 @@ Contents

      - - -

      Environment Variables

      +

      Environment Variables

      The MESA_GLSL environment variable can be set to a comma-separated @@ -58,8 +57,7 @@ Example: export MESA_GLSL=dump,nopt

      -
      -

      GLSL Version

      +

      GLSL Version

      The GLSL compiler currently supports version 1.20 of the shading language. @@ -76,8 +74,7 @@ Several GLSL extensions are also supported: - -

      Unsupported Features

      +

      Unsupported Features

      XXX update this section

      @@ -100,8 +97,7 @@ All other major features of the shading language should function.

      -
      -

      Implementation Notes

      +

      Implementation Notes

      - -

      Compiler Validation

      +

      Compiler Validation

      Developers working on the GLSL compiler should test frequently to avoid @@ -264,5 +253,5 @@ tests GLSL features. The Mesa demos repository also has some good GLSL tests.

      - - + + diff --git a/mesalib/docs/sourcedocs.html b/mesalib/docs/sourcedocs.html index 90538af5c..2b1633c67 100644 --- a/mesalib/docs/sourcedocs.html +++ b/mesalib/docs/sourcedocs.html @@ -1,15 +1,16 @@ - + + + + + Source Code Documentation + + + -Source Code Documentation - - - - - -

      Source Code Documentation

      +

      Source Code Documentation

      -Doxygen +Doxygen is used to automatically produce cross-referenced documentation from the Mesa source code.

      @@ -27,11 +28,11 @@ such as here -

      +here +

      - - + + diff --git a/mesalib/docs/sourcetree.html b/mesalib/docs/sourcetree.html index e26c653ab..abc5e3986 100644 --- a/mesalib/docs/sourcetree.html +++ b/mesalib/docs/sourcetree.html @@ -1,10 +1,11 @@ - - -Mesa Source Tree - - - - + + + + + Mesa Source Tree + + +

      Mesa source code tree overview

      @@ -157,5 +158,5 @@ each directory. - - + + diff --git a/mesalib/docs/subset-A.html b/mesalib/docs/subset-A.html index d576bb674..6dcd84374 100644 --- a/mesalib/docs/subset-A.html +++ b/mesalib/docs/subset-A.html @@ -1,21 +1,15 @@ - - + + + Mini GLX Specification -

      -
      Mesa Subset Specification
      -

      -

      -
      -

      Tungsten Graphics, Inc.

      -

      February 26, 2003
      -

      -
      -

      +

      Mesa Subset Specification

      +

      Tungsten Graphics, Inc.

      +

      February 26, 2003

      Copyright © 2002-2003 by Tungsten Graphics, Inc., Cedar Park, Texas. All Rights Reserved.

      diff --git a/mesalib/docs/subset.html b/mesalib/docs/subset.html index c706381e3..0ceb13666 100644 --- a/mesalib/docs/subset.html +++ b/mesalib/docs/subset.html @@ -1,12 +1,13 @@ - + + + + + Mesa Subset Driver + + + -Mesa Subset Driver - - - - - -

      Mesa Subset Driver

      +

      Mesa Subset Driver

      In 2002/2003 Tungsten Graphics was contracted to develop a subset Mesa/Radeon @@ -20,5 +21,5 @@ The specification for this subset can be found here.

      - - + + diff --git a/mesalib/docs/systems.html b/mesalib/docs/systems.html index 62a6e0b52..999975183 100644 --- a/mesalib/docs/systems.html +++ b/mesalib/docs/systems.html @@ -1,12 +1,13 @@ - + + + + + Supported Systems and Drivers + + + -Supported Systems and Drivers - - - - - -

      Supported Systems and Drivers

      +

      Supported Systems and Drivers

      Mesa is primarily developed and used on Linux systems. @@ -47,14 +48,14 @@ Software drivers include: Additional driver information:

      -

      @@ -80,7 +81,7 @@ The list includes:
    3. DOS
    4. fbdev
    5. DEC/VMS -
        +
      diff --git a/mesalib/docs/thanks.html b/mesalib/docs/thanks.html index 2031788f0..b9a2b27cb 100644 --- a/mesalib/docs/thanks.html +++ b/mesalib/docs/thanks.html @@ -1,14 +1,13 @@ - + + + + + Acknowledgements + + + - -Acknowledgements - - - - - - -

      Acknowledgments

      +

      Acknowledgments

      The following individuals and groups are to be acknowledged for their @@ -18,8 +17,8 @@ This list is far from complete and somewhat dated, unfortunately.
      • Early Mesa development was done while Brian was part of the -SSEC Visualization Project at the University of +SSEC Visualization Project at the University of Wisconsin. He'd like to thank Bill Hibbard for letting him work on Mesa as part of that project.
        @@ -34,11 +33,11 @@ Tungsten Graphics, Inc. have supported the ongoing development of Mesa.

      • The -Mesa +Mesa website is hosted by - -Sourceforge.net + +Sourceforge.net

        @@ -130,5 +129,5 @@ Please send corrections and additions to Brian.

        - - + + diff --git a/mesalib/docs/utilities.html b/mesalib/docs/utilities.html index 4693639b8..c74816944 100644 --- a/mesalib/docs/utilities.html +++ b/mesalib/docs/utilities.html @@ -1,12 +1,13 @@ - + + + + + Development Utilities + + + -Development Utilities - - - - - -

        Development Utilities

        +

        Development Utilities

          @@ -23,4 +24,4 @@ memory-related problems in your code.
        - \ No newline at end of file + diff --git a/mesalib/docs/utility.html b/mesalib/docs/utility.html index dfb4a909f..23d65496b 100644 --- a/mesalib/docs/utility.html +++ b/mesalib/docs/utility.html @@ -1,12 +1,13 @@ - - -Utilities - - - - - -

        Utilities

        + + + + + Utilities + + + + +

        Utilities

        • - -Mesa Version History - - - - - - - - + + + + + Mesa Version History + + + + + NOTE: Changes for Mesa 6.4 and later are documented in the corresponding release notes file. - + -

          Mesa Version History

          +

          Mesa Version History

          -

          1.0 beta February 1995

          +

          1.0 beta February 1995

          • Initial release
          -

          1.1 beta March 4, 1995

          +

          1.1 beta March 4, 1995

          Changes:
          • faster point and line drawing (2x faster) @@ -37,7 +36,7 @@ New:
          • GLUT support
          -

          1.1.1 beta March 7, 1995

          +

          1.1.1 beta March 7, 1995

          Changes:
          • Reverted from eval2.c to eval.c due to FPE on Linux @@ -45,7 +44,7 @@ Changes:
          • more Makefile changes
          -

          1.1.2 beta March 14, 1995

          +

          1.1.2 beta March 14, 1995

          New:
          • implementation of SGI's blending extensions @@ -61,7 +60,7 @@ Changes:
          • faster transformation arithmetic
          -

          1.1.3 beta March 31, 1995

          +

          1.1.3 beta March 31, 1995

          New:
          • gluScaleImage() and gluBuild2DMipMaps() implemented @@ -76,7 +75,7 @@ Changes:
          • more bug fixes
          -

          1.1.4 beta April 20, 1995

          +

          1.1.4 beta April 20, 1995

          Bug fixes:
          • missing #define SEEK_SET in src-tk/image.c @@ -96,7 +95,7 @@ New features:
          • Implemented gluPartialDisk()
          -

          1.2 May 22, 1995

          +

          1.2 May 22, 1995

          Bug fixes:
          • IRIX 4.x makefile problem @@ -128,7 +127,7 @@ Bug fixes:
          • X/Mesa incorrect default clear color and drawing color
          • more robust X MIT-SHM support in X/Mesa
          • glTexImage( format=GL_LUMINANCE ) didn't work -
          • GL_LINE mode polygons with line width > 1.0 could cause a crash +
          • GL_LINE mode polygons with line width > 1.0 could cause a crash
          • numerous feedback bugs
          • glReadPixels() from depth buffer was wrong
          • error prone depth and stencil buffer allocation @@ -391,7 +390,7 @@ Bug fixes:
          • using 24-bit color on some X servers resulted in garbage rendering
          • 32-bit per pixel mode for XFree86 now works
          • glRotate(a,0,0,0) gave unpredictable results -
          • GL_LINE_STRIP with > 480 vertices had occasional clipping problems +
          • GL_LINE_STRIP with > 480 vertices had occasional clipping problems
          • 8-bit TrueColor GLXPixmap rendering incorrectly required a colormap
          • glMaterial() wasn't ignored when GL_COLOR_MATERIAL was enabled
          • glEnable(GL_COLOR_MATERIAL) followed by glColor() didn't work right @@ -505,7 +504,7 @@ Changes:
          • many 3Dfx driver updates
          • cygnus Makefiles now included
          • updated DOS driver -
          • made a few changes to dosmesa.c and wmesa.c (VB->Unclipped) +
          • made a few changes to dosmesa.c and wmesa.c (VB->Unclipped)
          • internally, colors now stored in GLubytes, not GLfixed
          • optimized changing of GL_SHININESS parameter
          @@ -594,7 +593,7 @@ New:
        • v0.22 of 3Dfx Glide driver
        • more X86 assembly language optimizations
        • faster blending for some modes -
        • XMesaSetFXmode() to switch between 3Dfx window and full-screen mode +
        • XMesaSetFXmode() to switch between 3Dfx window and full-screen mode
        • added preliminary thread support
        • added GLX_MESA_copy_sub_buffer extension
        • some clipping optimizations @@ -606,7 +605,7 @@ Bug fixes:
        • fixed clipping bug when using 3Dfx driver
        • fixed a problem when trying to use X fonts w/ 3Dfx driver
        • fixed a texture filter bug in 3Dfx/Glide driver -
        • fixed bug in 3Dfx/Glide driver involving depth mask & clearing +
        • fixed bug in 3Dfx/Glide driver involving depth mask & clearing
        • glLoadMatrix to set projection matrix confused the 3Dfx driver
        • non-identity texture matrices didn't work with linux-386 configs
        • glGenTextures() didn't reserve the returned texture IDs @@ -621,7 +620,7 @@ Changes:
          • replaced old Mesa/windows/ directory with Mesa/WIN32/ directory
          • converted a few old glaux/gltk demos to GLUT -
          • renamed directories: demos -> xdemos, gdemos -> demos +
          • renamed directories: demos -> xdemos, gdemos -> demos
          @@ -898,9 +897,9 @@ New:
        • demos/texenv.c demo
        • GL_EXT_texture_env_combine extension (by Holger Waechtler)
        • Xlib driver is now thread-safe (see xdemos/glthreads) -
            -Bug Fixes:
          +Bug Fixes: +
          • various GL conformance failures fixed since 3.2.1
          Changes: @@ -936,9 +935,9 @@ Bug Fixes:
        • texture matrix changes weren't always detected (GLUT projtex demo)
        • fixed random color problem in vertex fog code
        • fixed Glide-related bug that let Quake get a 24-bit Z buffer -
            -Changes:
          +Changes: +
          • finished internal support for compressed textures for DRI
          @@ -1137,12 +1136,12 @@ Bug fixes:
        • glDraw/ReadPixels didn't catch all the errors that they should have
        • Fixed 24bpp rendering problem in Windows driver (Karl Schultz)
        • 16-bit GLchan mode fixes (m_trans_tmp.h, s_triangle.c) -
        • Fixed 1-bit float->int conversion bug in glDrawPixels(GL_DEPTH_COMP) +
        • Fixed 1-bit float->int conversion bug in glDrawPixels(GL_DEPTH_COMP)
        • glColorMask as sometimes effecting glXSwapBuffers()
        • fixed a potential bug in XMesaGarbageCollect()
        • N threads rendering into one window didn't work reliably
        • glCopyPixels didn't work for deep color channels -
        • improved 8 -> 16bit/channel texture image conversion (Gerk Huisma) +
        • improved 8 -> 16bit/channel texture image conversion (Gerk Huisma)
        • glPopAttrib() didn't correctly restore user clip planes
        • user clip planes failed for some perspective projections (Chromium)
        @@ -1180,7 +1179,7 @@ Bug fixes: Changes:
        • lots of C++ (g++) code clean-ups -
        • lots of T&L updates for the Radeon DRI driver +
        • lots of T&L updates for the Radeon DRI driver
        Known bugs:
          @@ -1380,7 +1379,7 @@ Changes: New:
          • reorganized directory tree -
          • GL_ARB_vertex/fragment_program extensions (Michal Krol & Karl Rasche) +
          • GL_ARB_vertex/fragment_program extensions (Michal Krol & Karl Rasche)
          • GL_ATI_texture_env_combine3 extension (Ian Romanick)
          • GL_SGI_texture_color_table extension (Eric Plante)
          • GL_NV_fragment_program extension @@ -1443,7 +1442,7 @@ Bug fixes:
          -

          6.0.1 April 2, 2004

          +

          6.0.1 April 2, 2004

          New:
          • upgraded glext.h to version 22 @@ -1456,7 +1455,7 @@ Bug fixes:
          • fixed build problems on OpenBSD
          • omit CVS directories from tarballs
          • glGetTexImage(GL_COLOR_INDEX) was broken -
          • fixed an infinite loop in t&l module +
          • fixed an infinite loop in t&l module
          • silenced some valgrind warnings about using unitialized memory
          • fixed some compilation/link glitches on IRIX (Mike Stephens)
          • glBindProgram wasn't getting compiled into display lists @@ -1481,7 +1480,7 @@ Bug fixes:
          -

          6.1 August 18, 2004

          +

          6.1 August 18, 2004

          New:
          • Revamped Makefile system @@ -1514,7 +1513,7 @@ Bug fixes:
          • sampling an incomplete texture in a fragment program would segfault
          • glTexImage was missing a few error checks
          • fixed some minor glGetTexParameter glitches -
          • GL_INTENSITY was mistakenly accepted as a to glTexImage +
          • GL_INTENSITY was mistakenly accepted as a <format> to glTexImage
          • fragment program writes to RC/HC register were broken
          • fixed a few glitches in GL_HP_occlusion_test extension
          • glBeginQueryARB and glEndQueryARB didn't work inside display lists @@ -1524,7 +1523,7 @@ Bug fixes:
          -

          6.2 October 2, 2004

          +

          6.2 October 2, 2004

          New:
          • enabled GL_ARB_texture_rectangle (same as GL_NV_texture_rectangle) @@ -1551,7 +1550,7 @@ Bug fixes:
          -

          6.2.1 December 9, 2004

          +

          6.2.1 December 9, 2004

          Bug fixes:
          • don't apply regular fog or color sum when using a fragment program @@ -1572,7 +1571,7 @@ Changes:
          -

          6.3 July 20, 2005

          +

          6.3 July 20, 2005

          New:
          • GL_EXT_framebuffer_object extension @@ -1616,13 +1615,13 @@ Bug fixes:
          -

          6.3.1

          +

          6.3.1

          This was an intermediate release for X.org which wasn't otherwise released.)

          -

          6.3.2 August 19, 2005

          +

          6.3.2 August 19, 2005

          New:
          • The distribution now includes the DRI drivers and GLX code @@ -1646,10 +1645,10 @@ Bug fixes:
          - + NOTE: Changes for Mesa 6.4 and later are documented in the corresponding
          release notes file. - + diff --git a/mesalib/docs/viewperf.html b/mesalib/docs/viewperf.html index af351bc42..6c3faf68c 100644 --- a/mesalib/docs/viewperf.html +++ b/mesalib/docs/viewperf.html @@ -1,10 +1,11 @@ - - -Viewperf Issues - - - - + + + + + Viewperf Issues + + +

          Viewperf Issues

          @@ -196,5 +197,5 @@ and with a semi-random color (between white and black) since GL_FOG is enabled.

          - - + + diff --git a/mesalib/docs/vmware-guest.html b/mesalib/docs/vmware-guest.html index 4d95c1769..abb904c43 100644 --- a/mesalib/docs/vmware-guest.html +++ b/mesalib/docs/vmware-guest.html @@ -1,12 +1,12 @@ - - -VMware guest GL driver - - - + + + + + VMware guest GL driver + + -

          VMware guest GL driver

          @@ -186,13 +186,13 @@ OpenGL renderer string: Gallium 0.4 on SVGA3D; build: RELEASE; OpenGL version string: 2.1 Mesa 8.0 +

          If you don't see this, try setting this environment variable:

             export LIBGL_DEBUG=verbose
          +

          then rerun glxinfo and examine the output for error messages.

          - - diff --git a/mesalib/docs/webmaster.html b/mesalib/docs/webmaster.html index 16f4dc803..f9de714fd 100644 --- a/mesalib/docs/webmaster.html +++ b/mesalib/docs/webmaster.html @@ -1,17 +1,18 @@ - + + + + + Mesa Introduction + + + -Mesa Introduction - - - - - -

          Webmaster

          +

          Webmaster

          If you have problems, edits or additions for this website send them to Brian -(brian.e.paul gmail.com). +(brian.e.paul gmail.com).

          diff --git a/mesalib/docs/xlibdriver.html b/mesalib/docs/xlibdriver.html index db03bc353..57b23789e 100644 --- a/mesalib/docs/xlibdriver.html +++ b/mesalib/docs/xlibdriver.html @@ -1,12 +1,13 @@ - + + + + + Xlib Software Driver + + + -Xlib Software Driver - - - - - -

          Xlib Software Driver

          +

          Xlib Software Driver

          Mesa's Xlib driver provides an emulation of the GLX interface so that @@ -31,7 +32,7 @@ The unique features of the Xlib driver follows.

          -

          X Visual Selection

          +

          X Visual Selection

          Mesa supports RGB(A) rendering into almost any X visual type and depth.

          @@ -68,7 +69,7 @@ Here are some examples: -

          Double Buffering

          +

          Double Buffering

          Mesa can use either an X Pixmap or XImage as the back color buffer when in double-buffer mode. @@ -95,7 +96,7 @@ for your application.

          -

          Colormaps

          +

          Colormaps

          When using Mesa directly or with GLX, it's up to the application writer to create a window with an appropriate colormap. The GLUT @@ -116,7 +117,7 @@ significant.

          -

          Gamma Correction

          +

          Gamma Correction

          To compensate for the nonlinear relationship between pixel values and displayed intensities, there is a gamma correction feature in @@ -169,7 +170,7 @@ the Gamma FAQ

          -

          Overlay Planes

          +

          Overlay Planes

          Hardware overlay planes are supported by the Xlib driver. To determine if your X server has overlay support you can test for the @@ -180,7 +181,7 @@ SERVER_OVERLAY_VISUALS property: -

          HPCR Dithering

          +

          HPCR Dithering

          If you set the MESA_HPCR_CLEAR environment variable then dithering will be used when clearing the color buffer. This is only applicable @@ -189,7 +190,7 @@ This incurs a small performance penalty.

          -

          Extensions

          +

          Extensions

          The following MESA-specific extensions are implemented in the Xlib driver.

          @@ -248,7 +249,7 @@ just before an X window is destroyed. For example: This extension was added in Mesa 2.0.

          -

          GLX_MESA_copy_sub_buffer

          +

          GLX_MESA_copy_sub_buffer

          This extension adds the glXCopySubBufferMESA() function. It works like glXSwapBuffers() but only copies a sub-region of the window @@ -261,7 +262,7 @@ instead of the whole window. This extension was added in Mesa 2.6

          -

          Summary of X-related environment variables

          +

          Summary of X-related environment variables

              MESA_RGB_VISUAL - specifies the X visual and depth for RGB mode (X only)
              MESA_CI_VISUAL - specifies the X visual and depth for CI mode (X only)
          diff --git a/mesalib/scons/gallium.py b/mesalib/scons/gallium.py
          index 2fa80db88..ee91ca444 100644
          --- a/mesalib/scons/gallium.py
          +++ b/mesalib/scons/gallium.py
          @@ -327,7 +327,8 @@ def generate(env):
                           #'-march=pentium4',
                       ]
                       if distutils.version.LooseVersion(ccversion) >= distutils.version.LooseVersion('4.2') \
          -               and (platform != 'windows' or env['build'] == 'debug' or True):
          +               and (platform != 'windows' or env['build'] == 'debug' or True) \
          +               and platform != 'haiku':
                           # NOTE: We need to ensure stack is realigned given that we
                           # produce shared objects, and have no control over the stack
                           # alignment policy of the application. Therefore we need
          @@ -346,6 +347,14 @@ def generate(env):
                       if platform in ['windows', 'darwin']:
                           # Workaround http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37216
                           ccflags += ['-fno-common']
          +            if platform in ['haiku']:
          +                # Make optimizations compatible with Pentium or higher on Haiku
          +                ccflags += [
          +                    '-mstackrealign', # ensure stack is aligned
          +                    '-march=i586', # Haiku target is Pentium
          +                    '-mtune=i686', # use i686 where we can
          +                    '-mmmx' # use mmx math where we can
          +                ]
                   if env['machine'] == 'x86_64':
                       ccflags += ['-m64']
                       if platform == 'darwin':
          diff --git a/mesalib/src/gallium/auxiliary/util/u_blit.c b/mesalib/src/gallium/auxiliary/util/u_blit.c
          index e5b97f720..9bd2ef52d 100644
          --- a/mesalib/src/gallium/auxiliary/util/u_blit.c
          +++ b/mesalib/src/gallium/auxiliary/util/u_blit.c
          @@ -419,7 +419,7 @@ util_blit_pixels_writemask(struct blit_state *ctx,
                                            dstX0, dstY0, dst->u.tex.first_layer,/* dest */
                                            src_tex, src_level,
                                            &src_box);
          -       return;
          +      return;
              }
           
              if (dst_format == dst->format) {
          @@ -444,6 +444,9 @@ util_blit_pixels_writemask(struct blit_state *ctx,
                  src_tex->target != PIPE_TEXTURE_2D &&
                  src_tex->target != PIPE_TEXTURE_RECT))
              {
          +      /* Make a temporary texture which contains a copy of the source pixels.
          +       * Then we'll sample from the temporary texture.
          +       */
                 struct pipe_resource texTemp;
                 struct pipe_resource *tex;
                 struct pipe_sampler_view sv_templ;
          @@ -515,6 +518,7 @@ util_blit_pixels_writemask(struct blit_state *ctx,
                 pipe_resource_reference(&tex, NULL);
              }
              else {
          +      /* Directly sample from the source resource/texture */
                 u_sampler_view_default_template(&sv_templ, src_tex, src_format);
                 sampler_view = pipe->create_sampler_view(pipe, src_tex, &sv_templ);
           
          diff --git a/mesalib/src/glsl/TODO b/mesalib/src/glsl/TODO
          index eb73fc2e8..bd077a856 100644
          --- a/mesalib/src/glsl/TODO
          +++ b/mesalib/src/glsl/TODO
          @@ -6,9 +6,6 @@
             constant index values.  For others it is more complicated.  Perhaps these
             cases should be silently converted to uniforms?
           
          -- Implement support for ir_binop_dot in opt_algebraic.cpp.  Perform
          -  transformations such as "dot(v, vec3(0.0, 1.0, 0.0))" -> v.y.
          -
           - Track source locations throughout the IR.  There are currently several
             places where we cannot emit line numbers for errors (and currently emit 0:0)
             because we've "lost" the line number information.  This is particularly
          diff --git a/mesalib/src/glsl/ir.cpp b/mesalib/src/glsl/ir.cpp
          index 69954998b..f81bfd1ab 100644
          --- a/mesalib/src/glsl/ir.cpp
          +++ b/mesalib/src/glsl/ir.cpp
          @@ -46,6 +46,11 @@ bool ir_rvalue::is_negative_one() const
              return false;
           }
           
          +bool ir_rvalue::is_basis() const
          +{
          +   return false;
          +}
          +
           /**
            * Modify the swizzle make to move one component to another
            *
          @@ -1125,6 +1130,49 @@ ir_constant::is_negative_one() const
              return true;
           }
           
          +bool
          +ir_constant::is_basis() const
          +{
          +   if (!this->type->is_scalar() && !this->type->is_vector())
          +      return false;
          +
          +   if (this->type->is_boolean())
          +      return false;
          +
          +   unsigned ones = 0;
          +   for (unsigned c = 0; c < this->type->vector_elements; c++) {
          +      switch (this->type->base_type) {
          +      case GLSL_TYPE_FLOAT:
          +	 if (this->value.f[c] == 1.0)
          +	    ones++;
          +	 else if (this->value.f[c] != 0.0)
          +	    return false;
          +	 break;
          +      case GLSL_TYPE_INT:
          +	 if (this->value.i[c] == 1)
          +	    ones++;
          +	 else if (this->value.i[c] != 0)
          +	    return false;
          +	 break;
          +      case GLSL_TYPE_UINT:
          +	 if (int(this->value.u[c]) == 1)
          +	    ones++;
          +	 else if (int(this->value.u[c]) != 0)
          +	    return false;
          +	 break;
          +      default:
          +	 /* The only other base types are structures, arrays, samplers, and
          +	  * booleans.  Samplers cannot be constants, and the others should
          +	  * have been filtered out above.
          +	  */
          +	 assert(!"Should not get here.");
          +	 return false;
          +      }
          +   }
          +
          +   return ones == 1;
          +}
          +
           ir_loop::ir_loop()
           {
              this->ir_type = ir_type_loop;
          diff --git a/mesalib/src/glsl/ir.h b/mesalib/src/glsl/ir.h
          index a3f9f0588..55535b2f5 100644
          --- a/mesalib/src/glsl/ir.h
          +++ b/mesalib/src/glsl/ir.h
          @@ -201,7 +201,8 @@ public:
               * for vector and scalar types that have all elements set to the value
               * zero (or \c false for booleans).
               *
          -    * \sa ir_constant::has_value, ir_rvalue::is_one, ir_rvalue::is_negative_one
          +    * \sa ir_constant::has_value, ir_rvalue::is_one, ir_rvalue::is_negative_one,
          +    *     ir_constant::is_basis
               */
              virtual bool is_zero() const;
           
          @@ -213,7 +214,8 @@ public:
               * for vector and scalar types that have all elements set to the value
               * one (or \c true for booleans).
               *
          -    * \sa ir_constant::has_value, ir_rvalue::is_zero, ir_rvalue::is_negative_one
          +    * \sa ir_constant::has_value, ir_rvalue::is_zero, ir_rvalue::is_negative_one,
          +    *     ir_constant::is_basis
               */
              virtual bool is_one() const;
           
          @@ -223,12 +225,27 @@ public:
               * The base implementation of this function always returns \c false.  The
               * \c ir_constant class over-rides this function to return \c true \b only
               * for vector and scalar types that have all elements set to the value
          -    * negative one.  For boolean times, the result is always \c false.
          +    * negative one.  For boolean types, the result is always \c false.
               *
               * \sa ir_constant::has_value, ir_rvalue::is_zero, ir_rvalue::is_one
          +    *     ir_constant::is_basis
               */
              virtual bool is_negative_one() const;
           
          +   /**
          +    * Determine if an r-value is a basis vector
          +    *
          +    * The base implementation of this function always returns \c false.  The
          +    * \c ir_constant class over-rides this function to return \c true \b only
          +    * for vector and scalar types that have one element set to the value one,
          +    * and the other elements set to the value zero.  For boolean types, the
          +    * result is always \c false.
          +    *
          +    * \sa ir_constant::has_value, ir_rvalue::is_zero, ir_rvalue::is_one,
          +    *     is_constant::is_negative_one
          +    */
          +   virtual bool is_basis() const;
          +
           
              /**
               * Return a generic value of error_type.
          @@ -1743,13 +1760,14 @@ public:
               * Determine whether a constant has the same value as another constant
               *
               * \sa ir_constant::is_zero, ir_constant::is_one,
          -    * ir_constant::is_negative_one
          +    * ir_constant::is_negative_one, ir_constant::is_basis
               */
              bool has_value(const ir_constant *) const;
           
              virtual bool is_zero() const;
              virtual bool is_one() const;
              virtual bool is_negative_one() const;
          +   virtual bool is_basis() const;
           
              /**
               * Value of the constant.
          diff --git a/mesalib/src/glsl/opt_algebraic.cpp b/mesalib/src/glsl/opt_algebraic.cpp
          index d39761260..75948db16 100644
          --- a/mesalib/src/glsl/opt_algebraic.cpp
          +++ b/mesalib/src/glsl/opt_algebraic.cpp
          @@ -84,6 +84,12 @@ is_vec_one(ir_constant *ir)
              return (ir == NULL) ? false : ir->is_one();
           }
           
          +static inline bool
          +is_vec_basis(ir_constant *ir)
          +{
          +   return (ir == NULL) ? false : ir->is_basis();
          +}
          +
           static void
           update_type(ir_expression *ir)
           {
          @@ -309,6 +315,31 @@ ir_algebraic_visitor::handle_expression(ir_expression *ir)
                 }
                 break;
           
          +   case ir_binop_dot:
          +      if (is_vec_zero(op_const[0]) || is_vec_zero(op_const[1])) {
          +	 this->progress = true;
          +	 return ir_constant::zero(mem_ctx, ir->type);
          +      }
          +      if (is_vec_basis(op_const[0])) {
          +	 this->progress = true;
          +	 unsigned component = 0;
          +	 for (unsigned c = 0; c < op_const[0]->type->vector_elements; c++) {
          +	    if (op_const[0]->value.f[c] == 1.0)
          +	       component = c;
          +	 }
          +	 return new(mem_ctx) ir_swizzle(ir->operands[1], component, 0, 0, 0, 1);
          +      }
          +      if (is_vec_basis(op_const[1])) {
          +	 this->progress = true;
          +	 unsigned component = 0;
          +	 for (unsigned c = 0; c < op_const[1]->type->vector_elements; c++) {
          +	    if (op_const[1]->value.f[c] == 1.0)
          +	       component = c;
          +	 }
          +	 return new(mem_ctx) ir_swizzle(ir->operands[0], component, 0, 0, 0, 1);
          +      }
          +      break;
          +
              case ir_binop_logic_and:
                 /* FINISHME: Also simplify (a && a) to (a). */
                 if (is_vec_one(op_const[0])) {
          diff --git a/mesalib/src/mapi/glapi/gen/ARB_texture_storage.xml b/mesalib/src/mapi/glapi/gen/ARB_texture_storage.xml
          index 945467939..045913806 100644
          --- a/mesalib/src/mapi/glapi/gen/ARB_texture_storage.xml
          +++ b/mesalib/src/mapi/glapi/gen/ARB_texture_storage.xml
          @@ -8,7 +8,7 @@
           
           
           
          -  
          +  
           
             
               
          diff --git a/mesalib/src/mapi/glapi/gen/GL3x.xml b/mesalib/src/mapi/glapi/gen/GL3x.xml
          index ab4900c3e..f3d782ca4 100644
          --- a/mesalib/src/mapi/glapi/gen/GL3x.xml
          +++ b/mesalib/src/mapi/glapi/gen/GL3x.xml
          @@ -32,6 +32,8 @@
             
             
             
          +  
          +  
             
             
             
          @@ -474,8 +476,41 @@
           
           
           
          +  
          +  
          +  
          +  
          +  
          +  
          +  
          +  
          +  
          +  
          +  
          +  
          +  
          +  
          +  
          +  
          +  
          +  
          +  
          +  
          +  
          +  
          +  
          +  
          +  
          +  
          +  
          +  
          +  
          +  
          +  
          +  
             
             
          +  
             
             
             
          @@ -583,6 +618,11 @@
           
           
             
          +  
          +  
          +  
          +  
          +  
           
             
               
          diff --git a/mesalib/src/mapi/glapi/gen/gl_API.xml b/mesalib/src/mapi/glapi/gen/gl_API.xml
          index a74577d1f..4bd0fc6b2 100644
          --- a/mesalib/src/mapi/glapi/gen/gl_API.xml
          +++ b/mesalib/src/mapi/glapi/gen/gl_API.xml
          @@ -7965,7 +7965,12 @@
           
           
           
          -
          +
          +
          +    
          +        
          +    
          +
           
           
           
          @@ -8614,37 +8619,37 @@
           
           
           
          -    
          +    
                   
                   
                   
               
           
          -    
          +    
                   
                   
                   
               
           
          -    
          +    
                   
                   
                   
               
           
          -    
          +    
                   
                   
                   
               
           
          -    
          +    
                   
                   
                   
               
           
          -    
          +    
                   
                   
                   
          @@ -8787,6 +8792,15 @@
           
           
           
          +    
          +    
          +    
          +    
          +    
          +    
          +    
          +
          +
               
                   
               
          @@ -9381,6 +9395,9 @@
           
           
           
          +    
          +    
          +
               
                   
                   
          @@ -10003,7 +10020,7 @@
           
           
           
          -    
          +    
                   
                   
               
          @@ -10522,11 +10539,11 @@
           
           
           
          -    
          +    
                   
               
           
          -    
          +    
                   
                   
                   
          @@ -10534,31 +10551,31 @@
           
           
           
          -    
          +    
                   
                   
                   
               
           
          -    
          +    
                   
                   
                   
               
           
          -    
          +    
                   
                   
                   
               
           
          -    
          +    
                   
                   
                   
               
           
          -    
          +    
                   
                   
                   
          @@ -10568,7 +10585,7 @@
                   
               
           
          -    
          +    
                   
                   
                   
          @@ -10582,7 +10599,7 @@
                   
               
           
          -    
          +    
                   
                   
                   
          @@ -10590,7 +10607,7 @@
                   
               
           
          -    
          +    
                   
                   
                   
          @@ -10599,7 +10616,7 @@
                   
               
           
          -    
          +    
                   
                   
                   
          @@ -10608,7 +10625,7 @@
                   
               
           
          -    
          +    
                   
                   
                   
          @@ -10616,7 +10633,7 @@
                   
               
           
          -    
          +    
                   
                   
                   
          @@ -10624,14 +10641,14 @@
                   
               
           
          -    
          +    
                   
                   
                   
                   
               
           
          -    
          +    
                   
                   
                   
          @@ -10654,7 +10671,7 @@
           
           
           
          -    
          +    
               
                   
                   
          @@ -10988,43 +11005,43 @@
           
           
           
          -    
          +    
                   
                   
                   
               
           
          -    
          +    
                   
                   
                   
               
           
          -    
          +    
                   
                   
                   
               
           
          -    
          +    
                   
                   
                   
               
           
          -    
          +    
                   
                   
                   
                   
               
           
          -    
          +    
                   
                   
               
           
          -    
          +    
                   
                   
                   
          @@ -11776,6 +11793,117 @@
           
           
           
          +    
          +    
          +    
          +    
          +    
          +    
          +    
          +
          +    
          +    
          +    
          +    
          +    
          +    
          +    
          +    
          +    
          +    
          +    
          +    
          +    
          +    
          +    
          +    
          +    
          +    
          +    
          +    
          +    
          +    
          +    
          +    
          +    
          +    
          +    
          +
          +    
          +    
          +    
          +    
          +    
          +    
          +    
          +    
          +
          +    
          +    
          +    
          +    
          +    
          +    
          +    
          +    
          +    
          +    
          +    
          +    
          +    
          +    
          +    
          +    
          +    
          +    
          +    
          +    
          +    
          +    
          +    
          +    
          +    
          +
          +    
          +    
          +    
          +    
          +    
          +    
          +    
          +    
          +    
          +    
          +    
          +    
          +
          +    
          +    
          +    
          +    
          +    
          +    
          +    
          +    
          +    
          +
          +    
          +    
          +    
          +    
          +
          +    
          +    
          +    
          +
          +    
          +
               
                 
                 
          @@ -12030,6 +12158,13 @@
           
           
           
          +    
          +    
          +    
          +    
          +    
          +    
          +
               
                   
                   
          @@ -12236,8 +12371,19 @@
               
           
           
          +
          +    
          +    
          +    
          +
          +
           
           
          +
          +    
          +    
          +
          +
           
               
                   
          @@ -12264,12 +12410,12 @@
               
                   
               
          -    
          +    
                   
                   
                   
               
          -    
          +    
                   
                   
                   
          @@ -12279,6 +12425,12 @@
           
           
          +
          +    
          +    
          +    
          +
          +
           
           
           
          diff --git a/mesalib/src/mesa/Makefile b/mesalib/src/mesa/Makefile
          index 845b524e6..b0b461fdd 100644
          --- a/mesalib/src/mesa/Makefile
          +++ b/mesalib/src/mesa/Makefile
          @@ -135,7 +135,7 @@ asm_subdirs:
           ######################################################################
           # Dependency generation
           
          -depend: $(ALL_FILES)
          +depend: $(ALL_FILES) main/git_sha1.h
           	@ echo "running $(MKDEP)"
           	@ touch depend
           	@$(MKDEP) $(MKDEP_OPTIONS) $(MESA_CPPFLAGS) \
          diff --git a/mesalib/src/mesa/drivers/common/meta.c b/mesalib/src/mesa/drivers/common/meta.c
          index 8d7e90126..be7141a58 100644
          --- a/mesalib/src/mesa/drivers/common/meta.c
          +++ b/mesalib/src/mesa/drivers/common/meta.c
          @@ -319,6 +319,10 @@ struct gl_meta_state
              struct drawtex_state DrawTex;  /**< For _mesa_meta_DrawTex() */
           };
           
          +static void meta_glsl_blit_cleanup(struct gl_context *ctx, struct blit_state *blit);
          +static void cleanup_temp_texture(struct gl_context *ctx, struct temp_texture *tex);
          +static void meta_glsl_clear_cleanup(struct gl_context *ctx, struct clear_state *clear);
          +
           static GLuint
           compile_shader_with_debug(struct gl_context *ctx, GLenum target, const GLcharARB *source)
           {
          @@ -335,12 +339,16 @@ compile_shader_with_debug(struct gl_context *ctx, GLenum target, const GLcharARB
                 return shader;
           
              _mesa_GetShaderiv(shader, GL_INFO_LOG_LENGTH, &size);
          -   if (size == 0)
          +   if (size == 0) {
          +      _mesa_DeleteObjectARB(shader);
                 return 0;
          +   }
           
              info = malloc(size);
          -   if (!info)
          +   if (!info) {
          +      _mesa_DeleteObjectARB(shader);
                 return 0;
          +   }
           
              _mesa_GetProgramInfoLog(shader, size, NULL, info);
              _mesa_problem(ctx,
          @@ -349,6 +357,7 @@ compile_shader_with_debug(struct gl_context *ctx, GLenum target, const GLcharARB
           		 info, source);
           
              free(info);
          +   _mesa_DeleteObjectARB(shader);
           
              return 0;
           }
          @@ -401,10 +410,15 @@ _mesa_meta_init(struct gl_context *ctx)
           void
           _mesa_meta_free(struct gl_context *ctx)
           {
          -   /* Note: Any textures, VBOs, etc, that we allocate should get
          -    * freed by the normal context destruction code.  But this would be
          -    * the place to free other meta data someday.
          -    */
          +   GET_CURRENT_CONTEXT(old_context);
          +   _mesa_make_current(ctx, NULL, NULL);
          +   meta_glsl_blit_cleanup(ctx, &ctx->Meta->Blit);
          +   meta_glsl_clear_cleanup(ctx, &ctx->Meta->Clear);
          +   cleanup_temp_texture(ctx, &ctx->Meta->TempTex);
          +   if (old_context)
          +      _mesa_make_current(old_context, old_context->WinSysDrawBuffer, old_context->WinSysReadBuffer);
          +   else
          +      _mesa_make_current(NULL, NULL, NULL);
              free(ctx->Meta);
              ctx->Meta = NULL;
           }
          @@ -1068,6 +1082,15 @@ init_temp_texture(struct gl_context *ctx, struct temp_texture *tex)
              _mesa_GenTextures(1, &tex->TexObj);
           }
           
          +static void
          +cleanup_temp_texture(struct gl_context *ctx, struct temp_texture *tex)
          +{
          +   if (!tex->TexObj)
          +     return;
          +   _mesa_DeleteTextures(1, &tex->TexObj);
          +   tex->TexObj = 0;
          +}
          +
           
           /**
            * Return pointer to temp_texture info for non-bitmap ops.
          @@ -1604,6 +1627,21 @@ _mesa_meta_BlitFramebuffer(struct gl_context *ctx,
              }
           }
           
          +static void
          +meta_glsl_blit_cleanup(struct gl_context *ctx, struct blit_state *blit)
          +{
          +   if (blit->ArrayObj) {
          +      _mesa_DeleteVertexArraysAPPLE(1, &blit->ArrayObj);
          +      blit->ArrayObj = 0;
          +      _mesa_DeleteBuffersARB(1, &blit->VBO);
          +      blit->VBO = 0;
          +   }
          +   if (blit->DepthFP) {
          +      _mesa_DeletePrograms(1, &blit->DepthFP);
          +      blit->DepthFP = 0;
          +   }
          +}
          +
           
           /**
            * Meta implementation of ctx->Driver.Clear() in terms of polygon rendering.
          @@ -1786,7 +1824,9 @@ meta_glsl_clear_init(struct gl_context *ctx, struct clear_state *clear)
           
              clear->ShaderProg = _mesa_CreateProgramObjectARB();
              _mesa_AttachShader(clear->ShaderProg, fs);
          +   _mesa_DeleteObjectARB(fs);
              _mesa_AttachShader(clear->ShaderProg, vs);
          +   _mesa_DeleteObjectARB(vs);
              _mesa_BindAttribLocationARB(clear->ShaderProg, 0, "position");
              _mesa_LinkProgramARB(clear->ShaderProg);
           
          @@ -1799,7 +1839,9 @@ meta_glsl_clear_init(struct gl_context *ctx, struct clear_state *clear)
           
                 clear->IntegerShaderProg = _mesa_CreateProgramObjectARB();
                 _mesa_AttachShader(clear->IntegerShaderProg, fs);
          +      _mesa_DeleteObjectARB(fs);
                 _mesa_AttachShader(clear->IntegerShaderProg, vs);
          +      _mesa_DeleteObjectARB(vs);
                 _mesa_BindAttribLocationARB(clear->IntegerShaderProg, 0, "position");
           
                 /* Note that user-defined out attributes get automatically assigned
          @@ -1814,6 +1856,24 @@ meta_glsl_clear_init(struct gl_context *ctx, struct clear_state *clear)
              }
           }
           
          +static void
          +meta_glsl_clear_cleanup(struct gl_context *ctx, struct clear_state *clear)
          +{
          +   if (clear->ArrayObj == 0)
          +      return;
          +   _mesa_DeleteVertexArraysAPPLE(1, &clear->ArrayObj);
          +   clear->ArrayObj = 0;
          +   _mesa_DeleteBuffersARB(1, &clear->VBO);
          +   clear->VBO = 0;
          +   _mesa_DeleteObjectARB(clear->ShaderProg);
          +   clear->ShaderProg = 0;
          +
          +   if (clear->IntegerShaderProg) {
          +      _mesa_DeleteObjectARB(clear->IntegerShaderProg);
          +      clear->IntegerShaderProg = 0;
          +   }
          +}
          +
           /**
            * Meta implementation of ctx->Driver.Clear() in terms of polygon rendering.
            */
          diff --git a/mesalib/src/mesa/drivers/windows/gdi/mesa.def b/mesalib/src/mesa/drivers/windows/gdi/mesa.def
          index d5c98801d..fec7bbac0 100644
          --- a/mesalib/src/mesa/drivers/windows/gdi/mesa.def
          +++ b/mesalib/src/mesa/drivers/windows/gdi/mesa.def
          @@ -556,21 +556,6 @@ EXPORTS
           	glFogCoorddvEXT
           	glFogCoordPointerEXT
           	glBlendFuncSeparateEXT
          -	glFlushVertexArrayRangeNV
          -	glVertexArrayRangeNV
          -	glCombinerParameterfvNV
          -	glCombinerParameterfNV
          -	glCombinerParameterivNV
          -	glCombinerParameteriNV
          -	glCombinerInputNV
          -	glCombinerOutputNV
          -	glFinalCombinerInputNV
          -	glGetCombinerInputParameterfvNV
          -	glGetCombinerInputParameterivNV
          -	glGetCombinerOutputParameterfvNV
          -	glGetCombinerOutputParameterivNV
          -	glGetFinalCombinerInputParameterfvNV
          -	glGetFinalCombinerInputParameterivNV
           	glResizeBuffersMESA
           	glWindowPos2dMESA
           	glWindowPos2dvMESA
          diff --git a/mesalib/src/mesa/main/shaderobj.c b/mesalib/src/mesa/main/shaderobj.c
          index 7eb6f0bda..16800ae5e 100644
          --- a/mesalib/src/mesa/main/shaderobj.c
          +++ b/mesalib/src/mesa/main/shaderobj.c
          @@ -278,7 +278,9 @@ _mesa_clear_shader_program_data(struct gl_context *ctx,
                                           struct gl_shader_program *shProg)
           {
              if (shProg->UniformStorage) {
          -      _mesa_uniform_detach_all_driver_storage(shProg->UniformStorage);
          +      unsigned i;
          +      for (i = 0; i < shProg->NumUserUniformStorage; ++i)
          +         _mesa_uniform_detach_all_driver_storage(&shProg->UniformStorage[i]);
                 ralloc_free(shProg->UniformStorage);
                 shProg->NumUserUniformStorage = 0;
                 shProg->UniformStorage = NULL;
          diff --git a/mesalib/src/mesa/program/hash_table.c b/mesalib/src/mesa/program/hash_table.c
          index dc8563a33..7dabadc50 100644
          --- a/mesalib/src/mesa/program/hash_table.c
          +++ b/mesalib/src/mesa/program/hash_table.c
          @@ -149,7 +149,7 @@ hash_table_insert(struct hash_table *ht, void *data, const void *key)
               insert_at_head(& ht->buckets[bucket], & node->link);
           }
           
          -void
          +bool
           hash_table_replace(struct hash_table *ht, void *data, const void *key)
           {
               const unsigned hash_value = (*ht->hash)(key);
          @@ -162,7 +162,7 @@ hash_table_replace(struct hash_table *ht, void *data, const void *key)
           
                  if ((*ht->compare)(hn->key, key) == 0) {
           	  hn->data = data;
          -	  return;
          +	  return true;
                  }
               }
           
          @@ -172,6 +172,7 @@ hash_table_replace(struct hash_table *ht, void *data, const void *key)
               hn->key = key;
           
               insert_at_head(& ht->buckets[bucket], & hn->link);
          +    return false;
           }
           
           void
          diff --git a/mesalib/src/mesa/program/hash_table.h b/mesalib/src/mesa/program/hash_table.h
          index bcf65df7d..e95fc4982 100644
          --- a/mesalib/src/mesa/program/hash_table.h
          +++ b/mesalib/src/mesa/program/hash_table.h
          @@ -32,6 +32,7 @@
           #define HASH_TABLE_H
           
           #include 
          +#include 
           #include 
           #include 
           #include 
          @@ -114,6 +115,10 @@ extern void hash_table_insert(struct hash_table *ht, void *data,
           /**
            * Add an element to a hash table with replacement
            *
          + * \return
          + * 1 if it did replace the the value (in which case the old key is kept), 0 if
          + * it did not replace the value (in which case the new key is kept).
          + *
            * \warning
            * If \c key is already in the hash table, \c data will \b replace the most
            * recently inserted \c data (see the warning in \c hash_table_insert) for
          @@ -121,7 +126,7 @@ extern void hash_table_insert(struct hash_table *ht, void *data,
            *
            * \sa hash_table_insert
            */
          -extern void hash_table_replace(struct hash_table *ht, void *data,
          +extern bool hash_table_replace(struct hash_table *ht, void *data,
               const void *key);
           
           /**
          @@ -219,6 +224,7 @@ public:
               */
              void clear()
              {
          +      hash_table_call_foreach(this->ht, delete_key, NULL);
                 hash_table_clear(this->ht);
              }
           
          @@ -258,9 +264,12 @@ public:
                  * because UINT_MAX+1 = 0.
                  */
                 assert(value != UINT_MAX);
          -      hash_table_replace(this->ht,
          -			 (void *) (intptr_t) (value + 1),
          -			 strdup(key));
          +      char *dup_key = strdup(key);
          +      bool result = hash_table_replace(this->ht,
          +				       (void *) (intptr_t) (value + 1),
          +				       dup_key);
          +      if (result)
          +	 free(dup_key);
              }
           
           private:
          diff --git a/mesalib/src/mesa/sources.mak b/mesalib/src/mesa/sources.mak
          index 608aa79ab..16b1c39c0 100644
          --- a/mesalib/src/mesa/sources.mak
          +++ b/mesalib/src/mesa/sources.mak
          @@ -198,6 +198,7 @@ VBO_FILES = \
           
           STATETRACKER_FILES = \
           	$(SRCDIR)/state_tracker/st_atom.c \
          +	$(SRCDIR)/state_tracker/st_atom_array.c \
           	$(SRCDIR)/state_tracker/st_atom_blend.c \
           	$(SRCDIR)/state_tracker/st_atom_clip.c \
           	$(SRCDIR)/state_tracker/st_atom_constbuf.c \
          diff --git a/mesalib/src/mesa/state_tracker/st_atom.c b/mesalib/src/mesa/state_tracker/st_atom.c
          index d9cd4aab4..e6fc114f1 100644
          --- a/mesalib/src/mesa/state_tracker/st_atom.c
          +++ b/mesalib/src/mesa/state_tracker/st_atom.c
          @@ -63,7 +63,10 @@ static const struct st_tracked_state *atoms[] =
              &st_update_vs_constants,
              &st_update_gs_constants,
              &st_update_fs_constants,
          -   &st_update_pixel_transfer
          +   &st_update_pixel_transfer,
          +
          +   /* this must be done after the vertex program update */
          +   &st_update_array
           };
           
           
          @@ -122,6 +125,22 @@ static void check_program_state( struct st_context *st )
                 st->dirty.st |= ST_NEW_GEOMETRY_PROGRAM;
           }
           
          +static void check_attrib_edgeflag(struct st_context *st)
          +{
          +   const struct gl_client_array **arrays = st->ctx->Array._DrawArrays;
          +   GLboolean vertDataEdgeFlags;
          +
          +   if (!arrays)
          +      return;
          +
          +   vertDataEdgeFlags = arrays[VERT_ATTRIB_EDGEFLAG]->BufferObj &&
          +                       arrays[VERT_ATTRIB_EDGEFLAG]->BufferObj->Name;
          +   if (vertDataEdgeFlags != st->vertdata_edgeflags) {
          +      st->vertdata_edgeflags = vertDataEdgeFlags;
          +      st->dirty.st |= ST_NEW_EDGEFLAGS_DATA;
          +   }
          +}
          +
           
           /***********************************************************************
            * Update all derived state:
          @@ -132,6 +151,12 @@ void st_validate_state( struct st_context *st )
              struct st_state_flags *state = &st->dirty;
              GLuint i;
           
          +   /* Get Mesa driver state. */
          +   st->dirty.st |= st->ctx->NewDriverState;
          +   st->ctx->NewDriverState = 0;
          +
          +   check_attrib_edgeflag(st);
          +
              /* The bitmap cache is immune to pixel unpack changes.
               * Note that GLUT makes several calls to glPixelStore for each
               * bitmap char it draws so this is an important check.
          diff --git a/mesalib/src/mesa/state_tracker/st_atom.h b/mesalib/src/mesa/state_tracker/st_atom.h
          index 930a08444..703bc2ab3 100644
          --- a/mesalib/src/mesa/state_tracker/st_atom.h
          +++ b/mesalib/src/mesa/state_tracker/st_atom.h
          @@ -46,6 +46,7 @@ void st_destroy_atoms( struct st_context *st );
           void st_validate_state( struct st_context *st );
           
           
          +extern const struct st_tracked_state st_update_array;
           extern const struct st_tracked_state st_update_framebuffer;
           extern const struct st_tracked_state st_update_clip;
           extern const struct st_tracked_state st_update_depth_stencil_alpha;
          @@ -70,4 +71,8 @@ extern const struct st_tracked_state st_update_pixel_transfer;
           
           GLuint st_compare_func_to_pipe(GLenum func);
           
          +enum pipe_format
          +st_pipe_vertex_format(GLenum type, GLuint size, GLenum format,
          +                      GLboolean normalized, GLboolean integer);
          +
           #endif
          diff --git a/mesalib/src/mesa/state_tracker/st_atom_array.c b/mesalib/src/mesa/state_tracker/st_atom_array.c
          new file mode 100644
          index 000000000..d60b0d7a9
          --- /dev/null
          +++ b/mesalib/src/mesa/state_tracker/st_atom_array.c
          @@ -0,0 +1,588 @@
          +/**************************************************************************
          + *
          + * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas.
          + * Copyright 2012 Marek Olšák 
          + * All Rights Reserved.
          + *
          + * Permission is hereby granted, free of charge, to any person obtaining a
          + * copy of this software and associated documentation files (the
          + * "Software"), to deal in the Software without restriction, including
          + * without limitation the rights to use, copy, modify, merge, publish,
          + * distribute, sub license, and/or sell copies of the Software, and to
          + * permit persons to whom the Software is furnished to do so, subject to
          + * the following conditions:
          + *
          + * The above copyright notice and this permission notice (including the
          + * next paragraph) shall be included in all copies or substantial portions
          + * of the Software.
          + *
          + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
          + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
          + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
          + * IN NO EVENT SHALL AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR
          + * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
          + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
          + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
          + *
          + **************************************************************************/
          +
          +/*
          + * This converts the VBO's vertex attribute/array information into
          + * Gallium vertex state and binds it.
          + *
          + * Authors:
          + *   Keith Whitwell 
          + *   Marek Olšák 
          + */
          +
          +#include "st_context.h"
          +#include "st_atom.h"
          +#include "st_cb_bufferobjects.h"
          +#include "st_draw.h"
          +#include "st_program.h"
          +
          +#include "cso_cache/cso_context.h"
          +#include "util/u_math.h"
          +
          +#include "main/bufferobj.h"
          +#include "main/image.h"
          +
          +
          +static GLuint double_types[4] = {
          +   PIPE_FORMAT_R64_FLOAT,
          +   PIPE_FORMAT_R64G64_FLOAT,
          +   PIPE_FORMAT_R64G64B64_FLOAT,
          +   PIPE_FORMAT_R64G64B64A64_FLOAT
          +};
          +
          +static GLuint float_types[4] = {
          +   PIPE_FORMAT_R32_FLOAT,
          +   PIPE_FORMAT_R32G32_FLOAT,
          +   PIPE_FORMAT_R32G32B32_FLOAT,
          +   PIPE_FORMAT_R32G32B32A32_FLOAT
          +};
          +
          +static GLuint half_float_types[4] = {
          +   PIPE_FORMAT_R16_FLOAT,
          +   PIPE_FORMAT_R16G16_FLOAT,
          +   PIPE_FORMAT_R16G16B16_FLOAT,
          +   PIPE_FORMAT_R16G16B16A16_FLOAT
          +};
          +
          +static GLuint uint_types_norm[4] = {
          +   PIPE_FORMAT_R32_UNORM,
          +   PIPE_FORMAT_R32G32_UNORM,
          +   PIPE_FORMAT_R32G32B32_UNORM,
          +   PIPE_FORMAT_R32G32B32A32_UNORM
          +};
          +
          +static GLuint uint_types_scale[4] = {
          +   PIPE_FORMAT_R32_USCALED,
          +   PIPE_FORMAT_R32G32_USCALED,
          +   PIPE_FORMAT_R32G32B32_USCALED,
          +   PIPE_FORMAT_R32G32B32A32_USCALED
          +};
          +
          +static GLuint uint_types_int[4] = {
          +   PIPE_FORMAT_R32_UINT,
          +   PIPE_FORMAT_R32G32_UINT,
          +   PIPE_FORMAT_R32G32B32_UINT,
          +   PIPE_FORMAT_R32G32B32A32_UINT
          +};
          +
          +static GLuint int_types_norm[4] = {
          +   PIPE_FORMAT_R32_SNORM,
          +   PIPE_FORMAT_R32G32_SNORM,
          +   PIPE_FORMAT_R32G32B32_SNORM,
          +   PIPE_FORMAT_R32G32B32A32_SNORM
          +};
          +
          +static GLuint int_types_scale[4] = {
          +   PIPE_FORMAT_R32_SSCALED,
          +   PIPE_FORMAT_R32G32_SSCALED,
          +   PIPE_FORMAT_R32G32B32_SSCALED,
          +   PIPE_FORMAT_R32G32B32A32_SSCALED
          +};
          +
          +static GLuint int_types_int[4] = {
          +   PIPE_FORMAT_R32_SINT,
          +   PIPE_FORMAT_R32G32_SINT,
          +   PIPE_FORMAT_R32G32B32_SINT,
          +   PIPE_FORMAT_R32G32B32A32_SINT
          +};
          +
          +static GLuint ushort_types_norm[4] = {
          +   PIPE_FORMAT_R16_UNORM,
          +   PIPE_FORMAT_R16G16_UNORM,
          +   PIPE_FORMAT_R16G16B16_UNORM,
          +   PIPE_FORMAT_R16G16B16A16_UNORM
          +};
          +
          +static GLuint ushort_types_scale[4] = {
          +   PIPE_FORMAT_R16_USCALED,
          +   PIPE_FORMAT_R16G16_USCALED,
          +   PIPE_FORMAT_R16G16B16_USCALED,
          +   PIPE_FORMAT_R16G16B16A16_USCALED
          +};
          +
          +static GLuint ushort_types_int[4] = {
          +   PIPE_FORMAT_R16_UINT,
          +   PIPE_FORMAT_R16G16_UINT,
          +   PIPE_FORMAT_R16G16B16_UINT,
          +   PIPE_FORMAT_R16G16B16A16_UINT
          +};
          +
          +static GLuint short_types_norm[4] = {
          +   PIPE_FORMAT_R16_SNORM,
          +   PIPE_FORMAT_R16G16_SNORM,
          +   PIPE_FORMAT_R16G16B16_SNORM,
          +   PIPE_FORMAT_R16G16B16A16_SNORM
          +};
          +
          +static GLuint short_types_scale[4] = {
          +   PIPE_FORMAT_R16_SSCALED,
          +   PIPE_FORMAT_R16G16_SSCALED,
          +   PIPE_FORMAT_R16G16B16_SSCALED,
          +   PIPE_FORMAT_R16G16B16A16_SSCALED
          +};
          +
          +static GLuint short_types_int[4] = {
          +   PIPE_FORMAT_R16_SINT,
          +   PIPE_FORMAT_R16G16_SINT,
          +   PIPE_FORMAT_R16G16B16_SINT,
          +   PIPE_FORMAT_R16G16B16A16_SINT
          +};
          +
          +static GLuint ubyte_types_norm[4] = {
          +   PIPE_FORMAT_R8_UNORM,
          +   PIPE_FORMAT_R8G8_UNORM,
          +   PIPE_FORMAT_R8G8B8_UNORM,
          +   PIPE_FORMAT_R8G8B8A8_UNORM
          +};
          +
          +static GLuint ubyte_types_scale[4] = {
          +   PIPE_FORMAT_R8_USCALED,
          +   PIPE_FORMAT_R8G8_USCALED,
          +   PIPE_FORMAT_R8G8B8_USCALED,
          +   PIPE_FORMAT_R8G8B8A8_USCALED
          +};
          +
          +static GLuint ubyte_types_int[4] = {
          +   PIPE_FORMAT_R8_UINT,
          +   PIPE_FORMAT_R8G8_UINT,
          +   PIPE_FORMAT_R8G8B8_UINT,
          +   PIPE_FORMAT_R8G8B8A8_UINT
          +};
          +
          +static GLuint byte_types_norm[4] = {
          +   PIPE_FORMAT_R8_SNORM,
          +   PIPE_FORMAT_R8G8_SNORM,
          +   PIPE_FORMAT_R8G8B8_SNORM,
          +   PIPE_FORMAT_R8G8B8A8_SNORM
          +};
          +
          +static GLuint byte_types_scale[4] = {
          +   PIPE_FORMAT_R8_SSCALED,
          +   PIPE_FORMAT_R8G8_SSCALED,
          +   PIPE_FORMAT_R8G8B8_SSCALED,
          +   PIPE_FORMAT_R8G8B8A8_SSCALED
          +};
          +
          +static GLuint byte_types_int[4] = {
          +   PIPE_FORMAT_R8_SINT,
          +   PIPE_FORMAT_R8G8_SINT,
          +   PIPE_FORMAT_R8G8B8_SINT,
          +   PIPE_FORMAT_R8G8B8A8_SINT
          +};
          +
          +static GLuint fixed_types[4] = {
          +   PIPE_FORMAT_R32_FIXED,
          +   PIPE_FORMAT_R32G32_FIXED,
          +   PIPE_FORMAT_R32G32B32_FIXED,
          +   PIPE_FORMAT_R32G32B32A32_FIXED
          +};
          +
          +
          +/**
          + * Return a PIPE_FORMAT_x for the given GL datatype and size.
          + */
          +enum pipe_format
          +st_pipe_vertex_format(GLenum type, GLuint size, GLenum format,
          +                      GLboolean normalized, GLboolean integer)
          +{
          +   assert((type >= GL_BYTE && type <= GL_DOUBLE) ||
          +          type == GL_FIXED || type == GL_HALF_FLOAT ||
          +          type == GL_INT_2_10_10_10_REV ||
          +          type == GL_UNSIGNED_INT_2_10_10_10_REV);
          +   assert(size >= 1);
          +   assert(size <= 4);
          +   assert(format == GL_RGBA || format == GL_BGRA);
          +
          +   if (type == GL_INT_2_10_10_10_REV ||
          +       type == GL_UNSIGNED_INT_2_10_10_10_REV) {
          +      assert(size == 4);
          +      assert(!integer);
          +
          +      if (format == GL_BGRA) {
          +         if (type == GL_INT_2_10_10_10_REV) {
          +            if (normalized)
          +               return PIPE_FORMAT_B10G10R10A2_SNORM;
          +            else
          +               return PIPE_FORMAT_B10G10R10A2_SSCALED;
          +         } else {
          +            if (normalized)
          +               return PIPE_FORMAT_B10G10R10A2_UNORM;
          +            else
          +               return PIPE_FORMAT_B10G10R10A2_USCALED;
          +         }
          +      } else {
          +         if (type == GL_INT_2_10_10_10_REV) {
          +            if (normalized)
          +               return PIPE_FORMAT_R10G10B10A2_SNORM;
          +            else
          +               return PIPE_FORMAT_R10G10B10A2_SSCALED;
          +         } else {
          +            if (normalized)
          +               return PIPE_FORMAT_R10G10B10A2_UNORM;
          +            else
          +               return PIPE_FORMAT_R10G10B10A2_USCALED;
          +         }
          +      }
          +   }
          +
          +   if (format == GL_BGRA) {
          +      /* this is an odd-ball case */
          +      assert(type == GL_UNSIGNED_BYTE);
          +      assert(normalized);
          +      return PIPE_FORMAT_B8G8R8A8_UNORM;
          +   }
          +
          +   if (integer) {
          +      switch (type) {
          +      case GL_INT: return int_types_int[size-1];
          +      case GL_SHORT: return short_types_int[size-1];
          +      case GL_BYTE: return byte_types_int[size-1];
          +      case GL_UNSIGNED_INT: return uint_types_int[size-1];
          +      case GL_UNSIGNED_SHORT: return ushort_types_int[size-1];
          +      case GL_UNSIGNED_BYTE: return ubyte_types_int[size-1];
          +      default: assert(0); return 0;
          +      }
          +   }
          +   else if (normalized) {
          +      switch (type) {
          +      case GL_DOUBLE: return double_types[size-1];
          +      case GL_FLOAT: return float_types[size-1];
          +      case GL_HALF_FLOAT: return half_float_types[size-1];
          +      case GL_INT: return int_types_norm[size-1];
          +      case GL_SHORT: return short_types_norm[size-1];
          +      case GL_BYTE: return byte_types_norm[size-1];
          +      case GL_UNSIGNED_INT: return uint_types_norm[size-1];
          +      case GL_UNSIGNED_SHORT: return ushort_types_norm[size-1];
          +      case GL_UNSIGNED_BYTE: return ubyte_types_norm[size-1];
          +      case GL_FIXED: return fixed_types[size-1];
          +      default: assert(0); return 0;
          +      }
          +   }
          +   else {
          +      switch (type) {
          +      case GL_DOUBLE: return double_types[size-1];
          +      case GL_FLOAT: return float_types[size-1];
          +      case GL_HALF_FLOAT: return half_float_types[size-1];
          +      case GL_INT: return int_types_scale[size-1];
          +      case GL_SHORT: return short_types_scale[size-1];
          +      case GL_BYTE: return byte_types_scale[size-1];
          +      case GL_UNSIGNED_INT: return uint_types_scale[size-1];
          +      case GL_UNSIGNED_SHORT: return ushort_types_scale[size-1];
          +      case GL_UNSIGNED_BYTE: return ubyte_types_scale[size-1];
          +      case GL_FIXED: return fixed_types[size-1];
          +      default: assert(0); return 0;
          +      }
          +   }
          +   return PIPE_FORMAT_NONE; /* silence compiler warning */
          +}
          +
          +/**
          + * Examine the active arrays to determine if we have interleaved
          + * vertex arrays all living in one VBO, or all living in user space.
          + */
          +static GLboolean
          +is_interleaved_arrays(const struct st_vertex_program *vp,
          +                      const struct st_vp_variant *vpv,
          +                      const struct gl_client_array **arrays)
          +{
          +   GLuint attr;
          +   const struct gl_buffer_object *firstBufObj = NULL;
          +   GLint firstStride = -1;
          +   const GLubyte *firstPtr = NULL;
          +   GLboolean userSpaceBuffer = GL_FALSE;
          +
          +   for (attr = 0; attr < vpv->num_inputs; attr++) {
          +      const GLuint mesaAttr = vp->index_to_input[attr];
          +      const struct gl_client_array *array = arrays[mesaAttr];
          +      const struct gl_buffer_object *bufObj = array->BufferObj;
          +      const GLsizei stride = array->StrideB; /* in bytes */
          +
          +      if (attr == 0) {
          +         /* save info about the first array */
          +         firstStride = stride;
          +         firstPtr = array->Ptr;
          +         firstBufObj = bufObj;
          +         userSpaceBuffer = !bufObj || !bufObj->Name;
          +      }
          +      else {
          +         /* check if other arrays interleave with the first, in same buffer */
          +         if (stride != firstStride)
          +            return GL_FALSE; /* strides don't match */
          +
          +         if (bufObj != firstBufObj)
          +            return GL_FALSE; /* arrays in different VBOs */
          +
          +         if (abs(array->Ptr - firstPtr) > firstStride)
          +            return GL_FALSE; /* arrays start too far apart */
          +
          +         if ((!_mesa_is_bufferobj(bufObj)) != userSpaceBuffer)
          +            return GL_FALSE; /* mix of VBO and user-space arrays */
          +      }
          +   }
          +
          +   return GL_TRUE;
          +}
          +
          +/**
          + * Set up for drawing interleaved arrays that all live in one VBO
          + * or all live in user space.
          + * \param vbuffer  returns vertex buffer info
          + * \param velements  returns vertex element info
          + */
          +static boolean
          +setup_interleaved_attribs(const struct st_vertex_program *vp,
          +                          const struct st_vp_variant *vpv,
          +                          const struct gl_client_array **arrays,
          +                          struct pipe_vertex_buffer *vbuffer,
          +                          struct pipe_vertex_element velements[])
          +{
          +   GLuint attr;
          +   const GLubyte *low_addr = NULL;
          +   GLboolean usingVBO;      /* all arrays in a VBO? */
          +   struct gl_buffer_object *bufobj;
          +   GLsizei stride;
          +
          +   /* Find the lowest address of the arrays we're drawing,
          +    * Init bufobj and stride.
          +    */
          +   if (vpv->num_inputs) {
          +      const GLuint mesaAttr0 = vp->index_to_input[0];
          +      const struct gl_client_array *array = arrays[mesaAttr0];
          +
          +      /* Since we're doing interleaved arrays, we know there'll be at most
          +       * one buffer object and the stride will be the same for all arrays.
          +       * Grab them now.
          +       */
          +      bufobj = array->BufferObj;
          +      stride = array->StrideB;
          +
          +      low_addr = arrays[vp->index_to_input[0]]->Ptr;
          +
          +      for (attr = 1; attr < vpv->num_inputs; attr++) {
          +         const GLubyte *start = arrays[vp->index_to_input[attr]]->Ptr;
          +         low_addr = MIN2(low_addr, start);
          +      }
          +   }
          +   else {
          +      /* not sure we'll ever have zero inputs, but play it safe */
          +      bufobj = NULL;
          +      stride = 0;
          +      low_addr = 0;
          +   }
          +
          +   /* are the arrays in user space? */
          +   usingVBO = _mesa_is_bufferobj(bufobj);
          +
          +   for (attr = 0; attr < vpv->num_inputs; attr++) {
          +      const GLuint mesaAttr = vp->index_to_input[attr];
          +      const struct gl_client_array *array = arrays[mesaAttr];
          +      unsigned src_offset = (unsigned) (array->Ptr - low_addr);
          +      GLuint element_size = array->_ElementSize;
          +
          +      assert(element_size == array->Size * _mesa_sizeof_type(array->Type));
          +
          +      velements[attr].src_offset = src_offset;
          +      velements[attr].instance_divisor = array->InstanceDivisor;
          +      velements[attr].vertex_buffer_index = 0;
          +      velements[attr].src_format = st_pipe_vertex_format(array->Type,
          +                                                         array->Size,
          +                                                         array->Format,
          +                                                         array->Normalized,
          +                                                         array->Integer);
          +      assert(velements[attr].src_format);
          +   }
          +
          +   /*
          +    * Return the vbuffer info and setup user-space attrib info, if needed.
          +    */
          +   if (vpv->num_inputs == 0) {
          +      /* just defensive coding here */
          +      vbuffer->buffer = NULL;
          +      vbuffer->user_buffer = NULL;
          +      vbuffer->buffer_offset = 0;
          +      vbuffer->stride = 0;
          +   }
          +   else if (usingVBO) {
          +      /* all interleaved arrays in a VBO */
          +      struct st_buffer_object *stobj = st_buffer_object(bufobj);
          +
          +      if (!stobj || !stobj->buffer) {
          +         return FALSE; /* out-of-memory error probably */
          +      }
          +
          +      vbuffer->buffer = stobj->buffer;
          +      vbuffer->user_buffer = NULL;
          +      vbuffer->buffer_offset = pointer_to_offset(low_addr);
          +      vbuffer->stride = stride;
          +   }
          +   else {
          +      /* all interleaved arrays in user memory */
          +      vbuffer->buffer = NULL;
          +      vbuffer->user_buffer = low_addr;
          +      vbuffer->buffer_offset = 0;
          +      vbuffer->stride = stride;
          +   }
          +   return TRUE;
          +}
          +
          +/**
          + * Set up a separate pipe_vertex_buffer and pipe_vertex_element for each
          + * vertex attribute.
          + * \param vbuffer  returns vertex buffer info
          + * \param velements  returns vertex element info
          + */
          +static boolean
          +setup_non_interleaved_attribs(struct st_context *st,
          +                              const struct st_vertex_program *vp,
          +                              const struct st_vp_variant *vpv,
          +                              const struct gl_client_array **arrays,
          +                              struct pipe_vertex_buffer vbuffer[],
          +                              struct pipe_vertex_element velements[])
          +{
          +   struct gl_context *ctx = st->ctx;
          +   GLuint attr;
          +
          +   for (attr = 0; attr < vpv->num_inputs; attr++) {
          +      const GLuint mesaAttr = vp->index_to_input[attr];
          +      const struct gl_client_array *array = arrays[mesaAttr];
          +      struct gl_buffer_object *bufobj = array->BufferObj;
          +      GLsizei stride = array->StrideB;
          +
          +      assert(array->_ElementSize == array->Size * _mesa_sizeof_type(array->Type));
          +
          +      if (_mesa_is_bufferobj(bufobj)) {
          +         /* Attribute data is in a VBO.
          +          * Recall that for VBOs, the gl_client_array->Ptr field is
          +          * really an offset from the start of the VBO, not a pointer.
          +          */
          +         struct st_buffer_object *stobj = st_buffer_object(bufobj);
          +
          +         if (!stobj || !stobj->buffer) {
          +            return FALSE; /* out-of-memory error probably */
          +         }
          +
          +         vbuffer[attr].buffer = stobj->buffer;
          +         vbuffer[attr].user_buffer = NULL;
          +         vbuffer[attr].buffer_offset = pointer_to_offset(array->Ptr);
          +      }
          +      else {
          +         /* wrap user data */
          +         void *ptr;
          +
          +         if (array->Ptr) {
          +            ptr = (void *) array->Ptr;
          +         }
          +         else {
          +            /* no array, use ctx->Current.Attrib[] value */
          +            ptr = (void *) ctx->Current.Attrib[mesaAttr];
          +            stride = 0;
          +         }
          +
          +         assert(ptr);
          +
          +         vbuffer[attr].buffer = NULL;
          +         vbuffer[attr].user_buffer = ptr;
          +         vbuffer[attr].buffer_offset = 0;
          +      }
          +
          +      /* common-case setup */
          +      vbuffer[attr].stride = stride; /* in bytes */
          +
          +      velements[attr].src_offset = 0;
          +      velements[attr].instance_divisor = array->InstanceDivisor;
          +      velements[attr].vertex_buffer_index = attr;
          +      velements[attr].src_format = st_pipe_vertex_format(array->Type,
          +                                                         array->Size,
          +                                                         array->Format,
          +                                                         array->Normalized,
          +                                                         array->Integer);
          +      assert(velements[attr].src_format);
          +   }
          +   return TRUE;
          +}
          +
          +static void update_array(struct st_context *st)
          +{
          +   struct gl_context *ctx = st->ctx;
          +   const struct gl_client_array **arrays = ctx->Array._DrawArrays;
          +   const struct st_vertex_program *vp;
          +   const struct st_vp_variant *vpv;
          +   struct pipe_vertex_buffer vbuffer[PIPE_MAX_SHADER_INPUTS];
          +   struct pipe_vertex_element velements[PIPE_MAX_ATTRIBS];
          +   unsigned num_vbuffers, num_velements;
          +
          +   st->vertex_array_out_of_memory = FALSE;
          +
          +   /* No drawing has been done yet, so do nothing. */
          +   if (!arrays)
          +      return;
          +
          +   /* vertex program validation must be done before this */
          +   vp = st->vp;
          +   vpv = st->vp_variant;
          +
          +   memset(velements, 0, sizeof(struct pipe_vertex_element) * vpv->num_inputs);
          +
          +   /*
          +    * Setup the vbuffer[] and velements[] arrays.
          +    */
          +   if (is_interleaved_arrays(vp, vpv, arrays)) {
          +      if (!setup_interleaved_attribs(vp, vpv, arrays, vbuffer, velements)) {
          +         st->vertex_array_out_of_memory = TRUE;
          +         return;
          +      }
          +
          +      num_vbuffers = 1;
          +      num_velements = vpv->num_inputs;
          +      if (num_velements == 0)
          +         num_vbuffers = 0;
          +   }
          +   else {
          +      if (!setup_non_interleaved_attribs(st, vp, vpv, arrays, vbuffer,
          +                                         velements)) {
          +         st->vertex_array_out_of_memory = TRUE;
          +         return;
          +      }
          +
          +      num_vbuffers = vpv->num_inputs;
          +      num_velements = vpv->num_inputs;
          +   }
          +
          +   cso_set_vertex_buffers(st->cso_context, num_vbuffers, vbuffer);
          +   cso_set_vertex_elements(st->cso_context, num_velements, velements);
          +}
          +
          +
          +const struct st_tracked_state st_update_array = {
          +   "st_update_array",					/* name */
          +   {							/* dirty */
          +      (_NEW_PROGRAM | _NEW_BUFFER_OBJECT),		/* mesa */
          +      ST_NEW_VERTEX_ARRAYS | ST_NEW_VERTEX_PROGRAM,     /* st */
          +   },
          +   update_array						/* update */
          +};
          diff --git a/mesalib/src/mesa/state_tracker/st_cb_drawpixels.c b/mesalib/src/mesa/state_tracker/st_cb_drawpixels.c
          index 9a3f22465..d3f8d1368 100644
          --- a/mesalib/src/mesa/state_tracker/st_cb_drawpixels.c
          +++ b/mesalib/src/mesa/state_tracker/st_cb_drawpixels.c
          @@ -217,7 +217,7 @@ st_make_drawpix_z_stencil_program(struct st_context *st,
              if (!p)
                 return NULL;
           
          -   p->NumInstructions = write_depth ? 2 : 1;
          +   p->NumInstructions = write_depth ? 3 : 1;
              p->NumInstructions += write_stencil ? 1 : 0;
           
              p->Instructions = _mesa_alloc_instructions(p->NumInstructions);
          @@ -238,6 +238,13 @@ st_make_drawpix_z_stencil_program(struct st_context *st,
                 p->Instructions[ic].TexSrcUnit = 0;
                 p->Instructions[ic].TexSrcTarget = TEXTURE_2D_INDEX;
                 ic++;
          +      /* MOV result.color, fragment.color; */
          +      p->Instructions[ic].Opcode = OPCODE_MOV;
          +      p->Instructions[ic].DstReg.File = PROGRAM_OUTPUT;
          +      p->Instructions[ic].DstReg.Index = FRAG_RESULT_COLOR;
          +      p->Instructions[ic].SrcReg[0].File = PROGRAM_INPUT;
          +      p->Instructions[ic].SrcReg[0].Index = FRAG_ATTRIB_COL0;
          +      ic++;
              }
           
              if (write_stencil) {
          @@ -260,8 +267,10 @@ st_make_drawpix_z_stencil_program(struct st_context *st,
           
              p->InputsRead = FRAG_BIT_TEX0 | FRAG_BIT_COL0;
              p->OutputsWritten = 0;
          -   if (write_depth)
          +   if (write_depth) {
                 p->OutputsWritten |= BITFIELD64_BIT(FRAG_RESULT_DEPTH);
          +      p->OutputsWritten |= BITFIELD64_BIT(FRAG_RESULT_COLOR);
          +   }
              if (write_stencil)
                 p->OutputsWritten |= BITFIELD64_BIT(FRAG_RESULT_STENCIL);
           
          diff --git a/mesalib/src/mesa/state_tracker/st_context.h b/mesalib/src/mesa/state_tracker/st_context.h
          index 55ae65b3c..734b4d9c1 100644
          --- a/mesalib/src/mesa/state_tracker/st_context.h
          +++ b/mesalib/src/mesa/state_tracker/st_context.h
          @@ -88,6 +88,8 @@ struct st_context
               */
              boolean invalidate_on_gl_viewport;
           
          +   boolean vertex_array_out_of_memory;
          +
              /* Some state is contained in constant objects.
               * Other state is just parameter values.
               */
          diff --git a/mesalib/src/mesa/state_tracker/st_draw.c b/mesalib/src/mesa/state_tracker/st_draw.c
          index 0a06e9995..db8caa566 100644
          --- a/mesalib/src/mesa/state_tracker/st_draw.c
          +++ b/mesalib/src/mesa/state_tracker/st_draw.c
          @@ -31,10 +31,6 @@
            * this function whether the user called glBegin/End, glDrawArrays,
            * glDrawElements, glEvalMesh, or glCalList, etc.
            *
          - * We basically convert the VBO's vertex attribute/array information into
          - * Gallium vertex state, bind the vertex buffer objects and call
          - * pipe->draw_vbo().
          - *
            * Authors:
            *   Keith Whitwell 
            */
          @@ -68,261 +64,6 @@
           #include "../glsl/ir_uniform.h"
           
           
          -static GLuint double_types[4] = {
          -   PIPE_FORMAT_R64_FLOAT,
          -   PIPE_FORMAT_R64G64_FLOAT,
          -   PIPE_FORMAT_R64G64B64_FLOAT,
          -   PIPE_FORMAT_R64G64B64A64_FLOAT
          -};
          -
          -static GLuint float_types[4] = {
          -   PIPE_FORMAT_R32_FLOAT,
          -   PIPE_FORMAT_R32G32_FLOAT,
          -   PIPE_FORMAT_R32G32B32_FLOAT,
          -   PIPE_FORMAT_R32G32B32A32_FLOAT
          -};
          -
          -static GLuint half_float_types[4] = {
          -   PIPE_FORMAT_R16_FLOAT,
          -   PIPE_FORMAT_R16G16_FLOAT,
          -   PIPE_FORMAT_R16G16B16_FLOAT,
          -   PIPE_FORMAT_R16G16B16A16_FLOAT
          -};
          -
          -static GLuint uint_types_norm[4] = {
          -   PIPE_FORMAT_R32_UNORM,
          -   PIPE_FORMAT_R32G32_UNORM,
          -   PIPE_FORMAT_R32G32B32_UNORM,
          -   PIPE_FORMAT_R32G32B32A32_UNORM
          -};
          -
          -static GLuint uint_types_scale[4] = {
          -   PIPE_FORMAT_R32_USCALED,
          -   PIPE_FORMAT_R32G32_USCALED,
          -   PIPE_FORMAT_R32G32B32_USCALED,
          -   PIPE_FORMAT_R32G32B32A32_USCALED
          -};
          -
          -static GLuint uint_types_int[4] = {
          -   PIPE_FORMAT_R32_UINT,
          -   PIPE_FORMAT_R32G32_UINT,
          -   PIPE_FORMAT_R32G32B32_UINT,
          -   PIPE_FORMAT_R32G32B32A32_UINT
          -};
          -
          -static GLuint int_types_norm[4] = {
          -   PIPE_FORMAT_R32_SNORM,
          -   PIPE_FORMAT_R32G32_SNORM,
          -   PIPE_FORMAT_R32G32B32_SNORM,
          -   PIPE_FORMAT_R32G32B32A32_SNORM
          -};
          -
          -static GLuint int_types_scale[4] = {
          -   PIPE_FORMAT_R32_SSCALED,
          -   PIPE_FORMAT_R32G32_SSCALED,
          -   PIPE_FORMAT_R32G32B32_SSCALED,
          -   PIPE_FORMAT_R32G32B32A32_SSCALED
          -};
          -
          -static GLuint int_types_int[4] = {
          -   PIPE_FORMAT_R32_SINT,
          -   PIPE_FORMAT_R32G32_SINT,
          -   PIPE_FORMAT_R32G32B32_SINT,
          -   PIPE_FORMAT_R32G32B32A32_SINT
          -};
          -
          -static GLuint ushort_types_norm[4] = {
          -   PIPE_FORMAT_R16_UNORM,
          -   PIPE_FORMAT_R16G16_UNORM,
          -   PIPE_FORMAT_R16G16B16_UNORM,
          -   PIPE_FORMAT_R16G16B16A16_UNORM
          -};
          -
          -static GLuint ushort_types_scale[4] = {
          -   PIPE_FORMAT_R16_USCALED,
          -   PIPE_FORMAT_R16G16_USCALED,
          -   PIPE_FORMAT_R16G16B16_USCALED,
          -   PIPE_FORMAT_R16G16B16A16_USCALED
          -};
          -
          -static GLuint ushort_types_int[4] = {
          -   PIPE_FORMAT_R16_UINT,
          -   PIPE_FORMAT_R16G16_UINT,
          -   PIPE_FORMAT_R16G16B16_UINT,
          -   PIPE_FORMAT_R16G16B16A16_UINT
          -};
          -
          -static GLuint short_types_norm[4] = {
          -   PIPE_FORMAT_R16_SNORM,
          -   PIPE_FORMAT_R16G16_SNORM,
          -   PIPE_FORMAT_R16G16B16_SNORM,
          -   PIPE_FORMAT_R16G16B16A16_SNORM
          -};
          -
          -static GLuint short_types_scale[4] = {
          -   PIPE_FORMAT_R16_SSCALED,
          -   PIPE_FORMAT_R16G16_SSCALED,
          -   PIPE_FORMAT_R16G16B16_SSCALED,
          -   PIPE_FORMAT_R16G16B16A16_SSCALED
          -};
          -
          -static GLuint short_types_int[4] = {
          -   PIPE_FORMAT_R16_SINT,
          -   PIPE_FORMAT_R16G16_SINT,
          -   PIPE_FORMAT_R16G16B16_SINT,
          -   PIPE_FORMAT_R16G16B16A16_SINT
          -};
          -
          -static GLuint ubyte_types_norm[4] = {
          -   PIPE_FORMAT_R8_UNORM,
          -   PIPE_FORMAT_R8G8_UNORM,
          -   PIPE_FORMAT_R8G8B8_UNORM,
          -   PIPE_FORMAT_R8G8B8A8_UNORM
          -};
          -
          -static GLuint ubyte_types_scale[4] = {
          -   PIPE_FORMAT_R8_USCALED,
          -   PIPE_FORMAT_R8G8_USCALED,
          -   PIPE_FORMAT_R8G8B8_USCALED,
          -   PIPE_FORMAT_R8G8B8A8_USCALED
          -};
          -
          -static GLuint ubyte_types_int[4] = {
          -   PIPE_FORMAT_R8_UINT,
          -   PIPE_FORMAT_R8G8_UINT,
          -   PIPE_FORMAT_R8G8B8_UINT,
          -   PIPE_FORMAT_R8G8B8A8_UINT
          -};
          -
          -static GLuint byte_types_norm[4] = {
          -   PIPE_FORMAT_R8_SNORM,
          -   PIPE_FORMAT_R8G8_SNORM,
          -   PIPE_FORMAT_R8G8B8_SNORM,
          -   PIPE_FORMAT_R8G8B8A8_SNORM
          -};
          -
          -static GLuint byte_types_scale[4] = {
          -   PIPE_FORMAT_R8_SSCALED,
          -   PIPE_FORMAT_R8G8_SSCALED,
          -   PIPE_FORMAT_R8G8B8_SSCALED,
          -   PIPE_FORMAT_R8G8B8A8_SSCALED
          -};
          -
          -static GLuint byte_types_int[4] = {
          -   PIPE_FORMAT_R8_SINT,
          -   PIPE_FORMAT_R8G8_SINT,
          -   PIPE_FORMAT_R8G8B8_SINT,
          -   PIPE_FORMAT_R8G8B8A8_SINT
          -};
          -
          -static GLuint fixed_types[4] = {
          -   PIPE_FORMAT_R32_FIXED,
          -   PIPE_FORMAT_R32G32_FIXED,
          -   PIPE_FORMAT_R32G32B32_FIXED,
          -   PIPE_FORMAT_R32G32B32A32_FIXED
          -};
          -
          -
          -
          -/**
          - * Return a PIPE_FORMAT_x for the given GL datatype and size.
          - */
          -enum pipe_format
          -st_pipe_vertex_format(GLenum type, GLuint size, GLenum format,
          -                      GLboolean normalized, GLboolean integer)
          -{
          -   assert((type >= GL_BYTE && type <= GL_DOUBLE) ||
          -          type == GL_FIXED || type == GL_HALF_FLOAT ||
          -          type == GL_INT_2_10_10_10_REV ||
          -          type == GL_UNSIGNED_INT_2_10_10_10_REV);
          -   assert(size >= 1);
          -   assert(size <= 4);
          -   assert(format == GL_RGBA || format == GL_BGRA);
          -
          -   if (type == GL_INT_2_10_10_10_REV ||
          -       type == GL_UNSIGNED_INT_2_10_10_10_REV) {
          -      assert(size == 4);
          -      assert(!integer);
          -
          -      if (format == GL_BGRA) {
          -         if (type == GL_INT_2_10_10_10_REV) {
          -            if (normalized)
          -               return PIPE_FORMAT_B10G10R10A2_SNORM;
          -            else
          -               return PIPE_FORMAT_B10G10R10A2_SSCALED;
          -         } else {
          -            if (normalized)
          -               return PIPE_FORMAT_B10G10R10A2_UNORM;
          -            else
          -               return PIPE_FORMAT_B10G10R10A2_USCALED;
          -         }
          -      } else {
          -         if (type == GL_INT_2_10_10_10_REV) {
          -            if (normalized)
          -               return PIPE_FORMAT_R10G10B10A2_SNORM;
          -            else
          -               return PIPE_FORMAT_R10G10B10A2_SSCALED;
          -         } else {
          -            if (normalized)
          -               return PIPE_FORMAT_R10G10B10A2_UNORM;
          -            else
          -               return PIPE_FORMAT_R10G10B10A2_USCALED;
          -         }
          -      }
          -   }
          -
          -   if (format == GL_BGRA) {
          -      /* this is an odd-ball case */
          -      assert(type == GL_UNSIGNED_BYTE);
          -      assert(normalized);
          -      return PIPE_FORMAT_B8G8R8A8_UNORM;
          -   }
          -
          -   if (integer) {
          -      switch (type) {
          -      case GL_INT: return int_types_int[size-1];
          -      case GL_SHORT: return short_types_int[size-1];
          -      case GL_BYTE: return byte_types_int[size-1];
          -      case GL_UNSIGNED_INT: return uint_types_int[size-1];
          -      case GL_UNSIGNED_SHORT: return ushort_types_int[size-1];
          -      case GL_UNSIGNED_BYTE: return ubyte_types_int[size-1];
          -      default: assert(0); return 0;
          -      }
          -   }
          -   else if (normalized) {
          -      switch (type) {
          -      case GL_DOUBLE: return double_types[size-1];
          -      case GL_FLOAT: return float_types[size-1];
          -      case GL_HALF_FLOAT: return half_float_types[size-1];
          -      case GL_INT: return int_types_norm[size-1];
          -      case GL_SHORT: return short_types_norm[size-1];
          -      case GL_BYTE: return byte_types_norm[size-1];
          -      case GL_UNSIGNED_INT: return uint_types_norm[size-1];
          -      case GL_UNSIGNED_SHORT: return ushort_types_norm[size-1];
          -      case GL_UNSIGNED_BYTE: return ubyte_types_norm[size-1];
          -      case GL_FIXED: return fixed_types[size-1];
          -      default: assert(0); return 0;
          -      }
          -   }
          -   else {
          -      switch (type) {
          -      case GL_DOUBLE: return double_types[size-1];
          -      case GL_FLOAT: return float_types[size-1];
          -      case GL_HALF_FLOAT: return half_float_types[size-1];
          -      case GL_INT: return int_types_scale[size-1];
          -      case GL_SHORT: return short_types_scale[size-1];
          -      case GL_BYTE: return byte_types_scale[size-1];
          -      case GL_UNSIGNED_INT: return uint_types_scale[size-1];
          -      case GL_UNSIGNED_SHORT: return ushort_types_scale[size-1];
          -      case GL_UNSIGNED_BYTE: return ubyte_types_scale[size-1];
          -      case GL_FIXED: return fixed_types[size-1];
          -      default: assert(0); return 0;
          -      }
          -   }
          -   return PIPE_FORMAT_NONE; /* silence compiler warning */
          -}
          -
          -
           /**
            * This is very similar to vbo_all_varyings_in_vbos() but we are
            * only interested in per-vertex data.  See bug 38626.
          @@ -342,240 +83,6 @@ all_varyings_in_vbos(const struct gl_client_array *arrays[])
           }
           
           
          -/**
          - * Examine the active arrays to determine if we have interleaved
          - * vertex arrays all living in one VBO, or all living in user space.
          - */
          -static GLboolean
          -is_interleaved_arrays(const struct st_vertex_program *vp,
          -                      const struct st_vp_variant *vpv,
          -                      const struct gl_client_array **arrays)
          -{
          -   GLuint attr;
          -   const struct gl_buffer_object *firstBufObj = NULL;
          -   GLint firstStride = -1;
          -   const GLubyte *firstPtr = NULL;
          -   GLboolean userSpaceBuffer = GL_FALSE;
          -
          -   for (attr = 0; attr < vpv->num_inputs; attr++) {
          -      const GLuint mesaAttr = vp->index_to_input[attr];
          -      const struct gl_client_array *array = arrays[mesaAttr];
          -      const struct gl_buffer_object *bufObj = array->BufferObj;
          -      const GLsizei stride = array->StrideB; /* in bytes */
          -
          -      if (attr == 0) {
          -         /* save info about the first array */
          -         firstStride = stride;
          -         firstPtr = array->Ptr;         
          -         firstBufObj = bufObj;
          -         userSpaceBuffer = !bufObj || !bufObj->Name;
          -      }
          -      else {
          -         /* check if other arrays interleave with the first, in same buffer */
          -         if (stride != firstStride)
          -            return GL_FALSE; /* strides don't match */
          -
          -         if (bufObj != firstBufObj)
          -            return GL_FALSE; /* arrays in different VBOs */
          -
          -         if (abs(array->Ptr - firstPtr) > firstStride)
          -            return GL_FALSE; /* arrays start too far apart */
          -
          -         if ((!_mesa_is_bufferobj(bufObj)) != userSpaceBuffer)
          -            return GL_FALSE; /* mix of VBO and user-space arrays */
          -      }
          -   }
          -
          -   return GL_TRUE;
          -}
          -
          -
          -/**
          - * Set up for drawing interleaved arrays that all live in one VBO
          - * or all live in user space.
          - * \param vbuffer  returns vertex buffer info
          - * \param velements  returns vertex element info
          - * \return GL_TRUE for success, GL_FALSE otherwise (probably out of memory)
          - */
          -static GLboolean
          -setup_interleaved_attribs(struct gl_context *ctx,
          -                          const struct st_vertex_program *vp,
          -                          const struct st_vp_variant *vpv,
          -                          const struct gl_client_array **arrays,
          -                          struct pipe_vertex_buffer *vbuffer,
          -                          struct pipe_vertex_element velements[])
          -{
          -   GLuint attr;
          -   const GLubyte *low_addr = NULL;
          -   GLboolean usingVBO;      /* all arrays in a VBO? */
          -   struct gl_buffer_object *bufobj;
          -   GLsizei stride;
          -
          -   /* Find the lowest address of the arrays we're drawing,
          -    * Init bufobj and stride.
          -    */
          -   if (vpv->num_inputs) {
          -      const GLuint mesaAttr0 = vp->index_to_input[0];
          -      const struct gl_client_array *array = arrays[mesaAttr0];
          -
          -      /* Since we're doing interleaved arrays, we know there'll be at most
          -       * one buffer object and the stride will be the same for all arrays.
          -       * Grab them now.
          -       */
          -      bufobj = array->BufferObj;
          -      stride = array->StrideB;
          -
          -      low_addr = arrays[vp->index_to_input[0]]->Ptr;
          -
          -      for (attr = 1; attr < vpv->num_inputs; attr++) {
          -         const GLubyte *start = arrays[vp->index_to_input[attr]]->Ptr;
          -         low_addr = MIN2(low_addr, start);
          -      }
          -   }
          -   else {
          -      /* not sure we'll ever have zero inputs, but play it safe */
          -      bufobj = NULL;
          -      stride = 0;
          -      low_addr = 0;
          -   }
          -
          -   /* are the arrays in user space? */
          -   usingVBO = _mesa_is_bufferobj(bufobj);
          -
          -   for (attr = 0; attr < vpv->num_inputs; attr++) {
          -      const GLuint mesaAttr = vp->index_to_input[attr];
          -      const struct gl_client_array *array = arrays[mesaAttr];
          -      unsigned src_offset = (unsigned) (array->Ptr - low_addr);
          -      GLuint element_size = array->_ElementSize;
          -
          -      assert(element_size == array->Size * _mesa_sizeof_type(array->Type));
          -
          -      velements[attr].src_offset = src_offset;
          -      velements[attr].instance_divisor = array->InstanceDivisor;
          -      velements[attr].vertex_buffer_index = 0;
          -      velements[attr].src_format = st_pipe_vertex_format(array->Type,
          -                                                         array->Size,
          -                                                         array->Format,
          -                                                         array->Normalized,
          -                                                         array->Integer);
          -      assert(velements[attr].src_format);
          -   }
          -
          -   /*
          -    * Return the vbuffer info and setup user-space attrib info, if needed.
          -    */
          -   if (vpv->num_inputs == 0) {
          -      /* just defensive coding here */
          -      vbuffer->buffer = NULL;
          -      vbuffer->user_buffer = NULL;
          -      vbuffer->buffer_offset = 0;
          -      vbuffer->stride = 0;
          -   }
          -   else if (usingVBO) {
          -      /* all interleaved arrays in a VBO */
          -      struct st_buffer_object *stobj = st_buffer_object(bufobj);
          -
          -      if (!stobj || !stobj->buffer) {
          -         /* probably out of memory (or zero-sized buffer) */
          -         return GL_FALSE;
          -      }
          -
          -      vbuffer->buffer = stobj->buffer;
          -      vbuffer->user_buffer = NULL;
          -      vbuffer->buffer_offset = pointer_to_offset(low_addr);
          -      vbuffer->stride = stride;
          -   }
          -   else {
          -      /* all interleaved arrays in user memory */
          -      vbuffer->buffer = NULL;
          -      vbuffer->user_buffer = low_addr;
          -      vbuffer->buffer_offset = 0;
          -      vbuffer->stride = stride;
          -   }
          -
          -   return GL_TRUE;
          -}
          -
          -
          -/**
          - * Set up a separate pipe_vertex_buffer and pipe_vertex_element for each
          - * vertex attribute.
          - * \param vbuffer  returns vertex buffer info
          - * \param velements  returns vertex element info
          - * \return GL_TRUE for success, GL_FALSE otherwise (probably out of memory)
          - */
          -static GLboolean
          -setup_non_interleaved_attribs(struct gl_context *ctx,
          -                              const struct st_vertex_program *vp,
          -                              const struct st_vp_variant *vpv,
          -                              const struct gl_client_array **arrays,
          -                              struct pipe_vertex_buffer vbuffer[],
          -                              struct pipe_vertex_element velements[])
          -{
          -   GLuint attr;
          -
          -   for (attr = 0; attr < vpv->num_inputs; attr++) {
          -      const GLuint mesaAttr = vp->index_to_input[attr];
          -      const struct gl_client_array *array = arrays[mesaAttr];
          -      struct gl_buffer_object *bufobj = array->BufferObj;
          -      GLsizei stride = array->StrideB;
          -
          -      assert(array->_ElementSize == array->Size * _mesa_sizeof_type(array->Type));
          -
          -      if (_mesa_is_bufferobj(bufobj)) {
          -         /* Attribute data is in a VBO.
          -          * Recall that for VBOs, the gl_client_array->Ptr field is
          -          * really an offset from the start of the VBO, not a pointer.
          -          */
          -         struct st_buffer_object *stobj = st_buffer_object(bufobj);
          -
          -         if (!stobj || !stobj->buffer) {
          -            /* probably out of memory (or zero-sized buffer) */
          -            return GL_FALSE;
          -         }
          -
          -         vbuffer[attr].buffer = stobj->buffer;
          -         vbuffer[attr].user_buffer = NULL;
          -         vbuffer[attr].buffer_offset = pointer_to_offset(array->Ptr);
          -      }
          -      else {
          -         /* wrap user data */
          -         void *ptr;
          -
          -         if (array->Ptr) {
          -            ptr = (void *) array->Ptr;
          -         }
          -         else {
          -            /* no array, use ctx->Current.Attrib[] value */
          -            ptr = (void *) ctx->Current.Attrib[mesaAttr];
          -            stride = 0;
          -         }
          -
          -         assert(ptr);
          -
          -         vbuffer[attr].buffer = NULL;
          -         vbuffer[attr].user_buffer = ptr;
          -         vbuffer[attr].buffer_offset = 0;
          -      }
          -
          -      /* common-case setup */
          -      vbuffer[attr].stride = stride; /* in bytes */
          -
          -      velements[attr].src_offset = 0;
          -      velements[attr].instance_divisor = array->InstanceDivisor;
          -      velements[attr].vertex_buffer_index = attr;
          -      velements[attr].src_format = st_pipe_vertex_format(array->Type,
          -                                                         array->Size,
          -                                                         array->Format,
          -                                                         array->Normalized,
          -                                                         array->Integer);
          -      assert(velements[attr].src_format);
          -   }
          -
          -   return GL_TRUE;
          -}
          -
          -
           static void
           setup_index_buffer(struct st_context *st,
                              const struct _mesa_index_buffer *ib,
          @@ -664,58 +171,6 @@ translate_prim(const struct gl_context *ctx, unsigned prim)
           }
           
           
          -/**
          - * Setup vertex arrays and buffers prior to drawing.
          - * \return GL_TRUE for success, GL_FALSE otherwise (probably out of memory)
          - */
          -static GLboolean
          -st_validate_varrays(struct gl_context *ctx,
          -                    const struct gl_client_array **arrays)
          -{
          -   struct st_context *st = st_context(ctx);
          -   const struct st_vertex_program *vp;
          -   const struct st_vp_variant *vpv;
          -   struct pipe_vertex_buffer vbuffer[PIPE_MAX_SHADER_INPUTS];
          -   struct pipe_vertex_element velements[PIPE_MAX_ATTRIBS];
          -   unsigned num_vbuffers, num_velements;
          -
          -   /* must get these after state validation! */
          -   vp = st->vp;
          -   vpv = st->vp_variant;
          -
          -   memset(velements, 0, sizeof(struct pipe_vertex_element) * vpv->num_inputs);
          -
          -   /*
          -    * Setup the vbuffer[] and velements[] arrays.
          -    */
          -   if (is_interleaved_arrays(vp, vpv, arrays)) {
          -      if (!setup_interleaved_attribs(ctx, vp, vpv, arrays, vbuffer,
          -                                     velements)) {
          -         return GL_FALSE;
          -      }
          -
          -      num_vbuffers = 1;
          -      num_velements = vpv->num_inputs;
          -      if (num_velements == 0)
          -         num_vbuffers = 0;
          -   }
          -   else {
          -      if (!setup_non_interleaved_attribs(ctx, vp, vpv, arrays,
          -                                         vbuffer, velements)) {
          -         return GL_FALSE;
          -      }
          -
          -      num_vbuffers = vpv->num_inputs;
          -      num_velements = vpv->num_inputs;
          -   }
          -
          -   cso_set_vertex_buffers(st->cso_context, num_vbuffers, vbuffer);
          -   cso_set_vertex_elements(st->cso_context, num_velements, velements);
          -
          -   return GL_TRUE;
          -}
          -
          -
           /**
            * This function gets plugged into the VBO module and is called when
            * we have something to render.
          @@ -736,38 +191,16 @@ st_draw_vbo(struct gl_context *ctx,
              struct pipe_draw_info info;
              const struct gl_client_array **arrays = ctx->Array._DrawArrays;
              unsigned i;
          -   GLboolean new_array;
           
              /* Mesa core state should have been validated already */
              assert(ctx->NewState == 0x0);
           
          -   /* Get Mesa driver state. */
          -   st->dirty.st |= ctx->NewDriverState;
          -   ctx->NewDriverState = 0;
          -
          -   new_array =
          -      (st->dirty.st & (ST_NEW_VERTEX_ARRAYS | ST_NEW_VERTEX_PROGRAM)) ||
          -      (st->dirty.mesa & (_NEW_PROGRAM | _NEW_BUFFER_OBJECT)) != 0;
          -
              /* Validate state. */
          -   if (st->dirty.st) {
          -      GLboolean vertDataEdgeFlags;
          -
          -      vertDataEdgeFlags = arrays[VERT_ATTRIB_EDGEFLAG]->BufferObj &&
          -                          arrays[VERT_ATTRIB_EDGEFLAG]->BufferObj->Name;
          -      if (vertDataEdgeFlags != st->vertdata_edgeflags) {
          -         st->vertdata_edgeflags = vertDataEdgeFlags;
          -         st->dirty.st |= ST_NEW_EDGEFLAGS_DATA;
          -      }
          -
          +   if (st->dirty.st || ctx->NewDriverState) {
                 st_validate_state(st);
           
          -      if (new_array) {
          -         if (!st_validate_varrays(ctx, arrays)) {
          -            /* probably out of memory, no-op the draw call */
          -            return;
          -         }
          -      }
          +      if (st->vertex_array_out_of_memory)
          +         return;
           
           #if 0
                 if (MESA_VERBOSE & VERBOSE_GLSL) {
          diff --git a/mesalib/src/mesa/state_tracker/st_draw.h b/mesalib/src/mesa/state_tracker/st_draw.h
          index c608051eb..3313fc8c7 100644
          --- a/mesalib/src/mesa/state_tracker/st_draw.h
          +++ b/mesalib/src/mesa/state_tracker/st_draw.h
          @@ -67,13 +67,6 @@ st_feedback_draw_vbo(struct gl_context *ctx,
                                GLuint max_index,
                                struct gl_transform_feedback_object *tfb_vertcount);
           
          -/* Internal function:
          - */
          -extern enum pipe_format
          -st_pipe_vertex_format(GLenum type, GLuint size, GLenum format,
          -                      GLboolean normalized, GLboolean integer);
          -
          -
           /**
            * When drawing with VBOs, the addresses specified with
            * glVertex/Color/TexCoordPointer() are really offsets into the VBO, not real
          diff --git a/pixman/test/stress-test.c b/pixman/test/stress-test.c
          index 0b48da3f7..7fc067e82 100644
          --- a/pixman/test/stress-test.c
          +++ b/pixman/test/stress-test.c
          @@ -412,6 +412,7 @@ set_general_properties (pixman_image_t *image, pixman_bool_t allow_alpha_map)
           
           	case 6: case 7:
           	    n_rects = 3;
          +	    break;
           
           	default:
           	    n_rects = lcg_rand_n (100);
          diff --git a/xorg-server/Xi/exevents.c b/xorg-server/Xi/exevents.c
          index 4aad52734..e99bf6c20 100644
          --- a/xorg-server/Xi/exevents.c
          +++ b/xorg-server/Xi/exevents.c
          @@ -926,10 +926,10 @@ UpdateDeviceState(DeviceIntPtr device, DeviceEvent *event)
               else if (event->type == ET_ProximityOut)
                   device->proximity->in_proximity = FALSE;
               else if (event->type == ET_TouchBegin) {
          -        BUG_WARN(!b || !v);
          -        BUG_WARN(!t);
          +        BUG_RETURN_VAL(!b || !v, DONT_PROCESS);
          +        BUG_RETURN_VAL(!t, DONT_PROCESS);
           
          -        if (!b || !t || !b->map[key])
          +        if (!b->map[key])
                       return DONT_PROCESS;
           
                   if (!(event->flags & TOUCH_POINTER_EMULATED) ||
          @@ -941,10 +941,10 @@ UpdateDeviceState(DeviceIntPtr device, DeviceEvent *event)
                   UpdateDeviceMotionMask(device, t->state, DeviceButtonMotionMask);
               }
               else if (event->type == ET_TouchEnd) {
          -        BUG_WARN(!b || !v);
          -        BUG_WARN(!t);
          +        BUG_RETURN_VAL(!b || !v, DONT_PROCESS);
          +        BUG_RETURN_VAL(!t, DONT_PROCESS);
           
          -        if (!b || !t || t->buttonsDown <= 0 || !b->map[key])
          +        if (t->buttonsDown <= 0 || !b->map[key])
                       return DONT_PROCESS;
           
                   if (!(event->flags & TOUCH_POINTER_EMULATED))
          @@ -1356,9 +1356,8 @@ RetrieveTouchDeliveryData(DeviceIntPtr dev, TouchPointInfoPtr ti,
                                              wOtherInputMasks(*win)->inputClients, next)
                           if (xi2mask_isset(iclients->xi2mask, dev, evtype))
                           break;
          -            BUG_WARN(!iclients);
          -            if (!iclients)
          -                return FALSE;
          +
          +            BUG_RETURN_VAL(!iclients, FALSE);
           
                       *mask = iclients->xi2mask;
                       *client = rClient(iclients);
          @@ -1371,9 +1370,7 @@ RetrieveTouchDeliveryData(DeviceIntPtr dev, TouchPointInfoPtr ti,
                                              wOtherInputMasks(*win)->inputClients, next)
                           if (iclients->mask[dev->id] & xi_filter)
                           break;
          -            BUG_WARN(!iclients);
          -            if (!iclients)
          -                return FALSE;
          +            BUG_RETURN_VAL(!iclients, FALSE);
           
                       *client = rClient(iclients);
                   }
          @@ -1414,9 +1411,7 @@ DeliverTouchEmulatedEvent(DeviceIntPtr dev, TouchPointInfoPtr ti,
                   return Success;
           
               nevents = TouchConvertToPointerEvent(ev, &motion, &button);
          -    BUG_WARN(nevents == 0);
          -    if (nevents == 0)
          -        return BadValue;
          +    BUG_RETURN_VAL(nevents == 0, BadValue);
           
               if (nevents > 1)
                   ptrev = &button;
          diff --git a/xorg-server/Xi/xichangehierarchy.c b/xorg-server/Xi/xichangehierarchy.c
          index 756aaac06..89f16d8be 100644
          --- a/xorg-server/Xi/xichangehierarchy.c
          +++ b/xorg-server/Xi/xichangehierarchy.c
          @@ -293,12 +293,6 @@ remove_master(ClientPtr client, xXIRemoveMasterInfo * r, int flags[MAXDEVICES])
                   }
               }
           
          -    /* can't disable until we removed pairing */
          -    keybd->spriteInfo->paired = NULL;
          -    ptr->spriteInfo->paired = NULL;
          -    XTestptr->spriteInfo->paired = NULL;
          -    XTestkeybd->spriteInfo->paired = NULL;
          -
               /* disable the remove the devices, XTest devices must be done first
                  else the sprites they rely on will be destroyed  */
               DisableDevice(XTestptr, FALSE);
          diff --git a/xorg-server/configure.ac b/xorg-server/configure.ac
          index 9ae77fbae..fb3d12092 100644
          --- a/xorg-server/configure.ac
          +++ b/xorg-server/configure.ac
          @@ -777,7 +777,7 @@ DRI2PROTO="dri2proto >= 2.7"
           XINERAMAPROTO="xineramaproto"
           BIGFONTPROTO="xf86bigfontproto >= 1.2.0"
           DGAPROTO="xf86dgaproto >= 2.0.99.1"
          -GLPROTO="glproto >= 1.4.14"
          +GLPROTO="glproto >= 1.4.15"
           DMXPROTO="dmxproto >= 2.2.99.1"
           VIDMODEPROTO="xf86vidmodeproto >= 2.2.99.1"
           WINDOWSWMPROTO="windowswmproto"
          diff --git a/xorg-server/dix/devices.c b/xorg-server/dix/devices.c
          index 0c62a012d..08875bc3a 100644
          --- a/xorg-server/dix/devices.c
          +++ b/xorg-server/dix/devices.c
          @@ -178,12 +178,9 @@ DeviceSetProperty(DeviceIntPtr dev, Atom property, XIPropertyValuePtr prop,
           
           /* Pair the keyboard to the pointer device. Keyboard events will follow the
            * pointer sprite. Only applicable for master devices.
          - * If the client is set, the request to pair comes from some client. In this
          - * case, we need to check for access. If the client is NULL, it's from an
          - * internal automatic pairing, we must always permit this.
            */
           static int
          -PairDevices(ClientPtr client, DeviceIntPtr ptr, DeviceIntPtr kbd)
          +PairDevices(DeviceIntPtr ptr, DeviceIntPtr kbd)
           {
               if (!ptr)
                   return BadDevice;
          @@ -365,13 +362,12 @@ EnableDevice(DeviceIntPtr dev, BOOL sendevent)
                           /* mode doesn't matter */
                           EnterWindow(dev, screenInfo.screens[0]->root, NotifyAncestor);
                       }
          -            else if ((other = NextFreePointerDevice()) == NULL) {
          -                ErrorF("[dix] cannot find pointer to pair with. "
          -                       "This is a bug.\n");
          -                return FALSE;
          +            else {
          +                other = NextFreePointerDevice();
          +                BUG_RETURN_VAL_MSG(other == NULL, FALSE,
          +                                   "[dix] cannot find pointer to pair with.\n");
          +                PairDevices(other, dev);
                       }
          -            else
          -                PairDevices(NULL, other, dev);
                   }
                   else {
                       if (dev->coreEvents)
          @@ -432,6 +428,9 @@ DisableDevice(DeviceIntPtr dev, BOOL sendevent)
               BOOL enabled;
               int flags[MAXDEVICES] = { 0 };
           
          +    if (!dev->enabled)
          +        return TRUE;
          +
               for (prev = &inputInfo.devices;
                    *prev && (*prev != dev); prev = &(*prev)->next);
               if (*prev != dev)
          @@ -458,18 +457,19 @@ DisableDevice(DeviceIntPtr dev, BOOL sendevent)
               }
           
               if (IsMaster(dev) && dev->spriteInfo->sprite) {
          -        for (other = inputInfo.devices; other; other = other->next) {
          -            if (other->spriteInfo->paired == dev) {
          -                ErrorF("[dix] cannot disable device, still paired. "
          -                       "This is a bug. \n");
          -                return FALSE;
          -            }
          -        }
          +        for (other = inputInfo.devices; other; other = other->next)
          +            if (other->spriteInfo->paired == dev && !other->spriteInfo->spriteOwner)
          +                DisableDevice(other, sendevent);
               }
           
          +    if (dev->spriteInfo->paired)
          +        dev->spriteInfo->paired = NULL;
          +
               (void) (*dev->deviceProc) (dev, DEVICE_OFF);
               dev->enabled = FALSE;
           
          +    FreeSprite(dev);
          +
               /* now that the device is disabled, we can reset the signal handler's
                * last.slave */
               OsBlockSignals();
          @@ -501,6 +501,26 @@ DisableDevice(DeviceIntPtr dev, BOOL sendevent)
               return TRUE;
           }
           
          +void
          +DisableAllDevices(void)
          +{
          +    DeviceIntPtr dev, tmp;
          +
          +    nt_list_for_each_entry_safe(dev, tmp, inputInfo.devices, next) {
          +        if (!IsMaster(dev))
          +            DisableDevice(dev, FALSE);
          +    }
          +    /* master keyboards need to be disabled first */
          +    nt_list_for_each_entry_safe(dev, tmp, inputInfo.devices, next) {
          +        if (dev->enabled && IsMaster(dev) && IsKeyboardDevice(dev))
          +            DisableDevice(dev, FALSE);
          +    }
          +    nt_list_for_each_entry_safe(dev, tmp, inputInfo.devices, next) {
          +        if (dev->enabled)
          +            DisableDevice(dev, FALSE);
          +    }
          +}
          +
           /**
            * Initialise a new device through the driver and tell all clients about the
            * new device.
          @@ -923,12 +943,7 @@ CloseDevice(DeviceIntPtr dev)
                   free(classes);
               }
           
          -    if (DevHasCursor(dev) && dev->spriteInfo->sprite) {
          -        if (dev->spriteInfo->sprite->current)
          -            FreeCursor(dev->spriteInfo->sprite->current, None);
          -        free(dev->spriteInfo->sprite->spriteTrace);
          -        free(dev->spriteInfo->sprite);
          -    }
          +    FreeSprite(dev);
           
               /* a client may have the device set as client pointer */
               for (j = 0; j < currentMaxClients; j++) {
          diff --git a/xorg-server/dix/events.c b/xorg-server/dix/events.c
          index 83ae5c965..49894fa26 100644
          --- a/xorg-server/dix/events.c
          +++ b/xorg-server/dix/events.c
          @@ -3192,6 +3192,18 @@ InitializeSprite(DeviceIntPtr pDev, WindowPtr pWin)
           #endif
           }
           
          +void FreeSprite(DeviceIntPtr dev)
          +{
          +    if (DevHasCursor(dev) && dev->spriteInfo->sprite) {
          +        if (dev->spriteInfo->sprite->current)
          +            FreeCursor(dev->spriteInfo->sprite->current, None);
          +        free(dev->spriteInfo->sprite->spriteTrace);
          +        free(dev->spriteInfo->sprite);
          +    }
          +    dev->spriteInfo->sprite = NULL;
          +}
          +
          +
           /**
            * Update the mouse sprite info when the server switches from a pScreen to another.
            * Otherwise, the pScreen of the mouse sprite is never updated when we switch
          diff --git a/xorg-server/dix/getevents.c b/xorg-server/dix/getevents.c
          index 4fbaa6c94..baa26c4b8 100644
          --- a/xorg-server/dix/getevents.c
          +++ b/xorg-server/dix/getevents.c
          @@ -1821,10 +1821,7 @@ GetTouchEvents(InternalEvent *events, DeviceIntPtr dev, uint32_t ddx_touchid,
           
               if (flags & TOUCH_CLIENT_ID) {      /* A DIX-submitted TouchEnd */
                   touchpoint.dix_ti = TouchFindByClientID(dev, ddx_touchid);
          -        BUG_WARN(!touchpoint.dix_ti);
          -
          -        if (!touchpoint.dix_ti)
          -            return 0;
          +        BUG_RETURN_VAL(!touchpoint.dix_ti, 0);
           
                   if (!mask_in ||
                       !valuator_mask_isset(mask_in, 0) ||
          diff --git a/xorg-server/dix/main.c b/xorg-server/dix/main.c
          index 83efa7d7f..e95ca1cc2 100644
          --- a/xorg-server/dix/main.c
          +++ b/xorg-server/dix/main.c
          @@ -104,6 +104,7 @@ Equipment Corporation.
           #include "privates.h"
           #include "registry.h"
           #include "client.h"
          +#include "exevents.h"
           #ifdef PANORAMIX
           #include "panoramiXsrv.h"
           #else
          @@ -295,6 +296,7 @@ main(int argc, char *argv[], char *envp[])
           #endif
           
                   UndisplayDevices();
          +        DisableAllDevices();
           
                   /* Now free up whatever must be freed */
                   if (screenIsSaved == SCREEN_SAVER_ON)
          @@ -318,7 +320,9 @@ main(int argc, char *argv[], char *envp[])
           
                   for (i = 0; i < screenInfo.numScreens; i++)
                       screenInfo.screens[i]->root = NullWindow;
          +
                   CloseDownDevices();
          +
                   CloseDownEvents();
           
                   for (i = screenInfo.numScreens - 1; i >= 0; i--) {
          diff --git a/xorg-server/dix/touch.c b/xorg-server/dix/touch.c
          index 401cb981a..aa17faf28 100644
          --- a/xorg-server/dix/touch.c
          +++ b/xorg-server/dix/touch.c
          @@ -103,11 +103,11 @@ TouchResizeQueue(ClientPtr client, pointer closure)
           
                   tmp = realloc(dev->last.touches, size * sizeof(*dev->last.touches));
                   if (tmp) {
          -            int i;
          +            int j;
           
                       dev->last.touches = tmp;
          -            for (i = dev->last.num_touches; i < size; i++)
          -                TouchInitDDXTouchPoint(dev, &dev->last.touches[i]);
          +            for (j = dev->last.num_touches; j < size; j++)
          +                TouchInitDDXTouchPoint(dev, &dev->last.touches[j]);
                       dev->last.num_touches = size;
                   }
           
          @@ -598,8 +598,8 @@ TouchConvertToPointerEvent(const InternalEvent *event,
               int ptrtype;
               int nevents = 0;
           
          -    BUG_WARN(!event);
          -    BUG_WARN(!motion_event);
          +    BUG_RETURN_VAL(!event, 0);
          +    BUG_RETURN_VAL(!motion_event, 0);
           
               switch (event->any.type) {
               case ET_TouchUpdate:
          @@ -627,7 +627,7 @@ TouchConvertToPointerEvent(const InternalEvent *event,
               motion_event->device_event.flags = XIPointerEmulated;
           
               if (nevents > 1) {
          -        BUG_WARN(!button_event);
          +        BUG_RETURN_VAL(!button_event, 0);
                   *button_event = *event;
                   button_event->any.type = ptrtype;
                   button_event->device_event.flags = XIPointerEmulated;
          @@ -966,10 +966,8 @@ TouchListenerAcceptReject(DeviceIntPtr dev, TouchPointInfoPtr ti, int listener,
               int nev;
               int i;
           
          -    BUG_WARN(listener < 0);
          -    BUG_WARN(listener >= ti->num_listeners);
          -    if (listener < 0 || listener >= ti->num_listeners)
          -        return BadMatch;
          +    BUG_RETURN_VAL(listener < 0, BadMatch);
          +    BUG_RETURN_VAL(listener >= ti->num_listeners, BadMatch);
           
               if (listener > 0) {
                   if (mode == XIRejectTouch)
          @@ -981,10 +979,7 @@ TouchListenerAcceptReject(DeviceIntPtr dev, TouchPointInfoPtr ti, int listener,
               }
           
               events = InitEventList(GetMaximumEventsNum());
          -    if (!events) {
          -        BUG_WARN_MSG(TRUE, "Failed to allocate touch ownership events\n");
          -        return BadAlloc;
          -    }
          +    BUG_RETURN_VAL_MSG(!events, BadAlloc, "Failed to allocate touch ownership events\n");
           
               nev = GetTouchOwnershipEvents(events, dev, ti, mode,
                                             ti->listeners[0].listener, 0);
          diff --git a/xorg-server/glx/clientinfo.c b/xorg-server/glx/clientinfo.c
          index 15bbf15af..b26ac1a72 100644
          --- a/xorg-server/glx/clientinfo.c
          +++ b/xorg-server/glx/clientinfo.c
          @@ -26,17 +26,62 @@
           
           #include "glxserver.h"
           #include "indirect_dispatch.h"
          +#include "glxbyteorder.h"
          +#include "unpack.h"
           
           int
           __glXDisp_SetClientInfoARB(__GLXclientState * cl, GLbyte * pc)
           {
          -    return BadRequest;
          +    xGLXSetClientInfoARBReq *req = (xGLXSetClientInfoARBReq *) pc;
          +    char *gl_extensions;
          +    char *glx_extensions;
          +
          +    /* Verify that the size of the packet matches the size inferred from the
          +     * sizes specified for the various fields.
          +     */
          +    const unsigned expected_size = sz_xGLXSetClientInfoARBReq
          +        + (req->numVersions * 8)
          +        + __GLX_PAD(req->numGLExtensionBytes)
          +        + __GLX_PAD(req->numGLXExtensionBytes);
          +
          +    if (req->length != (expected_size / 4))
          +        return BadLength;
          +
          +    /* Verify that the actual length of the GL extension string matches what's
          +     * encoded in protocol packet.
          +     */
          +    gl_extensions = (char *) (req + 1) + (req->numVersions * 8);
          +    if (req->numGLExtensionBytes != 0
          +        && memchr(gl_extensions, 0,
          +                  __GLX_PAD(req->numGLExtensionBytes)) == NULL)
          +        return BadLength;
          +
          +    /* Verify that the actual length of the GLX extension string matches
          +     * what's encoded in protocol packet.
          +     */
          +    glx_extensions = gl_extensions + __GLX_PAD(req->numGLExtensionBytes);
          +    if (req->numGLXExtensionBytes != 0
          +        && memchr(glx_extensions, 0,
          +                  __GLX_PAD(req->numGLXExtensionBytes)) == NULL)
          +        return BadLength;
          +
          +    free(cl->GLClientextensions);
          +    cl->GLClientextensions = strdup(gl_extensions);
          +
          +    return 0;
           }
           
           int
           __glXDispSwap_SetClientInfoARB(__GLXclientState * cl, GLbyte * pc)
           {
          -    return BadRequest;
          +    xGLXSetClientInfoARBReq *req = (xGLXSetClientInfoARBReq *) pc;
          +
          +    req->length = bswap_16(req->length);
          +    req->numVersions = bswap_32(req->numVersions);
          +    req->numGLExtensionBytes = bswap_32(req->numGLExtensionBytes);
          +    req->numGLXExtensionBytes = bswap_32(req->numGLXExtensionBytes);
          +
          +    return __glXDisp_SetClientInfoARB(cl, pc);
           }
           
           int
          diff --git a/xorg-server/glx/createcontext.c b/xorg-server/glx/createcontext.c
          index 9c1eab3e4..025c423fe 100644
          --- a/xorg-server/glx/createcontext.c
          +++ b/xorg-server/glx/createcontext.c
          @@ -24,13 +24,224 @@
           #include 
           #endif
           
          +#include 
           #include "glxserver.h"
          +#include "glxext.h"
           #include "indirect_dispatch.h"
           
          +#define ALL_VALID_FLAGS \
          +    (GLX_CONTEXT_DEBUG_BIT_ARB | GLX_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB)
          +
          +static Bool
          +validate_GL_version(int major_version, int minor_version)
          +{
          +    if (major_version <= 0 || minor_version < 0)
          +        return False;
          +
          +    switch (major_version) {
          +    case 1:
          +        if (minor_version > 5)
          +            return False;
          +        break;
          +
          +    case 2:
          +        if (minor_version > 1)
          +            return False;
          +        break;
          +
          +    case 3:
          +        if (minor_version > 3)
          +            return False;
          +        break;
          +
          +    default:
          +        break;
          +    }
          +
          +    return True;
          +}
          +
          +static Bool
          +validate_render_type(uint32_t render_type)
          +{
          +    switch (render_type) {
          +    case GLX_RGBA_TYPE:
          +    case GLX_COLOR_INDEX_TYPE:
          +        return True;
          +    default:
          +        return False;
          +    }
          +}
          +
           int
           __glXDisp_CreateContextAttribsARB(__GLXclientState * cl, GLbyte * pc)
           {
          -    return BadRequest;
          +    ClientPtr client = cl->client;
          +    xGLXCreateContextAttribsARBReq *req = (xGLXCreateContextAttribsARBReq *) pc;
          +    int32_t *attribs = (req->numAttribs != 0) ? (int32_t *) (req + 1) : NULL;
          +    unsigned i;
          +    int major_version = 1;
          +    int minor_version = 0;
          +    uint32_t flags = 0;
          +    uint32_t render_type = GLX_RGBA_TYPE;
          +    __GLXcontext *ctx = NULL;
          +    __GLXcontext *shareCtx = NULL;
          +    __GLXscreen *glxScreen;
          +    __GLXconfig *config;
          +    int err;
          +
          +    /* Verify that the size of the packet matches the size inferred from the
          +     * sizes specified for the various fields.
          +     */
          +    const unsigned expected_size = (sz_xGLXCreateContextAttribsARBReq
          +                                    + (req->numAttribs * 8)) / 4;
          +
          +    if (req->length != expected_size)
          +        return BadLength;
          +
          +    LEGAL_NEW_RESOURCE(req->context, client);
          +
          +    /* The GLX_ARB_create_context spec says:
          +     *
          +     *     "* If  is not a valid GLXFBConfig, GLXBadFBConfig is
          +     *        generated."
          +     *
          +     * On the client, the screen comes from the FBConfig, so GLXBadFBConfig
          +     * should be issued if the screen is nonsense.
          +     */
          +    if (!validGlxScreen(client, req->screen, &glxScreen, &err))
          +        return __glXError(GLXBadFBConfig);
          +
          +    if (!validGlxFBConfig(client, glxScreen, req->fbconfig, &config, &err))
          +        return __glXError(GLXBadFBConfig);
          +
          +    /* Validate the context with which the new context should share resources.
          +     */
          +    if (req->shareList != None) {
          +        if (!validGlxContext(client, req->shareList, DixReadAccess,
          +                             &shareCtx, &err))
          +            return err;
          +
          +        /* The crazy condition is because C doesn't have a logical XOR
          +         * operator.  Comparing directly for equality may fail if one is 1 and
          +         * the other is 2 even though both are logically true.
          +         */
          +        if (!!req->isDirect != !!shareCtx->isDirect) {
          +            client->errorValue = req->shareList;
          +            return BadMatch;
          +        }
          +
          +        /* The GLX_ARB_create_context spec says:
          +         *
          +         *     "* If the server context state for ...was
          +         *        created on a different screen than the one referenced by
          +         *        ...BadMatch is generated."
          +         */
          +        if (glxScreen != shareCtx->pGlxScreen) {
          +            client->errorValue = shareCtx->pGlxScreen->pScreen->myNum;
          +            return BadMatch;
          +        }
          +    }
          +
          +    for (i = 0; i < req->numAttribs; i++) {
          +        switch (attribs[i * 2]) {
          +        case GLX_CONTEXT_MAJOR_VERSION_ARB:
          +            major_version = attribs[2 * i + 1];
          +            break;
          +
          +        case GLX_CONTEXT_MINOR_VERSION_ARB:
          +            minor_version = attribs[2 * i + 1];
          +            break;
          +
          +        case GLX_CONTEXT_FLAGS_ARB:
          +            flags = attribs[2 * i + 1];
          +            break;
          +
          +        case GLX_RENDER_TYPE:
          +            render_type = attribs[2 * i + 1];
          +            break;
          +
          +        default:
          +            return BadValue;
          +        }
          +    }
          +
          +    /* The GLX_ARB_create_context spec says:
          +     *
          +     *     "If attributes GLX_CONTEXT_MAJOR_VERSION_ARB and
          +     *     GLX_CONTEXT_MINOR_VERSION_ARB, when considered together
          +     *     with attributes GLX_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB and
          +     *     GLX_RENDER_TYPE, specify an OpenGL version and feature set
          +     *     that are not defined, BadMatch is generated.
          +     *
          +     *     ...Feature deprecation was introduced with OpenGL 3.0, so
          +     *     forward-compatible contexts may only be requested for
          +     *     OpenGL 3.0 and above. Thus, examples of invalid
          +     *     combinations of attributes include:
          +     *
          +     *       - Major version < 1 or > 3
          +     *       - Major version == 1 and minor version < 0 or > 5
          +     *       - Major version == 2 and minor version < 0 or > 1
          +     *       - Major version == 3 and minor version > 2
          +     *       - Forward-compatible flag set and major version < 3
          +     *       - Color index rendering and major version >= 3"
          +     */
          +    if (!validate_GL_version(major_version, minor_version))
          +        return BadMatch;
          +
          +    if (major_version < 3
          +        && ((flags & GLX_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB) != 0))
          +        return BadMatch;
          +
          +    if (major_version >= 3 && render_type == GLX_COLOR_INDEX_TYPE)
          +        return BadMatch;
          +
          +    if (!validate_render_type(render_type))
          +        return BadValue;
          +
          +    if ((flags & ~ALL_VALID_FLAGS) != 0)
          +        return BadValue;
          +
          +    /* Allocate memory for the new context
          +     */
          +    if (req->isDirect) {
          +        ctx = __glXdirectContextCreate(glxScreen, config, shareCtx);
          +        err = BadAlloc;
          +    }
          +    else {
          +        ctx = glxScreen->createContext(glxScreen, config, shareCtx,
          +                                       req->numAttribs, (uint32_t *) attribs,
          +                                       &err);
          +    }
          +
          +    if (ctx == NULL)
          +        return err;
          +
          +    ctx->pGlxScreen = glxScreen;
          +    ctx->config = config;
          +    ctx->id = req->context;
          +    ctx->share_id = req->shareList;
          +    ctx->idExists = True;
          +    ctx->isCurrent = False;
          +    ctx->isDirect = req->isDirect;
          +    ctx->hasUnflushedCommands = False;
          +    ctx->renderMode = GL_RENDER;
          +    ctx->feedbackBuf = NULL;
          +    ctx->feedbackBufSize = 0;
          +    ctx->selectBuf = NULL;
          +    ctx->selectBufSize = 0;
          +    ctx->drawPriv = NULL;
          +    ctx->readPriv = NULL;
          +
          +    /* Add the new context to the various global tables of GLX contexts.
          +     */
          +    if (!__glXAddContext(ctx)) {
          +        (*ctx->destroy) (ctx);
          +        client->errorValue = req->context;
          +        return BadAlloc;
          +    }
          +
          +    return Success;
           }
           
           int
          diff --git a/xorg-server/glx/extension_string.c b/xorg-server/glx/extension_string.c
          index 866f8bf45..6a1a6c6b2 100644
          --- a/xorg-server/glx/extension_string.c
          +++ b/xorg-server/glx/extension_string.c
          @@ -67,23 +67,27 @@ struct extension_info {
           
           static const struct extension_info known_glx_extensions[] = {
           /*   GLX_ARB_get_proc_address is implemented on the client. */
          -    {GLX(ARB_multisample), VER(1, 4), Y,},
          -
          -    {GLX(EXT_import_context), VER(0, 0), Y,},
          -    {GLX(EXT_texture_from_pixmap), VER(0, 0), Y,},
          -    {GLX(EXT_visual_info), VER(0, 0), Y,},
          -    {GLX(EXT_visual_rating), VER(0, 0), Y,},
          -
          -    {GLX(MESA_copy_sub_buffer), VER(0, 0), N,},
          -    {GLX(OML_swap_method), VER(0, 0), Y,},
          -    {GLX(SGI_make_current_read), VER(1, 3), N,},
          -    {GLX(SGI_swap_control), VER(0, 0), N,},
          -    {GLX(SGIS_multisample), VER(0, 0), Y,},
          -    {GLX(SGIX_fbconfig), VER(1, 3), Y,},
          -    {GLX(SGIX_pbuffer), VER(1, 3), Y,},
          -    {GLX(SGIX_visual_select_group), VER(0, 0), Y,},
          -    {GLX(INTEL_swap_event), VER(1, 4), N,},
          -    {NULL}
          +    /* *INDENT-OFF* */
          +    { GLX(ARB_create_context),          VER(0,0), N, },
          +    { GLX(ARB_create_context_profile),  VER(0,0), N, },
          +    { GLX(ARB_multisample),             VER(1,4), Y, },
          +
          +    { GLX(EXT_import_context),          VER(0,0), Y, },
          +    { GLX(EXT_texture_from_pixmap),     VER(0,0), Y, },
          +    { GLX(EXT_visual_info),             VER(0,0), Y, },
          +    { GLX(EXT_visual_rating),           VER(0,0), Y, },
          +
          +    { GLX(MESA_copy_sub_buffer),        VER(0,0), N, },
          +    { GLX(OML_swap_method),             VER(0,0), Y, },
          +    { GLX(SGI_make_current_read),       VER(1,3), N, },
          +    { GLX(SGI_swap_control),            VER(0,0), N, },
          +    { GLX(SGIS_multisample),            VER(0,0), Y, },
          +    { GLX(SGIX_fbconfig),               VER(1,3), Y, },
          +    { GLX(SGIX_pbuffer),                VER(1,3), Y, },
          +    { GLX(SGIX_visual_select_group),    VER(0,0), Y, },
          +    { GLX(INTEL_swap_event),            VER(1,4), N, },
          +    { NULL }
          +    /* *INDENT-ON* */
           };
           
           /**
          diff --git a/xorg-server/glx/extension_string.h b/xorg-server/glx/extension_string.h
          index e02213f8f..947bf89e6 100644
          --- a/xorg-server/glx/extension_string.h
          +++ b/xorg-server/glx/extension_string.h
          @@ -36,7 +36,9 @@
           
           enum {
           /*   GLX_ARB_get_proc_address is implemented on the client. */
          -    ARB_multisample_bit = 0,
          +    ARB_create_context_bit = 0,
          +    ARB_create_context_profile_bit,
          +    ARB_multisample_bit,
               EXT_import_context_bit,
               EXT_texture_from_pixmap_bit,
               EXT_visual_info_bit,
          diff --git a/xorg-server/glx/glxcmds.c b/xorg-server/glx/glxcmds.c
          index 24fed8f63..d483bbf8a 100644
          --- a/xorg-server/glx/glxcmds.c
          +++ b/xorg-server/glx/glxcmds.c
          @@ -50,7 +50,7 @@
           #include "indirect_table.h"
           #include "indirect_util.h"
           
          -static int
          +_X_HIDDEN int
           validGlxScreen(ClientPtr client, int screen, __GLXscreen ** pGlxScreen,
                          int *err)
           {
          @@ -67,7 +67,7 @@ validGlxScreen(ClientPtr client, int screen, __GLXscreen ** pGlxScreen,
               return TRUE;
           }
           
          -static int
          +_X_HIDDEN int
           validGlxFBConfig(ClientPtr client, __GLXscreen * pGlxScreen, XID id,
                            __GLXconfig ** config, int *err)
           {
          @@ -131,7 +131,7 @@ validGlxFBConfigForWindow(ClientPtr client, __GLXconfig * config,
               return TRUE;
           }
           
          -static int
          +_X_HIDDEN int
           validGlxContext(ClientPtr client, XID id, int access_mode,
                           __GLXcontext ** context, int *err)
           {
          @@ -200,7 +200,7 @@ __glXdirectContextDestroy(__GLXcontext * context)
               free(context);
           }
           
          -static __GLXcontext *
          +_X_HIDDEN __GLXcontext *
           __glXdirectContextCreate(__GLXscreen * screen,
                                    __GLXconfig * modes, __GLXcontext * shareContext)
           {
          @@ -251,20 +251,20 @@ DoCreateContext(__GLXclientState * cl, GLXContextID gcId,
                                        &shareglxc, &err))
                       return err;
           
          -        if (shareglxc->isDirect) {
          -            /*
          -             ** NOTE: no support for sharing display lists between direct
          -             ** contexts, even if they are in the same address space.
          -             */
          -#if 0
          -            /* Disabling this code seems to allow shared display lists
          -             * and texture objects to work.  We'll leave it disabled for now.
          -             */
          +        /* Page 26 (page 32 of the PDF) of the GLX 1.4 spec says:
          +         *
          +         *     "The server context state for all sharing contexts must exist
          +         *     in a single address space or a BadMatch error is generated."
          +         *
          +         * If the share context is indirect, force the new context to also be
          +         * indirect.  If the shard context is direct but the new context
          +         * cannot be direct, generate BadMatch.
          +         */
          +        if (shareglxc->isDirect && !isDirect) {
                       client->errorValue = shareList;
                       return BadMatch;
          -#endif
                   }
          -        else {
          +        else if (!shareglxc->isDirect) {
                       /*
                        ** Create an indirect context regardless of what the client asked
                        ** for; this way we can share display list space with shareList.
          @@ -276,42 +276,45 @@ DoCreateContext(__GLXclientState * cl, GLXContextID gcId,
               /*
                ** Allocate memory for the new context
                */
          -    if (!isDirect)
          -        glxc = pGlxScreen->createContext(pGlxScreen, config, shareglxc);
          +    if (!isDirect) {
          +        /* Without any attributes, the only error that the driver should be
          +         * able to generate is BadAlloc.  As result, just drop the error
          +         * returned from the driver on the floor.
          +         */
          +        glxc = pGlxScreen->createContext(pGlxScreen, config, shareglxc,
          +                                         0, NULL, &err);
          +    }
               else
                   glxc = __glXdirectContextCreate(pGlxScreen, config, shareglxc);
               if (!glxc) {
                   return BadAlloc;
               }
           
          -    /*
          -     ** Initially, setup the part of the context that could be used by
          -     ** a GL core that needs windowing information (e.g., Mesa).
          +    /* Initialize the GLXcontext structure.
                */
               glxc->pGlxScreen = pGlxScreen;
               glxc->config = config;
          -
          -    /*
          -     ** Register this context as a resource.
          -     */
          -    if (!AddResource(gcId, __glXContextRes, (pointer) glxc)) {
          -        (*glxc->destroy) (glxc);
          -        client->errorValue = gcId;
          -        return BadAlloc;
          -    }
          -
          -    /*
          -     ** Finally, now that everything is working, setup the rest of the
          -     ** context.
          -     */
               glxc->id = gcId;
               glxc->share_id = shareList;
               glxc->idExists = GL_TRUE;
               glxc->isCurrent = GL_FALSE;
               glxc->isDirect = isDirect;
          +    glxc->hasUnflushedCommands = GL_FALSE;
               glxc->renderMode = GL_RENDER;
          -
          -    __glXAddToContextList(glxc);
          +    glxc->feedbackBuf = NULL;
          +    glxc->feedbackBufSize = 0;
          +    glxc->selectBuf = NULL;
          +    glxc->selectBufSize = 0;
          +    glxc->drawPriv = NULL;
          +    glxc->readPriv = NULL;
          +
          +    /* Add the new context to the various global tables of GLX contexts.
          +     */
          +    if (!__glXAddContext(glxc)) {
          +        (*glxc->destroy) (glxc);
          +        client->errorValue = gcId;
          +        return BadAlloc;
          +    }
           
               return Success;
           }
          @@ -2396,8 +2399,6 @@ __glXDisp_ClientInfo(__GLXclientState * cl, GLbyte * pc)
               if (!memchr(buf, 0, (client->req_len << 2) - sizeof(xGLXClientInfoReq)))
                   return BadLength;
           
          -    cl->GLClientmajorVersion = req->major;
          -    cl->GLClientminorVersion = req->minor;
               free(cl->GLClientextensions);
               cl->GLClientextensions = strdup(buf);
           
          diff --git a/xorg-server/glx/glxcontext.h b/xorg-server/glx/glxcontext.h
          index ef2c4dbd5..b803a7fd1 100644
          --- a/xorg-server/glx/glxcontext.h
          +++ b/xorg-server/glx/glxcontext.h
          @@ -121,4 +121,17 @@ struct __GLXcontext {
           
           void __glXContextDestroy(__GLXcontext * context);
           
          +extern int validGlxScreen(ClientPtr client, int screen,
          +                          __GLXscreen ** pGlxScreen, int *err);
          +
          +extern int validGlxFBConfig(ClientPtr client, __GLXscreen * pGlxScreen,
          +                            XID id, __GLXconfig ** config, int *err);
          +
          +extern int validGlxContext(ClientPtr client, XID id, int access_mode,
          +                           __GLXcontext ** context, int *err);
          +
          +extern __GLXcontext *__glXdirectContextCreate(__GLXscreen * screen,
          +                                              __GLXconfig * modes,
          +                                              __GLXcontext * shareContext);
          +
           #endif                          /* !__GLX_context_h__ */
          diff --git a/xorg-server/glx/glxdri.c b/xorg-server/glx/glxdri.c
          index f3690c859..a5d87ecac 100644
          --- a/xorg-server/glx/glxdri.c
          +++ b/xorg-server/glx/glxdri.c
          @@ -599,7 +599,10 @@ __glXDRIscreenDestroy(__GLXscreen * baseScreen)
           static __GLXcontext *
           __glXDRIscreenCreateContext(__GLXscreen * baseScreen,
                                       __GLXconfig * glxConfig,
          -                            __GLXcontext * baseShareContext)
          +                            __GLXcontext * baseShareContext,
          +                            unsigned num_attribs,
          +                            const uint32_t *attribs,
          +                            int *error)
           {
               __GLXDRIscreen *screen = (__GLXDRIscreen *) baseScreen;
               __GLXDRIcontext *context, *shareContext;
          @@ -611,6 +614,13 @@ __glXDRIscreenCreateContext(__GLXscreen * baseScreen,
               drm_context_t hwContext;
               ScreenPtr pScreen = baseScreen->pScreen;
           
          +    /* DRI1 cannot support createContextAttribs, so these parameters will
          +     * never be used.
          +     */
          +    (void) num_attribs;
          +    (void) attribs;
          +    (void) error;
          +
               shareContext = (__GLXDRIcontext *) baseShareContext;
               if (shareContext)
                   driShare = shareContext->driContext;
          diff --git a/xorg-server/glx/glxdri2.c b/xorg-server/glx/glxdri2.c
          index 6614666ca..7b76c3a5f 100644
          --- a/xorg-server/glx/glxdri2.c
          +++ b/xorg-server/glx/glxdri2.c
          @@ -47,6 +47,7 @@
           #include "glxserver.h"
           #include "glxutil.h"
           #include "glxdricommon.h"
          +#include 
           
           #include "glapitable.h"
           #include "glapi.h"
          @@ -377,10 +378,150 @@ __glXDRIscreenDestroy(__GLXscreen * baseScreen)
               free(screen);
           }
           
          +static Bool
          +dri2_convert_glx_attribs(unsigned num_attribs, const uint32_t *attribs,
          +                         unsigned *major_ver, unsigned *minor_ver,
          +                         uint32_t *flags, unsigned *error)
          +{
          +    unsigned i;
          +
          +    if (num_attribs == 0)
          +        return True;
          +
          +    if (attribs == NULL) {
          +        *error = BadImplementation;
          +        return False;
          +    }
          +
          +    *major_ver = 1;
          +    *minor_ver = 0;
          +
          +    for (i = 0; i < num_attribs; i++) {
          +        switch (attribs[i * 2]) {
          +        case GLX_CONTEXT_MAJOR_VERSION_ARB:
          +            *major_ver = attribs[i * 2 + 1];
          +            break;
          +        case GLX_CONTEXT_MINOR_VERSION_ARB:
          +            *minor_ver = attribs[i * 2 + 1];
          +            break;
          +        case GLX_CONTEXT_FLAGS_ARB:
          +            *flags = attribs[i * 2 + 1];
          +            break;
          +        case GLX_RENDER_TYPE:
          +            break;
          +        default:
          +            /* If an unknown attribute is received, fail.
          +             */
          +            *error = BadValue;
          +            return False;
          +        }
          +    }
          +
          +    /* Unknown flag value.
          +     */
          +    if (*flags & ~(__DRI_CTX_FLAG_DEBUG | __DRI_CTX_FLAG_FORWARD_COMPATIBLE)) {
          +        *error = BadValue;
          +        return False;
          +    }
          +
          +    *error = Success;
          +    return True;
          +}
          +
          +static void
          +create_driver_context(__GLXDRIcontext * context,
          +                      __GLXDRIscreen * screen,
          +                      __GLXDRIconfig * config,
          +                      __DRIcontext * driShare,
          +                      unsigned num_attribs,
          +                      const uint32_t *attribs,
          +                      int *error)
          +{
          +    context->driContext = NULL;
          +
          +#if __DRI_DRI2_VERSION >= 3
          +    if (screen->dri2->base.version >= 3) {
          +        uint32_t ctx_attribs[3 * 2];
          +        unsigned num_ctx_attribs = 0;
          +        unsigned dri_err = 0;
          +        unsigned major_ver;
          +        unsigned minor_ver;
          +        uint32_t flags;
          +
          +        if (num_attribs != 0) {
          +            if (!dri2_convert_glx_attribs(num_attribs, attribs,
          +                                          &major_ver, &minor_ver,
          +                                          &flags, (unsigned *) error))
          +                return NULL;
          +
          +            ctx_attribs[num_ctx_attribs++] = __DRI_CTX_ATTRIB_MAJOR_VERSION;
          +            ctx_attribs[num_ctx_attribs++] = major_ver;
          +            ctx_attribs[num_ctx_attribs++] = __DRI_CTX_ATTRIB_MINOR_VERSION;
          +            ctx_attribs[num_ctx_attribs++] = minor_ver;
          +
          +            if (flags != 0) {
          +                ctx_attribs[num_ctx_attribs++] = __DRI_CTX_ATTRIB_FLAGS;
          +
          +                /* The current __DRI_CTX_FLAG_* values are identical to the
          +                 * GLX_CONTEXT_*_BIT values.
          +                 */
          +                ctx_attribs[num_ctx_attribs++] = flags;
          +            }
          +        }
          +
          +        context->driContext =
          +            (*screen->dri2->createContextAttribs)(screen->driScreen,
          +                                                  __DRI_API_OPENGL,
          +                                                  config->driConfig,
          +                                                  driShare,
          +                                                  num_ctx_attribs / 2,
          +                                                  ctx_attribs,
          +                                                  &dri_err,
          +                                                  context);
          +
          +        switch (dri_err) {
          +        case __DRI_CTX_ERROR_SUCCESS:
          +            *error = Success;
          +            break;
          +        case __DRI_CTX_ERROR_NO_MEMORY:
          +            *error = BadAlloc;
          +            break;
          +        case __DRI_CTX_ERROR_BAD_API:
          +            *error = __glXError(GLXBadProfileARB);
          +            break;
          +        case __DRI_CTX_ERROR_BAD_VERSION:
          +        case __DRI_CTX_ERROR_BAD_FLAG:
          +            *error = __glXError(GLXBadFBConfig);
          +            break;
          +        case __DRI_CTX_ERROR_UNKNOWN_ATTRIBUTE:
          +        case __DRI_CTX_ERROR_UNKNOWN_FLAG:
          +        default:
          +            *error = BadValue;
          +            break;
          +        }
          +
          +        return;
          +    }
          +#endif
          +
          +    if (num_attribs != 0) {
          +        *error = BadValue;
          +        return;
          +    }
          +
          +    context->driContext =
          +        (*screen->dri2->createNewContext) (screen->driScreen,
          +                                           config->driConfig,
          +                                           driShare, context);
          +}
          +
           static __GLXcontext *
           __glXDRIscreenCreateContext(__GLXscreen * baseScreen,
                                       __GLXconfig * glxConfig,
          -                            __GLXcontext * baseShareContext)
          +                            __GLXcontext * baseShareContext,
          +                            unsigned num_attribs,
          +                            const uint32_t *attribs,
          +                            int *error)
           {
               __GLXDRIscreen *screen = (__GLXDRIscreen *) baseScreen;
               __GLXDRIcontext *context, *shareContext;
          @@ -394,8 +535,10 @@ __glXDRIscreenCreateContext(__GLXscreen * baseScreen,
                   driShare = NULL;
           
               context = calloc(1, sizeof *context);
          -    if (context == NULL)
          +    if (context == NULL) {
          +        *error = BadAlloc;
                   return NULL;
          +    }
           
               context->base.destroy = __glXDRIcontextDestroy;
               context->base.makeCurrent = __glXDRIcontextMakeCurrent;
          @@ -404,10 +547,8 @@ __glXDRIscreenCreateContext(__GLXscreen * baseScreen,
               context->base.textureFromPixmap = &__glXDRItextureFromPixmap;
               context->base.wait = __glXDRIcontextWait;
           
          -    context->driContext =
          -        (*screen->dri2->createNewContext) (screen->driScreen,
          -                                           config->driConfig,
          -                                           driShare, context);
          +    create_driver_context(context, screen, config, driShare, num_attribs,
          +                          attribs, error);
               if (context->driContext == NULL) {
                   free(context);
                   return NULL;
          @@ -641,6 +782,14 @@ initializeExtensions(__GLXDRIscreen * screen)
               __glXEnableExtension(screen->glx_enable_bits, "GLX_INTEL_swap_event");
               LogMessage(X_INFO, "AIGLX: enabled GLX_INTEL_swap_event\n");
           
          +#if __DRI_DRI2_VERSION >= 3
          +    if (screen->dri2->base.version >= 3) {
          +        __glXEnableExtension(screen->glx_enable_bits,
          +                             "GLX_ARB_create_context");
          +        LogMessage(X_INFO, "AIGLX: enabled GLX_ARB_create_context\n");
          +    }
          +#endif
          +
               if (DRI2HasSwapControl(pScreen)) {
                   __glXEnableExtension(screen->glx_enable_bits, "GLX_SGI_swap_control");
                   __glXEnableExtension(screen->glx_enable_bits, "GLX_MESA_swap_control");
          diff --git a/xorg-server/glx/glxdriswrast.c b/xorg-server/glx/glxdriswrast.c
          index c69b4d258..b47839868 100644
          --- a/xorg-server/glx/glxdriswrast.c
          +++ b/xorg-server/glx/glxdriswrast.c
          @@ -257,7 +257,10 @@ __glXDRIscreenDestroy(__GLXscreen * baseScreen)
           static __GLXcontext *
           __glXDRIscreenCreateContext(__GLXscreen * baseScreen,
                                       __GLXconfig * glxConfig,
          -                            __GLXcontext * baseShareContext)
          +                            __GLXcontext * baseShareContext,
          +                            unsigned num_attribs,
          +                            const uint32_t *attribs,
          +                            int *error)
           {
               __GLXDRIscreen *screen = (__GLXDRIscreen *) baseScreen;
               __GLXDRIcontext *context, *shareContext;
          @@ -265,6 +268,13 @@ __glXDRIscreenCreateContext(__GLXscreen * baseScreen,
               const __DRIcoreExtension *core = screen->core;
               __DRIcontext *driShare;
           
          +    /* DRISWRAST won't support createContextAttribs, so these parameters will
          +     * never be used.
          +     */
          +    (void) num_attribs;
          +    (void) attribs;
          +    (void) error;
          +
               shareContext = (__GLXDRIcontext *) baseShareContext;
               if (shareContext)
                   driShare = shareContext->driContext;
          diff --git a/xorg-server/glx/glxext.c b/xorg-server/glx/glxext.c
          index acd696ef0..8d168d8a3 100644
          --- a/xorg-server/glx/glxext.c
          +++ b/xorg-server/glx/glxext.c
          @@ -157,11 +157,18 @@ DrawableGone(__GLXdrawable * glxPriv, XID xid)
               return True;
           }
           
          -void
          -__glXAddToContextList(__GLXcontext * cx)
          +Bool
          +__glXAddContext(__GLXcontext * cx)
           {
          +    /* Register this context as a resource.
          +     */
          +    if (!AddResource(cx->id, __glXContextRes, (pointer)cx)) {
          +	return False;
          +    }
          +
               cx->next = glxAllContexts;
               glxAllContexts = cx;
          +    return True;
           }
           
           static void
          @@ -281,8 +288,6 @@ glxClientCallback(CallbackListPtr *list, pointer closure, pointer data)
                    ** By default, assume that the client supports
                    ** GLX major version 1 minor version 0 protocol.
                    */
          -        cl->GLClientmajorVersion = 1;
          -        cl->GLClientminorVersion = 0;
                   cl->client = pClient;
                   break;
           
          diff --git a/xorg-server/glx/glxext.h b/xorg-server/glx/glxext.h
          index 7cd5cb49f..9b0978b93 100644
          --- a/xorg-server/glx/glxext.h
          +++ b/xorg-server/glx/glxext.h
          @@ -38,7 +38,7 @@
           extern GLboolean __glXFreeContext(__GLXcontext * glxc);
           extern void __glXFlushContextCache(void);
           
          -extern void __glXAddToContextList(__GLXcontext * cx);
          +extern Bool __glXAddContext(__GLXcontext * cx);
           extern void __glXErrorCallBack(GLenum code);
           extern void __glXClearErrorOccured(void);
           extern GLboolean __glXErrorOccured(void);
          diff --git a/xorg-server/glx/glxscreens.h b/xorg-server/glx/glxscreens.h
          index 172268b29..b29df58a5 100644
          --- a/xorg-server/glx/glxscreens.h
          +++ b/xorg-server/glx/glxscreens.h
          @@ -117,7 +117,10 @@ struct __GLXscreen {
           
               __GLXcontext *(*createContext) (__GLXscreen * screen,
                                               __GLXconfig * modes,
          -                                    __GLXcontext * shareContext);
          +                                    __GLXcontext * shareContext,
          +                                    unsigned num_attribs,
          +                                    const uint32_t *attribs,
          +                                    int *error);
           
               __GLXdrawable *(*createDrawable) (ClientPtr client,
                                                 __GLXscreen * context,
          diff --git a/xorg-server/glx/glxserver.h b/xorg-server/glx/glxserver.h
          index 707684842..87c94d9ec 100644
          --- a/xorg-server/glx/glxserver.h
          +++ b/xorg-server/glx/glxserver.h
          @@ -145,8 +145,6 @@ struct __GLXclientStateRec {
               /* Back pointer to X client record */
               ClientPtr client;
           
          -    int GLClientmajorVersion;
          -    int GLClientminorVersion;
               char *GLClientextensions;
           };
           
          diff --git a/xorg-server/hw/dmx/dmx.c b/xorg-server/hw/dmx/dmx.c
          index add0e5390..a226c5db1 100644
          --- a/xorg-server/hw/dmx/dmx.c
          +++ b/xorg-server/hw/dmx/dmx.c
          @@ -74,8 +74,9 @@ _DMXXineramaActive(void)
           {
           #ifdef PANORAMIX
               return !noPanoramiXExtension;
          -#endif
          +#else
               return 0;
          +#endif
           }
           
           static void
          diff --git a/xorg-server/hw/xfree86/common/compiler.h b/xorg-server/hw/xfree86/common/compiler.h
          index 0abdfb6c3..c980beeb9 100644
          --- a/xorg-server/hw/xfree86/common/compiler.h
          +++ b/xorg-server/hw/xfree86/common/compiler.h
          @@ -119,6 +119,23 @@ extern _X_EXPORT unsigned int inb(unsigned long);
           extern _X_EXPORT unsigned int inw(unsigned long);
           extern _X_EXPORT unsigned int inl(unsigned long);
           
          +#ifdef __SUNPRO_C
          +extern _X_EXPORT unsigned char  xf86ReadMmio8    (void *, unsigned long);
          +extern _X_EXPORT unsigned short xf86ReadMmio16Be (void *, unsigned long);
          +extern _X_EXPORT unsigned short xf86ReadMmio16Le (void *, unsigned long);
          +extern _X_EXPORT unsigned int   xf86ReadMmio32Be (void *, unsigned long);
          +extern _X_EXPORT unsigned int   xf86ReadMmio32Le (void *, unsigned long);
          +extern _X_EXPORT void xf86WriteMmio8    (void *, unsigned long, unsigned int);
          +extern _X_EXPORT void xf86WriteMmio16Be (void *, unsigned long, unsigned int);
          +extern _X_EXPORT void xf86WriteMmio16Le (void *, unsigned long, unsigned int);
          +extern _X_EXPORT void xf86WriteMmio32Be (void *, unsigned long, unsigned int);
          +extern _X_EXPORT void xf86WriteMmio32Le (void *, unsigned long, unsigned int);
          +extern _X_EXPORT void xf86WriteMmio8NB    (void *, unsigned long, unsigned int);
          +extern _X_EXPORT void xf86WriteMmio16BeNB (void *, unsigned long, unsigned int);
          +extern _X_EXPORT void xf86WriteMmio16LeNB (void *, unsigned long, unsigned int);
          +extern _X_EXPORT void xf86WriteMmio32BeNB (void *, unsigned long, unsigned int);
          +extern _X_EXPORT void xf86WriteMmio32LeNB (void *, unsigned long, unsigned int);
          +#endif                          /* _SUNPRO_C */
           #endif                          /* __sparc__,  __arm32__, __alpha__, __nds32__ */
           #endif                          /* __arm__ */
           
          diff --git a/xorg-server/hw/xfree86/fbdevhw/fbdevhwstub.c b/xorg-server/hw/xfree86/fbdevhw/fbdevhwstub.c
          index b7b4d2e7d..7d554e60a 100644
          --- a/xorg-server/hw/xfree86/fbdevhw/fbdevhwstub.c
          +++ b/xorg-server/hw/xfree86/fbdevhw/fbdevhwstub.c
          @@ -143,7 +143,7 @@ fbdevHWSwitchMode(ScrnInfoPtr pScrn, DisplayModePtr mode)
           }
           
           void
          -fbdevHWAdjustFrame(ScrnInfoPtr pScrn, int x, int y, int flags)
          +fbdevHWAdjustFrame(ScrnInfoPtr pScrn, int x, int y)
           {
           }
           
          diff --git a/xorg-server/hw/xfree86/int10/generic.c b/xorg-server/hw/xfree86/int10/generic.c
          index 5343e47e3..4633120fd 100644
          --- a/xorg-server/hw/xfree86/int10/generic.c
          +++ b/xorg-server/hw/xfree86/int10/generic.c
          @@ -179,7 +179,7 @@ xf86ExtendedInitInt10(int entityIndex, int Flags)
               vbiosMem = (char *) base + V_BIOS;
               memset(vbiosMem, 0, 2 * V_BIOS_SIZE);
               if (pci_device_read_rom(pInt->dev, vbiosMem) < V_BIOS_SIZE) {
          -        xf86DrvMsg(screen, X_WARNING,
          +        xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
                              "Unable to retrieve all of segment 0x0C0000.\n");
               }
           
          @@ -194,10 +194,10 @@ xf86ExtendedInitInt10(int entityIndex, int Flags)
                   vbiosMem = (unsigned char *) base + bios_location;
           
                   if (xf86IsEntityPrimary(entityIndex)) {
          -            if (int10_check_bios(screen, bios_location >> 4, vbiosMem))
          +            if (int10_check_bios(pScrn->scrnIndex, bios_location >> 4, vbiosMem))
                           done = TRUE;
                       else
          -                xf86DrvMsg(screen, X_INFO,
          +                xf86DrvMsg(pScrn->scrnIndex, X_INFO,
                                      "No legacy BIOS found -- trying PCI\n");
                   }
                   if (!done) {
          @@ -207,7 +207,7 @@ xf86ExtendedInitInt10(int entityIndex, int Flags)
           
                       err = pci_device_read_rom(rom_device, vbiosMem);
                       if (err) {
          -                xf86DrvMsg(screen, X_ERROR, "Cannot read V_BIOS (5) %s\n",
          +                xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Cannot read V_BIOS (5) %s\n",
                                      strerror(err));
                           goto error1;
                       }
          diff --git a/xorg-server/include/dix.h b/xorg-server/include/dix.h
          index 5dc2ac568..3d8b0e575 100644
          --- a/xorg-server/include/dix.h
          +++ b/xorg-server/include/dix.h
          @@ -395,6 +395,8 @@ DeliverTouchEvents(DeviceIntPtr /* dev */ ,
           extern void
           InitializeSprite(DeviceIntPtr /* pDev */ ,
                            WindowPtr /* pWin */ );
          +extern void
          +FreeSprite(DeviceIntPtr pDev);
           
           extern void
           UpdateSpriteForScreen(DeviceIntPtr /* pDev */ ,
          diff --git a/xorg-server/include/input.h b/xorg-server/include/input.h
          index bcf98a63e..5747f3cd2 100644
          --- a/xorg-server/include/input.h
          +++ b/xorg-server/include/input.h
          @@ -264,7 +264,7 @@ extern _X_EXPORT Bool ActivateDevice(DeviceIntPtr /*device */ ,
           
           extern _X_EXPORT Bool DisableDevice(DeviceIntPtr /*device */ ,
                                               BOOL /* sendevent */ );
          -
          +extern void DisableAllDevices(void);
           extern int InitAndStartDevices(void);
           
           extern void CloseDownDevices(void);
          diff --git a/xorg-server/include/misc.h b/xorg-server/include/misc.h
          index 41c13332a..fea74b86c 100644
          --- a/xorg-server/include/misc.h
          +++ b/xorg-server/include/misc.h
          @@ -381,4 +381,16 @@ extern _X_EXPORT unsigned long serverGeneration;
           
           #define BUG_WARN(cond)  __BUG_WARN_MSG(cond, 0, NULL)
           
          +#define BUG_RETURN(cond) \
          +        do { if (cond) { __BUG_WARN_MSG(cond, 0, NULL); return; } } while(0)
          +
          +#define BUG_RETURN_MSG(cond, ...) \
          +        do { if (cond) { __BUG_WARN_MSG(cond, 1, __VA_ARGS__); return; } } while(0)
          +
          +#define BUG_RETURN_VAL(cond, val) \
          +        do { if (cond) { __BUG_WARN_MSG(cond, 0, NULL); return (val); } } while(0)
          +
          +#define BUG_RETURN_VAL_MSG(cond, val, ...) \
          +        do { if (cond) { __BUG_WARN_MSG(cond, 1, __VA_ARGS__); return (val); } } while(0)
          +
           #endif                          /* MISC_H */
          diff --git a/xorg-server/test/touch.c b/xorg-server/test/touch.c
          index 2ec535b43..df1db11de 100644
          --- a/xorg-server/test/touch.c
          +++ b/xorg-server/test/touch.c
          @@ -40,6 +40,7 @@ touch_grow_queue(void)
               int i;
           
               memset(&dev, 0, sizeof(dev));
          +    dev.name = "test device";
               dev.id = 2;
               dev.valuator = &val;
               val.numAxes = 5;
          @@ -94,6 +95,7 @@ touch_find_ddxid(void)
               int i;
           
               memset(&dev, 0, sizeof(dev));
          +    dev.name = "test device";
               dev.id = 2;
               dev.valuator = &val;
               val.numAxes = 5;
          @@ -162,6 +164,7 @@ touch_begin_ddxtouch(void)
               int size = 5;
           
               memset(&dev, 0, sizeof(dev));
          +    dev.name = "test device";
               dev.id = 2;
               dev.valuator = &val;
               val.numAxes = 5;
          @@ -209,6 +212,7 @@ touch_begin_touch(void)
               screenInfo.screens[0] = &screen;
           
               memset(&dev, 0, sizeof(dev));
          +    dev.name = "test device";
               dev.id = 2;
           
               memset(&sprite, 0, sizeof(sprite));
          @@ -247,6 +251,7 @@ touch_init(void)
               screenInfo.screens[0] = &screen;
           
               memset(&dev, 0, sizeof(dev));
          +    dev.name = "test device";
           
               memset(&sprite, 0, sizeof(sprite));
               dev.spriteInfo = &sprite;
          diff --git a/xorg-server/xkb/xkbAccessX.c b/xorg-server/xkb/xkbAccessX.c
          index 95e28e789..fe28e12d7 100644
          --- a/xorg-server/xkb/xkbAccessX.c
          +++ b/xorg-server/xkb/xkbAccessX.c
          @@ -295,10 +295,15 @@ AccessXKRGExpire(OsTimerPtr timer, CARD32 now, pointer arg)
               cn.eventType = 0;
               cn.requestMajor = 0;
               cn.requestMinor = 0;
          -    if (xkbi->desc->ctrls->enabled_ctrls & XkbSlowKeysMask)
          +    if (xkbi->desc->ctrls->enabled_ctrls & XkbSlowKeysMask) {
                   AccessXKRGTurnOff((DeviceIntPtr) arg, &cn);
          -    else
          +        LogMessage(X_INFO, "XKB SlowKeys are disabled.\n");
          +    }
          +    else {
                   AccessXKRGTurnOn((DeviceIntPtr) arg, XkbSlowKeysMask, &cn);
          +        LogMessage(X_INFO, "XKB SlowKeys are now enabled. Hold shift to disable.\n");
          +    }
          +
               return 0;
           }
           
          -- 
          cgit v1.2.3