[Mesa-dev] [PATCH 3/9] mesa: fix sRGB rendering for GLES1

Marek Olšák maraeo at gmail.com
Wed Jun 10 09:27:14 PDT 2015


From: Marek Olšák <marek.olsak at amd.com>

---
 src/mesa/main/blend.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/src/mesa/main/blend.c b/src/mesa/main/blend.c
index d869fa2..d365305 100644
--- a/src/mesa/main/blend.c
+++ b/src/mesa/main/blend.c
@@ -930,12 +930,10 @@ void _mesa_init_color( struct gl_context * ctx )
    ctx->Color._ClampFragmentColor = GL_FALSE;
    ctx->Color.ClampReadColor = GL_FIXED_ONLY_ARB;
 
-   if (ctx->API == API_OPENGLES2) {
-      /* GLES 3 behaves as though GL_FRAMEBUFFER_SRGB is always enabled. */
-      ctx->Color.sRGBEnabled = GL_TRUE;
-   } else {
-      ctx->Color.sRGBEnabled = GL_FALSE;
-   }
+   /* GLES 1/2/3 behaves as though GL_FRAMEBUFFER_SRGB is always enabled
+    * if EGL_KHR_gl_colorspace has been used to request sRGB.
+    */
+   ctx->Color.sRGBEnabled = _mesa_is_gles(ctx);
 }
 
 /*@}*/
-- 
2.1.0



More information about the mesa-dev mailing list