diff options
Diffstat (limited to 'src/mesa/swrast/s_drawpix.c')
-rw-r--r-- | src/mesa/swrast/s_drawpix.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/mesa/swrast/s_drawpix.c b/src/mesa/swrast/s_drawpix.c index af1848a079e..debfcde0450 100644 --- a/src/mesa/swrast/s_drawpix.c +++ b/src/mesa/swrast/s_drawpix.c @@ -31,6 +31,7 @@ #include "macros.h" #include "imports.h" #include "pixel.h" +#include "state.h" #include "s_context.h" #include "s_drawpix.h" @@ -967,6 +968,11 @@ _swrast_DrawPixels( GLcontext *ctx, { SWcontext *swrast = SWRAST_CONTEXT(ctx); + RENDER_START(swrast,ctx); + + if (ctx->NewState) + _mesa_update_state(ctx); + if (swrast->NewState) _swrast_validate_derived( ctx ); @@ -977,7 +983,7 @@ _swrast_DrawPixels( GLcontext *ctx, format, type, pixels)) { _mesa_error(ctx, GL_INVALID_OPERATION, "glDrawPixels(invalid PBO access)"); - return; + goto end; } buf = (GLubyte *) ctx->Driver.MapBuffer(ctx, GL_PIXEL_UNPACK_BUFFER_EXT, GL_READ_ONLY_ARB, @@ -985,13 +991,11 @@ _swrast_DrawPixels( GLcontext *ctx, if (!buf) { /* buffer is already mapped - that's an error */ _mesa_error(ctx, GL_INVALID_OPERATION, "glDrawPixels(PBO is mapped)"); - return; + goto end; } pixels = ADD_POINTERS(buf, pixels); } - RENDER_START(swrast,ctx); - switch (format) { case GL_STENCIL_INDEX: draw_stencil_pixels( ctx, x, y, width, height, type, unpack, pixels ); @@ -1027,6 +1031,8 @@ _swrast_DrawPixels( GLcontext *ctx, /* don't return yet, clean-up */ } +end: + RENDER_FINISH(swrast,ctx); if (unpack->BufferObj->Name) { |