[Mesa-dev] [PATCH 3/4] mesa: remove ctx->Const.sRGBCapable

Ian Romanick idr at freedesktop.org
Tue Jan 24 17:53:29 PST 2012


On 01/24/2012 04:39 PM, Marek Olšák wrote:
> It always had the same value as ctx->Extensions.EXT_framebuffer_sRGB.

I'd be curious why Dave added this flag in the first place.  It's... 
odd.  In any case,

Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>

> ---
>   src/mesa/drivers/dri/intel/intel_context.c |    1 -
>   src/mesa/main/fbobject.c                   |    2 +-
>   src/mesa/main/framebuffer.c                |    2 +-
>   src/mesa/main/mtypes.h                     |    3 ---
>   src/mesa/state_tracker/st_cb_fbo.c         |    2 +-
>   src/mesa/state_tracker/st_extensions.c     |    1 -
>   6 files changed, 3 insertions(+), 8 deletions(-)
>
> diff --git a/src/mesa/drivers/dri/intel/intel_context.c b/src/mesa/drivers/dri/intel/intel_context.c
> index ffd9536..81ba6a1 100644
> --- a/src/mesa/drivers/dri/intel/intel_context.c
> +++ b/src/mesa/drivers/dri/intel/intel_context.c
> @@ -697,7 +697,6 @@ intelInitContext(struct intel_context *intel,
>      _mesa_init_point(ctx);
>
>      if (intel->gen>= 4) {
> -      ctx->Const.sRGBCapable = true;
>         if (MAX_WIDTH>  8192)
>   	 ctx->Const.MaxRenderbufferSize = 8192;
>      } else {
> diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c
> index 79a9729..987d687 100644
> --- a/src/mesa/main/fbobject.c
> +++ b/src/mesa/main/fbobject.c
> @@ -2405,7 +2405,7 @@ _mesa_GetFramebufferAttachmentParameterivEXT(GLenum target, GLenum attachment,
>                        "glGetFramebufferAttachmentParameterivEXT(pname)");
>         }
>         else {
> -         if (ctx->Extensions.EXT_framebuffer_sRGB&&  ctx->Const.sRGBCapable) {
> +         if (ctx->Extensions.EXT_framebuffer_sRGB) {
>               *params = _mesa_get_format_color_encoding(att->Renderbuffer->Format);
>            }
>            else {
> diff --git a/src/mesa/main/framebuffer.c b/src/mesa/main/framebuffer.c
> index 7c3c4e3..ea14148 100644
> --- a/src/mesa/main/framebuffer.c
> +++ b/src/mesa/main/framebuffer.c
> @@ -527,7 +527,7 @@ _mesa_update_framebuffer_visual(struct gl_context *ctx,
>               fb->Visual.samples = rb->NumSamples;
>               fb->Visual.sampleBuffers = rb->NumSamples>  0 ? 1 : 0;
>               if (_mesa_get_format_color_encoding(fmt) == GL_SRGB)
> -                fb->Visual.sRGBCapable = ctx->Const.sRGBCapable;
> +                fb->Visual.sRGBCapable = ctx->Extensions.EXT_framebuffer_sRGB;
>               break;
>            }
>         }
> diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
> index 7601131..a2b01d0 100644
> --- a/src/mesa/main/mtypes.h
> +++ b/src/mesa/main/mtypes.h
> @@ -2808,9 +2808,6 @@ struct gl_constants
>      /** GL_EXT_gpu_shader4 */
>      GLint MinProgramTexelOffset, MaxProgramTexelOffset;
>
> -   /* GL_EXT_framebuffer_sRGB */
> -   GLboolean sRGBCapable; /* can enable sRGB blend/update on FBOs */
> -
>      /* GL_ARB_robustness */
>      GLenum ResetStrategy;
>
> diff --git a/src/mesa/state_tracker/st_cb_fbo.c b/src/mesa/state_tracker/st_cb_fbo.c
> index fefd93a..1cbc0d6 100644
> --- a/src/mesa/state_tracker/st_cb_fbo.c
> +++ b/src/mesa/state_tracker/st_cb_fbo.c
> @@ -471,7 +471,7 @@ st_validate_attachment(struct gl_context *ctx,
>      /* If the encoding is sRGB and sRGB rendering cannot be enabled,
>       * check for linear format support instead.
>       * Later when we create a surface, we change the format to a linear one. */
> -   if (!ctx->Const.sRGBCapable&&
> +   if (!ctx->Extensions.EXT_framebuffer_sRGB&&
>          _mesa_get_format_color_encoding(texFormat) == GL_SRGB) {
>         const gl_format linearFormat = _mesa_get_srgb_format_linear(texFormat);
>         format = st_mesa_format_to_pipe_format(linearFormat);
> diff --git a/src/mesa/state_tracker/st_extensions.c b/src/mesa/state_tracker/st_extensions.c
> index 914f65f..7fb4c8c 100644
> --- a/src/mesa/state_tracker/st_extensions.c
> +++ b/src/mesa/state_tracker/st_extensions.c
> @@ -458,7 +458,6 @@ void st_init_extensions(struct st_context *st)
>                                      PIPE_TEXTURE_2D, 0,
>                                      PIPE_BIND_RENDER_TARGET)) {
>            ctx->Extensions.EXT_framebuffer_sRGB = GL_TRUE;
> -         ctx->Const.sRGBCapable = GL_TRUE;
>         }
>      }
>


More information about the mesa-dev mailing list