added a few more fields to help with DRI drivers
authorBrian Paul <brian.paul@tungstengraphics.com>
Thu, 1 Sep 2005 03:07:29 +0000 (03:07 +0000)
committerBrian Paul <brian.paul@tungstengraphics.com>
Thu, 1 Sep 2005 03:07:29 +0000 (03:07 +0000)
src/mesa/drivers/dri/common/drirenderbuffer.c
src/mesa/drivers/dri/common/drirenderbuffer.h

index 44826958d0240ba334c03ecba0756f7c03c24b61..201ce44950283e33e4d3f124fbaceca84208e3cb 100644 (file)
@@ -93,6 +93,10 @@ driNewRenderbuffer(GLenum format, GLint cpp, GLint offset, GLint pitch)
       drb->offset = offset;
       drb->pitch = pitch;
       drb->cpp = cpp;
+
+      /* may be changed if page flipping is active: */
+      drb->flippedOffset = offset;
+      drb->flippedPitch = pitch;
    }
    return drb;
 }
index 627f1d41d985c8bd9f8b4a86771732a056c34cb4..b2b6fea12cda9bec1ea251ec6a2f136f73cac07f 100644 (file)
@@ -29,6 +29,20 @@ typedef struct {
    GLint offset;  /* in bytes */
    GLint pitch;   /* in pixels */
 
+   /* If the driver can do page flipping (full-screen double buffering)
+    * the current front/back buffers may get swapped.
+    * If page flipping is disabled, these  fields will be identical to
+    * the offset/pitch above.
+    * If page flipping is enabled, and this is the front(back) renderbuffer,
+    * flippedOffset/Pitch will have the back(front) renderbuffer's values.
+    */
+   GLint flippedOffset;
+   GLint flippedPitch;
+
+   /* XXX this is for radeon/r200 only.  We should really create a new
+    * r200Renderbuffer class, derived from this class...  not a huge deal.
+    */
+   GLboolean depthHasSurface;
 } driRenderbuffer;