diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/gpu/gl/GrGLAssembleInterface.cpp | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/gpu/gl/GrGLAssembleInterface.cpp b/src/gpu/gl/GrGLAssembleInterface.cpp index 6b0234abb7..d33a8b6cb1 100644 --- a/src/gpu/gl/GrGLAssembleInterface.cpp +++ b/src/gpu/gl/GrGLAssembleInterface.cpp @@ -801,8 +801,22 @@ const GrGLInterface* GrGLAssembleGLESInterface(void* ctx, GrGLGetProc get) { GET_PROC(GetRenderbufferParameteriv); GET_PROC(RenderbufferStorage); + // There are several APIs for buffer mapping: + // ES2 + GL_OES_mapbuffer: MapBufferOES and UnmapBufferOES + // ES2 + GL_EXT_map_buffer_range: Adds MapBufferRangeEXT and FlushMappedBufferRangeEXT + // ES3: MapBufferRange, FlushMappedBufferRange, and UnmapBuffer are core (so no suffix). + // + // MapBuffer is not part of ES3, but implementations may still report the OES versions of + // MapBuffer and UnmapBuffer, per the older GL_OES_mapbuffer extension. Some implementations + // let us mix the newer MapBufferRange with the older UnmapBufferOES, but we've hit others that + // don't permit it. Note that in GrGLBuffer, we choose which API to use based on version and + // extensions. This code is written so that we never mix OES and non-OES functions. GET_PROC_SUFFIX(MapBuffer, OES); - GET_PROC_SUFFIX(UnmapBuffer, OES); + if (version >= GR_GL_VER(3, 0)) { + GET_PROC(UnmapBuffer); + } else { + GET_PROC_SUFFIX(UnmapBuffer, OES); + } if (version >= GR_GL_VER(3,0)) { GET_PROC(MapBufferRange); |