Fix glean scissor test
authorAlan Hourihane <alanh@tungstengraphics.com>
Thu, 13 Jan 2005 10:20:16 +0000 (10:20 +0000)
committerAlan Hourihane <alanh@tungstengraphics.com>
Thu, 13 Jan 2005 10:20:16 +0000 (10:20 +0000)
src/mesa/drivers/dri/unichrome/via_context.c
src/mesa/drivers/dri/unichrome/via_ioctl.c
src/mesa/drivers/dri/unichrome/via_state.c

index e48df63d0b9b80238e7ac40c8f55e4c86d819bfa..0c52374d60359cd05b821e120e1c6e0c29c64532 100644 (file)
@@ -676,6 +676,11 @@ viaMakeCurrent(__DRIcontextPrivate *driContextPriv,
        
        _mesa_update_state(vmesa->glCtx);
        viaValidateState(vmesa->glCtx);
+       ctx->Driver.Scissor(vmesa->glCtx,
+                           vmesa->glCtx->Scissor.X,
+                           vmesa->glCtx->Scissor.Y,
+                           vmesa->glCtx->Scissor.Width,
+                           vmesa->glCtx->Scissor.Height);
     }
     else {
         _mesa_make_current(0,0);
index efb7cf6b6cf21a049ff5b8835dc8c577fc7bab50..c7b616f405762cf8353a3123ec6378922cb88d32 100644 (file)
@@ -665,10 +665,10 @@ void viaFlushDmaLocked(viaContextPtr vmesa, GLuint flags)
         b.y1 = pbox[i].y1 - vmesa->drawY;
         b.y2 = pbox[i].y2 - vmesa->drawY;
 
-        if (vmesa->glCtx->Scissor.Enabled &&
+        if (vmesa->scissor &&
             !intersect_rect(&b, &b, &vmesa->scissorRect)) 
            continue;
-        
+
         b.x1 += vmesa->drawXoff;
         b.x2 += vmesa->drawXoff;
 
index 49782c78aa6da7d6e07e8dff42dd4c93c287ec18..fffea017895aad19e2a6fe1f1019aa9d8bdd1d9b 100644 (file)
@@ -612,14 +612,15 @@ static void viaScissor(GLcontext *ctx, GLint x, GLint y,
     if (VIA_DEBUG)
        fprintf(stderr, "%s %d,%d %dx%d, drawH %d\n", __FUNCTION__, x,y,w,h, vmesa->driDrawable->h);
 
-    if (ctx->Scissor.Enabled) {
+    if (vmesa->scissor) {
         VIA_FLUSH_DMA(vmesa); /* don't pipeline cliprect changes */
     }
 
     vmesa->scissorRect.x1 = x;
-    vmesa->scissorRect.y1 = vmesa->driDrawable->h - (y + h);
+    vmesa->scissorRect.y1 = vmesa->driDrawable->h - y - h;
     vmesa->scissorRect.x2 = x + w;
     vmesa->scissorRect.y2 = vmesa->driDrawable->h - y;
+
     if (VIA_DEBUG) fprintf(stderr, "%s out\n", __FUNCTION__);    
 }
 
@@ -630,6 +631,7 @@ static void viaEnable(GLcontext *ctx, GLenum cap, GLboolean state)
    switch (cap) {
    case GL_SCISSOR_TEST:
       VIA_FLUSH_DMA(vmesa);
+      vmesa->scissor = state;
       break;
    default:
       break;