<div dir="ltr">Again, I think this would be more readable if the refactor was in its own commit with a little more explanation what's going on.  Then add DSA.<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jan 21, 2015 at 5:40 PM, Laura Ekstrand <span dir="ltr"><<a href="mailto:laura@jlekstrand.net" target="_blank">laura@jlekstrand.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">---<br>
 src/mapi/glapi/gen/ARB_direct_state_access.xml |  14 ++<br>
 src/mesa/main/bufferobj.c                      | 327 ++++++++++++-------------<br>
 src/mesa/main/bufferobj.h                      |  20 +-<br>
 src/mesa/main/tests/dispatch_sanity.cpp        |   2 +<br>
 4 files changed, 189 insertions(+), 174 deletions(-)<br>
<br>
diff --git a/src/mapi/glapi/gen/ARB_direct_state_access.xml b/src/mapi/glapi/gen/ARB_direct_state_access.xml<br>
index 4b29e00..7727f0d 100644<br>
--- a/src/mapi/glapi/gen/ARB_direct_state_access.xml<br>
+++ b/src/mapi/glapi/gen/ARB_direct_state_access.xml<br>
@@ -61,6 +61,20 @@<br>
       <param name="data" type="const GLvoid *" /><br>
    </function><br>
<br>
+   <function name="MapNamedBuffer" offset="assign"><br>
+      <return type="GLvoid *" /><br>
+      <param name="buffer" type="GLuint" /><br>
+      <param name="access" type="GLenum" /><br>
+   </function><br>
+<br>
+   <function name="MapNamedBufferRange" offset="assign"><br>
+      <return type="GLvoid *" /><br>
+      <param name="buffer" type="GLuint" /><br>
+      <param name="offset" type="GLintptr" /><br>
+      <param name="length" type="GLsizeiptr" /><br>
+      <param name="access" type="GLbitfield" /><br>
+   </function><br>
+<br>
   <!-- Texture object functions --><br>
<br>
    <function name="CreateTextures" offset="assign"><br>
