From fee507b9092e0998c3f7e710b0d2feb3f191fec3 Mon Sep 17 00:00:00 2001 From: Samuel Pitoiset Date: Tue, 18 Jul 2017 17:30:54 +0200 Subject: mesa: add KHR_no_error support to glRead*Pixels*() Signed-off-by: Samuel Pitoiset Reviewed-by: Timothy Arceri --- src/mesa/main/readpix.c | 16 ++++++++++++++++ src/mesa/main/readpix.h | 9 +++++++++ 2 files changed, 25 insertions(+) (limited to 'src/mesa/main') diff --git a/src/mesa/main/readpix.c b/src/mesa/main/readpix.c index 72aa6a3f315..6ce340ddf9b 100644 --- a/src/mesa/main/readpix.c +++ b/src/mesa/main/readpix.c @@ -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) diff --git a/src/mesa/main/readpix.h b/src/mesa/main/readpix.h index 481ad9d9c37..eff8e029044 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, -- cgit v1.2.3