Index: ui/gl/gl_bindings_autogen_gl.cc |
diff --git a/ui/gl/gl_bindings_autogen_gl.cc b/ui/gl/gl_bindings_autogen_gl.cc |
index ea3f185b06c8b254c1db32e77bda27ad0092829b..80034a88d4b7a8f3b2a3ca3fa0315fd8116eda84 100644 |
--- a/ui/gl/gl_bindings_autogen_gl.cc |
+++ b/ui/gl/gl_bindings_autogen_gl.cc |
@@ -201,6 +201,7 @@ void DriverGL::InitializeStaticBindings() { |
fn.glGetFenceivNVFn = 0; |
fn.glGetFloatvFn = |
reinterpret_cast<glGetFloatvProc>(GetGLProcAddress("glGetFloatv")); |
+ fn.glGetFragDataIndexFn = 0; |
fn.glGetFragDataLocationFn = 0; |
fn.glGetFramebufferAttachmentParameterivEXTFn = 0; |
fn.glGetGraphicsResetStatusARBFn = 0; |
@@ -480,6 +481,8 @@ void DriverGL::InitializeDynamicBindings(GLContext* context) { |
extensions.find("GL_APPLE_fence ") != std::string::npos; |
ext.b_GL_APPLE_vertex_array_object = |
extensions.find("GL_APPLE_vertex_array_object ") != std::string::npos; |
+ ext.b_GL_ARB_blend_func_extended = |
+ extensions.find("GL_ARB_blend_func_extended ") != std::string::npos; |
ext.b_GL_ARB_draw_buffers = |
extensions.find("GL_ARB_draw_buffers ") != std::string::npos; |
ext.b_GL_ARB_draw_instanced = |
@@ -508,6 +511,8 @@ void DriverGL::InitializeDynamicBindings(GLContext* context) { |
std::string::npos; |
ext.b_GL_CHROMIUM_glgetstringi_hack = |
extensions.find("GL_CHROMIUM_glgetstringi_hack ") != std::string::npos; |
+ ext.b_GL_EXT_blend_func_extended = |
+ extensions.find("GL_EXT_blend_func_extended ") != std::string::npos; |
ext.b_GL_EXT_debug_marker = |
extensions.find("GL_EXT_debug_marker ") != std::string::npos; |
ext.b_GL_EXT_direct_state_access = |
@@ -524,6 +529,8 @@ void DriverGL::InitializeDynamicBindings(GLContext* context) { |
extensions.find("GL_EXT_framebuffer_multisample ") != std::string::npos; |
ext.b_GL_EXT_framebuffer_object = |
extensions.find("GL_EXT_framebuffer_object ") != std::string::npos; |
+ ext.b_GL_EXT_gpu_shader4 = |
+ extensions.find("GL_EXT_gpu_shader4 ") != std::string::npos; |
ext.b_GL_EXT_map_buffer_range = |
extensions.find("GL_EXT_map_buffer_range ") != std::string::npos; |
ext.b_GL_EXT_multisampled_render_to_texture = |
@@ -597,18 +604,27 @@ void DriverGL::InitializeDynamicBindings(GLContext* context) { |
} |
debug_fn.glBindFragDataLocationFn = 0; |
- if (ver->IsAtLeastGL(3u, 0u)) { |
+ if (ver->IsAtLeastGL(3u, 0u) || ext.b_GL_ARB_blend_func_extended) { |
fn.glBindFragDataLocationFn = reinterpret_cast<glBindFragDataLocationProc>( |
GetGLProcAddress("glBindFragDataLocation")); |
DCHECK(fn.glBindFragDataLocationFn); |
+ } else if (ext.b_GL_EXT_gpu_shader4 || ext.b_GL_EXT_blend_func_extended) { |
Mark Kilgard
2015/08/28 19:53:25
technically, correct to check for EXT_gpu_shader4
|
+ fn.glBindFragDataLocationFn = reinterpret_cast<glBindFragDataLocationProc>( |
+ GetGLProcAddress("glBindFragDataLocationEXT")); |
+ DCHECK(fn.glBindFragDataLocationFn); |
} |
debug_fn.glBindFragDataLocationIndexedFn = 0; |
- if (ver->IsAtLeastGL(3u, 3u)) { |
+ if (ver->IsAtLeastGL(3u, 3u) || ext.b_GL_ARB_blend_func_extended) { |
fn.glBindFragDataLocationIndexedFn = |
reinterpret_cast<glBindFragDataLocationIndexedProc>( |
GetGLProcAddress("glBindFragDataLocationIndexed")); |
DCHECK(fn.glBindFragDataLocationIndexedFn); |
+ } else if (ext.b_GL_EXT_blend_func_extended) { |
+ fn.glBindFragDataLocationIndexedFn = |
+ reinterpret_cast<glBindFragDataLocationIndexedProc>( |
+ GetGLProcAddress("glBindFragDataLocationIndexedEXT")); |
+ DCHECK(fn.glBindFragDataLocationIndexedFn); |
} |
debug_fn.glBindFramebufferEXTFn = 0; |
@@ -1254,6 +1270,17 @@ void DriverGL::InitializeDynamicBindings(GLContext* context) { |
DCHECK(fn.glGetFenceivNVFn); |
} |
+ debug_fn.glGetFragDataIndexFn = 0; |
+ if (ver->IsAtLeastGL(3u, 3u) || ext.b_GL_ARB_blend_func_extended) { |
+ fn.glGetFragDataIndexFn = reinterpret_cast<glGetFragDataIndexProc>( |
+ GetGLProcAddress("glGetFragDataIndex")); |
+ DCHECK(fn.glGetFragDataIndexFn); |
+ } else if (ext.b_GL_EXT_blend_func_extended) { |
+ fn.glGetFragDataIndexFn = reinterpret_cast<glGetFragDataIndexProc>( |
+ GetGLProcAddress("glGetFragDataIndexEXT")); |
+ DCHECK(fn.glGetFragDataIndexFn); |
+ } |
+ |
debug_fn.glGetFragDataLocationFn = 0; |
if (ver->IsAtLeastGL(3u, 0u) || ver->IsAtLeastGLES(3u, 0u)) { |
fn.glGetFragDataLocationFn = reinterpret_cast<glGetFragDataLocationProc>( |
@@ -3413,6 +3440,15 @@ static void GL_BINDING_CALL Debug_glGetFloatv(GLenum pname, GLfloat* params) { |
g_driver_gl.debug_fn.glGetFloatvFn(pname, params); |
} |
+static GLint GL_BINDING_CALL Debug_glGetFragDataIndex(GLuint program, |
+ const char* name) { |
+ GL_SERVICE_LOG("glGetFragDataIndex" |
+ << "(" << program << ", " << name << ")"); |
+ GLint result = g_driver_gl.debug_fn.glGetFragDataIndexFn(program, name); |
+ GL_SERVICE_LOG("GL_RESULT: " << result); |
+ return result; |
+} |
+ |
static GLint GL_BINDING_CALL Debug_glGetFragDataLocation(GLuint program, |
const char* name) { |
GL_SERVICE_LOG("glGetFragDataLocation" |
@@ -5810,6 +5846,10 @@ void DriverGL::InitializeDebugBindings() { |
debug_fn.glGetFloatvFn = fn.glGetFloatvFn; |
fn.glGetFloatvFn = Debug_glGetFloatv; |
} |
+ if (!debug_fn.glGetFragDataIndexFn) { |
+ debug_fn.glGetFragDataIndexFn = fn.glGetFragDataIndexFn; |
+ fn.glGetFragDataIndexFn = Debug_glGetFragDataIndex; |
+ } |
if (!debug_fn.glGetFragDataLocationFn) { |
debug_fn.glGetFragDataLocationFn = fn.glGetFragDataLocationFn; |
fn.glGetFragDataLocationFn = Debug_glGetFragDataLocation; |
@@ -7318,6 +7358,10 @@ void GLApiBase::glGetFloatvFn(GLenum pname, GLfloat* params) { |
driver_->fn.glGetFloatvFn(pname, params); |
} |
+GLint GLApiBase::glGetFragDataIndexFn(GLuint program, const char* name) { |
+ return driver_->fn.glGetFragDataIndexFn(program, name); |
+} |
+ |
GLint GLApiBase::glGetFragDataLocationFn(GLuint program, const char* name) { |
return driver_->fn.glGetFragDataLocationFn(program, name); |
} |
@@ -9313,6 +9357,11 @@ void TraceGLApi::glGetFloatvFn(GLenum pname, GLfloat* params) { |
gl_api_->glGetFloatvFn(pname, params); |
} |
+GLint TraceGLApi::glGetFragDataIndexFn(GLuint program, const char* name) { |
+ TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::glGetFragDataIndex") |
+ return gl_api_->glGetFragDataIndexFn(program, name); |
+} |
+ |
GLint TraceGLApi::glGetFragDataLocationFn(GLuint program, const char* name) { |
TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::glGetFragDataLocation") |
return gl_api_->glGetFragDataLocationFn(program, name); |
@@ -11617,6 +11666,14 @@ void NoContextGLApi::glGetFloatvFn(GLenum pname, GLfloat* params) { |
LOG(ERROR) << "Trying to call glGetFloatv() without current GL context"; |
} |
+GLint NoContextGLApi::glGetFragDataIndexFn(GLuint program, const char* name) { |
+ NOTREACHED() |
+ << "Trying to call glGetFragDataIndex() without current GL context"; |
+ LOG(ERROR) |
+ << "Trying to call glGetFragDataIndex() without current GL context"; |
+ return 0; |
+} |
+ |
GLint NoContextGLApi::glGetFragDataLocationFn(GLuint program, |
const char* name) { |
NOTREACHED() |