r300g: better describe another flush and move it closer to the real problem
[mesa.git] / src / mesa / main / depthstencil.c
index 803dc6c75e1779d48357cdcf916baf95638b2330..892520b695908a5bec5b43b55e095ade9f2e949f 100644 (file)
@@ -25,7 +25,6 @@
 #include "glheader.h"
 #include "imports.h"
 #include "context.h"
-#include "fbobject.h"
 #include "formats.h"
 #include "mtypes.h"
 #include "depthstencil.h"
@@ -66,7 +65,7 @@ delete_wrapper(struct gl_renderbuffer *rb)
    ASSERT(rb->Format == MESA_FORMAT_Z24_S8 ||
           rb->Format == MESA_FORMAT_S8_Z24);
    _mesa_reference_renderbuffer(&rb->Wrapped, NULL);
-   _mesa_free(rb);
+   free(rb);
 }
 
 
@@ -329,8 +328,8 @@ put_mono_values_z24(GLcontext *ctx, struct gl_renderbuffer *z24rb,
       }
    }
    else {
-      assert(dsrb->Format == MESA_FORMAT_S8_Z24);
       const GLuint shiftedVal = *((GLuint *) value);
+      assert(dsrb->Format == MESA_FORMAT_S8_Z24);
       for (i = 0; i < count; i++) {
          if (!mask || mask[i]) {
             temp[i] = shiftedVal | (temp[i] & 0xff000000);
@@ -366,7 +365,7 @@ _mesa_new_z24_renderbuffer_wrapper(GLcontext *ctx,
    z24rb->Width = dsrb->Width;
    z24rb->Height = dsrb->Height;
    z24rb->InternalFormat = GL_DEPTH_COMPONENT24;
-   z24rb->Format = MESA_FORMAT_Z24_S8;
+   z24rb->Format = MESA_FORMAT_X8_Z24;
    z24rb->_BaseFormat = GL_DEPTH_COMPONENT;
    z24rb->DataType = GL_UNSIGNED_INT;
    z24rb->Data = NULL;
@@ -819,5 +818,5 @@ _mesa_promote_stencil(GLcontext *ctx, struct gl_renderbuffer *stencilRb)
       }
       stencilRb->PutRow(ctx, stencilRb, width, 0, i, depthStencil, NULL);
    }
-   _mesa_free(data);
+   free(data);
 }