Reland "Support EXT_blend_func_extended in the GLES2 context"
This re-lands EXT_blend_func_extended implementation. A lot of the
implementation has been rewritten on top of changes that have been
done since the last attempt.
For now we only expose the extension on desktop GL. To support GLES,
we'd need to investigate what's the most robust way to handle the
compiler output and make the binding of the fragment outputs
conditional.
The extension is disabled on AMD and Intel because of test failures.
BUG=angleproject:1085
TEST=angle_end2end_tests
Change-Id: I619ae3162769b90aad095ddec158ce6c57a114a8
Reviewed-on: https://chromium-review.googlesource.com/1233713
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
diff --git a/src/libANGLE/Context.cpp b/src/libANGLE/Context.cpp
index 54f9f13..92a225e 100644
--- a/src/libANGLE/Context.cpp
+++ b/src/libANGLE/Context.cpp
@@ -1854,6 +1854,11 @@
*params = mGLState.getMaxShaderCompilerThreads();
break;
+ // GL_EXT_blend_func_extended
+ case GL_MAX_DUAL_SOURCE_DRAW_BUFFERS_EXT:
+ *params = mExtensions.maxDualSourceDrawBuffers;
+ break;
+
default:
handleError(mGLState.getIntegerv(this, pname, params));
break;
@@ -3176,6 +3181,11 @@
{
// FIXME(geofflang): Don't support EXT_sRGB in non-ES2 contexts
// supportedExtensions.sRGB = false;
+
+ // EXT_blend_func_extended is only implemented against GLES2 now
+ // TODO(http://anglebug.com/1085): remove this limitation once GLES3 binding API for the
+ // outputs is in place.
+ supportedExtensions.blendFuncExtended = false;
}
// Some extensions are always available because they are implemented in the GL layer.
@@ -7203,6 +7213,13 @@
return true;
}
+ if (getExtensions().blendFuncExtended && pname == GL_MAX_DUAL_SOURCE_DRAW_BUFFERS_EXT)
+ {
+ *type = GL_INT;
+ *numParams = 1;
+ return true;
+ }
+
// Check for ES3.0+ parameter names which are also exposed as ES2 extensions
switch (pname)
{