[Mesa-dev] [PATCH 032/101] mesa: add KHR_no_error support to glRead*Pixels*()
Samuel Pitoiset
samuel.pitoiset at gmail.com
Fri Jul 21 17:39:41 UTC 2017
Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
---
src/mapi/glapi/gen/ARB_robustness.xml | 2 +-
src/mapi/glapi/gen/gl_API.xml | 2 +-
src/mesa/main/readpix.c | 16 ++++++++++++++++
src/mesa/main/readpix.h | 9 +++++++++
4 files changed, 27 insertions(+), 2 deletions(-)
diff --git a/src/mapi/glapi/gen/ARB_robustness.xml b/src/mapi/glapi/gen/ARB_robustness.xml
index 9b2f2f0a74..1f6ac4696b 100644
--- a/src/mapi/glapi/gen/ARB_robustness.xml
+++ b/src/mapi/glapi/gen/ARB_robustness.xml
@@ -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"/>
diff --git a/src/mapi/glapi/gen/gl_API.xml b/src/mapi/glapi/gen/gl_API.xml
index 18839ec70c..2e3eeaacd1 100644
--- a/src/mapi/glapi/gen/gl_API.xml
+++ b/src/mapi/glapi/gen/gl_API.xml
@@ -2640,7 +2640,7 @@
<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"/>
diff --git a/src/mesa/main/readpix.c b/src/mesa/main/readpix.c
index 72aa6a3f31..6ce340ddf9 100644
--- a/src/mesa/main/readpix.c
+++ b/src/mesa/main/readpix.c
@@ -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)
{
diff --git a/src/mesa/main/readpix.h b/src/mesa/main/readpix.h
index 481ad9d9c3..eff8e02904 100644
--- a/src/mesa/main/readpix.h
+++ b/src/mesa/main/readpix.h
@@ -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,
--
2.13.3
More information about the mesa-dev
mailing list