mesa: add support for glNamedBufferStorageEXT
authorTimothy Arceri <tarceri@itsqueeze.com>
Fri, 18 May 2018 03:23:15 +0000 (13:23 +1000)
committerMarek Olšák <marek.olsak@amd.com>
Fri, 28 Jun 2019 19:41:14 +0000 (15:41 -0400)
This is available in ARB_buffer_storage when
EXT_direct_state_access is present.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
src/mapi/glapi/gen/gl_API.xml
src/mapi/glapi/gen/static_data.py
src/mesa/main/bufferobj.c
src/mesa/main/bufferobj.h
src/mesa/main/tests/dispatch_sanity.cpp

index ca7ac95ded0f7f4d60bdb5bed6bfaaf506c40c0b..60ae1aaa0db95ae49040c43b70677201ccfff239 100644 (file)
         <param name="data" type="const GLvoid *"/>
         <param name="flags" type="GLbitfield"/>
     </function>
+
+   <function name="NamedBufferStorageEXT">
+      <param name="buffer" type="GLuint" />
+      <param name="size" type="GLsizeiptr" />
+      <param name="data" type="const GLvoid *" />
+      <param name="flags" type="GLbitfield" />
+   </function>
 </category>
 
 <xi:include href="ARB_clear_texture.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
index 92a07abd9db737b7f2c7af6e79f5058d4dfe871e..582530c046a691714ed4f2cbf96f518b2b30b32e 100644 (file)
@@ -1476,6 +1476,7 @@ offsets = {
     "BindMultiTextureEXT": 1440,
     "NamedBufferDataEXT": 1441,
     "NamedBufferSubDataEXT": 1442,
+    "NamedBufferStorageEXT": 1443,
 }
 
 functions = [
index 6b8a2111a8fb222f896471d82c569cea6cdc42d3..0d350dbabd585781f31d90817a2dc658c31da40f 100644 (file)
@@ -1937,6 +1937,21 @@ _mesa_BufferStorage(GLenum target, GLsizeiptr size, const GLvoid *data,
                           false, false, false, "glBufferStorage");
 }
 
+void GLAPIENTRY
+_mesa_NamedBufferStorageEXT(GLuint buffer, GLsizeiptr size,
+                            const GLvoid *data, GLbitfield flags)
+{
+   GET_CURRENT_CONTEXT(ctx);
+
+   struct gl_buffer_object *bufObj = _mesa_lookup_bufferobj(ctx, buffer);
+   if (!_mesa_handle_bind_buffer_gen(ctx, buffer,
+                                     &bufObj, "glNamedBufferStorageEXT"))
+      return;
+
+   inlined_buffer_storage(GL_NONE, buffer, size, data, flags, GL_NONE, 0,
+                          true, false, false, "glNamedBufferStorageEXT");
+}
+
 
 void GLAPIENTRY
 _mesa_BufferStorageMemEXT(GLenum target, GLsizeiptr size,
index 74124649bb68b5686767196a9b1099a44f62b9af..6b35d70606f66c4aec395fc2851320045cc93fa4 100644 (file)
@@ -189,6 +189,9 @@ void GLAPIENTRY
 _mesa_BufferStorage(GLenum target, GLsizeiptr size, const GLvoid *data,
                     GLbitfield flags);
 void GLAPIENTRY
+_mesa_NamedBufferStorageEXT(GLuint buffer, GLsizeiptr size,
+                            const GLvoid *data, GLbitfield flags);
+void GLAPIENTRY
 _mesa_BufferStorageMemEXT(GLenum target, GLsizeiptr size,
                           GLuint memory, GLuint64 offset);
 void GLAPIENTRY
index 0fba8d19fe3cad43de3bf5aa76fbfe8a7e15d7c9..c789a2d513b6a6f062afc83d6ad2277ca6e4a858 100644 (file)
@@ -1295,6 +1295,7 @@ const struct function common_desktop_functions_possible[] = {
 
    /* GL_ARB_buffer_storage */
    { "glBufferStorage", 43, -1 },
+   { "glNamedBufferStorageEXT", 43, -1 },
 
    /* GL_ARB_clear_texture */
    { "glClearTexImage", 13, -1 },