mesa: add KHR_no_error support to glNamedBufferData() and glBufferData()
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Thu, 20 Jul 2017 08:59:41 +0000 (10:59 +0200)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Wed, 2 Aug 2017 10:54:31 +0000 (12:54 +0200)
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
src/mapi/glapi/gen/ARB_direct_state_access.xml
src/mapi/glapi/gen/gl_API.xml
src/mesa/main/bufferobj.c
src/mesa/main/bufferobj.h

index 7927a4e1f6f843e54032d793436317e2ec35ea8f..ca2ef76bfe3a85638c6872b5d5691a66cb6061de 100644 (file)
@@ -61,7 +61,7 @@
       <param name="flags" type="GLbitfield" />
    </function>
 
-   <function name="NamedBufferData" marshal="custom">
+   <function name="NamedBufferData" marshal="custom" no_error="true">
       <param name="buffer" type="GLuint" />
       <param name="size" type="GLsizeiptr" />
       <param name="data" type="const GLvoid *" />
index 8c4277b984b04e560e26a7e5c460a3905380c8a4..e1b3c43fb19bad67daa48007b8ea2940e20da897 100644 (file)
         <glx ignore="true"/>
     </function>
 
-    <function name="BufferData" es1="1.1" es2="2.0" marshal="custom">
+    <function name="BufferData" es1="1.1" es2="2.0" marshal="custom" no_error="true">
         <param name="target" type="GLenum"/>
         <param name="size" type="GLsizeiptr" counter="true"/>
         <param name="data" type="const GLvoid *" count="size" img_null_flag="true"/>
index 1bae0258054868f0d344106de8fc8ff834ba2e72..2d1b652dfc06ea1284d9cd7ec554da7183260602 100644 (file)
@@ -2024,6 +2024,14 @@ buffer_data_error(struct gl_context *ctx, struct gl_buffer_object *bufObj,
    buffer_data(ctx, bufObj, target, size, data, usage, func, false);
 }
 
+static void
+buffer_data_no_error(struct gl_context *ctx, struct gl_buffer_object *bufObj,
+                     GLenum target, GLsizeiptr size, const GLvoid *data,
+                     GLenum usage, const char *func)
+{
+   buffer_data(ctx, bufObj, target, size, data, usage, func, true);
+}
+
 void
 _mesa_buffer_data(struct gl_context *ctx, struct gl_buffer_object *bufObj,
                   GLenum target, GLsizeiptr size, const GLvoid *data,
@@ -2032,6 +2040,17 @@ _mesa_buffer_data(struct gl_context *ctx, struct gl_buffer_object *bufObj,
    buffer_data_error(ctx, bufObj, target, size, data, usage, func);
 }
 
+void GLAPIENTRY
+_mesa_BufferData_no_error(GLenum target, GLsizeiptr size, const GLvoid *data,
+                          GLenum usage)
+{
+   GET_CURRENT_CONTEXT(ctx);
+
+   struct gl_buffer_object **bufObj = get_buffer_target(ctx, target);
+   buffer_data_no_error(ctx, *bufObj, target, size, data, usage,
+                        "glBufferData");
+}
+
 void GLAPIENTRY
 _mesa_BufferData(GLenum target, GLsizeiptr size,
                  const GLvoid *data, GLenum usage)
@@ -2047,6 +2066,17 @@ _mesa_BufferData(GLenum target, GLsizeiptr size,
                      "glBufferData");
 }
 
+void GLAPIENTRY
+_mesa_NamedBufferData_no_error(GLuint buffer, GLsizeiptr size,
+                               const GLvoid *data, GLenum usage)
+{
+   GET_CURRENT_CONTEXT(ctx);
+
+   struct gl_buffer_object *bufObj = _mesa_lookup_bufferobj(ctx, buffer);
+   buffer_data_no_error(ctx, bufObj, GL_NONE, size, data, usage,
+                        "glNamedBufferData");
+}
+
 void GLAPIENTRY
 _mesa_NamedBufferData(GLuint buffer, GLsizeiptr size, const GLvoid *data,
                       GLenum usage)
index 69e85498186203446be25b2dcc6f28e48399e193..19f935d1be9c07bd6f0f7c49721350d8ef131f15 100644 (file)
@@ -196,10 +196,18 @@ void GLAPIENTRY
 _mesa_NamedBufferStorage(GLuint buffer, GLsizeiptr size, const GLvoid *data,
                          GLbitfield flags);
 
+void GLAPIENTRY
+_mesa_BufferData_no_error(GLenum target, GLsizeiptr size,
+                          const GLvoid *data, GLenum usage);
+
 void GLAPIENTRY
 _mesa_BufferData(GLenum target, GLsizeiptr size,
                  const GLvoid *data, GLenum usage);
 
+void GLAPIENTRY
+_mesa_NamedBufferData_no_error(GLuint buffer, GLsizeiptr size,
+                               const GLvoid *data, GLenum usage);
+
 void GLAPIENTRY
 _mesa_NamedBufferData(GLuint buffer, GLsizeiptr size,
                       const GLvoid *data, GLenum usage);