}
-static struct gl_renderbuffer*
-intel_create_wrapped_renderbuffer(struct gl_context * ctx,
- struct gl_renderbuffer *wrapper,
- gl_format format);
-
-
/**
* Called via glRenderbufferStorageEXT() to set the format and allocate
* storage for a user-created renderbuffer.
struct gl_renderbuffer *depth_rb;
struct gl_renderbuffer *stencil_rb;
- depth_rb = intel_create_wrapped_renderbuffer(ctx, rb,
+ depth_rb = intel_create_wrapped_renderbuffer(ctx, width, height,
MESA_FORMAT_X8_Z24);
- stencil_rb = intel_create_wrapped_renderbuffer(ctx, rb,
+ stencil_rb = intel_create_wrapped_renderbuffer(ctx, width, height,
MESA_FORMAT_S8);
ok = depth_rb && stencil_rb;
ok = ok && intel_alloc_renderbuffer_storage(ctx, depth_rb,
return false;
}
+ depth_rb->Wrapped = rb;
+ stencil_rb->Wrapped = rb;
_mesa_reference_renderbuffer(&irb->wrapped_depth, depth_rb);
_mesa_reference_renderbuffer(&irb->wrapped_stencil, stencil_rb);
}
-static struct gl_renderbuffer *
+struct gl_renderbuffer*
intel_create_wrapped_renderbuffer(struct gl_context * ctx,
- struct gl_renderbuffer *wrapper,
+ int width, int height,
gl_format format)
{
/*
rb->Format = format;
rb->InternalFormat = rb->_BaseFormat;
rb->DataType = intel_mesa_format_to_rb_datatype(format);
- rb->Width = wrapper->Width;
- rb->Height = wrapper->Height;
-
- rb->AllocStorage = intel_nop_alloc_storage;
- rb->Delete = intel_delete_renderbuffer;
- rb->GetPointer = intel_get_pointer;
-
- /*
- * A refcount here would cause a cyclic reference. The wrapper references
- * the unwrapper.
- */
- rb->Wrapped = wrapper;
+ rb->Width = width;
+ rb->Height = height;
return rb;
}