some missing renderbuffer changes (Roland)
authorBrian Paul <brian.paul@tungstengraphics.com>
Thu, 1 Sep 2005 14:04:32 +0000 (14:04 +0000)
committerBrian Paul <brian.paul@tungstengraphics.com>
Thu, 1 Sep 2005 14:04:32 +0000 (14:04 +0000)
src/mesa/drivers/dri/r200/r200_screen.c

index b4c360c2188db2803a6a3828b230e85aff8395e2..779ce5a531c43edb43d3d49b16bb9d08ec7ae6b1 100644 (file)
@@ -173,7 +173,7 @@ r200FillInModes( unsigned pixel_bits, unsigned depth_bits,
 
     depth_bits_array[0] = depth_bits;
     depth_bits_array[1] = depth_bits;
-    
+
     /* Just like with the accumulation buffer, always provide some modes
      * with a stencil buffer.  It will be a sw fallback, but some apps won't
      * care about that.
@@ -547,16 +547,9 @@ r200CreateBuffer( __DRIscreenPrivate *driScrnPriv,
       const GLboolean swAccum = mesaVis->accumRedBits > 0;
       const GLboolean swStencil = mesaVis->stencilBits > 0 &&
          mesaVis->depthBits != 24;
-#if 0
-      driDrawPriv->driverPrivate = (void *)
-         _mesa_create_framebuffer( mesaVis,
-                                   swDepth,
-                                   swStencil,
-                                   swAccum,
-                                   swAlpha );
-#else
       struct gl_framebuffer *fb = _mesa_create_framebuffer(mesaVis);
 
+      /* front color renderbuffer */
       {
          driRenderbuffer *frontRb
             = driNewRenderbuffer(GL_RGBA, screen->cpp,
@@ -565,6 +558,7 @@ r200CreateBuffer( __DRIscreenPrivate *driScrnPriv,
          _mesa_add_renderbuffer(fb, BUFFER_FRONT_LEFT, &frontRb->Base);
       }
 
+      /* back color renderbuffer */
       if (mesaVis->doubleBufferMode) {
          driRenderbuffer *backRb
             = driNewRenderbuffer(GL_RGBA, screen->cpp,
@@ -573,12 +567,14 @@ r200CreateBuffer( __DRIscreenPrivate *driScrnPriv,
          _mesa_add_renderbuffer(fb, BUFFER_BACK_LEFT, &backRb->Base);
       }
 
+      /* depth renderbuffer */
       if (mesaVis->depthBits == 16) {
          driRenderbuffer *depthRb
             = driNewRenderbuffer(GL_DEPTH_COMPONENT16, screen->cpp,
                                  screen->depthOffset, screen->depthPitch);
          r200SetSpanFunctions(depthRb, mesaVis);
          _mesa_add_renderbuffer(fb, BUFFER_DEPTH, &depthRb->Base);
+        depthRb->depthHasSurface = screen->depthHasSurface;
       }
       else if (mesaVis->depthBits == 24) {
          driRenderbuffer *depthRb
@@ -586,8 +582,10 @@ r200CreateBuffer( __DRIscreenPrivate *driScrnPriv,
                                  screen->depthOffset, screen->depthPitch);
          r200SetSpanFunctions(depthRb, mesaVis);
          _mesa_add_renderbuffer(fb, BUFFER_DEPTH, &depthRb->Base);
+        depthRb->depthHasSurface = screen->depthHasSurface;
       }
 
+      /* stencil renderbuffer */
       if (mesaVis->stencilBits > 0 && !swStencil) {
          driRenderbuffer *stencilRb
             = driNewRenderbuffer(GL_STENCIL_INDEX8_EXT, screen->cpp,
@@ -604,7 +602,7 @@ r200CreateBuffer( __DRIscreenPrivate *driScrnPriv,
                                    swAlpha,
                                    GL_FALSE /* aux */);
       driDrawPriv->driverPrivate = (void *) fb;
-#endif
+
       return (driDrawPriv->driverPrivate != NULL);
    }
 }