rb->InternalFormat = GL_RGBA;
rb->Format = MESA_FORMAT_NONE;
- rb->Data = NULL;
-
/* Point back to ourself so that we don't have to check for Wrapped==NULL
* all over the drivers.
*/
void
_mesa_delete_renderbuffer(struct gl_renderbuffer *rb)
{
- if (rb->Data) {
- free(rb->Data);
- }
- free(rb);
+ /* no-op */
}
}
+/**
+ * Called via gl_renderbuffer::Delete()
+ */
+static void
+soft_renderbuffer_delete(struct gl_renderbuffer *rb)
+{
+ if (rb->Data) {
+ free(rb->Data);
+ rb->Data = NULL;
+ }
+ free(rb);
+}
+
+
void
_swrast_map_soft_renderbuffer(struct gl_context *ctx,
struct gl_renderbuffer *rb,
struct gl_renderbuffer *rb = _mesa_new_renderbuffer(ctx, name);
if (rb) {
rb->AllocStorage = soft_renderbuffer_storage;
+ rb->Delete = soft_renderbuffer_delete;
}
return rb;
}