diff --git a/src/mesa/main/bufferobj.c b/src/mesa/main/bufferobj.c<br>
index 1ec1681..16c0faa 100644<br>
--- a/src/mesa/main/bufferobj.c<br>
+++ b/src/mesa/main/bufferobj.c<br>
@@ -701,7 +701,7 @@ _mesa_ClearBufferSubData_sw(struct gl_context *ctx,<br>
  * Called via glMapBufferRange().<br>
  */<br>
 static void *<br>
-_mesa_buffer_map_range( struct gl_context *ctx, GLintptr offset,<br>
+_mesa_MapBufferRange_sw(struct gl_context *ctx, GLintptr offset,<br>
                         GLsizeiptr length, GLbitfield access,<br>
                         struct gl_buffer_object *bufObj,<br>
                         gl_map_buffer_index index)<br>
@@ -1116,7 +1116,7 @@ _mesa_init_buffer_object_functions(struct dd_function_table *driver)<br>
    driver->ClearBufferSubData = _mesa_ClearBufferSubData_sw;<br>
<br>
    /* GL_ARB_map_buffer_range */<br>
-   driver->MapBufferRange = _mesa_buffer_map_range;<br>
+   driver->MapBufferRange = _mesa_MapBufferRange_sw;<br>
    driver->FlushMappedBufferRange = _mesa_buffer_flush_mapped_range;<br>
<br>
    /* GL_ARB_copy_buffer */<br>
@@ -1794,116 +1794,6 @@ _mesa_ClearNamedBufferSubData(GLuint buffer, GLenum internalformat,<br>
 }<br>
<br>
<br>
-void * GLAPIENTRY<br>
-_mesa_MapBuffer(GLenum target, GLenum access)<br>
-{<br>
-   GET_CURRENT_CONTEXT(ctx);<br>
-   struct gl_buffer_object * bufObj;<br>
-   GLbitfield accessFlags;<br>
-   void *map;<br>
-   bool valid_access;<br>
-<br>
-   ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, NULL);<br>
-<br>
-   switch (access) {<br>
-   case GL_READ_ONLY_ARB:<br>
-      accessFlags = GL_MAP_READ_BIT;<br>
-      valid_access = _mesa_is_desktop_gl(ctx);<br>
-      break;<br>
-   case GL_WRITE_ONLY_ARB:<br>
-      accessFlags = GL_MAP_WRITE_BIT;<br>
-      valid_access = true;<br>
-      break;<br>
-   case GL_READ_WRITE_ARB:<br>
-      accessFlags = GL_MAP_READ_BIT | GL_MAP_WRITE_BIT;<br>
-      valid_access = _mesa_is_desktop_gl(ctx);<br>
-      break;<br>
-   default:<br>
-      valid_access = false;<br>
-      break;<br>
-   }<br>
-<br>
-   if (!valid_access) {<br>
-      _mesa_error(ctx, GL_INVALID_ENUM, "glMapBufferARB(access)");<br>
-      return NULL;<br>
-   }<br>
-<br>
-   bufObj = get_buffer(ctx, "glMapBufferARB", target, GL_INVALID_OPERATION);<br>
-   if (!bufObj)<br>
-      return NULL;<br>
-<br>
-   if (accessFlags & GL_MAP_READ_BIT &&<br>
-       !(bufObj->StorageFlags & GL_MAP_READ_BIT)) {<br>
-      _mesa_error(ctx, GL_INVALID_OPERATION,<br>
-                  "glMapBuffer(invalid read flag)");<br>
-      return NULL;<br>
-   }<br>
-<br>
-   if (accessFlags & GL_MAP_WRITE_BIT &&<br>
-       !(bufObj->StorageFlags & GL_MAP_WRITE_BIT)) {<br>
-      _mesa_error(ctx, GL_INVALID_OPERATION,<br>
-                  "glMapBuffer(invalid write flag)");<br>
-      return NULL;<br>
-   }<br>
-<br>
-   if (_mesa_bufferobj_mapped(bufObj, MAP_USER)) {<br>
-      _mesa_error(ctx, GL_INVALID_OPERATION, "glMapBufferARB(already mapped)");<br>
-      return NULL;<br>
-   }<br>
-<br>
-   if (!bufObj->Size) {<br>
-      _mesa_error(ctx, GL_OUT_OF_MEMORY,<br>
-                  "glMapBuffer(buffer size = 0)");<br>
-      return NULL;<br>
-   }<br>
-<br>
-   ASSERT(ctx->Driver.MapBufferRange);<br>
-   map = ctx->Driver.MapBufferRange(ctx, 0, bufObj->Size, accessFlags, bufObj,<br>
-                                    MAP_USER);<br>
-   if (!map) {<br>
-      _mesa_error(ctx, GL_OUT_OF_MEMORY, "glMapBufferARB(map failed)");<br>
-      return NULL;<br>
-   }<br>
-   else {<br>
-      /* The driver callback should have set these fields.<br>
-       * This is important because other modules (like VBO) might call<br>
-       * the driver function directly.<br>
-       */<br>
-      ASSERT(bufObj->Mappings[MAP_USER].Pointer == map);<br>
-      ASSERT(bufObj->Mappings[MAP_USER].Length == bufObj->Size);<br>
-      ASSERT(bufObj->Mappings[MAP_USER].Offset == 0);<br>
-      bufObj->Mappings[MAP_USER].AccessFlags = accessFlags;<br>
-   }<br>
-<br>
-   if (access == GL_WRITE_ONLY_ARB || access == GL_READ_WRITE_ARB)<br>
-      bufObj->Written = GL_TRUE;<br>
-<br>
-#ifdef VBO_DEBUG<br>
-   printf("glMapBufferARB(%u, sz %ld, access 0x%x)\n",<br>
-         bufObj->Name, bufObj->Size, access);<br>
-   if (access == GL_WRITE_ONLY_ARB) {<br>
-      GLuint i;<br>
-      GLubyte *b = (GLubyte *) bufObj->Pointer;<br>
-      for (i = 0; i < bufObj->Size; i++)<br>
-         b[i] = i & 0xff;<br>
-   }<br>
-#endif<br>
-<br>
-#ifdef BOUNDS_CHECK<br>
-   {<br>
-      GLubyte *buf = (GLubyte *) bufObj->Pointer;<br>
-      GLuint i;<br>
-      /* buffer is 100 bytes larger than requested, fill with magic value */<br>
-      for (i = 0; i < 100; i++) {<br>
-         buf[bufObj->Size - i - 1] = 123;<br>
-      }<br>
-   }<br>
-#endif<br>
-<br>
-   return bufObj->Mappings[MAP_USER].Pointer;<br>
-}<br>
-<br>
-<br>
 GLboolean GLAPIENTRY<br>
 _mesa_UnmapBuffer(GLenum target)<br>
 {<br>
@@ -2227,35 +2117,33 @@ _mesa_CopyNamedBufferSubData(GLuint readBuffer, GLuint writeBuffer,<br>
 }<br>
<br>
<br>
-/**<br>
- * See GL_ARB_map_buffer_range spec<br>
- */<br>
-void * GLAPIENTRY<br>
-_mesa_MapBufferRange(GLenum target, GLintptr offset, GLsizeiptr length,<br>
-                     GLbitfield access)<br>
+void *<br>
+_mesa_map_buffer_range(struct gl_context *ctx,<br>
+                       struct gl_buffer_object *bufObj,<br>
+                       GLintptr offset, GLsizeiptr length,<br>
+                       GLbitfield access, const char *func)<br>
 {<br>
-   GET_CURRENT_CONTEXT(ctx);<br>
-   struct gl_buffer_object *bufObj;<br>
    void *map;<br>
    GLbitfield allowed_access;<br>
<br>
    ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, NULL);<br>
<br>
-   if (!ctx->Extensions.ARB_map_buffer_range) {<br>
-      _mesa_error(ctx, GL_INVALID_OPERATION,<br>
-                  "glMapBufferRange(extension not supported)");<br>
+   if (offset < 0) {<br>
+      _mesa_error(ctx, GL_INVALID_VALUE,<br>
+                  "%s(offset %ld < 0)", func, (long) offset);<br>
       return NULL;<br>
    }<br>
<br>
-   if (offset < 0) {<br>
+   if (length < 0) {<br>
       _mesa_error(ctx, GL_INVALID_VALUE,<br>
-                  "glMapBufferRange(offset = %ld)", (long)offset);<br>
+                  "%s(length %ld < 0)", func, (long) length);<br>
       return NULL;<br>
    }<br>
<br>
-   if (length < 0) {<br>
+   if (offset + length > bufObj->Size) {<br>
       _mesa_error(ctx, GL_INVALID_VALUE,<br>
-                  "glMapBufferRange(length = %ld)", (long)length);<br>
+                  "%s(offset %d + length %d > bufObj->Size %d)", func,<br>
+                  (int) offset, (int) length, (int) bufObj->Size);<br>
       return NULL;<br>
    }<br>
<br>
@@ -2265,13 +2153,30 @@ _mesa_MapBufferRange(GLenum target, GLintptr offset, GLsizeiptr length,<br>
     *     conditions:<br>
     *<br>
     *     * <length> is zero."<br>
+    *<br>
+    * Additionally, page 94 of the PDF of the OpenGL 4.5 core spec<br>
+    * (30.10.2014) also says this, so it's no longer allowed for desktop GL,<br>
+    * either.<br>
     */<br>
-   if (_mesa_is_gles(ctx) && length == 0) {<br>
+   if (length == 0) {<br>
+      _mesa_error(ctx, GL_INVALID_OPERATION, "%s(length = 0)", func);<br>
+      return NULL;<br>
+   }<br>
+<br>
+   if (_mesa_bufferobj_mapped(bufObj, MAP_USER)) {<br>
       _mesa_error(ctx, GL_INVALID_OPERATION,<br>
-                  "glMapBufferRange(length = 0)");<br>
+                  "%s(buffer already mapped)", func);<br>
+      return NULL;<br>
+   }<br>
+<br>
+   if (!bufObj->Size) {<br>
+      _mesa_error(ctx, GL_OUT_OF_MEMORY, "%s(buffer size = 0)", func);<br>
       return NULL;<br>
    }<br>
<br>
+<br>
+   /* Check access bits */<br>
+<br>
    allowed_access = GL_MAP_READ_BIT |<br>
                     GL_MAP_WRITE_BIT |<br>
                     GL_MAP_INVALIDATE_RANGE_BIT |<br>
@@ -2285,14 +2190,15 @@ _mesa_MapBufferRange(GLenum target, GLintptr offset, GLsizeiptr length,<br>
    }<br>
<br>
    if (access & ~allowed_access) {<br>
-      /* generate an error if any other than allowed bit is set */<br>
-      _mesa_error(ctx, GL_INVALID_VALUE, "glMapBufferRange(access)");<br>
+      /* generate an error if any bits other than those allowed are set */<br>
+      _mesa_error(ctx, GL_INVALID_VALUE,<br>
+                  "%s(access has undefined bits set)", func);<br>
       return NULL;<br>
    }<br>
<br>
    if ((access & (GL_MAP_READ_BIT | GL_MAP_WRITE_BIT)) == 0) {<br>
       _mesa_error(ctx, GL_INVALID_OPERATION,<br>
-                  "glMapBufferRange(access indicates neither read or write)");<br>
+                  "%s(access indicates neither read or write)", func);<br>
       return NULL;<br>
    }<br>
<br>
@@ -2301,82 +2207,53 @@ _mesa_MapBufferRange(GLenum target, GLintptr offset, GLsizeiptr length,<br>
                   GL_MAP_INVALIDATE_BUFFER_BIT |<br>
                   GL_MAP_UNSYNCHRONIZED_BIT))) {<br>
       _mesa_error(ctx, GL_INVALID_OPERATION,<br>
-                  "glMapBufferRange(invalid access flags)");<br>
+                  "%s(read access with disallowed bits)", func);<br>
       return NULL;<br>
    }<br>
