aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/gl/GrGLAssembleInterface.cpp
diff options
context:
space:
mode:
authorGravatar kkinnunen <kkinnunen@nvidia.com>2015-07-30 22:47:04 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-07-30 22:47:04 -0700
commitd94708e71e8611015cdeb4f5874a11816e40ecdc (patch)
tree46fcc208c449c0717f7e729f98b5e28fa76f07f2 /src/gpu/gl/GrGLAssembleInterface.cpp
parentbf49e46aca85dc1a0ec089ccaefbb33e7ed6a7d5 (diff)
Implement support for dual source blending in ES
Use EXT_blend_func_extended to implement dual source blending in OpenGL ES. The extension is the ES version of ARB_blend_func_extended. The extension provides gl_SecondaryFragColorEXT for ES 2.0 contexts. The extension provides glBindFragDataLocationIndexed to bind a custom fragment shader output to the secondary color for ES 3.0 contexts. For ES 3.1 contexts, the extension would also give "layout (location=0, index=1)" output varible layout modifier syntax, but it is not used in this patch. The extension needs #extension GL_EXT_blend_func_extended : require directive for the variables to be available in ES 2.0. For ES 3.0, the directive relaxes the rules for the amount of output variables without layout location qualifiers. OpenGL continues to use GL_ARB_blend_func_extended for dual source blending. Review URL: https://codereview.chromium.org/1266773003
Diffstat (limited to 'src/gpu/gl/GrGLAssembleInterface.cpp')
-rw-r--r--src/gpu/gl/GrGLAssembleInterface.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/gpu/gl/GrGLAssembleInterface.cpp b/src/gpu/gl/GrGLAssembleInterface.cpp
index d19b1a3077..9b07246ef3 100644
--- a/src/gpu/gl/GrGLAssembleInterface.cpp
+++ b/src/gpu/gl/GrGLAssembleInterface.cpp
@@ -497,6 +497,11 @@ const GrGLInterface* GrGLAssembleGLESInterface(void* ctx, GrGLGetProc get) {
GET_PROC(BindTexture);
GET_PROC_SUFFIX(BindVertexArray, OES);
+ if (version >= GR_GL_VER(3,0) && extensions.has("GL_EXT_blend_func_extended")) {
+ GET_PROC_SUFFIX(BindFragDataLocation, EXT);
+ GET_PROC_SUFFIX(BindFragDataLocationIndexed, EXT);
+ }
+
if (extensions.has("GL_KHR_blend_equation_advanced")) {
GET_PROC_SUFFIX(BlendBarrier, KHR);
} else if (extensions.has("GL_NV_blend_equation_advanced")) {