Fix batch.ptr when dropping a batchbuffer segment due to zero cliprects.
authorKeith Whitwell <keith@tungstengraphics.com>
Wed, 16 Jun 2004 12:03:53 +0000 (12:03 +0000)
committerKeith Whitwell <keith@tungstengraphics.com>
Wed, 16 Jun 2004 12:03:53 +0000 (12:03 +0000)
src/mesa/drivers/dri/i915/intel_ioctl.c

index 2fa88b52014500a663a9691d617287e2950bd5a1..ce20acbe564bb99fb2bf2743b73b005bda71fedd 100644 (file)
@@ -142,7 +142,6 @@ void intelFlushBatchLocked( intelContextPtr intel,
     * single buffer.
     */
    if (intel->numClipRects == 0 && !ignore_cliprects) {
-      intel->batch.space = intel->batch.size;
       
       /* Without this yeild, an application with no cliprects can hog
        * the hardware.  Without unlocking, the effect is much worse -
@@ -157,6 +156,8 @@ void intelFlushBatchLocked( intelContextPtr intel,
       /* Note that any state thought to have been emitted actually
        * hasn't:
        */
+      intel->batch.ptr -= (intel->batch.size - intel->batch.space);
+      intel->batch.space = intel->batch.size;
       intel->vtbl.lost_hardware( intel ); 
    }