<br>
    if ((access & GL_MAP_FLUSH_EXPLICIT_BIT) &&<br>
        ((access & GL_MAP_WRITE_BIT) == 0)) {<br>
       _mesa_error(ctx, GL_INVALID_OPERATION,<br>
-                  "glMapBufferRange(invalid access flags)");<br>
+                  "%s(access has flush explicit without write)", func);<br>
       return NULL;<br>
    }<br>
<br>
-   bufObj = get_buffer(ctx, "glMapBufferRange", target, GL_INVALID_OPERATION);<br>
-   if (!bufObj)<br>
-      return NULL;<br>
-<br>
    if (access & GL_MAP_READ_BIT &&<br>
        !(bufObj->StorageFlags & GL_MAP_READ_BIT)) {<br>
       _mesa_error(ctx, GL_INVALID_OPERATION,<br>
-                  "glMapBufferRange(invalid read flag)");<br>
+                  "%s(buffer does not allow read access)", func);<br>
       return NULL;<br>
    }<br>
<br>
    if (access & GL_MAP_WRITE_BIT &&<br>
        !(bufObj->StorageFlags & GL_MAP_WRITE_BIT)) {<br>
       _mesa_error(ctx, GL_INVALID_OPERATION,<br>
-                  "glMapBufferRange(invalid write flag)");<br>
-      return NULL;<br>
-   }<br>
-<br>
-   if (access & GL_MAP_COHERENT_BIT &&<br>
-       !(bufObj->StorageFlags & GL_MAP_COHERENT_BIT)) {<br>
-      _mesa_error(ctx, GL_INVALID_OPERATION,<br>
-                  "glMapBufferRange(invalid coherent flag)");<br>
+                  "%s(buffer does not allow write access)", func);<br>
       return NULL;<br>
    }<br>
