[Mesa-dev] [PATCH 1/2] mesa: rename MESA_FORMAT_RG88 to MESA_FORMAT_GR88

Brian Paul brianp at vmware.com
Wed Nov 30 19:36:41 PST 2011


To better reflect the component ordering and be consistent with other
format names.
---
 src/mesa/drivers/dri/i965/brw_wm_surface_state.c |    2 +-
 src/mesa/drivers/dri/intel/intel_span.c          |    2 +-
 src/mesa/drivers/dri/intel/intel_tex_format.c    |    2 +-
 src/mesa/main/format_unpack.c                    |    4 ++--
 src/mesa/main/formats.c                          |   10 +++++-----
 src/mesa/main/formats.h                          |    2 +-
 src/mesa/main/renderbuffer.c                     |    4 ++--
 src/mesa/main/texformat.c                        |    4 ++--
 src/mesa/main/texstore.c                         |   10 +++++-----
 src/mesa/state_tracker/st_format.c               |    4 ++--
 src/mesa/swrast/s_texfetch.c                     |   10 +++++-----
 src/mesa/swrast/s_texfetch_tmp.h                 |    6 +++---
 12 files changed, 30 insertions(+), 30 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c
index 0f6abe2..378e083 100644
--- a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c
+++ b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c
@@ -315,7 +315,7 @@ brw_format_for_mesa_format(gl_format mesa_format)
       [MESA_FORMAT_YCBCR_REV] = BRW_SURFACEFORMAT_YCRCB_NORMAL,
       [MESA_FORMAT_YCBCR] = BRW_SURFACEFORMAT_YCRCB_SWAPUVY,
       [MESA_FORMAT_R8] = BRW_SURFACEFORMAT_R8_UNORM,
-      [MESA_FORMAT_RG88] = BRW_SURFACEFORMAT_R8G8_UNORM,
+      [MESA_FORMAT_GR88] = BRW_SURFACEFORMAT_R8G8_UNORM,
       [MESA_FORMAT_RG88_REV] = 0,
       [MESA_FORMAT_R16] = BRW_SURFACEFORMAT_R16_UNORM,
       [MESA_FORMAT_RG1616] = BRW_SURFACEFORMAT_R16G16_UNORM,
diff --git a/src/mesa/drivers/dri/intel/intel_span.c b/src/mesa/drivers/dri/intel/intel_span.c
index 042bc30..d203617 100644
--- a/src/mesa/drivers/dri/intel/intel_span.c
+++ b/src/mesa/drivers/dri/intel/intel_span.c
@@ -420,7 +420,7 @@ static span_init_func intel_span_init_funcs[MESA_FORMAT_COUNT] =
    [MESA_FORMAT_S8_Z24] = _mesa_set_renderbuffer_accessors,
    [MESA_FORMAT_S8] = _mesa_set_renderbuffer_accessors,
    [MESA_FORMAT_R8] = _mesa_set_renderbuffer_accessors,
-   [MESA_FORMAT_RG88] = _mesa_set_renderbuffer_accessors,
+   [MESA_FORMAT_GR88] = _mesa_set_renderbuffer_accessors,
    [MESA_FORMAT_R16] = _mesa_set_renderbuffer_accessors,
    [MESA_FORMAT_RG1616] = _mesa_set_renderbuffer_accessors,
    [MESA_FORMAT_RGBA_FLOAT32] = _mesa_set_renderbuffer_accessors,
diff --git a/src/mesa/drivers/dri/intel/intel_tex_format.c b/src/mesa/drivers/dri/intel/intel_tex_format.c
index a9f4981..898846f 100644
--- a/src/mesa/drivers/dri/intel/intel_tex_format.c
+++ b/src/mesa/drivers/dri/intel/intel_tex_format.c
@@ -14,7 +14,7 @@ intel_mesa_format_to_rb_datatype(gl_format format)
    case MESA_FORMAT_XRGB8888:
    case MESA_FORMAT_SARGB8:
    case MESA_FORMAT_R8:
-   case MESA_FORMAT_RG88:
+   case MESA_FORMAT_GR88:
    case MESA_FORMAT_A8:
    case MESA_FORMAT_I8:
    case MESA_FORMAT_L8:
