diff --git a/src/gpu/gl/GrGLAssembleGLInterfaceAutogen.cpp b/src/gpu/gl/GrGLAssembleGLInterfaceAutogen.cpp index 46d0185b0f..f8f46fd105 100644 --- a/src/gpu/gl/GrGLAssembleGLInterfaceAutogen.cpp +++ b/src/gpu/gl/GrGLAssembleGLInterfaceAutogen.cpp @@ -158,9 +158,19 @@ sk_sp GrGLMakeAssembledGLInterface(void *ctx, GrGLGetProc g GET_PROC(MemoryBarrier); } - GET_PROC(BindVertexArray); - GET_PROC(DeleteVertexArrays); - GET_PROC(GenVertexArrays); + if (glVer >= GR_GL_VER(3,0)) { + GET_PROC(BindVertexArray); + GET_PROC(DeleteVertexArrays); + GET_PROC(GenVertexArrays); + } else if (extensions.has("GL_ARB_vertex_array_object")) { + GET_PROC(BindVertexArray); + GET_PROC(DeleteVertexArrays); + GET_PROC(GenVertexArrays); + } else if (extensions.has("GL_APPLE_vertex_array_object")) { + GET_PROC_SUFFIX(BindVertexArray, APPLE); + GET_PROC_SUFFIX(DeleteVertexArrays, APPLE); + GET_PROC_SUFFIX(GenVertexArrays, APPLE); + } if (glVer >= GR_GL_VER(4,0)) { GET_PROC(PatchParameteri); diff --git a/src/gpu/gl/GrGLInterfaceAutogen.cpp b/src/gpu/gl/GrGLInterfaceAutogen.cpp index a382f7a1c5..3417ecef03 100644 --- a/src/gpu/gl/GrGLInterfaceAutogen.cpp +++ b/src/gpu/gl/GrGLInterfaceAutogen.cpp @@ -205,7 +205,10 @@ bool GrGLInterface::validate() const { // all functions were marked optional or test_only } - if (GR_IS_GR_GL(fStandard) || + if ((GR_IS_GR_GL(fStandard) && ( + (glVer >= GR_GL_VER(3,0)) || + fExtensions.has("GL_ARB_vertex_array_object") || + fExtensions.has("GL_APPLE_vertex_array_object"))) || (GR_IS_GR_GL_ES(fStandard) && ( (glVer >= GR_GL_VER(3,0)) || fExtensions.has("GL_OES_vertex_array_object"))) || diff --git a/tools/gpu/gl/interface/interface.json5 b/tools/gpu/gl/interface/interface.json5 index 94ae5a48dd..26324ac1a6 100644 --- a/tools/gpu/gl/interface/interface.json5 +++ b/tools/gpu/gl/interface/interface.json5 @@ -79,7 +79,9 @@ }, { - "GL": [{"ext": ""}], + "GL": [{"min_version": [3, 0], "ext": ""}, + {/* else if */ "ext": "GL_ARB_vertex_array_object"}, + {/* else if */ "ext": "GL_APPLE_vertex_array_object"}], "GLES": [{"min_version": [3, 0], "ext": ""}, {/* else if */ "ext": "GL_OES_vertex_array_object"}], "WebGL": [{"min_version": [2, 0], "ext": ""},