<br>
    if (access & GL_MAP_PERSISTENT_BIT &&<br>
        !(bufObj->StorageFlags & GL_MAP_PERSISTENT_BIT)) {<br>
       _mesa_error(ctx, GL_INVALID_OPERATION,<br>
-                  "glMapBufferRange(invalid persistent flag)");<br>
-      return NULL;<br>
-   }<br>
-<br>
-   if (offset + length > bufObj->Size) {<br>
-      _mesa_error(ctx, GL_INVALID_VALUE,<br>
-                  "glMapBufferRange(offset + length > size)");<br>
+                  "%s(buffer does not allow persistent access)", func);<br>
       return NULL;<br>
    }<br>
<br>
-   if (_mesa_bufferobj_mapped(bufObj, MAP_USER)) {<br>
+   if (access & GL_MAP_COHERENT_BIT &&<br>
+       !(bufObj->StorageFlags & GL_MAP_COHERENT_BIT)) {<br>
       _mesa_error(ctx, GL_INVALID_OPERATION,<br>
-                  "glMapBufferRange(buffer already mapped)");<br>
+                  "%s(buffer does not allow coherent access)", func);<br>
       return NULL;<br>
    }<br>
<br>
-   if (!bufObj->Size) {<br>
-      _mesa_error(ctx, GL_OUT_OF_MEMORY,<br>
-                  "glMapBufferRange(buffer size = 0)");<br>
-      return NULL;<br>
-   }<br>
<br>
-   /* Mapping zero bytes should return a non-null pointer. */<br>
-   if (!length) {<br>
-      static long dummy = 0;<br>
-      bufObj->Mappings[MAP_USER].Pointer = &dummy;<br>
-      bufObj->Mappings[MAP_USER].Length = length;<br>
-      bufObj->Mappings[MAP_USER].Offset = offset;<br>
-      bufObj->Mappings[MAP_USER].AccessFlags = access;<br>
-      return bufObj->Mappings[MAP_USER].Pointer;<br>
-   }<br>
+   /* Perform mapping */<br>
<br>
    ASSERT(ctx->Driver.MapBufferRange);<br>
    map = ctx->Driver.MapBufferRange(ctx, offset, length, access, bufObj,<br>
                                     MAP_USER);<br>
    if (!map) {<br>
-      _mesa_error(ctx, GL_OUT_OF_MEMORY, "glMapBufferARB(map failed)");<br>
+      _mesa_error(ctx, GL_OUT_OF_MEMORY, "%s(map failed)", func);<br>
    }<br>
    else {<br>
       /* The driver callback should have set all these fields.<br>
@@ -2392,6 +2269,114 @@ _mesa_MapBufferRange(GLenum target, GLintptr offset, GLsizeiptr length,<br>
    return map;<br>
 }<br>
<br>
+void * GLAPIENTRY<br>
+_mesa_MapBufferRange(GLenum target, GLintptr offset, GLsizeiptr length,<br>
+                     GLbitfield access)<br>
+{<br>
+   GET_CURRENT_CONTEXT(ctx);<br>
+   struct gl_buffer_object *bufObj;<br>
+<br>
+   bufObj = get_buffer(ctx, "glMapBufferRange", target, GL_INVALID_OPERATION);<br>
+   if (!bufObj)<br>
+      return NULL;<br>
+<br>
+   if (!ctx->Extensions.ARB_map_buffer_range) {<br>
+      _mesa_error(ctx, GL_INVALID_OPERATION,<br>
+                  "glMapBufferRange(ARB_map_buffer_range not supported)");<br>
+      return NULL;<br>
+   }<br>
+<br>
+   return _mesa_map_buffer_range(ctx, bufObj, offset, length, access,<br>
+                                 "glMapBufferRange");<br>
+}<br>
+<br>
+void * GLAPIENTRY<br>
+_mesa_MapNamedBufferRange(GLuint buffer, GLintptr offset, GLsizeiptr length,<br>
+                          GLbitfield access)<br>
+{<br>
+   GET_CURRENT_CONTEXT(ctx);<br>
+   struct gl_buffer_object *bufObj;<br>
+<br>
+   bufObj = _mesa_lookup_bufferobj_err(ctx, buffer, "glMapNamedBufferRange");<br>
+   if (!bufObj)<br>
+      return NULL;<br>
+<br>
+   if (!ctx->Extensions.ARB_map_buffer_range) {<br>
+      _mesa_error(ctx, GL_INVALID_OPERATION,<br>
+                  "glMapNamedBufferRange("<br>
+                  "ARB_map_buffer_range not supported)");<br>
+      return NULL;<br>
+   }<br>
+<br>
+   return _mesa_map_buffer_range(ctx, bufObj, offset, length, access,<br>
+                                 "glMapNamedBufferRange");<br>
+}<br>
+<br>
+/**<br>
+ * Converts GLenum access from MapBuffer and MapNamedBuffer into<br>
+ * flags for input to _mesa_map_buffer_range.<br>
+ *<br>
+ * \return true if the type of requested access is permissible.<br>
+ */<br>
+static bool<br>
+get_map_buffer_access_flags(struct gl_context *ctx, GLenum access,<br>
+                            GLbitfield *flags)<br>
+{<br>
+   switch (access) {<br>
+   case GL_READ_ONLY_ARB:<br>
+      *flags = GL_MAP_READ_BIT;<br>
+      return _mesa_is_desktop_gl(ctx);<br>
+   case GL_WRITE_ONLY_ARB:<br>
+      *flags = GL_MAP_WRITE_BIT;<br>
+      return true;<br>
+   case GL_READ_WRITE_ARB:<br>
+      *flags = GL_MAP_READ_BIT | GL_MAP_WRITE_BIT;<br>
+      return _mesa_is_desktop_gl(ctx);<br>
+   default:<br>
+      return false;<br>
+   }<br>
+}<br>
+<br>
+void * GLAPIENTRY<br>
+_mesa_MapBuffer(GLenum target, GLenum access)<br>
+{<br>
+   GET_CURRENT_CONTEXT(ctx);<br>
+   struct gl_buffer_object *bufObj;<br>
+   GLbitfield accessFlags;<br>
+<br>
+   if (!get_map_buffer_access_flags(ctx, access, &accessFlags)) {<br>
+      _mesa_error(ctx, GL_INVALID_ENUM, "glMapBuffer(invalid access)");<br>
+      return NULL;<br>
+   }<br>
+<br>
+   bufObj = get_buffer(ctx, "glMapBuffer", target, GL_INVALID_OPERATION);<br>
+   if (!bufObj)<br>
+      return NULL;<br>
+<br>
+   return _mesa_map_buffer_range(ctx, bufObj, 0, bufObj->Size, accessFlags,<br>
+                                 "glMapBuffer");<br>
+}<br>
+<br>
+void * GLAPIENTRY<br>
+_mesa_MapNamedBuffer(GLuint buffer, GLenum access)<br>
+{<br>
+   GET_CURRENT_CONTEXT(ctx);<br>
+   struct gl_buffer_object *bufObj;<br>
+   GLbitfield accessFlags;<br>
+<br>
+   if (!get_map_buffer_access_flags(ctx, access, &accessFlags)) {<br>
+      _mesa_error(ctx, GL_INVALID_ENUM, "glMapNamedBuffer(invalid access)");<br>
+      return NULL;<br>
+   }<br>
+<br>
+   bufObj = _mesa_lookup_bufferobj_err(ctx, buffer, "glMapNamedBuffer");<br>
+   if (!bufObj)<br>
+      return NULL;<br>
+<br>
+   return _mesa_map_buffer_range(ctx, bufObj, 0, bufObj->Size, accessFlags,<br>
+                                 "glMapNamedBuffer");<br>
+}<br>
+<br>
<br>
 /**<br>
  * See GL_ARB_map_buffer_range spec<br>
diff --git a/src/mesa/main/bufferobj.h b/src/mesa/main/bufferobj.h<br>
index b6e833d..b34162e 100644<br>
--- a/src/mesa/main/bufferobj.h<br>
+++ b/src/mesa/main/bufferobj.h<br>
@@ -155,6 +155,12 @@ _mesa_copy_buffer_sub_data(struct gl_context *ctx,<br>
                            GLintptr readOffset, GLintptr writeOffset,<br>
                            GLsizeiptr size, const char *func);<br>
<br>
+extern void *<br>
+_mesa_map_buffer_range(struct gl_context *ctx,<br>
+                       struct gl_buffer_object *bufObj,<br>
+                       GLintptr offset, GLsizeiptr length,<br>
+                       GLbitfield access, const char *func);<br>
+<br>
 extern void<br>
 _mesa_ClearBufferSubData_sw(struct gl_context *ctx,<br>
                             GLintptr offset, GLsizeiptr size,<br>
@@ -239,9 +245,6 @@ _mesa_ClearNamedBufferSubData(GLuint buffer, GLenum internalformat,<br>
                               GLenum format, GLenum type,<br>
                               const GLvoid *data);<br>
<br>
-void * GLAPIENTRY<br>
-_mesa_MapBuffer(GLenum target, GLenum access);<br>
-<br>
 GLboolean GLAPIENTRY<br>
 _mesa_UnmapBuffer(GLenum target);<br>
<br>
@@ -268,6 +271,17 @@ void * GLAPIENTRY<br>
 _mesa_MapBufferRange(GLenum target, GLintptr offset, GLsizeiptr length,<br>
                      GLbitfield access);<br>
<br>
+void * GLAPIENTRY<br>
+_mesa_MapNamedBufferRange(GLuint buffer, GLintptr offset, GLsizeiptr length,<br>
+                          GLbitfield access);<br>
+<br>
+void * GLAPIENTRY<br>
+_mesa_MapBuffer(GLenum target, GLenum access);<br>
+<br>
+void * GLAPIENTRY<br>
+_mesa_MapNamedBuffer(GLuint buffer, GLenum access);<br>
+<br>
+<br>
 void GLAPIENTRY<br>
 _mesa_FlushMappedBufferRange(GLenum target,<br>
                              GLintptr offset, GLsizeiptr length);<br>
diff --git a/src/mesa/main/tests/dispatch_sanity.cpp b/src/mesa/main/tests/dispatch_sanity.cpp<br>
index 9dcfecc..5632ac0 100644<br>
--- a/src/mesa/main/tests/dispatch_sanity.cpp<br>
+++ b/src/mesa/main/tests/dispatch_sanity.cpp<br>
@@ -962,6 +962,8 @@ const struct function gl_core_functions_possible[] = {<br>
    { "glCopyNamedBufferSubData", 45, -1 },<br>
    { "glClearNamedBufferData", 45, -1 },<br>
    { "glClearNamedBufferSubData", 45, -1 },<br>
+   { "glMapNamedBuffer", 45, -1 },<br>
+   { "glMapNamedBufferRange", 45, -1 },<br>
    { "glCreateTextures", 45, -1 },<br>
    { "glTextureStorage1D", 45, -1 },<br>
    { "glTextureStorage2D", 45, -1 },<br>
<span class="HOEnZb"><font color="#888888">--<br>
2.1.0<br>
<br>
_______________________________________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/mesa-dev" target="_blank">http://lists.freedesktop.org/mailman/listinfo/mesa-dev</a><br>
</font></span></blockquote></div><br></div>