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 e7482d7dc71af0b5db9256f250420c560541fcda..eabd4ae9213e2fe293f320ac6935fabedf5c6d9e 100644 |
--- a/ui/gl/gl_bindings_autogen_gl.cc |
+++ b/ui/gl/gl_bindings_autogen_gl.cc |
@@ -202,6 +202,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; |
@@ -481,6 +482,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 = |
@@ -509,6 +512,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 = |
@@ -525,6 +530,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 = |
@@ -601,16 +608,23 @@ 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")); |
+ } else if (ext.b_GL_EXT_gpu_shader4 || ext.b_GL_EXT_blend_func_extended) { |
+ fn.glBindFragDataLocationFn = reinterpret_cast<glBindFragDataLocationProc>( |
+ GetGLProcAddress("glBindFragDataLocationEXT")); |
} |
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")); |
+ } else if (ext.b_GL_EXT_blend_func_extended) { |
+ fn.glBindFragDataLocationIndexedFn = |
+ reinterpret_cast<glBindFragDataLocationIndexedProc>( |
+ GetGLProcAddress("glBindFragDataLocationIndexedEXT")); |
} |
debug_fn.glBindFramebufferEXTFn = 0; |
@@ -1157,6 +1171,15 @@ void DriverGL::InitializeDynamicBindings(GLContext* context) { |
GetGLProcAddress("glGetFenceivNV")); |
} |
+ debug_fn.glGetFragDataIndexFn = 0; |
+ if (ver->IsAtLeastGL(3u, 3u) || ext.b_GL_ARB_blend_func_extended) { |
+ fn.glGetFragDataIndexFn = reinterpret_cast<glGetFragDataIndexProc>( |
+ GetGLProcAddress("glGetFragDataIndex")); |
+ } else if (ext.b_GL_EXT_blend_func_extended) { |
+ fn.glGetFragDataIndexFn = reinterpret_cast<glGetFragDataIndexProc>( |
+ GetGLProcAddress("glGetFragDataIndexEXT")); |
+ } |
+ |
debug_fn.glGetFragDataLocationFn = 0; |
if (ver->IsAtLeastGL(3u, 0u) || ver->IsAtLeastGLES(3u, 0u)) { |
fn.glGetFragDataLocationFn = reinterpret_cast<glGetFragDataLocationProc>( |
@@ -3188,6 +3211,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" |
@@ -5591,6 +5623,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; |
@@ -7103,6 +7139,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); |
} |
@@ -9104,6 +9144,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); |
@@ -11415,6 +11460,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() |