Merge commit 'origin/master' into gallium-0.2
authorAlan Hourihane <alanh@vmware.com>
Thu, 22 Jan 2009 09:43:42 +0000 (09:43 +0000)
committerAlan Hourihane <alanh@vmware.com>
Thu, 22 Jan 2009 09:43:42 +0000 (09:43 +0000)
Conflicts:
windows/VC8/mesa/osmesa/osmesa.vcproj
windows/VC8/progs/demos/gears.vcproj
windows/VC8/progs/progs.sln

1  2 
Makefile
progs/tests/Makefile
src/mesa/drivers/dri/common/dri_util.h
src/mesa/main/enable.c
src/mesa/main/texformat.c
src/mesa/main/texformat.h
src/mesa/main/texformat_tmp.h
src/mesa/main/texstore.c
src/mesa/main/texstore.h

diff --combined Makefile
index 9d839595790f7db1a551cff0bcf02fea944106d3,ebc52546deb0d0ced42165d0c72f9e3f8b311f89..c1581a0bd29faf3586be6b265f10fc4f08003a21
+++ b/Makefile
@@@ -12,8 -12,6 +12,8 @@@ default: $(TOP)/configs/curren
                fi \
        done
  
 +all: default
 +
  
  doxygen:
        cd doxygen && $(MAKE)
@@@ -37,6 -35,7 +37,6 @@@ realclean: clea
          -name depend -o -name depend.bak ')' -exec rm -f '{}' ';'
  
  
 -
  install:
        @for dir in $(SUBDIRS) ; do \
                if [ -d $$dir ] ; then \
@@@ -108,8 -107,6 +108,8 @@@ irix6-o32-static 
  linux \
  linux-alpha \
  linux-alpha-static \
 +linux-cell \
 +linux-cell-debug \
  linux-debug \
  linux-directfb \
  linux-dri \
@@@ -118,7 -115,6 +118,7 @@@ linux-dri-x86 
  linux-dri-x86-64 \
  linux-dri-ppc \
  linux-dri-xcb \
 +linux-egl \
  linux-indirect \
  linux-fbdev \
  linux-glide \
@@@ -126,14 -122,12 +126,14 @@@ linux-ia64-icc 
  linux-ia64-icc-static \
  linux-icc \
  linux-icc-static \
 +linux-llvm \
  linux-osmesa \
  linux-osmesa16 \
  linux-osmesa16-static \
  linux-osmesa32 \
  linux-ppc \
  linux-ppc-static \
 +linux-profile \
  linux-solo \
  linux-solo-x86 \
  linux-solo-ia64 \
@@@ -147,10 -141,8 +147,10 @@@ linux-x86-debug 
  linux-x86-32 \
  linux-x86-64 \
  linux-x86-64-debug \
 +linux-x86-64-profile \
  linux-x86-64-static \
  linux-x86-glide \
 +linux-x86-profile \
  linux-x86-static \
  netbsd \
  openbsd \
@@@ -182,10 -174,10 +182,10 @@@ ultrix-gcc
  
  # Rules for making release tarballs
  
- DIRECTORY = Mesa-7.3-rc2
- LIB_NAME = MesaLib-7.3-rc2
- DEMO_NAME = MesaDemos-7.3-rc2
- GLUT_NAME = MesaGLUT-7.3-rc2
+ DIRECTORY = Mesa-7.3-rc3
+ LIB_NAME = MesaLib-7.3-rc3
+ DEMO_NAME = MesaDemos-7.3-rc3
+ GLUT_NAME = MesaGLUT-7.3-rc3
  
  MAIN_FILES = \
        $(DIRECTORY)/Makefile*                                          \
        $(DIRECTORY)/vms/analyze_map.com                                \
        $(DIRECTORY)/vms/xlib.opt                                       \
        $(DIRECTORY)/vms/xlib_share.opt                                 \
-       $(DIRECTORY)/windows/VC8/mesa/mesa.sln                          \
-       $(DIRECTORY)/windows/VC8/mesa/gdi/gdi.vcproj                    \
-       $(DIRECTORY)/windows/VC8/mesa/glu/glu.vcproj                    \
-       $(DIRECTORY)/windows/VC8/mesa/mesa/mesa.vcproj                  \
-       $(DIRECTORY)/windows/VC8/mesa/osmesa/osmesa.vcproj              \
-       $(DIRECTORY)/windows/VC8/progs/progs.sln                        \
-       $(DIRECTORY)/windows/VC8/progs/demos/gears.vcproj               \
-       $(DIRECTORY)/windows/VC8/progs/glut/glut.vcproj
+       $(DIRECTORY)/windows/VC8/
  
  
  DRI_FILES = \
diff --combined progs/tests/Makefile
index b96ad9f4b469536186803f6c26c52f2984d4b746,5f17f88d36cf94599a0616f60264db4575df1cb8..34c9ab1dcef28a3038b71a9840e2fdc408080d28
@@@ -26,12 -26,11 +26,13 @@@ SOURCES = 
        arraytexture.c \
        blendminmax.c \
        blendsquare.c \
+       blendxor.c \
        bufferobj.c \
        bug_3050.c \
        bug_3101.c \
        bug_3195.c \
 +      bug_texstore_i8.c \
 +      calibrate_rast.c \
        copypixrate.c \
        crossbar.c \
        cva.c \
@@@ -42,7 -41,6 +43,7 @@@
        fbotest1.c \
        fbotest2.c \
        fbotexture.c \
 +      fillrate.c \
        fog.c \
        fogcoord.c \
        fptest1.c \
        manytex.c \
        minmag.c \
        mipmap_limits.c \
 +      mipmap_view.c \
        multipal.c \
        no_s3tc.c \
        packedpixels.c \
        pbo.c \
        prog_parameter.c \
        projtex.c \
 +      quads.c \
        random.c \
        readrate.c \
+       rubberband.c \
        seccolor.c \
        shader_api.c \
        sharedtex.c \
        stencil_twoside.c \
        stencilwrap.c \
        stencil_wrap.c \
 +      subtex \
        subtexrate.c \
        tex1d.c \
        texcompress2.c \
@@@ -91,8 -87,6 +93,8 @@@
        vpwarpmesh.c \
        yuvrect.c \
        yuvsquare.c \
 +      zcomp.c \
 +      zdrawpix.c \
        zreaddraw.c
  
  PROGS = $(SOURCES:%.c=%)
