gallium: use is_format_supported() to determine if GL_EXT_texture_sRGB is supported
authorBrian Paul <brian.paul@tungstengraphics.com>
Fri, 21 Mar 2008 16:51:21 +0000 (10:51 -0600)
committerBrian Paul <brian.paul@tungstengraphics.com>
Fri, 21 Mar 2008 17:06:52 +0000 (11:06 -0600)
src/mesa/state_tracker/st_extensions.c

index 0962b5f..9926e11 100644 (file)
@@ -155,7 +155,6 @@ void st_init_extensions(struct st_context *st)
    ctx->Extensions.EXT_texture_env_combine = GL_TRUE;
    ctx->Extensions.EXT_texture_env_dot3 = GL_TRUE;
    ctx->Extensions.EXT_texture_lod_bias = GL_TRUE;
-   ctx->Extensions.EXT_texture_sRGB = GL_TRUE; /* XXX temp */
 
    ctx->Extensions.NV_blend_square = GL_TRUE;
    ctx->Extensions.NV_texgen_reflection = GL_TRUE;
@@ -214,4 +213,8 @@ void st_init_extensions(struct st_context *st)
       /*ctx->Extensions.ARB_shadow_ambient = GL_TRUE;*/
    }
 
+   if (screen->is_format_supported(screen, PIPE_FORMAT_R8G8B8A8_SRGB,
+                                   PIPE_TEXTURE)) {
+      ctx->Extensions.EXT_texture_sRGB = GL_TRUE;
+   }
 }