summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/depthstencil.c
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2010-07-14 14:50:29 -0600
committerBrian Paul <[email protected]>2010-07-14 15:13:54 -0600
commitf2bfc2b7d2c5ef8a54ef9c9d25bc2e4cac2b8616 (patch)
treef4600b019e976599304e1e1923896ece5d77eb19 /src/mesa/main/depthstencil.c
parent4beea12f170cdbce75bd07549b475f59fc3cd7f9 (diff)
mesa: update assertions and fix refcounting in depth/stencil renderbuffer code
Diffstat (limited to 'src/mesa/main/depthstencil.c')
-rw-r--r--src/mesa/main/depthstencil.c22
1 files changed, 16 insertions, 6 deletions
diff --git a/src/mesa/main/depthstencil.c b/src/mesa/main/depthstencil.c
index 892520b6959..885e718a767 100644
--- a/src/mesa/main/depthstencil.c
+++ b/src/mesa/main/depthstencil.c
@@ -62,8 +62,8 @@ nop_get_pointer(GLcontext *ctx, struct gl_renderbuffer *rb, GLint x, GLint y)
static void
delete_wrapper(struct gl_renderbuffer *rb)
{
- ASSERT(rb->Format == MESA_FORMAT_Z24_S8 ||
- rb->Format == MESA_FORMAT_S8_Z24);
+ ASSERT(rb->Format == MESA_FORMAT_S8 ||
+ rb->Format == MESA_FORMAT_X8_Z24);
_mesa_reference_renderbuffer(&rb->Wrapped, NULL);
free(rb);
}
@@ -83,7 +83,9 @@ alloc_wrapper_storage(GLcontext *ctx, struct gl_renderbuffer *rb,
(void) internalFormat;
ASSERT(dsrb->Format == MESA_FORMAT_Z24_S8 ||
- dsrb->Format == MESA_FORMAT_S8_Z24);
+ dsrb->Format == MESA_FORMAT_Z24_X8 ||
+ dsrb->Format == MESA_FORMAT_S8_Z24 ||
+ dsrb->Format == MESA_FORMAT_X8_Z24);
retVal = dsrb->AllocStorage(ctx, dsrb, dsrb->InternalFormat, width, height);
if (retVal) {
@@ -352,16 +354,21 @@ _mesa_new_z24_renderbuffer_wrapper(GLcontext *ctx,
struct gl_renderbuffer *z24rb;
ASSERT(dsrb->Format == MESA_FORMAT_Z24_S8 ||
- dsrb->Format == MESA_FORMAT_S8_Z24);
+ dsrb->Format == MESA_FORMAT_Z24_X8 ||
+ dsrb->Format == MESA_FORMAT_S8_Z24 ||
+ dsrb->Format == MESA_FORMAT_X8_Z24);
ASSERT(dsrb->DataType == GL_UNSIGNED_INT_24_8_EXT);
z24rb = _mesa_new_renderbuffer(ctx, 0);
if (!z24rb)
return NULL;
+ /* NOTE: need to do manual refcounting here */
z24rb->Wrapped = dsrb;
+ dsrb->RefCount++;
+
z24rb->Name = dsrb->Name;
- z24rb->RefCount = 1;
+ z24rb->RefCount = 0;
z24rb->Width = dsrb->Width;
z24rb->Height = dsrb->Height;
z24rb->InternalFormat = GL_DEPTH_COMPONENT24;
@@ -642,9 +649,12 @@ _mesa_new_s8_renderbuffer_wrapper(GLcontext *ctx, struct gl_renderbuffer *dsrb)
if (!s8rb)
return NULL;
+ /* NOTE: need to do manual refcounting here */
s8rb->Wrapped = dsrb;
+ dsrb->RefCount++;
+
s8rb->Name = dsrb->Name;
- s8rb->RefCount = 1;
+ s8rb->RefCount = 0;
s8rb->Width = dsrb->Width;
s8rb->Height = dsrb->Height;
s8rb->InternalFormat = GL_STENCIL_INDEX8_EXT;