[Mesa-dev] [PATCH 41/45] mesa: replace FEATURE_EXT_texture_sRGB with FEATURE_GL define.

Oliver McFadden oliver.mcfadden at linux.intel.com
Tue Sep 11 02:56:54 PDT 2012


Signed-off-by: Oliver McFadden <oliver.mcfadden at linux.intel.com>
---
 src/mesa/main/extensions.c         |    4 ++--
 src/mesa/main/formats.c            |    4 ++--
 src/mesa/main/glformats.c          |    4 ++--
 src/mesa/main/mfeatures.h          |    1 -
 src/mesa/main/texcompress.c        |    2 +-
 src/mesa/main/texcompress_s3tc.c   |    8 ++++----
 src/mesa/main/texformat.c          |    4 ++--
 src/mesa/main/teximage.c           |    4 ++--
 src/mesa/main/texstore.c           |    4 ++--
 src/mesa/state_tracker/st_format.c |    8 ++++----
 10 files changed, 21 insertions(+), 22 deletions(-)

diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c
index 2f8c73f..bcedb40 100644
--- a/src/mesa/main/extensions.c
+++ b/src/mesa/main/extensions.c
@@ -472,7 +472,7 @@ _mesa_enable_sw_extensions(struct gl_context *ctx)
    ctx->Extensions.EXT_texture_filter_anisotropic = GL_TRUE;
    ctx->Extensions.EXT_texture_mirror_clamp = GL_TRUE;
    ctx->Extensions.EXT_texture_shared_exponent = GL_TRUE;
-#if FEATURE_EXT_texture_sRGB
+#if FEATURE_GL
    ctx->Extensions.EXT_texture_sRGB = GL_TRUE;
    ctx->Extensions.EXT_texture_sRGB_decode = GL_TRUE;
 #endif
@@ -584,7 +584,7 @@ void
 _mesa_enable_2_1_extensions(struct gl_context *ctx)
 {
    ctx->Extensions.EXT_pixel_buffer_object = GL_TRUE;
-#if FEATURE_EXT_texture_sRGB
+#if FEATURE_GL
    ctx->Extensions.EXT_texture_sRGB = GL_TRUE;
 #endif
 }
