Add some FLUSH_CURRENT() calls.
authorBrian <brian.paul@tungstengraphics.com>
Wed, 17 Oct 2007 22:18:45 +0000 (16:18 -0600)
committerKeith Whitwell <keith@tungstengraphics.com>
Mon, 22 Sep 2008 05:13:51 +0000 (22:13 -0700)
Without these we can find ourselves in _mesa_load_state_parameters()
computing derived lighting/material values whhen the current material
properties haven't been updated from the VBO.
This may be a somewhat wide-spread problem that needs more attention...
(cherry picked from commit 49adf51eeec31c9f3c995a70acc5008522689708)

src/mesa/main/buffers.c
src/mesa/main/drawpix.c

index 5ab969e0ebb249617e1f364f2344417a219e1c82..a4aa5e9cf4a5e632b17331012d18125ccda5d9bb 100644 (file)
@@ -118,6 +118,8 @@ _mesa_Clear( GLbitfield mask )
    GET_CURRENT_CONTEXT(ctx);
    ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
 
+   FLUSH_CURRENT(ctx, 0);
+
    if (MESA_VERBOSE & VERBOSE_API)
       _mesa_debug(ctx, "glClear 0x%x\n", mask);
 
index fde933843095522911387a0804b379076b836cd7..244ca65e7087a44e3db96f6cbcd029c3646bb2fe 100644 (file)
@@ -293,6 +293,8 @@ _mesa_ReadPixels( GLint x, GLint y, GLsizei width, GLsizei height,
    GET_CURRENT_CONTEXT(ctx);
    ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
 
+   FLUSH_CURRENT(ctx, 0);
+
    if (width < 0 || height < 0) {
       _mesa_error( ctx, GL_INVALID_VALUE,
                    "glReadPixels(width=%d height=%d)", width, height );