[Mesa-dev] [PATCH 18/21] mesa: add KHR_no_error support for glCopyImageSubData()

Samuel Pitoiset samuel.pitoiset at gmail.com
Thu Jun 1 13:05:07 UTC 2017


---
 src/mapi/glapi/gen/ARB_copy_image.xml |  2 +-
 src/mesa/main/copyimage.c             | 23 +++++++++++++++++++++++
 src/mesa/main/copyimage.h             |  7 +++++++
 3 files changed, 31 insertions(+), 1 deletion(-)

diff --git a/src/mapi/glapi/gen/ARB_copy_image.xml b/src/mapi/glapi/gen/ARB_copy_image.xml
index 9ee2ba304f..fb4c9b1c24 100644
--- a/src/mapi/glapi/gen/ARB_copy_image.xml
+++ b/src/mapi/glapi/gen/ARB_copy_image.xml
@@ -5,7 +5,7 @@
 
 <category name="GL_ARB_copy_image" number="123">
 
-    <function name="CopyImageSubData" es2="3.2">
+    <function name="CopyImageSubData" es2="3.2" no_error="true">
         <param name="srcName" type="GLuint"/>
         <param name="srcTarget" type="GLenum"/>
         <param name="srcLevel" type="GLint"/>
diff --git a/src/mesa/main/copyimage.c b/src/mesa/main/copyimage.c
index 16a8132544..4a67f420de 100644
--- a/src/mesa/main/copyimage.c
+++ b/src/mesa/main/copyimage.c
@@ -519,6 +519,29 @@ copy_image_subdata(struct gl_context *ctx,
 }
 
 void GLAPIENTRY
+_mesa_CopyImageSubData_no_error(GLuint srcName, GLenum srcTarget, GLint srcLevel,
+                                GLint srcX, GLint srcY, GLint srcZ,
+                                GLuint dstName, GLenum dstTarget, GLint dstLevel,
+                                GLint dstX, GLint dstY, GLint dstZ,
+                                GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth)
+{
+   struct gl_texture_image *srcTexImage, *dstTexImage;
+   struct gl_renderbuffer *srcRenderbuffer, *dstRenderbuffer;
+
+   GET_CURRENT_CONTEXT(ctx);
+
+   prepare_target(ctx, srcName, srcTarget, srcLevel, srcZ, &srcTexImage,
+                  &srcRenderbuffer);
+
+   prepare_target(ctx, dstName, dstTarget, dstLevel, dstZ, &dstTexImage,
+                  &dstRenderbuffer);
+
+   copy_image_subdata(ctx, srcTexImage, srcRenderbuffer, srcX, srcY, srcZ,
+                      srcLevel, dstTexImage, dstRenderbuffer, dstX, dstY, dstZ,
+                      dstLevel, srcWidth, srcHeight, srcDepth);
+}
+
+void GLAPIENTRY
 _mesa_CopyImageSubData(GLuint srcName, GLenum srcTarget, GLint srcLevel,
                        GLint srcX, GLint srcY, GLint srcZ,
                        GLuint dstName, GLenum dstTarget, GLint dstLevel,
diff --git a/src/mesa/main/copyimage.h b/src/mesa/main/copyimage.h
index 40e95b6631..ea2f15b435 100644
--- a/src/mesa/main/copyimage.h
+++ b/src/mesa/main/copyimage.h
@@ -35,6 +35,13 @@
 extern "C" {
 #endif
 
+void GLAPIENTRY
+_mesa_CopyImageSubData_no_error(GLuint srcName, GLenum srcTarget, GLint srcLevel,
+                                GLint srcX, GLint srcY, GLint srcZ,
+                                GLuint destName, GLenum destTarget, GLint destLevel,
+                                GLint destX, GLint destY, GLint destZ,
+                                GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth);
+
 extern void GLAPIENTRY
 _mesa_CopyImageSubData(GLuint srcName, GLenum srcTarget, GLint srcLevel,
                        GLint srcX, GLint srcY, GLint srcZ,
-- 
2.13.0



More information about the mesa-dev mailing list