mesa: add KHR_no_error support for glBufferSubData()
authorTimothy Arceri <tarceri@itsqueeze.com>
Fri, 12 May 2017 11:36:25 +0000 (21:36 +1000)
committerTimothy Arceri <tarceri@itsqueeze.com>
Wed, 17 May 2017 00:12:03 +0000 (10:12 +1000)
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
src/mapi/glapi/gen/gl_API.xml
src/mesa/main/bufferobj.c
src/mesa/main/bufferobj.h

index 8afd5ec5138a81d975b7adb09a68ccd377c10123..762fb5a67699cdc6e964571833119344de21997a 100644 (file)
         <glx ignore="true"/>
     </function>
 
-    <function name="BufferSubData" es1="1.1" es2="2.0" marshal="custom">
+    <function name="BufferSubData" es1="1.1" es2="2.0" marshal="custom"
+              no_error="true">
         <param name="target" type="GLenum"/>
         <param name="offset" type="GLintptr"/>
         <param name="size" type="GLsizeiptr" counter="true"/>
index 3e903cb3c29eae21849bf3ca8562dc13e682a782..461d69779a15f754de54e80ce9c9caf29047c5ab 100644 (file)
@@ -1872,9 +1872,14 @@ buffer_sub_data(GLenum target, GLuint buffer, GLintptr offset,
             return;
       }
    } else {
-      bufObj = get_buffer(ctx, func, target, GL_INVALID_OPERATION);
-      if (!bufObj)
-         return;
+      if (no_error) {
+         struct gl_buffer_object **bufObjPtr = get_buffer_target(ctx, target);
+         bufObj = *bufObjPtr;
+      } else {
+         bufObj = get_buffer(ctx, func, target, GL_INVALID_OPERATION);
+         if (!bufObj)
+            return;
+      }
    }
 
    if (no_error || validate_buffer_sub_data(ctx, bufObj, offset, size, func))
@@ -1882,6 +1887,15 @@ buffer_sub_data(GLenum target, GLuint buffer, GLintptr offset,
 }
 
 
+void GLAPIENTRY
+_mesa_BufferSubData_no_error(GLenum target, GLintptr offset,
+                             GLsizeiptr size, const GLvoid *data)
+{
+   buffer_sub_data(target, 0, offset, size, data, false, true,
+                   "glBufferSubData");
+}
+
+
 void GLAPIENTRY
 _mesa_BufferSubData(GLenum target, GLintptr offset,
                     GLsizeiptr size, const GLvoid *data)
index b3cfcc0a4a390d48ff603bbed8c537bfa23ad511..f652ec30d057eced703adb080953fb706c060516 100644 (file)
@@ -193,6 +193,9 @@ _mesa_NamedBufferData(GLuint buffer, GLsizeiptr size,
                       const GLvoid *data, GLenum usage);
 
 void GLAPIENTRY
+_mesa_BufferSubData_no_error(GLenum target, GLintptr offset,
+                             GLsizeiptr size, const GLvoid *data);
+void GLAPIENTRY
 _mesa_BufferSubData(GLenum target, GLintptr offset,
                     GLsizeiptr size, const GLvoid *data);