get rid of more cliprects...
authorRoland Scheidegger <sroland@tungstengraphics.com>
Mon, 16 Jul 2007 15:41:22 +0000 (17:41 +0200)
committerRoland Scheidegger <sroland@tungstengraphics.com>
Mon, 16 Jul 2007 15:41:22 +0000 (17:41 +0200)
src/mesa/drivers/dri/i915tex/intel_blit.c
src/mesa/drivers/dri/i915tex/intel_pixel_draw.c

index db72f59a2c7bb0d35f7e725f610da3eaeffa90c9..3ecd2e8e481b9dfbb2d56b32c4ff4cdc44b05559 100644 (file)
@@ -402,10 +402,8 @@ intelClearWithBlit(GLcontext * ctx, GLbitfield mask)
    LOCK_HARDWARE(intel);
 
    if (intel->numClipRects) {
-      assert(intel->numClipRects == 1);
       GLint cx, cy, cw, ch;
-      drm_clip_rect_t clear;
-      int i;
+      drm_clip_rect_t b;
 
       /* Get clear bounds after locking */
       cx = fb->_Xmin;
@@ -416,36 +414,25 @@ intelClearWithBlit(GLcontext * ctx, GLbitfield mask)
       if (fb->Name == 0) {
          /* clearing a window */
          /* flip top to bottom */
-         clear.x1 = cx;
-         clear.y1 = intel->pClipRects->y2 - cy - ch;
-         clear.x2 = clear.x1 + cw;
-         clear.y2 = clear.y1 + ch;
+         b.x1 = cx;
+         b.y1 = fb->Height - cy - ch;
+         b.x2 = b.x1 + cw;
+         b.y2 = b.y1 + ch;
       }
       else {
          /* clearing FBO */
-         assert(intel->numClipRects == 1);
-         assert(intel->pClipRects == &intel->fboRect);
-         clear.x1 = cx;
-         clear.y1 = cy;
-         clear.x2 = clear.x1 + cw;
-         clear.y2 = clear.y1 + ch;
+         b.x1 = cx;
+         b.y1 = cy;
+         b.x2 = b.x1 + cw;
+         b.y2 = b.y1 + ch;
          /* no change to mask */
       }
 
-      for (i = 0; i < intel->numClipRects; i++) {
-         const drm_clip_rect_t *box = &intel->pClipRects[i];
-         drm_clip_rect_t b;
+      {
          GLuint buf;
          GLuint clearMask = mask;      /* use copy, since we modify it below */
          GLboolean all = (cw == fb->Width && ch == fb->Height);
 
-         if (!all) {
-            intel_intersect_cliprects(&b, &clear, box);
-         }
-         else {
-            b = *box;
-         }
-
          DBG("clear %d,%d..%d,%d, mask %x\n",
                       b.x1, b.y1, b.x2, b.y2, mask);
 
index b1ecf2b0ce37c49496ae2b300287c20c8e7192e1..1c83028d8abb83880dddc6e09053c74f455fd30b 100644 (file)
@@ -421,10 +421,17 @@ intelDrawPixels(GLcontext * ctx,
        * wise happily run the fragment program on each pixel in the image).
        */
       struct gl_fragment_program *fpSave = ctx->FragmentProgram._Current;
+   /* can't just set current frag prog to 0 here as on buffer resize
+      we'll get new state checks which will segfault (actually don't get them
+      with current priv buffers). Remains a hack. */
       ctx->FragmentProgram._Current = NULL;
+      ctx->FragmentProgram._UseTexEnvProgram = GL_FALSE;
+      ctx->FragmentProgram._Active = GL_FALSE;
       _swrast_DrawPixels( ctx, x, y, width, height, format, type,
                           unpack, pixels );
       ctx->FragmentProgram._Current = fpSave;
+      ctx->FragmentProgram._UseTexEnvProgram = GL_TRUE;
+      ctx->FragmentProgram._Active = GL_TRUE;
    }
    else {
       _swrast_DrawPixels( ctx, x, y, width, height, format, type,