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 9b2f2f0a74cc59b24dac94a8e82301eced93133c..1f6ac4696b6b2bfe751f4f5a6dccf0949a9f0d4c 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 18839ec70c3f39bff407f724fba4cfb0c34d72c5..2e3eeaacd152266ec35c9409643cc3f46f83719b 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 72aa6a3f31531b4bbf5bcf8d02970b96aa28a9e6..6ce340ddf9bbc8442aa515f669c60c96a7182868 100644 (file)
@@ -1125,6 +1125,14 @@ read_pixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format,
                           format, type, &clippedPacking, pixels);
 }
 
+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,
@@ -1133,6 +1141,14 @@ _mesa_ReadnPixelsARB(GLint x, GLint y, GLsizei width, GLsizei height,
    read_pixels(x, y, width, height, format, type, bufSize, pixels, false);
 }
 
+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 481ad9d9c3752ff1ca27921eeeb9d522bad1e84b..eff8e029044b291f6146be5ff9e1b5eed3324821 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,