diff --git a/src/mesa/main/format_unpack.c b/src/mesa/main/format_unpack.c
index fc0db34..a71fe61 100644
--- a/src/mesa/main/format_unpack.c
+++ b/src/mesa/main/format_unpack.c
@@ -504,7 +504,7 @@ unpack_R8(const void *src, GLfloat dst[][4], GLuint n)
 }
 
 static void
-unpack_RG88(const void *src, GLfloat dst[][4], GLuint n)
+unpack_GR88(const void *src, GLfloat dst[][4], GLuint n)
 {
    const GLushort *s = ((const GLushort *) src);
    GLuint i;
@@ -1460,7 +1460,7 @@ get_unpack_rgba_function(gl_format format)
       table[MESA_FORMAT_YCBCR] = unpack_YCBCR;
       table[MESA_FORMAT_YCBCR_REV] = unpack_YCBCR_REV;
       table[MESA_FORMAT_R8] = unpack_R8;
-      table[MESA_FORMAT_RG88] = unpack_RG88;
+      table[MESA_FORMAT_GR88] = unpack_GR88;
       table[MESA_FORMAT_RG88_REV] = unpack_RG88_REV;
       table[MESA_FORMAT_R16] = unpack_R16;
       table[MESA_FORMAT_RG1616] = unpack_RG1616;
diff --git a/src/mesa/main/formats.c b/src/mesa/main/formats.c
index 873fedc..9f3a056 100644
--- a/src/mesa/main/formats.c
+++ b/src/mesa/main/formats.c
@@ -375,8 +375,8 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] =
       1, 1, 1
    },
    {
-      MESA_FORMAT_RG88,
-      "MESA_FORMAT_RG88",
+      MESA_FORMAT_GR88,
+      "MESA_FORMAT_GR88",
       GL_RG,
       GL_UNSIGNED_NORMALIZED,
       8, 8, 0, 0,
@@ -1779,7 +1779,7 @@ _mesa_get_uncompressed_format(gl_format format)
    case MESA_FORMAT_SIGNED_RED_RGTC1:
       return MESA_FORMAT_SIGNED_R8;
    case MESA_FORMAT_RG_RGTC2:
-      return MESA_FORMAT_RG88;
+      return MESA_FORMAT_GR88;
    case MESA_FORMAT_SIGNED_RG_RGTC2:
       return MESA_FORMAT_SIGNED_RG88_REV;
    case MESA_FORMAT_L_LATC1:
@@ -2064,7 +2064,7 @@ _mesa_format_to_type_and_comps(gl_format format,
 
    case MESA_FORMAT_AL88:
    case MESA_FORMAT_AL88_REV:
-   case MESA_FORMAT_RG88:
+   case MESA_FORMAT_GR88:
    case MESA_FORMAT_RG88_REV:
       *datatype = GL_UNSIGNED_BYTE;
       *comps = 2;
@@ -2598,7 +2598,7 @@ _mesa_format_matches_format_and_type(gl_format gl_format,
 
    case MESA_FORMAT_R8:
       return format == GL_RED && type == GL_UNSIGNED_BYTE;
-   case MESA_FORMAT_RG88:
+   case MESA_FORMAT_GR88:
       return format == GL_RG && type == GL_UNSIGNED_BYTE && littleEndian;
    case MESA_FORMAT_RG88_REV:
       return GL_FALSE;
diff --git a/src/mesa/main/formats.h b/src/mesa/main/formats.h
index b22b073..2712c11 100644
--- a/src/mesa/main/formats.h
+++ b/src/mesa/main/formats.h
@@ -91,7 +91,7 @@ typedef enum
    MESA_FORMAT_YCBCR,		/*                     YYYY YYYY UorV UorV */
    MESA_FORMAT_YCBCR_REV,	/*                     UorV UorV YYYY YYYY */
    MESA_FORMAT_R8,		/*                               RRRR RRRR */
-   MESA_FORMAT_RG88,		/*                     GGGG GGGG RRRR RRRR */
+   MESA_FORMAT_GR88,		/*                     GGGG GGGG RRRR RRRR */
    MESA_FORMAT_RG88_REV,	/*                     RRRR RRRR GGGG GGGG */
    MESA_FORMAT_R16,		/*                     RRRR RRRR RRRR RRRR */
    MESA_FORMAT_RG1616,		/* GGGG GGGG GGGG GGGG RRRR RRRR RRRR RRRR */
diff --git a/src/mesa/main/renderbuffer.c b/src/mesa/main/renderbuffer.c
index c9a16a9..24060e6 100644
--- a/src/mesa/main/renderbuffer.c
+++ b/src/mesa/main/renderbuffer.c
@@ -1015,7 +1015,7 @@ get_values_r8(struct gl_context *ctx, struct gl_renderbuffer *rb, GLuint count,
 }
 
 /**********************************************************************
- * Functions for MESA_FORMAT_RG88.
+ * Functions for MESA_FORMAT_GR88.
  */
 static void
 get_row_rg88(struct gl_context *ctx, struct gl_renderbuffer *rb, GLuint count,
@@ -1422,7 +1422,7 @@ _mesa_set_renderbuffer_accessors(struct gl_renderbuffer *rb)
       rb->PutMonoValues = put_mono_values_generic;
       break;
 
-   case MESA_FORMAT_RG88:
+   case MESA_FORMAT_GR88:
       rb->DataType = GL_UNSIGNED_BYTE;
       rb->GetValues = get_values_rg88;
       rb->GetRow = get_row_rg88;
diff --git a/src/mesa/main/texformat.c b/src/mesa/main/texformat.c
index 6d8e272..009c4cc 100644
--- a/src/mesa/main/texformat.c
+++ b/src/mesa/main/texformat.c
@@ -763,12 +763,12 @@ _mesa_choose_tex_format( struct gl_context *ctx, GLint internalFormat,
 
       case GL_RG:
       case GL_RG8:
-	 RETURN_IF_SUPPORTED(MESA_FORMAT_RG88);
+	 RETURN_IF_SUPPORTED(MESA_FORMAT_GR88);
 	 break;
 
       case GL_COMPRESSED_RG:
 	 RETURN_IF_SUPPORTED(MESA_FORMAT_RG_RGTC2);
-	 RETURN_IF_SUPPORTED(MESA_FORMAT_RG88);
+	 RETURN_IF_SUPPORTED(MESA_FORMAT_GR88);
 	 break;
 
       case GL_RG16:
diff --git a/src/mesa/main/texstore.c b/src/mesa/main/texstore.c
index 0079590..78fc297 100644
--- a/src/mesa/main/texstore.c
+++ b/src/mesa/main/texstore.c
@@ -2141,7 +2141,7 @@ _mesa_texstore_unorm88(TEXSTORE_PARAMS)
 
    ASSERT(dstFormat == MESA_FORMAT_AL88 ||
           dstFormat == MESA_FORMAT_AL88_REV ||
-          dstFormat == MESA_FORMAT_RG88 ||
+          dstFormat == MESA_FORMAT_GR88 ||
           dstFormat == MESA_FORMAT_RG88_REV);
    ASSERT(texelBytes == 2);
 
@@ -2150,7 +2150,7 @@ _mesa_texstore_unorm88(TEXSTORE_PARAMS)
        ((dstFormat == MESA_FORMAT_AL88 &&
          baseInternalFormat == GL_LUMINANCE_ALPHA &&
          srcFormat == GL_LUMINANCE_ALPHA) ||
-        (dstFormat == MESA_FORMAT_RG88 &&
+        (dstFormat == MESA_FORMAT_GR88 &&
          baseInternalFormat == srcFormat)) &&
        srcType == GL_UNSIGNED_BYTE &&
        littleEndian) {
@@ -2182,7 +2182,7 @@ _mesa_texstore_unorm88(TEXSTORE_PARAMS)
 	 }
       }
       else {
-	 if ((littleEndian && dstFormat == MESA_FORMAT_RG88) ||
+	 if ((littleEndian && dstFormat == MESA_FORMAT_GR88) ||
 	     (!littleEndian && dstFormat == MESA_FORMAT_RG88_REV)) {
 	    dstmap[0] = 0;
 	    dstmap[1] = 1;
@@ -2224,7 +2224,7 @@ _mesa_texstore_unorm88(TEXSTORE_PARAMS)
          for (row = 0; row < srcHeight; row++) {
             GLushort *dstUS = (GLushort *) dstRow;
             if (dstFormat == MESA_FORMAT_AL88 ||
-		dstFormat == MESA_FORMAT_RG88) {
+		dstFormat == MESA_FORMAT_GR88) {
                for (col = 0; col < srcWidth; col++) {
                   /* src[0] is luminance (or R), src[1] is alpha (or G) */
                  dstUS[col] = PACK_COLOR_88( src[1],
@@ -4374,7 +4374,7 @@ _mesa_get_texstore_func(gl_format format)
       table[MESA_FORMAT_YCBCR] = _mesa_texstore_ycbcr;
       table[MESA_FORMAT_YCBCR_REV] = _mesa_texstore_ycbcr;
       table[MESA_FORMAT_R8] = _mesa_texstore_unorm8;
-      table[MESA_FORMAT_RG88] = _mesa_texstore_unorm88;
+      table[MESA_FORMAT_GR88] = _mesa_texstore_unorm88;
       table[MESA_FORMAT_RG88_REV] = _mesa_texstore_unorm88;
       table[MESA_FORMAT_R16] = _mesa_texstore_unorm16;
       table[MESA_FORMAT_RG1616] = _mesa_texstore_unorm1616;
diff --git a/src/mesa/state_tracker/st_format.c b/src/mesa/state_tracker/st_format.c
index bc414f4..8639110 100644
--- a/src/mesa/state_tracker/st_format.c
+++ b/src/mesa/state_tracker/st_format.c
@@ -287,7 +287,7 @@ st_mesa_format_to_pipe_format(gl_format mesaFormat)
       return PIPE_FORMAT_R8_UNORM;
    case MESA_FORMAT_R16:
       return PIPE_FORMAT_R16_UNORM;
-   case MESA_FORMAT_RG88:
+   case MESA_FORMAT_GR88:
       return PIPE_FORMAT_R8G8_UNORM;
    case MESA_FORMAT_RG1616:
       return PIPE_FORMAT_R16G16_UNORM;
@@ -616,7 +616,7 @@ st_pipe_format_to_mesa_format(enum pipe_format format)
    case PIPE_FORMAT_R16_UNORM:
       return MESA_FORMAT_R16;
    case PIPE_FORMAT_R8G8_UNORM:
-      return MESA_FORMAT_RG88;
+      return MESA_FORMAT_GR88;
    case PIPE_FORMAT_R16G16_UNORM:
       return MESA_FORMAT_RG1616;
 
diff --git a/src/mesa/swrast/s_texfetch.c b/src/mesa/swrast/s_texfetch.c
index ab7cfb5..735f253 100644
--- a/src/mesa/swrast/s_texfetch.c
+++ b/src/mesa/swrast/s_texfetch.c
@@ -361,11 +361,11 @@ texfetch_funcs[MESA_FORMAT_COUNT] =
       store_texel_r8,
    },
    {
-      MESA_FORMAT_RG88,
-      fetch_texel_1d_f_rg88,
-      fetch_texel_2d_f_rg88,
-      fetch_texel_3d_f_rg88,
-      store_texel_rg88,
+      MESA_FORMAT_GR88,
+      fetch_texel_1d_f_gr88,
+      fetch_texel_2d_f_gr88,
+      fetch_texel_3d_f_gr88,
+      store_texel_gr88,
    },
    {
       MESA_FORMAT_RG88_REV,
diff --git a/src/mesa/swrast/s_texfetch_tmp.h b/src/mesa/swrast/s_texfetch_tmp.h
index 88711b0..5a7c650 100644
--- a/src/mesa/swrast/s_texfetch_tmp.h
+++ b/src/mesa/swrast/s_texfetch_tmp.h
@@ -1007,10 +1007,10 @@ static void store_texel_argb2101010(struct swrast_texture_image *texImage,
 #endif
 
 
-/* MESA_FORMAT_RG88 **********************************************************/
+/* MESA_FORMAT_GR88 **********************************************************/
 
 /* Fetch texel from 1D, 2D or 3D rg88 texture, return 4 GLchans */
-static void FETCH(f_rg88)( const struct swrast_texture_image *texImage,
+static void FETCH(f_gr88)( const struct swrast_texture_image *texImage,
                            GLint i, GLint j, GLint k, GLfloat *texel )
 {
    const GLushort s = *TEXEL_ADDR(GLushort, texImage, i, j, k, 1);
@@ -1021,7 +1021,7 @@ static void FETCH(f_rg88)( const struct swrast_texture_image *texImage,
 }
 
 #if DIM == 3
-static void store_texel_rg88(struct swrast_texture_image *texImage,
+static void store_texel_gr88(struct swrast_texture_image *texImage,
                              GLint i, GLint j, GLint k, const void *texel)
 {
    const GLchan *rgba = (const GLchan *) texel;
-- 
1.7.3.4



More information about the mesa-dev mailing list