@@@ -117,13 -111,13 +119,13 @@@ clean
  .SUFFIXES: .c
  
  .c:
 -      $(CC) $(INCLUDES) $(CFLAGS) $(LDFLAGS) $< $(LIBS) -o $@
 +      $(APP_CC) $(INCLUDES) $(CFLAGS) $(LDFLAGS) $< $(LIBS) -o $@
  
  .c.o:
 -      $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
 +      $(APP_CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
  
  .S.o:
 -      $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES)  $< -o $@
 +      $(APP_CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES)  $< -o $@
  
  # auto code generation
  getprocaddress: getprocaddress.c getproclist.h
@@@ -132,55 -126,40 +134,55 @@@ getproclist.h: $(TOP)/src/mesa/glapi/gl
        python getprocaddress.py > getproclist.h
  
  arraytexture: arraytexture.o readtex.o
 -      $(CC) $(CFLAGS) arraytexture.o readtex.o $(LIBS) -o $@
 +      $(APP_CC) $(CFLAGS) arraytexture.o readtex.o $(LIBS) -o $@
  
  arraytexture.o: arraytexture.c readtex.h
 -      $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) arraytexture.c -o $@
 +      $(APP_CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) arraytexture.c -o $@
  
  afsmultiarb: afsmultiarb.o readtex.o
 -      $(CC) $(CFLAGS) $(LDFLAGS) afsmultiarb.o readtex.o $(LIBS) -o $@
 +      $(APP_CC) $(CFLAGS) $(LDFLAGS) afsmultiarb.o readtex.o $(LIBS) -o $@
  
  afsmultiarb.o: afsmultiarb.c readtex.h
 -      $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) afsmultiarb.c -o $@
 +      $(APP_CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) afsmultiarb.c -o $@
  
  drawbuffers: drawbuffers.o
 -      $(CC) $(CFLAGS) $(LDFLAGS) drawbuffers.o $(LIBS) -o $@
 +      $(APP_CC) $(CFLAGS) $(LDFLAGS) drawbuffers.o $(LIBS) -o $@
  
  drawbuffers.o: drawbuffers.c extfuncs.h
 -      $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) drawbuffers.c -o $@
 +      $(APP_CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) drawbuffers.c -o $@
  
  texrect: texrect.o readtex.o
 -      $(CC) $(CFLAGS) $(LDFLAGS) texrect.o readtex.o $(LIBS) -o $@
 +      $(APP_CC) $(CFLAGS) $(LDFLAGS) texrect.o readtex.o $(LIBS) -o $@
  
  texrect.o: texrect.c readtex.h
 -      $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) texrect.c -o $@
 +      $(APP_CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) texrect.c -o $@
  
  bug_3195: bug_3195.o readtex.o
 -      $(CC) $(CFLAGS) $(LDFLAGS) bug_3195.o readtex.o $(LIBS) -o $@
 +      $(APP_CC) $(CFLAGS) $(LDFLAGS) bug_3195.o readtex.o $(LIBS) -o $@
  
  bug_3195.o: bug_3195.c readtex.h
 -      $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) bug_3195.c -o $@
 +      $(APP_CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) bug_3195.c -o $@
  
  invert: invert.o readtex.o
 -      $(CC) $(CFLAGS) $(LDFLAGS) invert.o readtex.o $(LIBS) -o $@
 +      $(APP_CC) $(CFLAGS) $(LDFLAGS) invert.o readtex.o $(LIBS) -o $@
  
  invert.o: invert.c readtex.h
 -      $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) invert.c -o $@
 +      $(APP_CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) invert.c -o $@
 +
 +mipmap_view: mipmap_view.o readtex.o
 +      $(APP_CC) $(CFLAGS) mipmap_view.o readtex.o $(LIBS) -o $@
 +
 +mipmap_view.o: mipmap_view.c readtex.h
 +      $(APP_CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
 +
 +
 +fillrate: fillrate.o readtex.o
 +      $(APP_CC) $(CFLAGS) fillrate.o readtex.o $(LIBS) -o $@
 +
 +fillrate.o: fillrate.c readtex.h
 +      $(APP_CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
 +
 +
  
  
  floattex: floattex.o readtex.o shaderutil.o
@@@ -191,7 -170,7 +193,7 @@@ floattex.o: floattex.c readtex.h shader
  
  
  readtex.o: readtex.c
 -      $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) readtex.c -o $@
 +      $(APP_CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) readtex.c -o $@
  
  readtex.h: $(TOP)/progs/util/readtex.h
        ln -s $(TOP)/progs/util/readtex.h .
index 0feb57b3c6e6ac6d40e070f909e04a917ca2d200,c6781f1c7ab537216b6bc66d11b9488d11cb47e5..c95a5c8299a11c672527137bea9f78b4bbea3cf6
@@@ -1,3 -1,25 +1,3 @@@
 -/* $XFree86: xc/lib/GL/dri/dri_util.h,v 1.1 2002/02/22 21:32:52 dawes Exp $ */
 -/**
 - * \file dri_util.h
 - * DRI utility functions definitions.
 - *
 - * This module acts as glue between GLX and the actual hardware driver.  A DRI
 - * driver doesn't really \e have to use any of this - it's optional.  But, some
 - * useful stuff is done here that otherwise would have to be duplicated in most
 - * drivers.
 - * 
 - * Basically, these utility functions take care of some of the dirty details of
 - * screen initialization, context creation, context binding, DRM setup, etc.
 - *
 - * These functions are compiled into each DRI driver so libGL.so knows nothing
 - * about them.
 - *
 - * \sa dri_util.c.
 - * 
 - * \author Kevin E. Martin <kevin@precisioninsight.com>
 - * \author Brian Paul <brian@precisioninsight.com>
 - */
 -
  /*
   * Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
   * All Rights Reserved.
   * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
   */
  
 +/**
 + * \file dri_util.h
 + * DRI utility functions definitions.
 + *
 + * This module acts as glue between GLX and the actual hardware driver.  A DRI
 + * driver doesn't really \e have to use any of this - it's optional.  But, some
 + * useful stuff is done here that otherwise would have to be duplicated in most
 + * drivers.
 + * 
 + * Basically, these utility functions take care of some of the dirty details of
 + * screen initialization, context creation, context binding, DRM setup, etc.
 + *
 + * These functions are compiled into each DRI driver so libGL.so knows nothing
 + * about them.
 + *
 + * \sa dri_util.c.
 + * 
 + * \author Kevin E. Martin <kevin@precisioninsight.com>
 + * \author Brian Paul <brian@precisioninsight.com>
 + */
  
  #ifndef _DRI_UTIL_H_
  #define _DRI_UTIL_H_
@@@ -106,6 -108,28 +106,28 @@@ do 
      }                                                                   \
  } while (0)
  
