summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTimothy Arceri <[email protected]>2017-05-04 14:48:02 +1000
committerTimothy Arceri <[email protected]>2017-05-07 15:29:33 +1000
commitf9e682065239be8618506d51923e32ca04156764 (patch)
tree5c6e4a70c5cff5c6afa85b9ba552ae0fc44f9f44
parent5e86bfaee3ebbcc711e30929770dd114c7a8221c (diff)
mesa: add KHR_no_error support to copy buffer subdata functions
Reviewed-by: Eric Anholt <[email protected]>
-rw-r--r--src/mapi/glapi/gen/ARB_copy_buffer.xml2
-rw-r--r--src/mapi/glapi/gen/ARB_direct_state_access.xml2
-rw-r--r--src/mesa/main/bufferobj.c33
-rw-r--r--src/mesa/main/bufferobj.h9
4 files changed, 43 insertions, 3 deletions
diff --git a/src/mapi/glapi/gen/ARB_copy_buffer.xml b/src/mapi/glapi/gen/ARB_copy_buffer.xml
index d1c6f1fecce..12e0c195da6 100644
--- a/src/mapi/glapi/gen/ARB_copy_buffer.xml
+++ b/src/mapi/glapi/gen/ARB_copy_buffer.xml
@@ -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"/>
diff --git a/src/mapi/glapi/gen/ARB_direct_state_access.xml b/src/mapi/glapi/gen/ARB_direct_state_access.xml
index 03f6c8b6beb..3cb486edab0 100644
--- a/src/mapi/glapi/gen/ARB_direct_state_access.xml
+++ b/src/mapi/glapi/gen/ARB_direct_state_access.xml
@@ -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" />
diff --git a/src/mesa/main/bufferobj.c b/src/mesa/main/bufferobj.c
index b0a7543f577..d7e77de4245 100644
--- a/src/mesa/main/bufferobj.c
+++ b/src/mesa/main/bufferobj.c
@@ -2349,6 +2349,24 @@ copy_buffer_sub_data(struct gl_context *ctx, struct gl_buffer_object *src,
}
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,
GLsizeiptr size)
@@ -2371,6 +2389,21 @@ _mesa_CopyBufferSubData(GLenum readTarget, GLenum writeTarget,
}
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,
GLsizeiptr size)
diff --git a/src/mesa/main/bufferobj.h b/src/mesa/main/bufferobj.h
index 93a360dcb63..926ffb4faf2 100644
--- a/src/mesa/main/bufferobj.h
+++ b/src/mesa/main/bufferobj.h
@@ -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);