mesa: add KHR_no_error support to copy buffer subdata functions
authorTimothy Arceri <tarceri@itsqueeze.com>
Thu, 4 May 2017 04:48:02 +0000 (14:48 +1000)
committerTimothy Arceri <tarceri@itsqueeze.com>
Sun, 7 May 2017 05:29:33 +0000 (15:29 +1000)
Reviewed-by: Eric Anholt <eric@anholt.net>
src/mapi/glapi/gen/ARB_copy_buffer.xml
src/mapi/glapi/gen/ARB_direct_state_access.xml
src/mesa/main/bufferobj.c
src/mesa/main/bufferobj.h

index d1c6f1fecce07a6ef3cc6420a7ac64b5071c88a1..12e0c195da6caa6069c8ab0bbdec04b3eb4db451 100644 (file)
@@ -11,7 +11,7 @@
     <enum name="COPY_READ_BUFFER"   value="0x8F36"/>
     <enum name="COPY_WRITE_BUFFER"  value="0x8F37"/>
 
-    <function name="CopyBufferSubData" es2="3.0">
+    <function name="CopyBufferSubData" es2="3.0" no_error="true">
         <param name="readTarget" type="GLenum"/>
         <param name="writeTarget" type="GLenum"/>
         <param name="readOffset" type="GLintptr"/>
index 03f6c8b6bebc8014ee5b3d9dfbe4601e8d689b88..3cb486edab04ce9247c029accd5793faa872c9d1 100644 (file)
@@ -75,7 +75,7 @@
       <param name="data" type="const GLvoid *" />
    </function>
 
-   <function name="CopyNamedBufferSubData">
+   <function name="CopyNamedBufferSubData" no_error="true">
       <param name="readBuffer" type="GLuint" />
       <param name="writeBuffer" type="GLuint" />
       <param name="readOffset" type="GLintptr" />
index b0a7543f57745b37665ef83499013531578eddc5..d7e77de42458d996dcb10d6b94534753d174dc20 100644 (file)
@@ -2348,6 +2348,24 @@ copy_buffer_sub_data(struct gl_context *ctx, struct gl_buffer_object *src,
    ctx->Driver.CopyBufferSubData(ctx, src, dst, readOffset, writeOffset, size);
 }
 
+void GLAPIENTRY
+_mesa_CopyBufferSubData_no_error(GLenum readTarget, GLenum writeTarget,
+                                 GLintptr readOffset, GLintptr writeOffset,
+                                 GLsizeiptr size)
+{
+   GET_CURRENT_CONTEXT(ctx);
+
+   struct gl_buffer_object **src_ptr = get_buffer_target(ctx, readTarget);
+   struct gl_buffer_object *src = *src_ptr;
+
+   struct gl_buffer_object **dst_ptr = get_buffer_target(ctx, writeTarget);
+   struct gl_buffer_object *dst = *dst_ptr;
+
+   dst->MinMaxCacheDirty = true;
+   ctx->Driver.CopyBufferSubData(ctx, src, dst, readOffset, writeOffset,
+                                 size);
+}
+
 void GLAPIENTRY
 _mesa_CopyBufferSubData(GLenum readTarget, GLenum writeTarget,
                         GLintptr readOffset, GLintptr writeOffset,
@@ -2370,6 +2388,21 @@ _mesa_CopyBufferSubData(GLenum readTarget, GLenum writeTarget,
                         "glCopyBufferSubData");
 }
 
+void GLAPIENTRY
+_mesa_CopyNamedBufferSubData_no_error(GLuint readBuffer, GLuint writeBuffer,
+                                      GLintptr readOffset,
+                                      GLintptr writeOffset, GLsizeiptr size)
+{
+   GET_CURRENT_CONTEXT(ctx);
+
+   struct gl_buffer_object *src = _mesa_lookup_bufferobj(ctx, readBuffer);
+   struct gl_buffer_object *dst = _mesa_lookup_bufferobj(ctx, writeBuffer);
+
+   dst->MinMaxCacheDirty = true;
+   ctx->Driver.CopyBufferSubData(ctx, src, dst, readOffset, writeOffset,
+                                 size);
+}
+
 void GLAPIENTRY
 _mesa_CopyNamedBufferSubData(GLuint readBuffer, GLuint writeBuffer,
                              GLintptr readOffset, GLintptr writeOffset,
index 93a360dcb635ef62209fc80bb6d241f332498f25..926ffb4faf2b57a94fa027ec6b3812f36f200cd3 100644 (file)
@@ -254,13 +254,20 @@ _mesa_GetBufferPointerv(GLenum target, GLenum pname, GLvoid **params);
 void GLAPIENTRY
 _mesa_GetNamedBufferPointerv(GLuint buffer, GLenum pname, GLvoid **params);
 
-
+void GLAPIENTRY
+_mesa_CopyBufferSubData_no_error(GLenum readTarget, GLenum writeTarget,
+                                 GLintptr readOffset, GLintptr writeOffset,
+                                 GLsizeiptr size);
 void GLAPIENTRY
 _mesa_CopyBufferSubData(GLenum readTarget, GLenum writeTarget,
                         GLintptr readOffset, GLintptr writeOffset,
                         GLsizeiptr size);
 
 void GLAPIENTRY
+_mesa_CopyNamedBufferSubData_no_error(GLuint readBuffer, GLuint writeBuffer,
+                                      GLintptr readOffset,
+                                      GLintptr writeOffset, GLsizeiptr size);
+void GLAPIENTRY
 _mesa_CopyNamedBufferSubData(GLuint readBuffer, GLuint writeBuffer,
                              GLintptr readOffset, GLintptr writeOffset,
                              GLsizeiptr size);