+ /**
+  * Same as above, but for two drawables simultaneously.
+  *
+  */
+ #define DRI_VALIDATE_TWO_DRAWABLES_INFO(psp, pdp, prp)                        \
+ do {                                                          \
+     while (*((pdp)->pStamp) != (pdp)->lastStamp ||                    \
+          *((prp)->pStamp) != (prp)->lastStamp) {                      \
+         register unsigned int hwContext = (psp)->pSAREA->lock.lock &  \
+           ~(DRM_LOCK_HELD | DRM_LOCK_CONT);                           \
+       DRM_UNLOCK((psp)->fd, &(psp)->pSAREA->lock, hwContext);         \
+                                                                       \
+       DRM_SPINLOCK(&(psp)->pSAREA->drawable_lock, (psp)->drawLockID); \
+       DRI_VALIDATE_DRAWABLE_INFO_ONCE(pdp);                           \
+       DRI_VALIDATE_DRAWABLE_INFO_ONCE(prp);                           \
+       DRM_SPINUNLOCK(&(psp)->pSAREA->drawable_lock, (psp)->drawLockID); \
+                                                                       \
+       DRM_LIGHT_LOCK((psp)->fd, &(psp)->pSAREA->lock, hwContext);     \
+     }                                                                   \
+ } while (0)
  
  /**
   * Driver callback functions.
diff --combined src/mesa/main/enable.c
index 72ed50808c58b3381618a11feb2cbf5071dd5d7e,dae576ae5ac36da2d71d4a6a6c8837909904325a..2ef4b1b207be1259d92db7dce65d27d175c747de
@@@ -341,10 -341,6 +341,6 @@@ _mesa_set_enable(GLcontext *ctx, GLenu
           ctx->Transform.CullVertexFlag = state;
           break;
        case GL_DEPTH_TEST:
-          if (state && ctx->DrawBuffer->Visual.depthBits == 0) {
-             _mesa_warning(ctx,"glEnable(GL_DEPTH_TEST) but no depth buffer");
-             return;
-          }
           if (ctx->Depth.Test == state)
              return;
           FLUSH_VERTICES(ctx, _NEW_DEPTH);
           break;
  
        /* GL_MESA_program_debug */
 +#if FEATURE_MESA_program_debug
        case GL_FRAGMENT_PROGRAM_CALLBACK_MESA:
           CHECK_EXTENSION(MESA_program_debug, cap);
           ctx->FragmentProgram.CallbackEnabled = state;
           CHECK_EXTENSION(MESA_program_debug, cap);
           ctx->VertexProgram.CallbackEnabled = state;
           break;
 +#endif
  
  #if FEATURE_ATI_fragment_shader
        case GL_FRAGMENT_SHADER_ATI:
@@@ -1416,15 -1410,12 +1412,15 @@@ _mesa_IsEnabled( GLenum cap 
           return ctx->Depth.BoundsTest;
  
        /* GL_MESA_program_debug */
 +#if FEATURE_MESA_program_debug
        case GL_FRAGMENT_PROGRAM_CALLBACK_MESA:
           CHECK_EXTENSION(MESA_program_debug);
           return ctx->FragmentProgram.CallbackEnabled;
        case GL_VERTEX_PROGRAM_CALLBACK_MESA:
           CHECK_EXTENSION(MESA_program_debug);
           return ctx->VertexProgram.CallbackEnabled;
 +#endif
 +
  #if FEATURE_ATI_fragment_shader
        case GL_FRAGMENT_SHADER_ATI:
         CHECK_EXTENSION(ATI_fragment_shader);
index 50e8d7a3b8716d8370a815c676479f452717602b,08725846c6e939710133ffb9c6ac59ccf930afaa..f49c916b33006833c7afafa30adb55b137e9dd84
@@@ -3,7 -3,6 +3,7 @@@
   * Version:  6.5.1
   *
   * Copyright (C) 1999-2006  Brian Paul   All Rights Reserved.
 + * Copyright (c) 2008 VMware, Inc.
   *
   * Permission is hereby granted, free of charge, to any person obtaining a
   * copy of this software and associated documentation files (the "Software"),
@@@ -334,30 -333,6 +334,30 @@@ const struct gl_texture_format _mesa_te
     store_texel_srgba8                 /* StoreTexel */
  };
  
 +const struct gl_texture_format _mesa_texformat_sargb8 = {
 +   MESA_FORMAT_SARGB8,                        /* MesaFormat */
 +   GL_RGBA,                           /* BaseFormat */
 +   GL_UNSIGNED_NORMALIZED_ARB,                /* DataType */
 +   8,                                 /* RedBits */
 +   8,                                 /* GreenBits */
 +   8,                                 /* BlueBits */
 +   8,                                 /* AlphaBits */
 +   0,                                 /* LuminanceBits */
 +   0,                                 /* IntensityBits */
 +   0,                                 /* IndexBits */
 +   0,                                 /* DepthBits */
 +   0,                                 /* StencilBits */
 +   4,                                 /* TexelBytes */
 +   _mesa_texstore_sargb8,             /* StoreTexImageFunc */
 +   NULL,                              /* FetchTexel1D */
 +   NULL,                              /* FetchTexel2D */
 +   NULL,                              /* FetchTexel3D */
 +   fetch_texel_1d_sargb8,             /* FetchTexel1Df */
 +   fetch_texel_2d_sargb8,             /* FetchTexel2Df */
 +   fetch_texel_3d_sargb8,             /* FetchTexel3Df */
 +   store_texel_sargb8                 /* StoreTexel */
 +};
 +
  const struct gl_texture_format _mesa_texformat_sl8 = {
     MESA_FORMAT_SL8,                   /* MesaFormat */
     GL_LUMINANCE,                      /* BaseFormat */
@@@ -896,6 -871,30 +896,30 @@@ const struct gl_texture_format _mesa_te
     store_texel_rgb565_rev             /* StoreTexel */
  };
  
