summaryrefslogtreecommitdiff
path: root/src/mesa/main/drawpix.c
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2010-10-23 09:35:01 -0600
committerBrian Paul <brianp@vmware.com>2010-10-23 10:19:30 -0600
commit2502ee673893394cfa01f1f26ab9b657a3ccb2dc (patch)
tree9ec04f4498766400b521db8b535125fc3609bd57 /src/mesa/main/drawpix.c
parent013d5ffeec3af5665c81c6a7a8370d21699ca609 (diff)
mesa: new glDrawPixels error check for integer formats
Diffstat (limited to 'src/mesa/main/drawpix.c')
-rw-r--r--src/mesa/main/drawpix.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/mesa/main/drawpix.c b/src/mesa/main/drawpix.c
index ac92a3fb08..890d0ab5a7 100644
--- a/src/mesa/main/drawpix.c
+++ b/src/mesa/main/drawpix.c
@@ -30,9 +30,11 @@
#include "enums.h"
#include "feedback.h"
#include "framebuffer.h"
+#include "image.h"
#include "readpix.h"
+#include "shaderobj.h"
#include "state.h"
-#include "main/dispatch.h"
+#include "dispatch.h"
#if FEATURE_drawpix
@@ -94,6 +96,14 @@ _mesa_DrawPixels( GLsizei width, GLsizei height,
goto end; /* no-op, not an error */
}
+ if (_mesa_is_integer_format(format) &&
+ !_mesa_is_fragment_shader_active(ctx)) {
+ /* A fragment shader is required when drawing integer formats */
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glDrawPixels(integer format but no fragment shader)");
+ goto end;
+ }
+
if (ctx->RenderMode == GL_RENDER) {
if (width > 0 && height > 0) {
/* Round, to satisfy conformance tests (matches SGI's OpenGL) */