summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/blend.c
diff options
context:
space:
mode:
authorPaul Berry <stereotype441@gmail.com>2012-09-24 14:47:12 -0700
committerPaul Berry <stereotype441@gmail.com>2012-09-25 15:02:43 -0700
commit112caa853d53467a9c0ef171f272505db0278c6a (patch)
tree81cdbb77abf7d8bb2e2c9de30065766acdf53e36 /src/mesa/main/blend.c
parent414f69aaad442abfce506323d0f0640139928898 (diff)
gles3: Prohibit set/get of GL_FRAMEBUFFER_SRGB.
GLES 3 supports sRGB functionality, but it does not expose the GL_FRAMEBUFFER_SRGB enable/disable bit. Instead the implementation is expected to behave as though that bit is always enabled. This patch ensures that ctx->Color.sRGBEnabled (the internal variable tracking GL_FRAMEBUFFER_SRGB) is initially true in GLES 2/3 contexts, and that it cannot be modified through the GLES 3 API. This is safe for GLES 2, since ctx->Color.sRGBEnabled has no effect on non-sRGB formats, and GLES 2 doesn't support any sRGB formats. Reviewed-by: Brian Paul <brianp@vmware.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Diffstat (limited to 'src/mesa/main/blend.c')
-rw-r--r--src/mesa/main/blend.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/mesa/main/blend.c b/src/mesa/main/blend.c
index de871a92a39..5d553118c1b 100644
--- a/src/mesa/main/blend.c
+++ b/src/mesa/main/blend.c
@@ -858,6 +858,13 @@ void _mesa_init_color( struct gl_context * ctx )
ctx->Color._ClampFragmentColor = GL_TRUE;
ctx->Color.ClampReadColor = GL_FIXED_ONLY_ARB;
ctx->Color._ClampReadColor = GL_TRUE;
+
+ 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;
+ }
}
/*@}*/