diff options
author | Eric Anholt <[email protected]> | 2011-11-27 16:26:19 -0800 |
---|---|---|
committer | Eric Anholt <[email protected]> | 2011-12-04 14:54:16 -0800 |
commit | 887c349d543d5b6d681845eb441be88acb8e0063 (patch) | |
tree | d2cfcc70e0f4ca451897ba112b079bf1b121a2bb /src/mesa/main/drawpix.c | |
parent | 1bb59b382a5702ebab37b0e7eb219e5b54769ffb (diff) |
mesa: Reject glDrawPixels(integer format).
When folding GL_EXT_texture_integer into the core, a new (and very
sensible) restriction was added.
Reviewed-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/mesa/main/drawpix.c')
-rw-r--r-- | src/mesa/main/drawpix.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/mesa/main/drawpix.c b/src/mesa/main/drawpix.c index 412cc15af4e..c9e714b210a 100644 --- a/src/mesa/main/drawpix.c +++ b/src/mesa/main/drawpix.c @@ -30,6 +30,7 @@ #include "enums.h" #include "feedback.h" #include "framebuffer.h" +#include "image.h" #include "mfeatures.h" #include "pbo.h" #include "readpix.h" @@ -76,6 +77,23 @@ _mesa_DrawPixels( GLsizei width, GLsizei height, goto end; /* the error code was recorded */ } + /* GL 3.0 introduced a new restriction on glDrawPixels() over what was in + * GL_EXT_texture_integer. From section 3.7.4 ("Rasterization of Pixel + * Rectangles) on page 151 of the GL 3.0 specification: + * + * "If format contains integer components, as shown in table 3.6, an + * INVALID OPERATION error is generated." + * + * Since DrawPixels rendering would be merely undefined if not an error (due + * to a lack of defined mapping from integer data to gl_Color fragment shader + * input), NVIDIA's implementation also just returns this error despite + * exposing GL_EXT_texture_integer, just return an error regardless. + */ + if (_mesa_is_integer_format(format)) { + _mesa_error(ctx, GL_INVALID_OPERATION, "glDrawPixels(integer format)"); + goto end; + } + if (_mesa_error_check_format_type(ctx, format, type, GL_TRUE)) { goto end; /* the error code was recorded */ } |