radeon: Fix scissor rectangle calculation when rendering to FBO.
authorMichel Dänzer <daenzer@vmware.com>
Sat, 11 Jul 2009 18:25:09 +0000 (20:25 +0200)
committerMichel Dänzer <michel@daenzer.net>
Sat, 11 Jul 2009 18:25:09 +0000 (20:25 +0200)
fgl_glxgears -fbo runs, though the gears don't look right yet.

src/mesa/drivers/dri/radeon/radeon_common.c

index 42922732ecd0d38dd57825096bb0b5af94cb7d42..e9559cc25a6d8c46f3138d7f7b5efce66f50f6ed 100644 (file)
@@ -221,7 +221,7 @@ void radeonUpdateScissor( GLcontext *ctx )
 {
        radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
 
-       if ( radeon_get_drawable(rmesa) ) {
+       if ( !ctx->DrawBuffer->Name ) {
                __DRIdrawablePrivate *dPriv = radeon_get_drawable(rmesa);
 
                int x = ctx->Scissor.X;
@@ -233,9 +233,14 @@ void radeonUpdateScissor( GLcontext *ctx )
                rmesa->state.scissor.rect.y1 = y + dPriv->y;
                rmesa->state.scissor.rect.x2 = w + dPriv->x + 1;
                rmesa->state.scissor.rect.y2 = h + dPriv->y + 1;
-
-               radeonRecalcScissorRects( rmesa );
+       } else {
+               rmesa->state.scissor.rect.x1 = ctx->Scissor.X;
+               rmesa->state.scissor.rect.y1 = ctx->Scissor.Y;
+               rmesa->state.scissor.rect.x2 = ctx->Scissor.X + ctx->Scissor.Width;
+               rmesa->state.scissor.rect.y2 = ctx->Scissor.Y + ctx->Scissor.Height;
        }
+
+       radeonRecalcScissorRects( rmesa );
 }
 
 /* =============================================================