On 25 September 2012 14:50, Jordan Justen <span dir="ltr"><<a href="mailto:jljusten@gmail.com" target="_blank">jljusten@gmail.com</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">On Mon, Sep 24, 2012 at 4:49 PM, Paul Berry <<a href="mailto:stereotype441@gmail.com">stereotype441@gmail.com</a>> wrote:<br>
> GLES 3 supports sRGB functionality, but it does not expose the<br>
> GL_FRAMEBUFFER_SRGB enable/disable bit.  Instead the implementation<br>
> is expected to behave as though that bit is always enabled.<br>
><br>
> This patch ensures that ctx->Color.sRGBEnabled (the internal variable<br>
> tracking GL_FRAMEBUFFER_SRG) is initially true in GLES 2/3 contexts,<br>
<br>
</div>And, changing this default state is okay for GLES2?<br></blockquote><div><br>Yes, it should be, since GLES2 implementations don't support any SRGB formats, and GL_FRAMEBUFFER_SRGB only has an effect when rendering to an SRGB format framebuffer.  I'll add a note to the commit message to clarify that.<br>
 </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
SRG => SRGB<br></blockquote><div><br>Gah!  My fingers must be color-blind.  Thanks.<br> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Series:<br>
Reviewed-by: Jordan Justen <<a href="mailto:jordan.l.justen@intel.com">jordan.l.justen@intel.com</a>><br>
<div class="HOEnZb"><div class="h5"><br>
> and that it cannot be modified through the GLES 3 API.<br>
> ---<br>
>  src/mesa/main/blend.c  | 7 +++++++<br>
>  src/mesa/main/enable.c | 4 ++--<br>
>  2 files changed, 9 insertions(+), 2 deletions(-)<br>
><br>
> diff --git a/src/mesa/main/blend.c b/src/mesa/main/blend.c<br>
> index de871a9..5d55311 100644<br>
> --- a/src/mesa/main/blend.c<br>
> +++ b/src/mesa/main/blend.c<br>
> @@ -858,6 +858,13 @@ void _mesa_init_color( struct gl_context * ctx )<br>
>     ctx->Color._ClampFragmentColor = GL_TRUE;<br>
>     ctx->Color.ClampReadColor = GL_FIXED_ONLY_ARB;<br>
>     ctx->Color._ClampReadColor = GL_TRUE;<br>
> +<br>
> +   if (ctx->API == API_OPENGLES2) {<br>
> +      /* GLES 3 behaves as though GL_FRAMEBUFFER_SRGB is always enabled. */<br>
> +      ctx->Color.sRGBEnabled = GL_TRUE;<br>
> +   } else {<br>
> +      ctx->Color.sRGBEnabled = GL_FALSE;<br>
> +   }<br>
>  }<br>
><br>
>  /*@}*/<br>
> diff --git a/src/mesa/main/enable.c b/src/mesa/main/enable.c<br>
> index 676cd9b..a607bdc 100644<br>
> --- a/src/mesa/main/enable.c<br>
> +++ b/src/mesa/main/enable.c<br>
> @@ -1061,7 +1061,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state)<br>
><br>
>        /* GL3.0 - GL_framebuffer_sRGB */<br>
>        case GL_FRAMEBUFFER_SRGB_EXT:<br>
> -         if (!_mesa_is_desktop_gl(ctx) && !_mesa_is_gles3(ctx))<br>
> +         if (!_mesa_is_desktop_gl(ctx))<br>
>              goto invalid_enum_error;<br>
>           CHECK_EXTENSION(EXT_framebuffer_sRGB, cap);<br>
>           _mesa_set_framebuffer_srgb(ctx, state);<br>
> @@ -1715,7 +1715,7 @@ _mesa_IsEnabled( GLenum cap )<br>
><br>
>        /* GL3.0 - GL_framebuffer_sRGB */<br>
>        case GL_FRAMEBUFFER_SRGB_EXT:<br>
> -         if (!_mesa_is_desktop_gl(ctx) && !_mesa_is_gles3(ctx))<br>
> +         if (!_mesa_is_desktop_gl(ctx))<br>
>              goto invalid_enum_error;<br>
>          CHECK_EXTENSION(EXT_framebuffer_sRGB);<br>
>          return ctx->Color.sRGBEnabled;<br>
> --<br>
> 1.7.12.1<br>
><br>
</div></div></blockquote></div><br>