nouveau: use _mesa_is_winsys/user_fbo() helpers
authorBrian Paul <brianp@vmware.com>
Fri, 20 Apr 2012 13:58:59 +0000 (07:58 -0600)
committerBrian Paul <brianp@vmware.com>
Tue, 1 May 2012 17:39:34 +0000 (11:39 -0600)
Reviewed-by: Eric Anholt <eric@anholt.net>
src/mesa/drivers/dri/nouveau/nouveau_context.c
src/mesa/drivers/dri/nouveau/nouveau_driver.c
src/mesa/drivers/dri/nouveau/nouveau_screen.c

index 48457675fc83c6648c7ed814397daa36dc7541ad..2625b76d14fb6e596c659b95daa80f4a143321fe 100644 (file)
@@ -33,6 +33,7 @@
 
 #include "main/dd.h"
 #include "main/framebuffer.h"
+#include "main/fbobject.h"
 #include "main/light.h"
 #include "main/state.h"
 #include "main/version.h"
@@ -396,11 +397,11 @@ nouveau_validate_framebuffer(struct gl_context *ctx)
        __DRIdrawable *dri_draw = dri_ctx->driDrawablePriv;
        __DRIdrawable *dri_read = dri_ctx->driReadablePriv;
 
-       if (ctx->DrawBuffer->Name == 0)
+       if (_mesa_is_winsys_fbo(ctx->DrawBuffer))
                validate_framebuffer(dri_ctx, dri_draw,
                                     &dri_ctx->dri2.draw_stamp);
 
-       if (ctx->ReadBuffer->Name == 0)
+       if (_mesa_is_winsys_fbo(ctx->ReadBuffer))
                validate_framebuffer(dri_ctx, dri_read,
                                     &dri_ctx->dri2.read_stamp);
 
index 7222f68b439f8b3b1d78036d04df9a98a596912b..69e5cac426afe922a05b6f12c2d052aa2e708351 100644 (file)
@@ -25,6 +25,8 @@
  */
 
 #include "main/mfeatures.h"
+#include "main/mtypes.h"
+#include "main/fbobject.h"
 
 #include "nouveau_driver.h"
 #include "nouveau_context.h"
@@ -61,7 +63,7 @@ nouveau_flush(struct gl_context *ctx)
 
        PUSH_KICK(push);
 
-       if (ctx->DrawBuffer->Name == 0 &&
+       if (_mesa_is_winsys_fbo(ctx->DrawBuffer) &&
            ctx->DrawBuffer->_ColorDrawBufferIndexes[0] == BUFFER_FRONT_LEFT) {
                __DRIscreen *screen = nctx->screen->dri_screen;
                __DRIdri2LoaderExtension *dri2 = screen->dri2.loader;
index 7e51b94a2ff5f0e9315b866ada782e03230346f4..2a15c08c6793e048058a493fdd55b5c5b6b2a3b0 100644 (file)
@@ -33,6 +33,7 @@
 #include "nv20_driver.h"
 
 #include "main/framebuffer.h"
+#include "main/fbobject.h"
 #include "main/renderbuffer.h"
 #include "swrast/s_renderbuffer.h"