Mesa (master): mesa: add missing error check for linear blit of integer colors
Brian Paul
brianp at kemper.freedesktop.org
Mon Jan 9 15:11:54 UTC 2012
Module: Mesa
Branch: master
Commit: 84c38c739e9faae86509eeec2bab4710813f9cc2
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=84c38c739e9faae86509eeec2bab4710813f9cc2
Author: Brian Paul <brianp at vmware.com>
Date: Mon Jan 9 08:11:33 2012 -0700
mesa: add missing error check for linear blit of integer colors
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
---
src/mesa/main/fbobject.c | 13 +++++++++++++
1 files changed, 13 insertions(+), 0 deletions(-)
diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c
index 912170a..1d5e3da 100644
--- a/src/mesa/main/fbobject.c
+++ b/src/mesa/main/fbobject.c
@@ -2742,6 +2742,19 @@ _mesa_BlitFramebufferEXT(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1,
}
}
+ if (filter == GL_LINEAR && (mask & GL_COLOR_BUFFER_BIT)) {
+ /* 3.1 spec, page 199:
+ * "Calling BlitFramebuffer will result in an INVALID_OPERATION error
+ * if filter is LINEAR and read buffer contains integer data."
+ */
+ GLenum type = _mesa_get_format_datatype(colorReadRb->Format);
+ if (type == GL_INT || type == GL_UNSIGNED_INT) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glBlitFramebufferEXT(integer color type)");
+ return;
+ }
+ }
+
if (!ctx->Extensions.EXT_framebuffer_blit) {
_mesa_error(ctx, GL_INVALID_OPERATION, "glBlitFramebufferEXT");
return;
More information about the mesa-commit
mailing list