+ const struct gl_texture_format _mesa_texformat_rgba4444 = {
+    MESA_FORMAT_RGBA4444,              /* MesaFormat */
+    GL_RGBA,                           /* BaseFormat */
+    GL_UNSIGNED_NORMALIZED_ARB,                /* DataType */
+    4,                                 /* RedBits */
+    4,                                 /* GreenBits */
+    4,                                 /* BlueBits */
+    4,                                 /* AlphaBits */
+    0,                                 /* LuminanceBits */
+    0,                                 /* IntensityBits */
+    0,                                 /* IndexBits */
+    0,                                 /* DepthBits */
+    0,                                 /* StencilBits */
+    2,                                 /* TexelBytes */
+    _mesa_texstore_rgba4444,           /* StoreTexImageFunc */
+    fetch_texel_1d_rgba4444,           /* FetchTexel1D */
+    fetch_texel_2d_rgba4444,           /* FetchTexel2D */
+    fetch_texel_3d_rgba4444,           /* FetchTexel3D */
+    NULL,                              /* FetchTexel1Df */
+    NULL,                              /* FetchTexel2Df */
+    NULL,                              /* FetchTexel3Df */
+    store_texel_rgba4444                       /* StoreTexel */
+ };
  const struct gl_texture_format _mesa_texformat_argb4444 = {
     MESA_FORMAT_ARGB4444,              /* MesaFormat */
     GL_RGBA,                           /* BaseFormat */
@@@ -944,6 -943,30 +968,30 @@@ const struct gl_texture_format _mesa_te
     store_texel_argb4444_rev           /* StoreTexel */
  };
  