diff --git a/src/mesa/main/formats.c b/src/mesa/main/formats.c
index caa1e8e..4e63328 100644
--- a/src/mesa/main/formats.c
+++ b/src/mesa/main/formats.c
@@ -2245,7 +2245,7 @@ _mesa_format_to_type_and_comps(gl_format format,
       *comps = 4;
       return;
 
-#if FEATURE_EXT_texture_sRGB
+#if FEATURE_GL
    case MESA_FORMAT_SRGB8:
       *datatype = GL_UNSIGNED_BYTE;
       *comps = 3;
@@ -2274,7 +2274,7 @@ _mesa_format_to_type_and_comps(gl_format format,
    case MESA_FORMAT_RGBA_DXT1:
    case MESA_FORMAT_RGBA_DXT3:
    case MESA_FORMAT_RGBA_DXT5:
-#if FEATURE_EXT_texture_sRGB
+#if FEATURE_GL
    case MESA_FORMAT_SRGB_DXT1:
    case MESA_FORMAT_SRGBA_DXT1:
    case MESA_FORMAT_SRGBA_DXT3:
diff --git a/src/mesa/main/glformats.c b/src/mesa/main/glformats.c
index 2d06cb7..96b3ae2 100644
--- a/src/mesa/main/glformats.c
+++ b/src/mesa/main/glformats.c
@@ -544,7 +544,7 @@ _mesa_is_color_format(GLenum format)
       case GL_COMPRESSED_RGBA_S3TC_DXT5_EXT:
       case GL_COMPRESSED_RGB_FXT1_3DFX:
       case GL_COMPRESSED_RGBA_FXT1_3DFX:
-#if FEATURE_EXT_texture_sRGB
+#if FEATURE_GL
       case GL_SRGB_EXT:
       case GL_SRGB8_EXT:
       case GL_SRGB_ALPHA_EXT:
@@ -561,7 +561,7 @@ _mesa_is_color_format(GLenum format)
       case GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT:
       case GL_COMPRESSED_SLUMINANCE_EXT:
       case GL_COMPRESSED_SLUMINANCE_ALPHA_EXT:
-#endif /* FEATURE_EXT_texture_sRGB */
+#endif /* FEATURE_GL */
       case GL_COMPRESSED_RED_RGTC1:
       case GL_COMPRESSED_SIGNED_RED_RGTC1:
       case GL_COMPRESSED_RG_RGTC2:
diff --git a/src/mesa/main/mfeatures.h b/src/mesa/main/mfeatures.h
index a161021..fd3eae1 100644
--- a/src/mesa/main/mfeatures.h
+++ b/src/mesa/main/mfeatures.h
@@ -84,7 +84,6 @@
 #define FEATURE_remap_table               0
 #endif
 
-#define FEATURE_EXT_texture_sRGB          FEATURE_GL
 #define FEATURE_EXT_transform_feedback    FEATURE_GL
 
 #define FEATURE_APPLE_object_purgeable    FEATURE_GL
diff --git a/src/mesa/main/texcompress.c b/src/mesa/main/texcompress.c
index a24fb23..6a20f14 100644
--- a/src/mesa/main/texcompress.c
+++ b/src/mesa/main/texcompress.c
@@ -390,7 +390,7 @@ _mesa_compressed_format_to_glenum(struct gl_context *ctx, gl_format mesaFormat)
       return GL_COMPRESSED_RGBA_S3TC_DXT3_EXT;
    case MESA_FORMAT_RGBA_DXT5:
       return GL_COMPRESSED_RGBA_S3TC_DXT5_EXT;
-#if FEATURE_EXT_texture_sRGB
+#if FEATURE_GL
    case MESA_FORMAT_SRGB_DXT1:
       return GL_COMPRESSED_SRGB_S3TC_DXT1_EXT;
    case MESA_FORMAT_SRGBA_DXT1:
diff --git a/src/mesa/main/texcompress_s3tc.c b/src/mesa/main/texcompress_s3tc.c
index b349c43..22d0619 100644
--- a/src/mesa/main/texcompress_s3tc.c
+++ b/src/mesa/main/texcompress_s3tc.c
@@ -60,7 +60,7 @@
 #define DXTN_LIBNAME "libtxc_dxtn.so"
 #endif
 
-#if FEATURE_EXT_texture_sRGB
+#if FEATURE_GL
 /**
  * Convert an 8-bit sRGB value from non-linear space to a
  * linear RGB value in [0, 1].
@@ -87,7 +87,7 @@ nonlinear_to_linear(GLubyte cs8)
    }
    return table[cs8];
 }
-#endif /* FEATURE_EXT_texture_sRGB */
+#endif /* FEATURE_GL */
 
 typedef void (*dxtFetchTexelFuncExt)( GLint srcRowstride, GLubyte *pixdata, GLint col, GLint row, GLvoid *texelOut );
 
@@ -478,7 +478,7 @@ _mesa_fetch_texel_rgba_dxt5(const struct swrast_texture_image *texImage,
    texel[ACOMP] = UBYTE_TO_FLOAT(rgba[ACOMP]);
 }
 
-#if FEATURE_EXT_texture_sRGB
+#if FEATURE_GL
 void
 _mesa_fetch_texel_srgb_dxt1(const struct swrast_texture_image *texImage,
                             GLint i, GLint j, GLint k, GLfloat *texel)
@@ -530,7 +530,7 @@ _mesa_fetch_texel_srgba_dxt5(const struct swrast_texture_image *texImage,
    texel[BCOMP] = nonlinear_to_linear(rgba[BCOMP]);
    texel[ACOMP] = UBYTE_TO_FLOAT(rgba[ACOMP]);
 }
-#endif /* FEATURE_EXT_texture_sRGB */
+#endif /* FEATURE_GL */
 
 
 #endif /* FEATURE_GL */
diff --git a/src/mesa/main/texformat.c b/src/mesa/main/texformat.c
index 8f97926..27ed406 100644
--- a/src/mesa/main/texformat.c
+++ b/src/mesa/main/texformat.c
@@ -555,7 +555,7 @@ _mesa_choose_tex_format(struct gl_context *ctx, GLenum target,
       }
    }
 
-#if FEATURE_EXT_texture_sRGB
+#if FEATURE_GL
    if (ctx->Extensions.EXT_texture_sRGB) {
       switch (internalFormat) {
          case GL_SRGB_EXT:
@@ -628,7 +628,7 @@ _mesa_choose_tex_format(struct gl_context *ctx, GLenum target,
             ; /* fallthrough */
       }
    }
-#endif /* FEATURE_EXT_texture_sRGB */
+#endif /* FEATURE_GL */
 
    if (ctx->Extensions.EXT_texture_integer) {
       switch (internalFormat) {
diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c
index 1c6c57b..de072f7 100644
--- a/src/mesa/main/teximage.c
+++ b/src/mesa/main/teximage.c
@@ -311,7 +311,7 @@ _mesa_base_tex_format( struct gl_context *ctx, GLint internalFormat )
       }
    }
 
-#if FEATURE_EXT_texture_sRGB
+#if FEATURE_GL
    if (ctx->Extensions.EXT_texture_sRGB) {
       switch (internalFormat) {
       case GL_SRGB_EXT:
@@ -338,7 +338,7 @@ _mesa_base_tex_format( struct gl_context *ctx, GLint internalFormat )
          ; /* fallthrough */
       }
    }
-#endif /* FEATURE_EXT_texture_sRGB */
+#endif /* FEATURE_GL */
 
    if (ctx->Version >= 30 ||
        ctx->Extensions.EXT_texture_integer) {
diff --git a/src/mesa/main/texstore.c b/src/mesa/main/texstore.c
index 2d05580..d93d3f7 100644
--- a/src/mesa/main/texstore.c
+++ b/src/mesa/main/texstore.c
@@ -3606,7 +3606,7 @@ _mesa_texstore_rgba_uint32(TEXSTORE_PARAMS)
 
 
 
-#if FEATURE_EXT_texture_sRGB
+#if FEATURE_GL
 static GLboolean
 _mesa_texstore_srgb8(TEXSTORE_PARAMS)
 {
@@ -3719,7 +3719,7 @@ _mesa_texstore_sla8(TEXSTORE_PARAMS)
 #define _mesa_texstore_sl8 NULL
 #define _mesa_texstore_sla8 NULL
 
-#endif /* FEATURE_EXT_texture_sRGB */
+#endif /* FEATURE_GL */
 
 static GLboolean
 _mesa_texstore_rgb9_e5(TEXSTORE_PARAMS)
diff --git a/src/mesa/state_tracker/st_format.c b/src/mesa/state_tracker/st_format.c
index 9bdb692..1d513ac 100644
--- a/src/mesa/state_tracker/st_format.c
+++ b/src/mesa/state_tracker/st_format.c
@@ -128,7 +128,7 @@ st_mesa_format_to_pipe_format(gl_format mesaFormat)
       return PIPE_FORMAT_DXT3_RGBA;
    case MESA_FORMAT_RGBA_DXT5:
       return PIPE_FORMAT_DXT5_RGBA;
-#if FEATURE_EXT_texture_sRGB
+#if FEATURE_GL
    case MESA_FORMAT_SRGB_DXT1:
       return PIPE_FORMAT_DXT1_SRGB;
    case MESA_FORMAT_SRGBA_DXT1:
@@ -139,7 +139,7 @@ st_mesa_format_to_pipe_format(gl_format mesaFormat)
       return PIPE_FORMAT_DXT5_SRGBA;
 #endif
 #endif
-#if FEATURE_EXT_texture_sRGB
+#if FEATURE_GL
    case MESA_FORMAT_SLA8:
       return PIPE_FORMAT_L8A8_SRGB;
    case MESA_FORMAT_SL8:
@@ -458,7 +458,7 @@ st_pipe_format_to_mesa_format(enum pipe_format format)
       return MESA_FORMAT_RGBA_DXT3;
    case PIPE_FORMAT_DXT5_RGBA:
       return MESA_FORMAT_RGBA_DXT5;
-#if FEATURE_EXT_texture_sRGB
+#if FEATURE_GL
    case PIPE_FORMAT_DXT1_SRGB:
       return MESA_FORMAT_SRGB_DXT1;
    case PIPE_FORMAT_DXT1_SRGBA:
@@ -470,7 +470,7 @@ st_pipe_format_to_mesa_format(enum pipe_format format)
 #endif
 #endif
 
-#if FEATURE_EXT_texture_sRGB
+#if FEATURE_GL
    case PIPE_FORMAT_L8A8_SRGB:
       return MESA_FORMAT_SLA8;
    case PIPE_FORMAT_L8_SRGB:
-- 
1.7.8.6



More information about the mesa-dev mailing list