[Mesa-dev] [PATCH 073/101] mesa: add KHR_no_error support to glTextureSubImage*D()

Samuel Pitoiset samuel.pitoiset at gmail.com
Fri Jul 21 17:40:22 UTC 2017


Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
---
 src/mapi/glapi/gen/ARB_direct_state_access.xml |  6 +--
 src/mesa/main/teximage.c                       | 52 ++++++++++++++++++++++++++
 src/mesa/main/teximage.h                       | 16 ++++++++
 3 files changed, 71 insertions(+), 3 deletions(-)

diff --git a/src/mapi/glapi/gen/ARB_direct_state_access.xml b/src/mapi/glapi/gen/ARB_direct_state_access.xml
index f85d2d5ed1..1c62ac6f2e 100644
--- a/src/mapi/glapi/gen/ARB_direct_state_access.xml
+++ b/src/mapi/glapi/gen/ARB_direct_state_access.xml
@@ -374,7 +374,7 @@
       <param name="fixedsamplelocations" type="GLboolean" />
    </function>
 
-   <function name="TextureSubImage1D">
+   <function name="TextureSubImage1D" no_error="true">
       <param name="texture" type="GLuint" />
       <param name="level" type="GLint" />
       <param name="xoffset" type="GLint" />
@@ -384,7 +384,7 @@
       <param name="pixels" type="const GLvoid *" />
    </function>
 
-   <function name="TextureSubImage2D">
+   <function name="TextureSubImage2D" no_error="true">
       <param name="texture" type="GLuint" />
       <param name="level" type="GLint" />
       <param name="xoffset" type="GLint" />
@@ -396,7 +396,7 @@
       <param name="pixels" type="const GLvoid *" />
    </function>
 
-   <function name="TextureSubImage3D">
+   <function name="TextureSubImage3D" no_error="true">
       <param name="texture" type="GLuint" />
       <param name="level" type="GLint" />
       <param name="xoffset" type="GLint" />
diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c
index 1d0e0fe697..38feb3fea4 100644
--- a/src/mesa/main/teximage.c
+++ b/src/mesa/main/teximage.c
@@ -3497,6 +3497,20 @@ texturesubimage_error(struct gl_context *ctx, GLuint dims,
 }
 
 
+static void
+texturesubimage_no_error(struct gl_context *ctx, GLuint dims,
+                         GLuint texture, GLint level,
+                         GLint xoffset, GLint yoffset, GLint zoffset,
+                         GLsizei width, GLsizei height, GLsizei depth,
+                         GLenum format, GLenum type, const GLvoid *pixels,
+                         const char *callerName)
+{
+   texturesubimage(ctx, dims, texture, level, xoffset, yoffset, zoffset,
+                   width, height, depth, format, type, pixels, callerName,
+                   true);
+}
+
+
 void GLAPIENTRY
 _mesa_TexSubImage1D_no_error(GLenum target, GLint level,
                              GLint xoffset, GLsizei width,
@@ -3584,6 +3598,18 @@ _mesa_TexSubImage3D( GLenum target, GLint level,
                    format, type, pixels, "glTexSubImage3D");
 }
 
+
+void GLAPIENTRY
+_mesa_TextureSubImage1D_no_error(GLuint texture, GLint level, GLint xoffset,
+                                 GLsizei width, GLenum format, GLenum type,
+                                 const GLvoid *pixels)
+{
+   GET_CURRENT_CONTEXT(ctx);
+   texturesubimage_no_error(ctx, 1, texture, level, xoffset, 0, 0, width, 1, 1,
+                            format, type, pixels, "glTextureSubImage1D");
+}
+
+
 void GLAPIENTRY
 _mesa_TextureSubImage1D(GLuint texture, GLint level,
                         GLint xoffset, GLsizei width,
@@ -3597,6 +3623,19 @@ _mesa_TextureSubImage1D(GLuint texture, GLint level,
 
 
 void GLAPIENTRY
+_mesa_TextureSubImage2D_no_error(GLuint texture, GLint level, GLint xoffset,
+                                 GLint yoffset, GLsizei width, GLsizei height,
+                                 GLenum format, GLenum type,
+                                 const GLvoid *pixels)
+{
+   GET_CURRENT_CONTEXT(ctx);
+   texturesubimage_no_error(ctx, 2, texture, level, xoffset, yoffset, 0, width,
+                            height, 1, format, type, pixels,
+                            "glTextureSubImage2D");
+}
+
+
+void GLAPIENTRY
 _mesa_TextureSubImage2D(GLuint texture, GLint level,
                         GLint xoffset, GLint yoffset,
                         GLsizei width, GLsizei height,
@@ -3611,6 +3650,19 @@ _mesa_TextureSubImage2D(GLuint texture, GLint level,
 
 
 void GLAPIENTRY
+_mesa_TextureSubImage3D_no_error(GLuint texture, GLint level, GLint xoffset,
+                                 GLint yoffset, GLint zoffset, GLsizei width,
+                                 GLsizei height, GLsizei depth, GLenum format,
+                                 GLenum type, const GLvoid *pixels)
+{
+   GET_CURRENT_CONTEXT(ctx);
+   texturesubimage_no_error(ctx, 3, texture, level, xoffset, yoffset, zoffset,
+                            width, height, depth, format, type, pixels,
+                            "glTextureSubImage3D");
+}
+
+
+void GLAPIENTRY
 _mesa_TextureSubImage3D(GLuint texture, GLint level,
                         GLint xoffset, GLint yoffset, GLint zoffset,
                         GLsizei width, GLsizei height, GLsizei depth,
diff --git a/src/mesa/main/teximage.h b/src/mesa/main/teximage.h
index 04ddbb90e5..42c34489cf 100644
--- a/src/mesa/main/teximage.h
+++ b/src/mesa/main/teximage.h
@@ -318,12 +318,22 @@ _mesa_TexSubImage3D( GLenum target, GLint level,
                      GLenum format, GLenum type,
                      const GLvoid *pixels );
 
+void GLAPIENTRY
+_mesa_TextureSubImage1D_no_error(GLuint texture, GLint level, GLint xoffset,
+                                 GLsizei width, GLenum format, GLenum type,
+                                 const GLvoid *pixels);
+
 extern void GLAPIENTRY
 _mesa_TextureSubImage1D(GLuint texture, GLint level, GLint xoffset,
                         GLsizei width,
                         GLenum format, GLenum type,
                         const GLvoid *pixels);
 
+void GLAPIENTRY
+_mesa_TextureSubImage2D_no_error(GLuint texture, GLint level, GLint xoffset,
+                                 GLint yoffset, GLsizei width, GLsizei height,
+                                 GLenum format, GLenum type,
+                                 const GLvoid *pixels);
 
 extern void GLAPIENTRY
 _mesa_TextureSubImage2D(GLuint texture, GLint level,
@@ -332,6 +342,12 @@ _mesa_TextureSubImage2D(GLuint texture, GLint level,
                         GLenum format, GLenum type,
                         const GLvoid *pixels);
 
+void GLAPIENTRY
+_mesa_TextureSubImage3D_no_error(GLuint texture, GLint level, GLint xoffset,
+                                 GLint yoffset, GLint zoffset, GLsizei width,
+                                 GLsizei height, GLsizei depth, GLenum format,
+                                 GLenum type, const GLvoid *pixels);
+
 extern void GLAPIENTRY
 _mesa_TextureSubImage3D(GLuint texture, GLint level,
                         GLint xoffset, GLint yoffset, GLint zoffset,
-- 
2.13.3



More information about the mesa-dev mailing list