summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/buffers.c
diff options
context:
space:
mode:
authorTapani Pälli <tapani.palli@intel.com>2014-11-25 06:10:30 -0500
committerTapani Pälli <tapani.palli@intel.com>2015-01-14 07:48:51 +0200
commitf52fe39d311f3b1988edaeb4765279bbe337b1b7 (patch)
treef2ddf1b2cff26f9ee99234018aef0e041daca760 /src/mesa/main/buffers.c
parent3a5c7e47fdcfb3e322c0756e960cbcf8403e4230 (diff)
downloadexternal_mesa3d-f52fe39d311f3b1988edaeb4765279bbe337b1b7.zip
external_mesa3d-f52fe39d311f3b1988edaeb4765279bbe337b1b7.tar.gz
external_mesa3d-f52fe39d311f3b1988edaeb4765279bbe337b1b7.tar.bz2
mesa/glsl/glapi: enable GL_EXT_draw_buffers extension
Patch enables ES2 extension that utilizes existing ES3 functionality. Changes make all the subtests to run and pass in WebGL conformance test 'webgl-draw-buffers' when running Chrome on OpenGL ES, also Piglit test 'draw_buffers_gles2' passes. v2: remove unused boolean (Ilia Mirkin) v3: proper error checking for invalid values (Chad Versace) v4: run error check explicitly for ES2 and ES3 (Kenneth Graunke) Signed-off-by: Tapani Pälli <tapani.palli@intel.com> Reviewed-by: Matt Turner <mattst88@gmail.com> Reviewed-by: Chad Versace <chad.versace@intel.com>
Diffstat (limited to 'src/mesa/main/buffers.c')
-rw-r--r--src/mesa/main/buffers.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/mesa/main/buffers.c b/src/mesa/main/buffers.c
index 1ee2009..49157f7 100644
--- a/src/mesa/main/buffers.c
+++ b/src/mesa/main/buffers.c
@@ -326,8 +326,9 @@ _mesa_DrawBuffers(GLsizei n, const GLenum *buffers)
/* From the ES 3.0 specification, page 180:
* "If the GL is bound to the default framebuffer, then n must be 1
* and the constant must be BACK or NONE."
+ * (same restriction applies with GL_EXT_draw_buffers specification)
*/
- if (_mesa_is_gles3(ctx) && _mesa_is_winsys_fbo(ctx->DrawBuffer) &&
+ if (ctx->API == API_OPENGLES2 && _mesa_is_winsys_fbo(ctx->DrawBuffer) &&
(n != 1 || (buffers[0] != GL_NONE && buffers[0] != GL_BACK))) {
_mesa_error(ctx, GL_INVALID_OPERATION, "glDrawBuffers(buffer)");
return;
@@ -399,8 +400,9 @@ _mesa_DrawBuffers(GLsizei n, const GLenum *buffers)
/* ES 3.0 is even more restrictive. From the ES 3.0 spec, page 180:
* "If the GL is bound to a framebuffer object, the ith buffer listed
* in bufs must be COLOR_ATTACHMENTi or NONE. [...] INVALID_OPERATION."
+ * (same restriction applies with GL_EXT_draw_buffers specification)
*/
- if (_mesa_is_gles3(ctx) && _mesa_is_user_fbo(ctx->DrawBuffer) &&
+ if (ctx->API == API_OPENGLES2 && _mesa_is_user_fbo(ctx->DrawBuffer) &&
buffers[output] != GL_NONE &&
buffers[output] != GL_COLOR_ATTACHMENT0 + output) {
_mesa_error(ctx, GL_INVALID_OPERATION, "glDrawBuffers(buffer)");