summaryrefslogtreecommitdiff
path: root/src/mesa
diff options
context:
space:
mode:
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>2017-06-26 17:12:18 +0200
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>2017-06-28 10:25:13 +0200
commit352adb53db342a5b9042680a5e81ffbca1b2a417 (patch)
treec79116a1720d6f2409de9a486527e34101be24c8 /src/mesa
parent91fcba99147c487370ce8ea8ca65f8734174c7d9 (diff)
mesa: add KHR_no_error support for gl*ReadBuffer()
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/main/buffers.c33
-rw-r--r--src/mesa/main/buffers.h5
2 files changed, 38 insertions, 0 deletions
diff --git a/src/mesa/main/buffers.c b/src/mesa/main/buffers.c
index 18e46adf84e..6359e1b51fd 100644
--- a/src/mesa/main/buffers.c
+++ b/src/mesa/main/buffers.c
@@ -801,6 +801,22 @@ read_buffer_err(struct gl_context *ctx, struct gl_framebuffer *fb,
}
+static void
+read_buffer_no_error(struct gl_context *ctx, struct gl_framebuffer *fb,
+ GLenum buffer, const char *caller)
+{
+ read_buffer(ctx, fb, buffer, caller, true);
+}
+
+
+void GLAPIENTRY
+_mesa_ReadBuffer_no_error(GLenum buffer)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ read_buffer_no_error(ctx, ctx->ReadBuffer, buffer, "glReadBuffer");
+}
+
+
void GLAPIENTRY
_mesa_ReadBuffer(GLenum buffer)
{
@@ -810,6 +826,23 @@ _mesa_ReadBuffer(GLenum buffer)
void GLAPIENTRY
+_mesa_NamedFramebufferReadBuffer_no_error(GLuint framebuffer, GLenum src)
+{
+ GET_CURRENT_CONTEXT(ctx);
+
+ struct gl_framebuffer *fb;
+
+ if (framebuffer) {
+ fb = _mesa_lookup_framebuffer(ctx, framebuffer);
+ } else {
+ fb = ctx->WinSysReadBuffer;
+ }
+
+ read_buffer_no_error(ctx, fb, src, "glNamedFramebufferReadBuffer");
+}
+
+
+void GLAPIENTRY
_mesa_NamedFramebufferReadBuffer(GLuint framebuffer, GLenum src)
{
GET_CURRENT_CONTEXT(ctx);
diff --git a/src/mesa/main/buffers.h b/src/mesa/main/buffers.h
index 9df08154688..ba06138017e 100644
--- a/src/mesa/main/buffers.h
+++ b/src/mesa/main/buffers.h
@@ -65,10 +65,15 @@ _mesa_readbuffer(struct gl_context *ctx, struct gl_framebuffer *fb,
extern void
_mesa_update_draw_buffers(struct gl_context *ctx);
+void GLAPIENTRY
+_mesa_ReadBuffer_no_error(GLenum mode);
extern void GLAPIENTRY
_mesa_ReadBuffer( GLenum mode );
+void GLAPIENTRY
+_mesa_NamedFramebufferReadBuffer_no_error(GLuint framebuffer, GLenum src);
+
extern void GLAPIENTRY
_mesa_NamedFramebufferReadBuffer(GLuint framebuffer, GLenum src);