diff options
Diffstat (limited to 'src/mesa/main/drawpix.c')
-rw-r--r-- | src/mesa/main/drawpix.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/mesa/main/drawpix.c b/src/mesa/main/drawpix.c index bf36a7e7a49..890d0ab5a72 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 @@ -43,7 +45,7 @@ * \return GL_TRUE if valid, GL_FALSE otherwise */ static GLboolean -valid_fragment_program(GLcontext *ctx) +valid_fragment_program(struct gl_context *ctx) { return !(ctx->FragmentProgram.Enabled && !ctx->FragmentProgram._Enabled); } @@ -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) */ |