mesa: add KHR_no_error support to glRead*Pixels*()
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Tue, 18 Jul 2017 15:30:54 +0000 (17:30 +0200)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Mon, 31 Jul 2017 11:53:39 +0000 (13:53 +0200)
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
src/mapi/glapi/gen/ARB_robustness.xml
src/mapi/glapi/gen/gl_API.xml
src/mesa/main/readpix.c
src/mesa/main/readpix.h

index 9b2f2f0..1f6ac46 100644 (file)
@@ -82,7 +82,7 @@
         <param name="img" type="GLvoid *" output="true"/>
     </function>
 
-    <function name="ReadnPixelsARB">
+    <function name="ReadnPixelsARB" no_error="true">
         <param name="x" type="GLint"/>
         <param name="y" type="GLint"/>
         <param name="width" type="GLsizei"/>
index 18839ec..2e3eeaa 100644 (file)
         <glx rop="172"/>
     </function>
 
-    <function name="ReadPixels" es1="1.0" es2="2.0">
+    <function name="ReadPixels" es1="1.0" es2="2.0" no_error="true">
         <param name="x" type="GLint"/>
         <param name="y" type="GLint"/>
         <param name="width" type="GLsizei"/>
index 72aa6a3..6ce340d 100644 (file)
@@ -1126,6 +1126,14 @@ read_pixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format,
 }
 
 void GLAPIENTRY
+_mesa_ReadnPixelsARB_no_error(GLint x, GLint y, GLsizei width, GLsizei height,
+                              GLenum format, GLenum type, GLsizei bufSize,
+                              GLvoid *pixels)
+{
+   read_pixels(x, y, width, height, format, type, bufSize, pixels, true);
+}
+
+void GLAPIENTRY
 _mesa_ReadnPixelsARB(GLint x, GLint y, GLsizei width, GLsizei height,
                      GLenum format, GLenum type, GLsizei bufSize,
                      GLvoid *pixels)
@@ -1134,6 +1142,14 @@ _mesa_ReadnPixelsARB(GLint x, GLint y, GLsizei width, GLsizei height,
 }
 
 void GLAPIENTRY
+_mesa_ReadPixels_no_error(GLint x, GLint y, GLsizei width, GLsizei height,
+                          GLenum format, GLenum type, GLvoid *pixels)
+{
+   _mesa_ReadnPixelsARB_no_error(x, y, width, height, format, type, INT_MAX,
+                                 pixels);
+}
+
+void GLAPIENTRY
 _mesa_ReadPixels(GLint x, GLint y, GLsizei width, GLsizei height,
                  GLenum format, GLenum type, GLvoid *pixels)
 {
index 481ad9d..eff8e02 100644 (file)
@@ -58,10 +58,19 @@ _mesa_readpixels(struct gl_context *ctx,
                  const struct gl_pixelstore_attrib *packing,
                  GLvoid *pixels);
 
+void GLAPIENTRY
+_mesa_ReadPixels_no_error(GLint x, GLint y, GLsizei width, GLsizei height,
+                          GLenum format, GLenum type, GLvoid *pixels);
+
 extern void GLAPIENTRY
 _mesa_ReadPixels( GLint x, GLint y, GLsizei width, GLsizei height,
                   GLenum format, GLenum type, GLvoid *pixels );
 
+void GLAPIENTRY
+_mesa_ReadnPixelsARB_no_error(GLint x, GLint y, GLsizei width, GLsizei height,
+                                       GLenum format, GLenum type, GLsizei bufSize,
+                              GLvoid *pixels);
+
 extern void GLAPIENTRY
 _mesa_ReadnPixelsARB( GLint x, GLint y, GLsizei width, GLsizei height,
                      GLenum format, GLenum type, GLsizei bufSize,