mesa: Rename pipe formats.
authorJosé Fonseca <jfonseca@vmware.com>
Mon, 1 Mar 2010 18:10:23 +0000 (18:10 +0000)
committerJosé Fonseca <jfonseca@vmware.com>
Mon, 1 Mar 2010 18:53:31 +0000 (18:53 +0000)
src/mesa/state_tracker/st_cb_drawpixels.c
src/mesa/state_tracker/st_cb_fbo.c
src/mesa/state_tracker/st_cb_readpixels.c
src/mesa/state_tracker/st_draw.c
src/mesa/state_tracker/st_extensions.c
src/mesa/state_tracker/st_format.c

index ba28a224e837017a3fcb46b70ff7f73328dcbd3a..98453321f86adea05e38e15a981879e0e6185132 100644 (file)
@@ -713,7 +713,7 @@ draw_stencil_pixels(GLcontext *ctx, GLint x, GLint y,
                   memcpy(dest, sValues, spanWidth);
                }
                break;
-            case PIPE_FORMAT_S8Z24_UNORM:
+            case PIPE_FORMAT_Z24S8_UNORM:
                if (format == GL_DEPTH_STENCIL) {
                   uint *dest = (uint *) (stmap + spanY * pt->stride + spanX*4);
                   GLint k;
@@ -731,7 +731,7 @@ draw_stencil_pixels(GLcontext *ctx, GLint x, GLint y,
                   }
                }
                break;
