mesa: add KHR_no_error support to glClear*Buffer*Data()
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Fri, 21 Jul 2017 10:02:26 +0000 (12:02 +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_clear_buffer_object.xml
src/mapi/glapi/gen/ARB_direct_state_access.xml
src/mesa/main/bufferobj.c
src/mesa/main/bufferobj.h

index 2284eacd656c0cea723db224d62d207fcfb03c61..25a42b3a479d33d35ca9eb92d5b55d103e8c75fa 100644 (file)
@@ -8,7 +8,7 @@
 
 <category name="GL_ARB_clear_buffer_object" number="121">
 
-    <function name ="ClearBufferData">
+    <function name ="ClearBufferData" no_error="true">
         <param name="target" type="GLenum"/>
         <param name="internalformat" type="GLenum"/>
         <param name="format" type="GLenum"/>
@@ -16,7 +16,7 @@
         <param name="data" type="const GLvoid *"/>
     </function>
 
-    <function name ="ClearBufferSubData">
+    <function name ="ClearBufferSubData" no_error="true">
         <param name="target" type="GLenum"/>
         <param name="internalformat" type="GLenum"/>
         <param name="offset" type="GLintptr"/>
index ca2ef76bfe3a85638c6872b5d5691a66cb6061de..fa90ffcdd22f86bcd3bc1fcd0661cc119a2596d2 100644 (file)
@@ -83,7 +83,7 @@
       <param name="size" type="GLsizeiptr" />
    </function>
 
-   <function name="ClearNamedBufferData">
+   <function name="ClearNamedBufferData" no_error="true">
       <param name="buffer" type="GLuint" />
       <param name="internalformat" type="GLenum" />
       <param name="format" type="GLenum" />
@@ -91,7 +91,7 @@
       <param name="data" type="const GLvoid *" />
    </function>
 
-   <function name="ClearNamedBufferSubData">
+   <function name="ClearNamedBufferSubData" no_error="true">
       <param name="buffer" type="GLuint" />
       <param name="internalformat" type="GLenum" />
       <param name="offset" type="GLintptr" />
index 61f680cf31559c45e52b59c27ebd1edfdad9e6ba..037b2adae0fb97cba9ff9d334d90baefaaf81288 100644 (file)
@@ -2338,6 +2338,33 @@ clear_buffer_sub_data_error(struct gl_context *ctx,
                          type, data, func, subdata, false);
 }
 
+
+static void
+clear_buffer_sub_data_no_error(struct gl_context *ctx,
+                               struct gl_buffer_object *bufObj,
+                               GLenum internalformat, GLintptr offset,
+                               GLsizeiptr size, GLenum format, GLenum type,
+                               const GLvoid *data, const char *func,
+                               bool subdata)
+{
+   clear_buffer_sub_data(ctx, bufObj, internalformat, offset, size, format,
+                         type, data, func, subdata, true);
+}
+
+
+void GLAPIENTRY
+_mesa_ClearBufferData_no_error(GLenum target, GLenum internalformat,
+                               GLenum format, GLenum type, const GLvoid *data)
+{
+   GET_CURRENT_CONTEXT(ctx);
+
+   struct gl_buffer_object **bufObj = get_buffer_target(ctx, target);
+   clear_buffer_sub_data_no_error(ctx, *bufObj, internalformat, 0,
+                                  (*bufObj)->Size, format, type, data,
+                                  "glClearBufferData", false);
+}
+
+
 void GLAPIENTRY
 _mesa_ClearBufferData(GLenum target, GLenum internalformat, GLenum format,
                       GLenum type, const GLvoid *data)
@@ -2353,6 +2380,21 @@ _mesa_ClearBufferData(GLenum target, GLenum internalformat, GLenum format,
                                format, type, data, "glClearBufferData", false);
 }
 
+
+void GLAPIENTRY
+_mesa_ClearNamedBufferData_no_error(GLuint buffer, GLenum internalformat,
+                                    GLenum format, GLenum type,
+                                    const GLvoid *data)
+{
+   GET_CURRENT_CONTEXT(ctx);
+
+   struct gl_buffer_object *bufObj = _mesa_lookup_bufferobj(ctx, buffer);
+   clear_buffer_sub_data_no_error(ctx, bufObj, internalformat, 0, bufObj->Size,
+                                  format, type, data, "glClearNamedBufferData",
+                                  false);
+}
+
+
 void GLAPIENTRY
 _mesa_ClearNamedBufferData(GLuint buffer, GLenum internalformat,
                            GLenum format, GLenum type, const GLvoid *data)
