dri/nouveau: Call _mesa_update_state() after framebuffer invalidation.
authorFrancisco Jerez <currojerez@riseup.net>
Mon, 25 Oct 2010 19:35:54 +0000 (21:35 +0200)
committerFrancisco Jerez <currojerez@riseup.net>
Sat, 30 Oct 2010 17:25:33 +0000 (19:25 +0200)
Previously nouveau_state_emit() was being called directly, sometimes
that doesn't work because it doesn't update the derived GL context.

src/mesa/drivers/dri/nouveau/nouveau_context.c
src/mesa/drivers/dri/nouveau/nv10_context.c

index 0ace139b886bbbc9c6287b40218cef5d8cf1f2b9..c6cf78150cb91661f152e7e3a44e621aeb2216ff 100644 (file)
@@ -365,5 +365,6 @@ nouveau_validate_framebuffer(struct gl_context *ctx)
                validate_framebuffer(dri_ctx, dri_read,
                                     &dri_ctx->dri2.read_stamp);
 
-       nouveau_state_emit(ctx);
+       if (ctx->NewState & _NEW_BUFFERS)
+               _mesa_update_state(ctx);
 }
index fdcb43b7718f045b28aad689bfc1acd87a904f79..78be401ba2abad03e4b9b7ef8ee1a1d0959844c6 100644 (file)
@@ -24,6 +24,7 @@
  *
  */
 
+#include "main/state.h"
 #include "nouveau_driver.h"
 #include "nouveau_context.h"
 #include "nouveau_fbo.h"
@@ -184,6 +185,9 @@ nv10_clear(struct gl_context *ctx, GLbitfield buffers)
                        nv17_zclear(ctx, &buffers);
                else
                        nv10_zclear(ctx, &buffers);
+
+               /* Emit the zclear state if it's dirty */
+               _mesa_update_state(ctx);
        }
 
        nouveau_clear(ctx, buffers);