Index: src/gpu/gl/GrGLAssembleInterface.cpp |
diff --git a/src/gpu/gl/GrGLAssembleInterface.cpp b/src/gpu/gl/GrGLAssembleInterface.cpp |
index 6b578f34fc7d1e13763d460a4ae40af5f6fef321..30eed62c5e49f05387a21117e492d647919a1145 100644 |
--- a/src/gpu/gl/GrGLAssembleInterface.cpp |
+++ b/src/gpu/gl/GrGLAssembleInterface.cpp |
@@ -138,6 +138,19 @@ const GrGLInterface* GrGLAssembleGLInterface(void* ctx, GrGLGetProc get) { |
GET_PROC(DrawBuffer); |
GET_PROC(DrawBuffers); |
GET_PROC(DrawElements); |
+ |
+ if (glVer >= GR_GL_VER(3,1) || extensions.has("GL_ARB_draw_instanced") || |
+ extensions.has("GL_EXT_draw_instanced")) { |
+ GET_PROC(DrawArraysInstanced); |
+ GET_PROC(DrawElementsInstanced); |
+ } |
+ |
+ if (glVer >= GR_GL_VER(4,0)) { |
+ // We don't use ARB_draw_indirect because it does not support a base instance. |
+ GET_PROC(DrawArraysIndirect); |
+ GET_PROC(DrawElementsIndirect); |
+ } |
+ |
GET_PROC(Enable); |
GET_PROC(EnableVertexAttribArray); |
GET_PROC(EndQuery); |
@@ -228,6 +241,11 @@ const GrGLInterface* GrGLAssembleGLInterface(void* ctx, GrGLGetProc get) { |
GET_PROC(VertexAttrib2fv); |
GET_PROC(VertexAttrib3fv); |
GET_PROC(VertexAttrib4fv); |
+ |
+ if (glVer >= GR_GL_VER(3,2) || extensions.has("GL_ARB_instanced_arrays")) { |
+ GET_PROC(VertexAttribDivisor); |
+ } |
+ |
GET_PROC(VertexAttribPointer); |
GET_PROC(Viewport); |
GET_PROC(BindFragDataLocationIndexed); |
@@ -338,14 +356,10 @@ const GrGLInterface* GrGLAssembleGLInterface(void* ctx, GrGLGetProc get) { |
GET_PROC(GetProgramResourceLocation); |
} |
- if (glVer >= GR_GL_VER(3,1) || extensions.has("GL_ARB_draw_instanced") || |
- extensions.has("GL_EXT_draw_instanced")) { |
- GET_PROC(DrawArraysInstanced); |
- GET_PROC(DrawElementsInstanced); |
- } |
- |
- if (glVer >= GR_GL_VER(3,2) || extensions.has("GL_ARB_instanced_arrays")) { |
- GET_PROC(VertexAttribDivisor); |
+ if (glVer >= GR_GL_VER(4,3)) { |
+ // We don't use ARB_multi_draw_indirect because it does not support GL_DRAW_INDIRECT_BUFFER. |
+ GET_PROC(MultiDrawArraysIndirect); |
+ GET_PROC(MultiDrawElementsIndirect); |
} |
if (extensions.has("GL_NV_bindless_texture")) { |
@@ -564,6 +578,20 @@ const GrGLInterface* GrGLAssembleGLESInterface(void* ctx, GrGLGetProc get) { |
GET_PROC(Disable); |
GET_PROC(DisableVertexAttribArray); |
GET_PROC(DrawArrays); |
+ |
+ if (version >= GR_GL_VER(3,0)) { |
+ GET_PROC(DrawArraysInstanced); |
+ GET_PROC(DrawElementsInstanced); |
+ } else if (extensions.has("GL_EXT_draw_instanced")) { |
+ GET_PROC_SUFFIX(DrawArraysInstanced, EXT); |
+ GET_PROC_SUFFIX(DrawElementsInstanced, EXT); |
+ } |
+ |
+ if (version >= GR_GL_VER(3,1)) { |
+ GET_PROC(DrawArraysIndirect); |
+ GET_PROC(DrawElementsIndirect); |
+ } |
+ |
GET_PROC(DrawElements); |
GET_PROC(Enable); |
GET_PROC(EnableVertexAttribArray); |
@@ -643,6 +671,13 @@ const GrGLInterface* GrGLAssembleGLESInterface(void* ctx, GrGLGetProc get) { |
GET_PROC(VertexAttrib2fv); |
GET_PROC(VertexAttrib3fv); |
GET_PROC(VertexAttrib4fv); |
+ |
+ if (version >= GR_GL_VER(3,0)) { |
+ GET_PROC(VertexAttribDivisor); |
+ } else if (extensions.has("GL_EXT_instanced_arrays")) { |
+ GET_PROC_SUFFIX(VertexAttribDivisor, EXT); |
+ } |
+ |
GET_PROC(VertexAttribPointer); |
GET_PROC(Viewport); |
GET_PROC(BindFramebuffer); |
@@ -779,18 +814,9 @@ const GrGLInterface* GrGLAssembleGLESInterface(void* ctx, GrGLGetProc get) { |
GET_PROC_SUFFIX(CoverageModulation, CHROMIUM); |
} |
- if (version >= GR_GL_VER(3,0)) { |
- GET_PROC(DrawArraysInstanced); |
- GET_PROC(DrawElementsInstanced); |
- } else if (extensions.has("GL_EXT_draw_instanced")) { |
- GET_PROC_SUFFIX(DrawArraysInstanced, EXT); |
- GET_PROC_SUFFIX(DrawElementsInstanced, EXT); |
- } |
- |
- if (version >= GR_GL_VER(3,0)) { |
- GET_PROC(VertexAttribDivisor); |
- } else if (extensions.has("GL_EXT_instanced_arrays")) { |
- GET_PROC_SUFFIX(VertexAttribDivisor, EXT); |
+ if (extensions.has("GL_EXT_multi_draw_indirect")) { |
+ GET_PROC_SUFFIX(MultiDrawArraysIndirect, EXT); |
+ GET_PROC_SUFFIX(MultiDrawElementsIndirect, EXT); |
} |
if (extensions.has("GL_NV_bindless_texture")) { |