#include "intel_regions.h"
#include "dri_bufmgr.h"
+static GLboolean intel_bufferobj_unmap(GLcontext * ctx,
+ GLenum target,
+ struct gl_buffer_object *obj);
+
/** Allocates a new dri_bo to store the data for the buffer object. */
static void
intel_bufferobj_alloc_buffer(struct intel_context *intel,
assert(intel_obj);
+ /* Buffer objects are automatically unmapped when deleting according
+ * to the spec.
+ */
+ if (obj->Pointer)
+ intel_bufferobj_unmap(ctx, 0, obj);
+
if (intel_obj->region) {
intel_bufferobj_release_region(intel, intel_obj);
}
intel_obj->Base.Size = size;
intel_obj->Base.Usage = usage;
+ /* Buffer objects are automatically unmapped when creating new data buffers
+ * according to the spec.
+ */
+ if (obj->Pointer)
+ intel_bufferobj_unmap(ctx, 0, obj);
+
if (intel_obj->region)
intel_bufferobj_release_region(intel, intel_obj);