+ const struct gl_texture_format _mesa_texformat_rgba5551 = {
+    MESA_FORMAT_RGBA5551,              /* MesaFormat */
+    GL_RGBA,                           /* BaseFormat */
+    GL_UNSIGNED_NORMALIZED_ARB,                /* DataType */
+    5,                                 /* RedBits */
+    5,                                 /* GreenBits */
+    5,                                 /* BlueBits */
+    1,                                 /* AlphaBits */
+    0,                                 /* LuminanceBits */
+    0,                                 /* IntensityBits */
+    0,                                 /* IndexBits */
+    0,                                 /* DepthBits */
+    0,                                 /* StencilBits */
+    2,                                 /* TexelBytes */
+    _mesa_texstore_rgba5551,           /* StoreTexImageFunc */
+    fetch_texel_1d_rgba5551,           /* FetchTexel1D */
+    fetch_texel_2d_rgba5551,           /* FetchTexel2D */
+    fetch_texel_3d_rgba5551,           /* FetchTexel3D */
+    NULL,                              /* FetchTexel1Df */
+    NULL,                              /* FetchTexel2Df */
+    NULL,                              /* FetchTexel3Df */
+    store_texel_rgba5551                       /* StoreTexel */
+ };
  const struct gl_texture_format _mesa_texformat_argb1555 = {
     MESA_FORMAT_ARGB1555,              /* MesaFormat */
     GL_RGBA,                           /* BaseFormat */
@@@ -1603,40 -1626,21 +1651,40 @@@ _mesa_choose_tex_format( GLcontext *ctx
           case GL_SLUMINANCE_ALPHA_EXT:
           case GL_SLUMINANCE8_ALPHA8_EXT:
              return &_mesa_texformat_sla8;
 -         /* NOTE: not supporting any compression of sRGB at this time */
 -         case GL_COMPRESSED_SRGB_EXT:
 -            return &_mesa_texformat_srgb8;
 -         case GL_COMPRESSED_SRGB_ALPHA_EXT:
 -            return &_mesa_texformat_srgba8;
           case GL_COMPRESSED_SLUMINANCE_EXT:
              return &_mesa_texformat_sl8;
           case GL_COMPRESSED_SLUMINANCE_ALPHA_EXT:
              return &_mesa_texformat_sla8;
 -         case GL_COMPRESSED_SRGB_S3TC_DXT1_EXT:
 +         case GL_COMPRESSED_SRGB_EXT:
 +#if FEATURE_texture_s3tc
 +            if (ctx->Extensions.EXT_texture_compression_s3tc)
 +               return &_mesa_texformat_srgb_dxt1;
 +#endif
              return &_mesa_texformat_srgb8;
 +         case GL_COMPRESSED_SRGB_ALPHA_EXT:
 +#if FEATURE_texture_s3tc
 +            if (ctx->Extensions.EXT_texture_compression_s3tc)
 +               return &_mesa_texformat_srgba_dxt3; /* Not srgba_dxt1, see spec */
 +#endif
 +            return &_mesa_texformat_srgba8;
 +#if FEATURE_texture_s3tc
 +         case GL_COMPRESSED_SRGB_S3TC_DXT1_EXT:
 +            if (ctx->Extensions.EXT_texture_compression_s3tc)
 +               return &_mesa_texformat_srgb_dxt1;
 +            break;
           case GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT:
 +            if (ctx->Extensions.EXT_texture_compression_s3tc)
 +               return &_mesa_texformat_srgba_dxt1;
 +            break;
           case GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT:
 +            if (ctx->Extensions.EXT_texture_compression_s3tc)
 +               return &_mesa_texformat_srgba_dxt3;
 +            break;
           case GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT:
 -            return &_mesa_texformat_srgba8;
 +            if (ctx->Extensions.EXT_texture_compression_s3tc)
 +               return &_mesa_texformat_srgba_dxt5;
 +            break;
 +#endif
           default:
              ; /* fallthrough */
        }
@@@ -1717,11 -1721,6 +1765,11 @@@ _mesa_format_to_type_and_comps(const st
        *comps = 1; /* XXX OK? */
        return;
  
 +   case MESA_FORMAT_S8_Z24:
 +      *datatype = GL_UNSIGNED_INT;
 +      *comps = 1; /* XXX OK? */
 +      return;
 +
     case MESA_FORMAT_Z16:
        *datatype = GL_UNSIGNED_SHORT;
        *comps = 1;
        *comps = 1;
        return;
  
 +#if FEATURE_EXT_texture_sRGB
     case MESA_FORMAT_SRGB8:
        *datatype = GL_UNSIGNED_BYTE;
        *comps = 3;
        return;
     case MESA_FORMAT_SRGBA8:
 +   case MESA_FORMAT_SARGB8:
        *datatype = GL_UNSIGNED_BYTE;
        *comps = 4;
        return;
        *datatype = GL_UNSIGNED_BYTE;
        *comps = 2;
        return;
 +#endif
  
 +#if FEATURE_texture_fxt1
     case MESA_FORMAT_RGB_FXT1:
     case MESA_FORMAT_RGBA_FXT1:
 +#endif
 +#if FEATURE_texture_s3tc
     case MESA_FORMAT_RGB_DXT1:
     case MESA_FORMAT_RGBA_DXT1:
     case MESA_FORMAT_RGBA_DXT3:
     case MESA_FORMAT_RGBA_DXT5:
 +#if FEATURE_EXT_texture_sRGB
 +   case MESA_FORMAT_SRGB_DXT1:
 +   case MESA_FORMAT_SRGBA_DXT1:
 +   case MESA_FORMAT_SRGBA_DXT3:
 +   case MESA_FORMAT_SRGBA_DXT5:
 +#endif
        /* XXX generate error instead? */
        *datatype = GL_UNSIGNED_BYTE;
        *comps = 0;
        return;
 +#endif
  
     case MESA_FORMAT_RGBA:
        *datatype = CHAN_TYPE;
index c7a754b0b75cc575b12033685b1ffa65d4ecb5a6,b1604d4a494893aac423b4887ed185b0c1c06a56..31364c36b1a902ba546545a01473108ffb1a68b5
@@@ -3,7 -3,6 +3,7 @@@
   * Version:  6.5.1
   *
   * Copyright (C) 1999-2006  Brian Paul   All Rights Reserved.
 + * Copyright (c) 2008 VMware, Inc.
   *
   * Permission is hereby granted, free of charge, to any person obtaining a
   * copy of this software and associated documentation files (the "Software"),
@@@ -71,8 -70,10 +71,10 @@@ enum _format 
     MESA_FORMAT_BGR888,                /*           BBBB BBBB GGGG GGGG RRRR RRRR */
     MESA_FORMAT_RGB565,                /*                     RRRR RGGG GGGB BBBB */
     MESA_FORMAT_RGB565_REV,    /*                     GGGB BBBB RRRR RGGG */
+    MESA_FORMAT_RGBA4444,        /*                     RRRR GGGG BBBB AAAA */
     MESA_FORMAT_ARGB4444,      /*                     AAAA RRRR GGGG BBBB */
     MESA_FORMAT_ARGB4444_REV,  /*                     GGGG BBBB AAAA RRRR */
+    MESA_FORMAT_RGBA5551,        /*                     RRRR RGGG GGBB BBBA */
     MESA_FORMAT_ARGB1555,      /*                     ARRR RRGG GGGB BBBB */
     MESA_FORMAT_ARGB1555_REV,  /*                     GGGB BBBB ARRR RRGG */
     MESA_FORMAT_AL88,          /*                     AAAA AAAA LLLL LLLL */
     /*@{*/
     MESA_FORMAT_SRGB8,
     MESA_FORMAT_SRGBA8,
 +   MESA_FORMAT_SARGB8,
     MESA_FORMAT_SL8,
     MESA_FORMAT_SLA8,
 +#if FEATURE_texture_s3tc
     MESA_FORMAT_SRGB_DXT1,
 +   MESA_FORMAT_SRGBA_DXT1,
 +   MESA_FORMAT_SRGBA_DXT3,
 +   MESA_FORMAT_SRGBA_DXT5,
 +#endif
     /*@}*/
  #endif
  
      * \name Compressed texture formats.
      */
     /*@{*/
 +#if FEATURE_texture_fxt1
     MESA_FORMAT_RGB_FXT1,
     MESA_FORMAT_RGBA_FXT1,
 +#endif
 +#if FEATURE_texture_s3tc
     MESA_FORMAT_RGB_DXT1,
     MESA_FORMAT_RGBA_DXT1,
     MESA_FORMAT_RGBA_DXT3,
     MESA_FORMAT_RGBA_DXT5,
 +#endif
     /*@}*/
  
     /**
@@@ -179,15 -170,9 +181,15 @@@ extern const struct gl_texture_format _
  /*@{*/
  extern const struct gl_texture_format _mesa_texformat_srgb8;
  extern const struct gl_texture_format _mesa_texformat_srgba8;
 +extern const struct gl_texture_format _mesa_texformat_sargb8;
  extern const struct gl_texture_format _mesa_texformat_sl8;
  extern const struct gl_texture_format _mesa_texformat_sla8;
 +#if FEATURE_texture_s3tc
  extern const struct gl_texture_format _mesa_texformat_srgb_dxt1;
 +extern const struct gl_texture_format _mesa_texformat_srgba_dxt1;
 +extern const struct gl_texture_format _mesa_texformat_srgba_dxt3;
 +extern const struct gl_texture_format _mesa_texformat_srgba_dxt5;
 +#endif
  /*@}*/
  #endif
  
@@@ -217,10 -202,12 +219,12 @@@ extern const struct gl_texture_format _
  extern const struct gl_texture_format _mesa_texformat_bgr888;
  extern const struct gl_texture_format _mesa_texformat_rgb565;
  extern const struct gl_texture_format _mesa_texformat_rgb565_rev;
+ extern const struct gl_texture_format _mesa_texformat_rgba4444;
  extern const struct gl_texture_format _mesa_texformat_argb4444;
  extern const struct gl_texture_format _mesa_texformat_argb4444_rev;
  extern const struct gl_texture_format _mesa_texformat_argb1555;
  extern const struct gl_texture_format _mesa_texformat_argb1555_rev;
+ extern const struct gl_texture_format _mesa_texformat_rgba5551;
  extern const struct gl_texture_format _mesa_texformat_al88;
  extern const struct gl_texture_format _mesa_texformat_al88_rev;
  extern const struct gl_texture_format _mesa_texformat_rgb332;
@@@ -242,16 -229,12 +246,16 @@@ extern const struct gl_texture_format _
  
  /** \name Compressed formats */
  /*@{*/
 +#if FEATURE_texture_fxt1
  extern const struct gl_texture_format _mesa_texformat_rgb_fxt1;
  extern const struct gl_texture_format _mesa_texformat_rgba_fxt1;
 +#endif
 +#if FEATURE_texture_s3tc
  extern const struct gl_texture_format _mesa_texformat_rgb_dxt1;
  extern const struct gl_texture_format _mesa_texformat_rgba_dxt1;
  extern const struct gl_texture_format _mesa_texformat_rgba_dxt3;
  extern const struct gl_texture_format _mesa_texformat_rgba_dxt5;
 +#endif
  /*@}*/
  
  /** \name The null format */
index b1031b0cfe3b84df9c579be91325091fa476a752,5f0c674d4fb2bcce95b603d05798161c8685a536..08b6d8f12fbdb6f207a51c4413fdbbb59fd77ee5
@@@ -3,7 -3,6 +3,7 @@@
   * Version:  6.5.1
   *
   * Copyright (C) 1999-2006  Brian Paul   All Rights Reserved.
 + * Copyright (c) 2008 VMware, Inc.
   *
   * Permission is hereby granted, free of charge, to any person obtaining a
   * copy of this software and associated documentation files (the "Software"),
@@@ -695,7 -694,7 +695,7 @@@ static void store_texel_argb8888_rev(st
  {
     const GLubyte *rgba = (const GLubyte *) texel;
     GLuint *dst = TEXEL_ADDR(GLuint, texImage, i, j, k, 1);
-    *dst = PACK_COLOR_8888(rgba[ACOMP], rgba[RCOMP], rgba[GCOMP], rgba[BCOMP]);
+    *dst = PACK_COLOR_8888(rgba[BCOMP], rgba[GCOMP], rgba[RCOMP], rgba[ACOMP]);
  }
  #endif
  
@@@ -804,6 -803,30 +804,30 @@@ static void store_texel_rgb565_rev(stru
  }
  #endif
  
+ /* MESA_FORMAT_RGBA4444 ******************************************************/
+ /* Fetch texel from 1D, 2D or 3D argb444 texture, return 4 GLchans */
+ static void FETCH(rgba4444)( const struct gl_texture_image *texImage,
+                            GLint i, GLint j, GLint k, GLchan *texel )
+ {
+    const GLushort *src = TEXEL_ADDR(GLushort, texImage, i, j, k, 1);
+    const GLushort s = *src;
+    texel[RCOMP] = UBYTE_TO_CHAN( ((s >> 12) & 0xf) | ((s >> 8) & 0xf0) );
+    texel[GCOMP] = UBYTE_TO_CHAN( ((s >>  8) & 0xf) | ((s >> 4) & 0xf0) );
+    texel[BCOMP] = UBYTE_TO_CHAN( ((s >>  4) & 0xf) | ((s     ) & 0xf0) );
+    texel[ACOMP] = UBYTE_TO_CHAN( ((s      ) & 0xf) | ((s << 4) & 0xf0) );
+ }
+ #if DIM == 3
+ static void store_texel_rgba4444(struct gl_texture_image *texImage,
+                                  GLint i, GLint j, GLint k, const void *texel)
+ {
+    const GLubyte *rgba = (const GLubyte *) texel;
+    GLushort *dst = TEXEL_ADDR(GLushort, texImage, i, j, k, 1);
+    *dst = PACK_COLOR_4444(rgba[RCOMP], rgba[GCOMP], rgba[BCOMP], rgba[ACOMP]);
+ }
+ #endif
  
  /* MESA_FORMAT_ARGB4444 ******************************************************/
  
@@@ -825,7 -848,7 +849,7 @@@ static void store_texel_argb4444(struc
  {
     const GLubyte *rgba = (const GLubyte *) texel;
     GLushort *dst = TEXEL_ADDR(GLushort, texImage, i, j, k, 1);
-    *dst = PACK_COLOR_4444(rgba[RCOMP], rgba[GCOMP], rgba[BCOMP], rgba[ACOMP]);
+    *dst = PACK_COLOR_4444(rgba[ACOMP], rgba[RCOMP], rgba[GCOMP], rgba[BCOMP]);
  }
  #endif
  
@@@ -853,6 -876,29 +877,29 @@@ static void store_texel_argb4444_rev(st
  }
  #endif
  
+ /* MESA_FORMAT_RGBA5551 ******************************************************/
+ /* Fetch texel from 1D, 2D or 3D argb1555 texture, return 4 GLchans */
+ static void FETCH(rgba5551)( const struct gl_texture_image *texImage,
+                            GLint i, GLint j, GLint k, GLchan *texel )
+ {
+    const GLushort *src = TEXEL_ADDR(GLushort, texImage, i, j, k, 1);
+    const GLushort s = *src;
+    texel[RCOMP] = UBYTE_TO_CHAN( ((s >>  8) & 0xf8) | ((s >> 13) & 0x7) );
+    texel[GCOMP] = UBYTE_TO_CHAN( ((s >>  3) & 0xf8) | ((s >>  8) & 0x7) );
+    texel[BCOMP] = UBYTE_TO_CHAN( ((s <<  2) & 0xf8) | ((s >>  3) & 0x7) );
+    texel[ACOMP] = UBYTE_TO_CHAN( ((s) & 0x01) ? 255 : 0);
+ }
+ #if DIM == 3
+ static void store_texel_rgba5551(struct gl_texture_image *texImage,
+                                  GLint i, GLint j, GLint k, const void *texel)
+ {
+    const GLubyte *rgba = (const GLubyte *) texel;
+    GLushort *dst = TEXEL_ADDR(GLushort, texImage, i, j, k, 1);
+    *dst = PACK_COLOR_5551(rgba[RCOMP], rgba[GCOMP], rgba[BCOMP], rgba[ACOMP]);
+ }
+ #endif
  
  /* MESA_FORMAT_ARGB1555 ******************************************************/
  
@@@ -1192,31 -1238,6 +1239,31 @@@ static void store_texel_srgba8(struct g
     dst[0] = rgba[RCOMP];
     dst[1] = rgba[GCOMP];
     dst[2] = rgba[BCOMP];
 +   dst[3] = rgba[ACOMP];
 +}
 +#endif
 +
 +/* Fetch texel from 1D, 2D or 3D sargb8 texture, return 4 GLfloats */
 +static void FETCH(sargb8)(const struct gl_texture_image *texImage,
 +                          GLint i, GLint j, GLint k, GLfloat *texel )
 +{
 +   const GLubyte *src = TEXEL_ADDR(GLubyte, texImage, i, j, k, 4);
 +   texel[RCOMP] = nonlinear_to_linear(src[1]);
 +   texel[GCOMP] = nonlinear_to_linear(src[2]);
 +   texel[BCOMP] = nonlinear_to_linear(src[3]);
 +   texel[ACOMP] = UBYTE_TO_FLOAT(src[0]); /* linear! */
 +}
 +
 +#if DIM == 3
 +static void store_texel_sargb8(struct gl_texture_image *texImage,
 +                               GLint i, GLint j, GLint k, const void *texel)
 +{
 +   const GLubyte *rgba = (const GLubyte *) texel;
 +   GLubyte *dst = TEXEL_ADDR(GLubyte, texImage, i, j, k, 4);
 +   dst[0] = rgba[ACOMP];
 +   dst[1] = rgba[RCOMP];
 +   dst[2] = rgba[GCOMP];
 +   dst[3] = rgba[BCOMP];
  }
  #endif
  
diff --combined src/mesa/main/texstore.c
index 8afb947fa1772d4c77b4952a8e138ae1cfba1947,67cfca25651b45316e3ff0e84fbdee63fbb2bf1f..2b06796abab17b7db0ff896c7c77eb289fad34e1
@@@ -3,7 -3,6 +3,7 @@@
   * Version:  7.3
   *
   * Copyright (C) 1999-2008  Brian Paul   All Rights Reserved.
 + * Copyright (c) 2008 VMware, Inc.
   *
   * Permission is hereby granted, free of charge, to any person obtaining a
   * copy of this software and associated documentation files (the "Software"),
@@@ -886,8 -885,8 +886,8 @@@ _mesa_swizzle_ubyte_image(GLcontext *ct
  
  /*    _mesa_printf("map %d %d %d %d\n", map[0], map[1], map[2], map[3]);  */
  
 -   if (srcRowStride == dstRowStride &&
 -       srcComponents == dstComponents &&
 +   if (srcComponents == dstComponents &&
 +       srcRowStride == dstRowStride &&
         srcRowStride == srcWidth * srcComponents &&
         dimensions < 3) {
        /* 1 and 2D images only */
@@@ -1899,6 -1898,60 +1899,60 @@@ _mesa_texstore_bgr888(TEXSTORE_PARAMS
     return GL_TRUE;
  }
  
+ GLboolean
+ _mesa_texstore_rgba4444(TEXSTORE_PARAMS)
+ {
+    ASSERT(dstFormat == &_mesa_texformat_rgba4444);
+    ASSERT(dstFormat->TexelBytes == 2);
+    if (!ctx->_ImageTransferState &&
+        !srcPacking->SwapBytes &&
+        dstFormat == &_mesa_texformat_rgba4444 &&
+        baseInternalFormat == GL_RGBA &&
+        srcFormat == GL_RGBA &&
+        srcType == GL_UNSIGNED_SHORT_4_4_4_4){
+       /* simple memcpy path */
+       memcpy_texture(ctx, dims,
+                      dstFormat, dstAddr, dstXoffset, dstYoffset, dstZoffset,
+                      dstRowStride,
+                      dstImageOffsets,
+                      srcWidth, srcHeight, srcDepth, srcFormat, srcType,
+                      srcAddr, srcPacking);
+    }
+    else {
+       /* general path */
+       const GLchan *tempImage = _mesa_make_temp_chan_image(ctx, dims,
+                                                  baseInternalFormat,
+                                                  dstFormat->BaseFormat,
+                                                  srcWidth, srcHeight, srcDepth,
+                                                  srcFormat, srcType, srcAddr,
+                                                  srcPacking);
+       const GLchan *src = tempImage;
+       GLint img, row, col;
+       if (!tempImage)
+          return GL_FALSE;
+       _mesa_adjust_image_for_convolution(ctx, dims, &srcWidth, &srcHeight);
+       for (img = 0; img < srcDepth; img++) {
+          GLubyte *dstRow = (GLubyte *) dstAddr
+             + dstImageOffsets[dstZoffset + img] * dstFormat->TexelBytes
+             + dstYoffset * dstRowStride
+             + dstXoffset * dstFormat->TexelBytes;
+          for (row = 0; row < srcHeight; row++) {
+             GLushort *dstUS = (GLushort *) dstRow;
+           for (col = 0; col < srcWidth; col++) {
+             dstUS[col] = PACK_COLOR_4444( CHAN_TO_UBYTE(src[RCOMP]),
+                                           CHAN_TO_UBYTE(src[GCOMP]),
+                                           CHAN_TO_UBYTE(src[BCOMP]),
+                                           CHAN_TO_UBYTE(src[ACOMP]) );
+             src += 4;
+             }
+             dstRow += dstRowStride;
+          }
+       }
+       _mesa_free((void *) tempImage);
+    }
+    return GL_TRUE;
+ }
  
  GLboolean
  _mesa_texstore_argb4444(TEXSTORE_PARAMS)
     return GL_TRUE;
  }
  
+ GLboolean
+ _mesa_texstore_rgba5551(TEXSTORE_PARAMS)
+ {
+    ASSERT(dstFormat == &_mesa_texformat_rgba5551);
+    ASSERT(dstFormat->TexelBytes == 2);
  
+    if (!ctx->_ImageTransferState &&
+        !srcPacking->SwapBytes &&
+        dstFormat == &_mesa_texformat_rgba5551 &&
+        baseInternalFormat == GL_RGBA &&
+        srcFormat == GL_RGBA &&
+        srcType == GL_UNSIGNED_SHORT_5_5_5_1) {
+       /* simple memcpy path */
+       memcpy_texture(ctx, dims,
+                      dstFormat, dstAddr, dstXoffset, dstYoffset, dstZoffset,
+                      dstRowStride,
+                      dstImageOffsets,
+                      srcWidth, srcHeight, srcDepth, srcFormat, srcType,
+                      srcAddr, srcPacking);
+    }
+    else {
+       /* general path */
+       const GLchan *tempImage = _mesa_make_temp_chan_image(ctx, dims,
+                                                  baseInternalFormat,
+                                                  dstFormat->BaseFormat,
+                                                  srcWidth, srcHeight, srcDepth,
+                                                  srcFormat, srcType, srcAddr,
+                                                  srcPacking);
+       const GLchan *src =tempImage;
+       GLint img, row, col;
+       if (!tempImage)
+          return GL_FALSE;
+       _mesa_adjust_image_for_convolution(ctx, dims, &srcWidth, &srcHeight);
+       for (img = 0; img < srcDepth; img++) {
+          GLubyte *dstRow = (GLubyte *) dstAddr
+             + dstImageOffsets[dstZoffset + img] * dstFormat->TexelBytes
+             + dstYoffset * dstRowStride
+             + dstXoffset * dstFormat->TexelBytes;
+          for (row = 0; row < srcHeight; row++) {
+             GLushort *dstUS = (GLushort *) dstRow;
+           for (col = 0; col < srcWidth; col++) {
+              dstUS[col] = PACK_COLOR_5551( CHAN_TO_UBYTE(src[RCOMP]),
+                                            CHAN_TO_UBYTE(src[GCOMP]),
+                                            CHAN_TO_UBYTE(src[BCOMP]),
+                                            CHAN_TO_UBYTE(src[ACOMP]) );
+             src += 4;
+           }
+             dstRow += dstRowStride;
+          }
+       }
+       _mesa_free((void *) tempImage);
+    }
+    return GL_TRUE;
+ }
  
  GLboolean
  _mesa_texstore_argb1555(TEXSTORE_PARAMS)
@@@ -2663,6 -2769,7 +2770,6 @@@ _mesa_texstore_rgba_float16(TEXSTORE_PA
  GLboolean
  _mesa_texstore_srgb8(TEXSTORE_PARAMS)
  {
 -   const GLboolean littleEndian = _mesa_little_endian();
     const struct gl_texture_format *newDstFormat;
     StoreTexImageFunc store;
     GLboolean k;
     ASSERT(dstFormat == &_mesa_texformat_srgb8);
  
     /* reuse normal rgb texstore code */
 -   if (littleEndian) {
 -      newDstFormat = &_mesa_texformat_bgr888;
 -      store = _mesa_texstore_bgr888;
 -   }
 -   else {
 -      newDstFormat = &_mesa_texformat_rgb888;
 -      store = _mesa_texstore_rgb888;
 -   }
 +   newDstFormat = &_mesa_texformat_rgb888;
 +   store = _mesa_texstore_rgb888;
  
     k = store(ctx, dims, baseInternalFormat,
               newDstFormat, dstAddr,
  GLboolean
  _mesa_texstore_srgba8(TEXSTORE_PARAMS)
  {
 -   const GLboolean littleEndian = _mesa_little_endian();
     const struct gl_texture_format *newDstFormat;
     GLboolean k;
  
     ASSERT(dstFormat == &_mesa_texformat_srgba8);
  
     /* reuse normal rgba texstore code */
 -   if (littleEndian)
 -      newDstFormat = &_mesa_texformat_rgba8888_rev;
 -   else
 -      newDstFormat = &_mesa_texformat_rgba8888;
 +   newDstFormat = &_mesa_texformat_rgba8888;
  
     k = _mesa_texstore_rgba8888(ctx, dims, baseInternalFormat,
                                 newDstFormat, dstAddr,
  }
  
  
 +GLboolean
 +_mesa_texstore_sargb8(TEXSTORE_PARAMS)
 +{
 +   const struct gl_texture_format *newDstFormat;
 +   GLboolean k;
 +
 +   ASSERT(dstFormat == &_mesa_texformat_sargb8);
 +
 +   /* reuse normal rgba texstore code */
 +   newDstFormat = &_mesa_texformat_argb8888;
 +
 +   k = _mesa_texstore_argb8888(ctx, dims, baseInternalFormat,
 +                               newDstFormat, dstAddr,
 +                               dstXoffset, dstYoffset, dstZoffset,
 +                               dstRowStride, dstImageOffsets,
 +                               srcWidth, srcHeight, srcDepth,
 +                               srcFormat, srcType,
 +                               srcAddr, srcPacking);
 +   return k;
 +}
 +
 +
  GLboolean
  _mesa_texstore_sl8(TEXSTORE_PARAMS)
  {
  GLboolean
  _mesa_texstore_sla8(TEXSTORE_PARAMS)
  {
 -   const GLboolean littleEndian = _mesa_little_endian();
     const struct gl_texture_format *newDstFormat;
     GLboolean k;
  
     ASSERT(dstFormat == &_mesa_texformat_sla8);
  
     /* reuse normal luminance/alpha texstore code */
 -   if (littleEndian)
 -      newDstFormat = &_mesa_texformat_al88;
 -   else
 -      newDstFormat = &_mesa_texformat_al88_rev;
 +   newDstFormat = &_mesa_texformat_al88;
  
     k = _mesa_texstore_al88(ctx, dims, baseInternalFormat,
                             newDstFormat, dstAddr,
@@@ -3589,7 -3688,6 +3696,7 @@@ is_srgb_teximage(const struct gl_textur
     switch (texImage->TexFormat->MesaFormat) {
     case MESA_FORMAT_SRGB8:
     case MESA_FORMAT_SRGBA8:
 +   case MESA_FORMAT_SARGB8:
     case MESA_FORMAT_SL8:
     case MESA_FORMAT_SLA8:
        return GL_TRUE;
@@@ -3722,10 -3820,6 +3829,10 @@@ _mesa_get_teximage(GLcontext *ctx, GLen
                 MEMCPY(dest,
                        (const GLubyte *) texImage->Data + row * rowstride,
                        comps * width * sizeof(GLubyte));
 +               /* FIXME: isn't it necessary to still do component assigning
 +                  according to format/type? */
 +               /* FIXME: need to do something else for compressed srgb textures
 +                         (currently will return values converted to linear) */
              }
  #endif /* FEATURE_EXT_texture_sRGB */
              else {
diff --combined src/mesa/main/texstore.h
index 8dc1c963cdaf33e34c22485ced9e817e8217acd4,951d0a112bb9d7b42f583b8f9dd97142b733eba0..b03386b2acc4c107849f3d694a2ca6f641a390cb
@@@ -3,7 -3,6 +3,7 @@@
   * Version:  6.5.1
   *
   * Copyright (C) 1999-2006  Brian Paul   All Rights Reserved.
 + * Copyright (c) 2008 VMware, Inc.
   *
   * Permission is hereby granted, free of charge, to any person obtaining a
   * copy of this software and associated documentation files (the "Software"),
@@@ -47,8 -46,10 +47,10 @@@ extern GLboolean _mesa_texstore_rgb888(
  extern GLboolean _mesa_texstore_bgr888(TEXSTORE_PARAMS);
  extern GLboolean _mesa_texstore_rgb565(TEXSTORE_PARAMS);
  extern GLboolean _mesa_texstore_rgb565_rev(TEXSTORE_PARAMS);
+ extern GLboolean _mesa_texstore_rgba4444(TEXSTORE_PARAMS);
  extern GLboolean _mesa_texstore_argb4444(TEXSTORE_PARAMS);
  extern GLboolean _mesa_texstore_argb4444_rev(TEXSTORE_PARAMS);
+ extern GLboolean _mesa_texstore_rgba5551(TEXSTORE_PARAMS);
  extern GLboolean _mesa_texstore_argb1555(TEXSTORE_PARAMS);
  extern GLboolean _mesa_texstore_argb1555_rev(TEXSTORE_PARAMS);
  extern GLboolean _mesa_texstore_al88(TEXSTORE_PARAMS);
@@@ -72,7 -73,6 +74,7 @@@ extern GLboolean _mesa_texstore_rgba_dx
  #if FEATURE_EXT_texture_sRGB
  extern GLboolean _mesa_texstore_srgb8(TEXSTORE_PARAMS);
  extern GLboolean _mesa_texstore_srgba8(TEXSTORE_PARAMS);
 +extern GLboolean _mesa_texstore_sargb8(TEXSTORE_PARAMS);
  extern GLboolean _mesa_texstore_sl8(TEXSTORE_PARAMS);
  extern GLboolean _mesa_texstore_sla8(TEXSTORE_PARAMS);
  #endif