@@ -2370,6 +2412,21 @@ _mesa_ClearNamedBufferData(GLuint buffer, GLenum internalformat,
 }
 
 
+void GLAPIENTRY
+_mesa_ClearBufferSubData_no_error(GLenum target, GLenum internalformat,
+                                  GLintptr offset, GLsizeiptr size,
+                                  GLenum format, GLenum type,
+                                  const GLvoid *data)
+{
+   GET_CURRENT_CONTEXT(ctx);
+
+   struct gl_buffer_object **bufObj = get_buffer_target(ctx, target);
+   clear_buffer_sub_data_no_error(ctx, *bufObj, internalformat, offset, size,
+                                  format, type, data, "glClearBufferSubData",
+                                  true);
+}
+
+
 void GLAPIENTRY
 _mesa_ClearBufferSubData(GLenum target, GLenum internalformat,
                          GLintptr offset, GLsizeiptr size,
@@ -2388,6 +2445,22 @@ _mesa_ClearBufferSubData(GLenum target, GLenum internalformat,
                                true);
 }
 
+
+void GLAPIENTRY
+_mesa_ClearNamedBufferSubData_no_error(GLuint buffer, GLenum internalformat,
+                                       GLintptr offset, GLsizeiptr size,
+                                       GLenum format, GLenum type,
+                                       const GLvoid *data)
+{
+   GET_CURRENT_CONTEXT(ctx);
+
+   struct gl_buffer_object *bufObj = _mesa_lookup_bufferobj(ctx, buffer);
+   clear_buffer_sub_data_no_error(ctx, bufObj, internalformat, offset, size,
+                                  format, type, data,
+                                  "glClearNamedBufferSubData", true);
+}
+
+
 void GLAPIENTRY
 _mesa_ClearNamedBufferSubData(GLuint buffer, GLenum internalformat,
                               GLintptr offset, GLsizeiptr size,
index 19f935d1be9c07bd6f0f7c49721350d8ef131f15..9920ed233ac57c87ab8bdd09524c8ae6a8786329 100644 (file)
@@ -234,22 +234,43 @@ void GLAPIENTRY
 _mesa_GetNamedBufferSubData(GLuint buffer, GLintptr offset,
                             GLsizeiptr size, GLvoid *data);
 
+void GLAPIENTRY
+_mesa_ClearBufferData_no_error(GLenum target, GLenum internalformat,
+                               GLenum format, GLenum type, const GLvoid *data);
+
 void GLAPIENTRY
 _mesa_ClearBufferData(GLenum target, GLenum internalformat,
                       GLenum format, GLenum type,
                       const GLvoid *data);
 
+void GLAPIENTRY
+_mesa_ClearNamedBufferData_no_error(GLuint buffer, GLenum internalformat,
+                                    GLenum format, GLenum type,
+                                    const GLvoid *data);
+
 void GLAPIENTRY
 _mesa_ClearNamedBufferData(GLuint buffer, GLenum internalformat,
                            GLenum format, GLenum type,
                            const GLvoid *data);
 
+void GLAPIENTRY
+_mesa_ClearBufferSubData_no_error(GLenum target, GLenum internalformat,
+                                  GLintptr offset, GLsizeiptr size,
+                                  GLenum format, GLenum type,
+                                  const GLvoid *data);
+
 void GLAPIENTRY
 _mesa_ClearBufferSubData(GLenum target, GLenum internalformat,
                          GLintptr offset, GLsizeiptr size,
                          GLenum format, GLenum type,
                          const GLvoid *data);
 
+void GLAPIENTRY
+_mesa_ClearNamedBufferSubData_no_error(GLuint buffer, GLenum internalformat,
+                                       GLintptr offset, GLsizeiptr size,
+                                       GLenum format, GLenum type,
+                                       const GLvoid *data);
+
 void GLAPIENTRY
 _mesa_ClearNamedBufferSubData(GLuint buffer, GLenum internalformat,
                               GLintptr offset, GLsizeiptr size,