mesa: add support for glNamedBuffer*DataEXT()
authorTimothy Arceri <tarceri@itsqueeze.com>
Fri, 18 May 2018 05:20:35 +0000 (15:20 +1000)
committerMarek Olšák <marek.olsak@amd.com>
Fri, 28 Jun 2019 19:41:12 +0000 (15:41 -0400)
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
src/mapi/glapi/gen/EXT_direct_state_access.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 73d8d973a8c72c364e39b7a6365e53041ca06de4..a19677cde10893ee1f347fca924157b9505c9bee 100644 (file)
       <param name="matrixMode" type="GLenum" />
       <param name="m" type="const GLdouble *" />
    </function>
-</category>
+
+   <!-- OpenGL 1.5 -->
+
+   <function name="NamedBufferDataEXT">
+      <param name="buffer" type="GLuint" />
+      <param name="size" type="GLsizeiptr" />
+      <param name="data" type="const GLvoid *" />
+      <param name="usage" type="GLenum" />
+   </function>
+
+   <function name="NamedBufferSubDataEXT">
+      <param name="buffer" type="GLuint" />
+      <param name="offset" type="GLintptr" />
+      <param name="size" type="GLsizeiptr" />
+      <param name="data" type="const GLvoid *" />
+   </function>
 </category>
 </OpenGLAPI>
index e189eb3ac4e8ccc0f0835dc64b05396b0bb18dbb..92a07abd9db737b7f2c7af6e79f5058d4dfe871e 100644 (file)
@@ -1474,6 +1474,8 @@ offsets = {
     "MatrixMultTransposefEXT": 1438,
     "MatrixMultTransposedEXT": 1439,
     "BindMultiTextureEXT": 1440,
+    "NamedBufferDataEXT": 1441,
+    "NamedBufferSubDataEXT": 1442,
 }
 
 functions = [
index e65c577e427daa93c9f0c74a31ba7b6782b1f9b7..6b8a2111a8fb222f896471d82c569cea6cdc42d3 100644 (file)
@@ -2169,6 +2169,20 @@ _mesa_NamedBufferData(GLuint buffer, GLsizeiptr size, const GLvoid *data,
                      "glNamedBufferData");
 }
 
+void GLAPIENTRY
+_mesa_NamedBufferDataEXT(GLuint buffer, GLsizeiptr size, const GLvoid *data,
+                         GLenum usage)
+{
+   GET_CURRENT_CONTEXT(ctx);
+
+   struct gl_buffer_object *bufObj = _mesa_lookup_bufferobj(ctx, buffer);
+   if (!_mesa_handle_bind_buffer_gen(ctx, buffer,
+                                     &bufObj, "glNamedBufferDataEXT"))
+      return;
+
+   _mesa_buffer_data(ctx, bufObj, GL_NONE, size, data, usage,
+                     "glNamedBufferDataEXT");
+}
 
 static bool
 validate_buffer_sub_data(struct gl_context *ctx,
@@ -2297,6 +2311,23 @@ _mesa_NamedBufferSubData(GLuint buffer, GLintptr offset,
                    "glNamedBufferSubData");
 }
 
+void GLAPIENTRY
+_mesa_NamedBufferSubDataEXT(GLuint buffer, GLintptr offset,
+                            GLsizeiptr size, const GLvoid *data)
+{
+   GET_CURRENT_CONTEXT(ctx);
+
+   struct gl_buffer_object *bufObj = _mesa_lookup_bufferobj(ctx, buffer);
+   if (!_mesa_handle_bind_buffer_gen(ctx, buffer,
+                                     &bufObj, "glNamedBufferSubDataEXT"))
+      return;
+
+   if (validate_buffer_sub_data(ctx, bufObj, offset, size,
+                                "glNamedBufferSubDataEXT")) {
+      _mesa_buffer_sub_data(ctx, bufObj, offset, size, data);
+   }
+}
+
 
 void GLAPIENTRY
 _mesa_GetBufferSubData(GLenum target, GLintptr offset,
index 74538648540b16fc33f15ba8917d0729c71de314..74124649bb68b5686767196a9b1099a44f62b9af 100644 (file)
@@ -222,6 +222,9 @@ _mesa_NamedBufferData_no_error(GLuint buffer, GLsizeiptr size,
 void GLAPIENTRY
 _mesa_NamedBufferData(GLuint buffer, GLsizeiptr size,
                       const GLvoid *data, GLenum usage);
+void GLAPIENTRY
+_mesa_NamedBufferDataEXT(GLuint buffer, GLsizeiptr size,
+                         const GLvoid *data, GLenum usage);
 
 void GLAPIENTRY
 _mesa_BufferSubData_no_error(GLenum target, GLintptr offset,
@@ -236,6 +239,9 @@ _mesa_NamedBufferSubData_no_error(GLuint buffer, GLintptr offset,
 void GLAPIENTRY
 _mesa_NamedBufferSubData(GLuint buffer, GLintptr offset,
                          GLsizeiptr size, const GLvoid *data);
+void GLAPIENTRY
+_mesa_NamedBufferSubDataEXT(GLuint buffer, GLintptr offset,
+                            GLsizeiptr size, const GLvoid *data);
 
 void GLAPIENTRY
 _mesa_GetBufferSubData(GLenum target, GLintptr offset,
index eb0f217a1d28d2748d5f4a8e14713b6d0dce536f..0fba8d19fe3cad43de3bf5aa76fbfe8a7e15d7c9 100644 (file)
@@ -1126,8 +1126,8 @@ const struct function common_desktop_functions_possible[] = {
    { "glMatrixMultTransposefEXT", 13, -1 },
    { "glMatrixMultTransposedEXT", 13, -1 },
    /* GL_EXT_direct_state_access - GL 1.5 */
-   //{ "glNamedBufferDataEXT", 15, -1 },
-   //{ "glNamedBufferSubDataEXT", 15, -1 },
+   { "glNamedBufferDataEXT", 15, -1 },
+   { "glNamedBufferSubDataEXT", 15, -1 },
    //{ "glMapNamedBufferEXT", 15, -1 },
    //{ "glUnmapNamedBufferEXT", 15, -1 },
    //{ "glGetNamedBufferParameterivEXT", 15, -1 },