-            case PIPE_FORMAT_Z24S8_UNORM:
+            case PIPE_FORMAT_S8Z24_UNORM:
                if (format == GL_DEPTH_STENCIL) {
                   uint *dest = (uint *) (stmap + spanY * pt->stride + spanX*4);
                   GLint k;
@@ -879,7 +879,7 @@ copy_stencil_pixels(GLcontext *ctx, GLint srcx, GLint srcy,
       src = buffer + i * width;
 
       switch (ptDraw->texture->format) {
-      case PIPE_FORMAT_S8Z24_UNORM:
+      case PIPE_FORMAT_Z24S8_UNORM:
          {
             uint *dst4 = (uint *) dst;
             int j;
@@ -890,7 +890,7 @@ copy_stencil_pixels(GLcontext *ctx, GLint srcx, GLint srcy,
             }
          }
          break;
-      case PIPE_FORMAT_Z24S8_UNORM:
+      case PIPE_FORMAT_S8Z24_UNORM:
          {
             uint *dst4 = (uint *) dst;
             int j;
index ea040bdc4fd93da475c47cb234435216a21c77ae..8fded0c69fcecb8440d2bee18f0bd3372f77e7e5 100644 (file)
@@ -238,13 +238,13 @@ st_new_renderbuffer_fb(enum pipe_format format, int samples, boolean sw)
    strb->software = sw;
    
    switch (format) {
-   case PIPE_FORMAT_A8R8G8B8_UNORM:
    case PIPE_FORMAT_B8G8R8A8_UNORM:
-   case PIPE_FORMAT_X8R8G8B8_UNORM:
+   case PIPE_FORMAT_A8R8G8B8_UNORM:
    case PIPE_FORMAT_B8G8R8X8_UNORM:
-   case PIPE_FORMAT_A1R5G5B5_UNORM:
-   case PIPE_FORMAT_A4R4G4B4_UNORM:
-   case PIPE_FORMAT_R5G6B5_UNORM:
+   case PIPE_FORMAT_X8R8G8B8_UNORM:
+   case PIPE_FORMAT_B5G5R5A1_UNORM:
+   case PIPE_FORMAT_B4G4R4A4_UNORM:
+   case PIPE_FORMAT_B5G6R5_UNORM:
       strb->Base.InternalFormat = GL_RGBA;
       break;
    case PIPE_FORMAT_Z16_UNORM:
@@ -253,10 +253,10 @@ st_new_renderbuffer_fb(enum pipe_format format, int samples, boolean sw)
    case PIPE_FORMAT_Z32_UNORM:
       strb->Base.InternalFormat = GL_DEPTH_COMPONENT32;
       break;
-   case PIPE_FORMAT_S8Z24_UNORM:
    case PIPE_FORMAT_Z24S8_UNORM:
-   case PIPE_FORMAT_X8Z24_UNORM:
+   case PIPE_FORMAT_S8Z24_UNORM:
    case PIPE_FORMAT_Z24X8_UNORM:
+   case PIPE_FORMAT_X8Z24_UNORM:
       strb->Base.InternalFormat = GL_DEPTH24_STENCIL8_EXT;
       break;
    case PIPE_FORMAT_S8_UNORM:
index 6b1fdf3ecd0704cda99250ca4025802d20315cdf..952d9ce91569fdccfc5579cc16280d6c41b6032c 100644 (file)
@@ -108,7 +108,7 @@ st_read_stencil_pixels(GLcontext *ctx, GLint x, GLint y,
             memcpy(sValues, src, width);
          }
          break;
-      case PIPE_FORMAT_S8Z24_UNORM:
+      case PIPE_FORMAT_Z24S8_UNORM:
          if (format == GL_DEPTH_STENCIL) {
             const uint *src = (uint *) (stmap + srcY * pt->stride);
             const GLfloat scale = 1.0f / (0xffffff);
@@ -126,7 +126,7 @@ st_read_stencil_pixels(GLcontext *ctx, GLint x, GLint y,
             }
          }
          break;
-      case PIPE_FORMAT_Z24S8_UNORM:
+      case PIPE_FORMAT_S8Z24_UNORM:
          if (format == GL_DEPTH_STENCIL) {
             const uint *src = (uint *) (stmap + srcY * pt->stride);
             const GLfloat scale = 1.0f / (0xffffff);
@@ -214,15 +214,15 @@ st_fast_readpixels(GLcontext *ctx, struct st_renderbuffer *strb,
    if (ctx->_ImageTransferState)
       return GL_FALSE;
 
-   if (strb->format == PIPE_FORMAT_A8R8G8B8_UNORM &&
+   if (strb->format == PIPE_FORMAT_B8G8R8A8_UNORM &&
        format == GL_RGBA && type == GL_UNSIGNED_BYTE) {
       combo = A8R8G8B8_UNORM_TO_RGBA_UBYTE;
    }
-   else if (strb->format == PIPE_FORMAT_A8R8G8B8_UNORM &&
+   else if (strb->format == PIPE_FORMAT_B8G8R8A8_UNORM &&
             format == GL_RGB && type == GL_UNSIGNED_BYTE) {
       combo = A8R8G8B8_UNORM_TO_RGB_UBYTE;
    }
-   else if (strb->format == PIPE_FORMAT_A8R8G8B8_UNORM &&
+   else if (strb->format == PIPE_FORMAT_B8G8R8A8_UNORM &&
             format == GL_BGRA && type == GL_UNSIGNED_INT_8_8_8_8_REV) {
       combo = A8R8G8B8_UNORM_TO_BGRA_UINT;
    }
@@ -429,8 +429,8 @@ st_readpixels(GLcontext *ctx, GLint x, GLint y, GLsizei width, GLsizei height,
       const GLint dstStride = _mesa_image_row_stride(&clippedPacking, width,
                                                      format, type);
 
-      if (trans->texture->format == PIPE_FORMAT_S8Z24_UNORM ||
-          trans->texture->format == PIPE_FORMAT_X8Z24_UNORM) {
+      if (trans->texture->format == PIPE_FORMAT_Z24S8_UNORM ||
+          trans->texture->format == PIPE_FORMAT_Z24X8_UNORM) {
          if (format == GL_DEPTH_COMPONENT) {
             for (i = 0; i < height; i++) {
                GLuint ztemp[MAX_WIDTH];
@@ -461,8 +461,8 @@ st_readpixels(GLcontext *ctx, GLint x, GLint y, GLsizei width, GLsizei height,
             }
          }
       }
-      else if (trans->texture->format == PIPE_FORMAT_Z24S8_UNORM ||
-               trans->texture->format == PIPE_FORMAT_Z24X8_UNORM) {
+      else if (trans->texture->format == PIPE_FORMAT_S8Z24_UNORM ||
+               trans->texture->format == PIPE_FORMAT_X8Z24_UNORM) {
          if (format == GL_DEPTH_COMPONENT) {
             for (i = 0; i < height; i++) {
                GLuint ztemp[MAX_WIDTH];
index 4b48c168e9cc037d484f76594ff14d5e13d16840..32b9a473cfc693bd2551f6dcdb3f7faeadc272f8 100644 (file)
@@ -183,7 +183,7 @@ st_pipe_vertex_format(GLenum type, GLuint size, GLenum format,
       /* this is an odd-ball case */
       assert(type == GL_UNSIGNED_BYTE);
       assert(normalized);
-      return PIPE_FORMAT_B8G8R8A8_UNORM;
+      return PIPE_FORMAT_A8R8G8B8_UNORM;
    }
 
    if (normalized) {
index e9ee65576d50f9d793295f1e23d032838ae0659d..79be833768fa1a34b8da6ac287d4f5f61639b298 100644 (file)
@@ -270,28 +270,28 @@ void st_init_extensions(struct st_context *st)
    /* GL_EXT_packed_depth_stencil requires both the ability to render to
     * a depth/stencil buffer and texture from depth/stencil source.
     */
-   if (screen->is_format_supported(screen, PIPE_FORMAT_Z24S8_UNORM,
+   if (screen->is_format_supported(screen, PIPE_FORMAT_S8Z24_UNORM,
                                    PIPE_TEXTURE_2D, 
                                    PIPE_TEXTURE_USAGE_DEPTH_STENCIL, 0) &&
-       screen->is_format_supported(screen, PIPE_FORMAT_Z24S8_UNORM,
+       screen->is_format_supported(screen, PIPE_FORMAT_S8Z24_UNORM,
                                    PIPE_TEXTURE_2D, 
                                    PIPE_TEXTURE_USAGE_SAMPLER, 0)) {
       ctx->Extensions.EXT_packed_depth_stencil = GL_TRUE;
    }
-   else if (screen->is_format_supported(screen, PIPE_FORMAT_S8Z24_UNORM,
+   else if (screen->is_format_supported(screen, PIPE_FORMAT_Z24S8_UNORM,
                                         PIPE_TEXTURE_2D, 
                                         PIPE_TEXTURE_USAGE_DEPTH_STENCIL, 0) &&
-            screen->is_format_supported(screen, PIPE_FORMAT_S8Z24_UNORM,
+            screen->is_format_supported(screen, PIPE_FORMAT_Z24S8_UNORM,
                                         PIPE_TEXTURE_2D, 
                                         PIPE_TEXTURE_USAGE_SAMPLER, 0)) {
       ctx->Extensions.EXT_packed_depth_stencil = GL_TRUE;
    }
 
    /* sRGB support */
-   if (screen->is_format_supported(screen, PIPE_FORMAT_R8G8B8A8_SRGB,
+   if (screen->is_format_supported(screen, PIPE_FORMAT_A8B8G8R8_SRGB,
                                    PIPE_TEXTURE_2D, 
                                    PIPE_TEXTURE_USAGE_SAMPLER, 0) ||
-      screen->is_format_supported(screen, PIPE_FORMAT_A8R8G8B8_SRGB,
+      screen->is_format_supported(screen, PIPE_FORMAT_B8G8R8A8_SRGB,
                                    PIPE_TEXTURE_2D, 
                                    PIPE_TEXTURE_USAGE_SAMPLER, 0)) {
       ctx->Extensions.EXT_texture_sRGB = GL_TRUE;
@@ -310,10 +310,10 @@ void st_init_extensions(struct st_context *st)
    }
 
    /* ycbcr support */
-   if (screen->is_format_supported(screen, PIPE_FORMAT_YCBCR
+   if (screen->is_format_supported(screen, PIPE_FORMAT_UYVY
                                    PIPE_TEXTURE_2D, 
                                    PIPE_TEXTURE_USAGE_SAMPLER, 0) ||
-       screen->is_format_supported(screen, PIPE_FORMAT_YCBCR_REV, 
+       screen->is_format_supported(screen, PIPE_FORMAT_YUYV, 
                                    PIPE_TEXTURE_2D, 
                                    PIPE_TEXTURE_USAGE_SAMPLER, 0)) {
       ctx->Extensions.MESA_ycbcr_texture = GL_TRUE;
index f24d6c86868c039d5b03f1ff7286306079692161..9ae0c9f9babe8dbda5e224ff6d5ee9bcb890fc8e 100644 (file)
@@ -72,12 +72,12 @@ st_format_datatype(enum pipe_format format)
    assert(desc);
 
    if (desc->layout == UTIL_FORMAT_LAYOUT_PLAIN) {
-      if (format == PIPE_FORMAT_A1R5G5B5_UNORM ||
-          format == PIPE_FORMAT_R5G6B5_UNORM) {
+      if (format == PIPE_FORMAT_B5G5R5A1_UNORM ||
+          format == PIPE_FORMAT_B5G6R5_UNORM) {
          return GL_UNSIGNED_SHORT;
       }
-      else if (format == PIPE_FORMAT_S8Z24_UNORM ||
-               format == PIPE_FORMAT_Z24S8_UNORM) {
+      else if (format == PIPE_FORMAT_Z24S8_UNORM ||
+               format == PIPE_FORMAT_S8Z24_UNORM) {
          return GL_UNSIGNED_INT_24_8;
       }
       else {
@@ -103,10 +103,10 @@ st_format_datatype(enum pipe_format format)
          }
       }
    }
-   else if (format == PIPE_FORMAT_YCBCR) {
+   else if (format == PIPE_FORMAT_UYVY) {
       return GL_UNSIGNED_SHORT;
    }
-   else if (format == PIPE_FORMAT_YCBCR_REV) {
+   else if (format == PIPE_FORMAT_YUYV) {
       return GL_UNSIGNED_SHORT;
    }
    else {
@@ -129,17 +129,17 @@ st_mesa_format_to_pipe_format(gl_format mesaFormat)
       /* fix this */
    case MESA_FORMAT_ARGB8888_REV:
    case MESA_FORMAT_ARGB8888:
-      return PIPE_FORMAT_A8R8G8B8_UNORM;
+      return PIPE_FORMAT_B8G8R8A8_UNORM;
    case MESA_FORMAT_XRGB8888:
-      return PIPE_FORMAT_X8R8G8B8_UNORM;
+      return PIPE_FORMAT_B8G8R8X8_UNORM;
    case MESA_FORMAT_ARGB1555:
-      return PIPE_FORMAT_A1R5G5B5_UNORM;
+      return PIPE_FORMAT_B5G5R5A1_UNORM;
    case MESA_FORMAT_ARGB4444:
-      return PIPE_FORMAT_A4R4G4B4_UNORM;
+      return PIPE_FORMAT_B4G4R4A4_UNORM;
    case MESA_FORMAT_RGB565:
-      return PIPE_FORMAT_R5G6B5_UNORM;
+      return PIPE_FORMAT_B5G6R5_UNORM;
    case MESA_FORMAT_AL88:
-      return PIPE_FORMAT_A8L8_UNORM;
+      return PIPE_FORMAT_L8A8_UNORM;
    case MESA_FORMAT_A8:
       return PIPE_FORMAT_A8_UNORM;
    case MESA_FORMAT_L8:
@@ -151,11 +151,11 @@ st_mesa_format_to_pipe_format(gl_format mesaFormat)
    case MESA_FORMAT_Z32:
       return PIPE_FORMAT_Z32_UNORM;
    case MESA_FORMAT_Z24_S8:
-      return PIPE_FORMAT_Z24S8_UNORM;
-   case MESA_FORMAT_S8_Z24:
       return PIPE_FORMAT_S8Z24_UNORM;
+   case MESA_FORMAT_S8_Z24:
+      return PIPE_FORMAT_Z24S8_UNORM;
    case MESA_FORMAT_YCBCR:
-      return PIPE_FORMAT_YCBCR;
+      return PIPE_FORMAT_UYVY;
 #if FEATURE_texture_s3tc
    case MESA_FORMAT_RGB_DXT1:
       return PIPE_FORMAT_DXT1_RGB;
@@ -178,15 +178,15 @@ st_mesa_format_to_pipe_format(gl_format mesaFormat)
 #endif
 #if FEATURE_EXT_texture_sRGB
    case MESA_FORMAT_SLA8:
-      return PIPE_FORMAT_A8L8_SRGB;
+      return PIPE_FORMAT_L8A8_SRGB;
    case MESA_FORMAT_SL8:
       return PIPE_FORMAT_L8_SRGB;
    case MESA_FORMAT_SRGB8:
       return PIPE_FORMAT_R8G8B8_SRGB;
    case MESA_FORMAT_SRGBA8:
-      return PIPE_FORMAT_R8G8B8A8_SRGB;
+      return PIPE_FORMAT_A8B8G8R8_SRGB;
    case MESA_FORMAT_SARGB8:
-      return PIPE_FORMAT_A8R8G8B8_SRGB;
+      return PIPE_FORMAT_B8G8R8A8_SRGB;
 #endif
    default:
       assert(0);
@@ -202,21 +202,21 @@ gl_format
 st_pipe_format_to_mesa_format(enum pipe_format format)
 {
    switch (format) {
-   case PIPE_FORMAT_A8R8G8B8_UNORM:
+   case PIPE_FORMAT_B8G8R8A8_UNORM:
       return MESA_FORMAT_ARGB8888;
-   case PIPE_FORMAT_X8R8G8B8_UNORM:
+   case PIPE_FORMAT_B8G8R8X8_UNORM:
       return MESA_FORMAT_XRGB8888;
-   case PIPE_FORMAT_B8G8R8A8_UNORM:
+   case PIPE_FORMAT_A8R8G8B8_UNORM:
       return MESA_FORMAT_ARGB8888_REV;
-   case PIPE_FORMAT_B8G8R8X8_UNORM:
+   case PIPE_FORMAT_X8R8G8B8_UNORM:
       return MESA_FORMAT_XRGB8888_REV;
-   case PIPE_FORMAT_A1R5G5B5_UNORM:
+   case PIPE_FORMAT_B5G5R5A1_UNORM:
       return MESA_FORMAT_ARGB1555;
-   case PIPE_FORMAT_A4R4G4B4_UNORM:
+   case PIPE_FORMAT_B4G4R4A4_UNORM:
       return MESA_FORMAT_ARGB4444;
-   case PIPE_FORMAT_R5G6B5_UNORM:
+   case PIPE_FORMAT_B5G6R5_UNORM:
       return MESA_FORMAT_RGB565;
-   case PIPE_FORMAT_A8L8_UNORM:
+   case PIPE_FORMAT_L8A8_UNORM:
       return MESA_FORMAT_AL88;
    case PIPE_FORMAT_A8_UNORM:
       return MESA_FORMAT_A8;
@@ -234,18 +234,18 @@ st_pipe_format_to_mesa_format(enum pipe_format format)
       return MESA_FORMAT_Z16;
    case PIPE_FORMAT_Z32_UNORM:
       return MESA_FORMAT_Z32;
-   case PIPE_FORMAT_Z24S8_UNORM:
+   case PIPE_FORMAT_S8Z24_UNORM:
       return MESA_FORMAT_Z24_S8;
-   case PIPE_FORMAT_Z24X8_UNORM:
-      return MESA_FORMAT_Z24_X8;
    case PIPE_FORMAT_X8Z24_UNORM:
+      return MESA_FORMAT_Z24_X8;
+   case PIPE_FORMAT_Z24X8_UNORM:
       return MESA_FORMAT_X8_Z24;
-   case PIPE_FORMAT_S8Z24_UNORM:
+   case PIPE_FORMAT_Z24S8_UNORM:
       return MESA_FORMAT_S8_Z24;
 
-   case PIPE_FORMAT_YCBCR:
+   case PIPE_FORMAT_UYVY:
       return MESA_FORMAT_YCBCR;
-   case PIPE_FORMAT_YCBCR_REV:
+   case PIPE_FORMAT_YUYV:
       return MESA_FORMAT_YCBCR_REV;
 
 #if FEATURE_texture_s3tc
@@ -270,15 +270,15 @@ st_pipe_format_to_mesa_format(enum pipe_format format)
 #endif
 
 #if FEATURE_EXT_texture_sRGB
-   case PIPE_FORMAT_A8L8_SRGB:
+   case PIPE_FORMAT_L8A8_SRGB:
       return MESA_FORMAT_SLA8;
    case PIPE_FORMAT_L8_SRGB:
       return MESA_FORMAT_SL8;
    case PIPE_FORMAT_R8G8B8_SRGB:
       return MESA_FORMAT_SRGB8;
-   case PIPE_FORMAT_R8G8B8A8_SRGB:
+   case PIPE_FORMAT_A8B8G8R8_SRGB:
       return MESA_FORMAT_SRGBA8;
-   case PIPE_FORMAT_A8R8G8B8_SRGB:
+   case PIPE_FORMAT_B8G8R8A8_SRGB:
       return MESA_FORMAT_SARGB8;
 #endif
    default:
@@ -298,10 +298,10 @@ default_rgba_format(struct pipe_screen *screen,
                     unsigned geom_flags)
 {
    static const enum pipe_format colorFormats[] = {
-      PIPE_FORMAT_A8R8G8B8_UNORM,
       PIPE_FORMAT_B8G8R8A8_UNORM,
-      PIPE_FORMAT_R8G8B8A8_UNORM_REV,
-      PIPE_FORMAT_R5G6B5_UNORM
+      PIPE_FORMAT_A8R8G8B8_UNORM,
+      PIPE_FORMAT_A8B8G8R8_UNORM,
+      PIPE_FORMAT_B5G6R5_UNORM
    };
    uint i;
    for (i = 0; i < Elements(colorFormats); i++) {
@@ -322,13 +322,13 @@ default_rgb_format(struct pipe_screen *screen,
                    unsigned geom_flags)
 {
    static const enum pipe_format colorFormats[] = {
-      PIPE_FORMAT_X8R8G8B8_UNORM,
       PIPE_FORMAT_B8G8R8X8_UNORM,
-      PIPE_FORMAT_R8G8B8X8_UNORM,
-      PIPE_FORMAT_A8R8G8B8_UNORM,
+      PIPE_FORMAT_X8R8G8B8_UNORM,
+      PIPE_FORMAT_X8B8G8R8_UNORM,
       PIPE_FORMAT_B8G8R8A8_UNORM,
-      PIPE_FORMAT_R8G8B8A8_UNORM_REV,
-      PIPE_FORMAT_R5G6B5_UNORM
+      PIPE_FORMAT_A8R8G8B8_UNORM,
+      PIPE_FORMAT_A8B8G8R8_UNORM,
+      PIPE_FORMAT_B5G6R5_UNORM
    };
    uint i;
    for (i = 0; i < Elements(colorFormats); i++) {
@@ -349,9 +349,9 @@ default_srgba_format(struct pipe_screen *screen,
                     unsigned geom_flags)
 {
    static const enum pipe_format colorFormats[] = {
-      PIPE_FORMAT_A8R8G8B8_SRGB,
       PIPE_FORMAT_B8G8R8A8_SRGB,
-      PIPE_FORMAT_R8G8B8A8_SRGB,
+      PIPE_FORMAT_A8R8G8B8_SRGB,
+      PIPE_FORMAT_A8B8G8R8_SRGB,
    };
    uint i;
    for (i = 0; i < Elements(colorFormats); i++) {
@@ -393,8 +393,8 @@ default_depth_format(struct pipe_screen *screen,
    static const enum pipe_format zFormats[] = {
       PIPE_FORMAT_Z16_UNORM,
       PIPE_FORMAT_Z32_UNORM,
-      PIPE_FORMAT_S8Z24_UNORM,
-      PIPE_FORMAT_Z24S8_UNORM
+      PIPE_FORMAT_Z24S8_UNORM,
+      PIPE_FORMAT_S8Z24_UNORM
    };
    uint i;
    for (i = 0; i < Elements(zFormats); i++) {
@@ -439,13 +439,13 @@ st_choose_format(struct pipe_screen *screen, GLenum internalFormat,
 
    case GL_RGBA4:
    case GL_RGBA2:
-      if (screen->is_format_supported( screen, PIPE_FORMAT_A4R4G4B4_UNORM, target, tex_usage, geom_flags ))
-         return PIPE_FORMAT_A4R4G4B4_UNORM;
+      if (screen->is_format_supported( screen, PIPE_FORMAT_B4G4R4A4_UNORM, target, tex_usage, geom_flags ))
+         return PIPE_FORMAT_B4G4R4A4_UNORM;
       return default_rgba_format( screen, target, tex_usage, geom_flags );
 
    case GL_RGB5_A1:
-      if (screen->is_format_supported( screen, PIPE_FORMAT_A1R5G5B5_UNORM, target, tex_usage, geom_flags ))
-         return PIPE_FORMAT_A1R5G5B5_UNORM;
+      if (screen->is_format_supported( screen, PIPE_FORMAT_B5G5R5A1_UNORM, target, tex_usage, geom_flags ))
+         return PIPE_FORMAT_B5G5R5A1_UNORM;
       return default_rgba_format( screen, target, tex_usage, geom_flags );
 
    case GL_RGB8:
@@ -457,10 +457,10 @@ st_choose_format(struct pipe_screen *screen, GLenum internalFormat,
    case GL_RGB5:
    case GL_RGB4:
    case GL_R3_G3_B2:
-      if (screen->is_format_supported( screen, PIPE_FORMAT_R5G6B5_UNORM, target, tex_usage, geom_flags ))
-         return PIPE_FORMAT_R5G6B5_UNORM;
-      if (screen->is_format_supported( screen, PIPE_FORMAT_A1R5G5B5_UNORM, target, tex_usage, geom_flags ))
-         return PIPE_FORMAT_A1R5G5B5_UNORM;
+      if (screen->is_format_supported( screen, PIPE_FORMAT_B5G6R5_UNORM, target, tex_usage, geom_flags ))
+         return PIPE_FORMAT_B5G6R5_UNORM;
+      if (screen->is_format_supported( screen, PIPE_FORMAT_B5G5R5A1_UNORM, target, tex_usage, geom_flags ))
+         return PIPE_FORMAT_B5G5R5A1_UNORM;
       return default_rgba_format( screen, target, tex_usage, geom_flags );
 
    case GL_ALPHA:
@@ -493,8 +493,8 @@ st_choose_format(struct pipe_screen *screen, GLenum internalFormat,
    case GL_LUMINANCE12_ALPHA12:
    case GL_LUMINANCE16_ALPHA16:
    case GL_COMPRESSED_LUMINANCE_ALPHA:
-      if (screen->is_format_supported( screen, PIPE_FORMAT_A8L8_UNORM, target, tex_usage, geom_flags ))
-         return PIPE_FORMAT_A8L8_UNORM;
+      if (screen->is_format_supported( screen, PIPE_FORMAT_L8A8_UNORM, target, tex_usage, geom_flags ))
+         return PIPE_FORMAT_L8A8_UNORM;
       return default_rgba_format( screen, target, tex_usage, geom_flags );
 
    case GL_INTENSITY:
@@ -508,13 +508,13 @@ st_choose_format(struct pipe_screen *screen, GLenum internalFormat,
       return default_rgba_format( screen, target, tex_usage, geom_flags );
 
    case GL_YCBCR_MESA:
-      if (screen->is_format_supported(screen, PIPE_FORMAT_YCBCR,
+      if (screen->is_format_supported(screen, PIPE_FORMAT_UYVY,
                                       target, tex_usage, geom_flags)) {
-         return PIPE_FORMAT_YCBCR;
+         return PIPE_FORMAT_UYVY;
       }
-      if (screen->is_format_supported(screen, PIPE_FORMAT_YCBCR_REV,
+      if (screen->is_format_supported(screen, PIPE_FORMAT_YUYV,
                                       target, tex_usage, geom_flags)) {
-         return PIPE_FORMAT_YCBCR_REV;
+         return PIPE_FORMAT_YUYV;
       }
       return PIPE_FORMAT_NONE;
 
@@ -546,10 +546,10 @@ st_choose_format(struct pipe_screen *screen, GLenum internalFormat,
          return PIPE_FORMAT_Z16_UNORM;
       /* fall-through */
    case GL_DEPTH_COMPONENT24:
-      if (screen->is_format_supported( screen, PIPE_FORMAT_S8Z24_UNORM, target, tex_usage, geom_flags ))
-         return PIPE_FORMAT_S8Z24_UNORM;
       if (screen->is_format_supported( screen, PIPE_FORMAT_Z24S8_UNORM, target, tex_usage, geom_flags ))
          return PIPE_FORMAT_Z24S8_UNORM;
+      if (screen->is_format_supported( screen, PIPE_FORMAT_S8Z24_UNORM, target, tex_usage, geom_flags ))
+         return PIPE_FORMAT_S8Z24_UNORM;
       /* fall-through */
    case GL_DEPTH_COMPONENT32:
       if (screen->is_format_supported( screen, PIPE_FORMAT_Z32_UNORM, target, tex_usage, geom_flags ))
@@ -565,18 +565,18 @@ st_choose_format(struct pipe_screen *screen, GLenum internalFormat,
    case GL_STENCIL_INDEX16_EXT:
       if (screen->is_format_supported( screen, PIPE_FORMAT_S8_UNORM, target, tex_usage, geom_flags ))
          return PIPE_FORMAT_S8_UNORM;
-      if (screen->is_format_supported( screen, PIPE_FORMAT_S8Z24_UNORM, target, tex_usage, geom_flags ))
-         return PIPE_FORMAT_S8Z24_UNORM;
       if (screen->is_format_supported( screen, PIPE_FORMAT_Z24S8_UNORM, target, tex_usage, geom_flags ))
          return PIPE_FORMAT_Z24S8_UNORM;
+      if (screen->is_format_supported( screen, PIPE_FORMAT_S8Z24_UNORM, target, tex_usage, geom_flags ))
+         return PIPE_FORMAT_S8Z24_UNORM;
       return PIPE_FORMAT_NONE;
 
    case GL_DEPTH_STENCIL_EXT:
    case GL_DEPTH24_STENCIL8_EXT:
-      if (screen->is_format_supported( screen, PIPE_FORMAT_S8Z24_UNORM, target, tex_usage, geom_flags ))
-         return PIPE_FORMAT_S8Z24_UNORM;
       if (screen->is_format_supported( screen, PIPE_FORMAT_Z24S8_UNORM, target, tex_usage, geom_flags ))
          return PIPE_FORMAT_Z24S8_UNORM;
+      if (screen->is_format_supported( screen, PIPE_FORMAT_S8Z24_UNORM, target, tex_usage, geom_flags ))
+         return PIPE_FORMAT_S8Z24_UNORM;
       return PIPE_FORMAT_NONE;
 
    case GL_SRGB_EXT:
@@ -599,8 +599,8 @@ st_choose_format(struct pipe_screen *screen, GLenum internalFormat,
    case GL_SLUMINANCE8_ALPHA8_EXT:
    case GL_COMPRESSED_SLUMINANCE_EXT:
    case GL_COMPRESSED_SLUMINANCE_ALPHA_EXT:
-      if (screen->is_format_supported( screen, PIPE_FORMAT_A8L8_SRGB, target, tex_usage, geom_flags ))
-         return PIPE_FORMAT_A8L8_SRGB;
+      if (screen->is_format_supported( screen, PIPE_FORMAT_L8A8_SRGB, target, tex_usage, geom_flags ))
+         return PIPE_FORMAT_L8A8_SRGB;
       return default_srgba_format( screen, target, tex_usage, geom_flags );
 
    case GL_SLUMINANCE_EXT:
@@ -680,11 +680,11 @@ GLboolean
 st_equal_formats(enum pipe_format pFormat, GLenum format, GLenum type)
 {
    switch (pFormat) {
-   case PIPE_FORMAT_R8G8B8A8_UNORM_REV:
+   case PIPE_FORMAT_A8B8G8R8_UNORM:
       return format == GL_RGBA && type == GL_UNSIGNED_BYTE;
-   case PIPE_FORMAT_B8G8R8A8_UNORM:
+   case PIPE_FORMAT_A8R8G8B8_UNORM:
       return format == GL_BGRA && type == GL_UNSIGNED_BYTE;
-   case PIPE_FORMAT_R5G6B5_UNORM:
+   case PIPE_FORMAT_B5G6R5_UNORM:
       return format == GL_RGB && type == GL_UNSIGNED_SHORT_5_6_5;
    /* XXX more combos... */
    default: