struct i915_winsys *iws = i915->iws;
if (i915_render->vbo) {
+ iws->buffer_unmap(iws, i915_render->vbo);
iws->buffer_destroy(iws, i915_render->vbo);
/*
* XXX If buffers where referenced then this should be done in
i915_render->vbo = iws->buffer_create(iws, i915_render->vbo_size,
I915_NEW_VERTEX);
+ i915_render->vbo_ptr = iws->buffer_map(iws, i915_render->vbo, TRUE);
}
/**
{
struct i915_vbuf_render *i915_render = i915_vbuf_render(render);
struct i915_context *i915 = i915_render->i915;
- struct i915_winsys *iws = i915->iws;
if (i915->vbo_flushed)
debug_printf("%s bad vbo flush occured stalling on hw\n", __FUNCTION__);
#ifdef VBUF_MAP_BUFFER
- i915_render->vbo_ptr = iws->buffer_map(iws, i915_render->vbo, TRUE);
return (unsigned char *)i915_render->vbo_ptr + i915_render->vbo_sw_offset;
#else
- (void)iws;
return (unsigned char *)i915_render->vbo_ptr;
#endif
}
i915_render->vbo_max_index = max_index;
i915_render->vbo_max_used = MAX2(i915_render->vbo_max_used, i915_render->vertex_size * (max_index + 1));
#ifdef VBUF_MAP_BUFFER
- iws->buffer_unmap(iws, i915_render->vbo);
+ (void)iws;
#else
i915_render->map_used_start = i915_render->vertex_size * min_index;
i915_render->map_used_end = i915_render->vertex_size * (max_index + 1);
i915_vbuf_render_destroy(struct vbuf_render *render)
{
struct i915_vbuf_render *i915_render = i915_vbuf_render(render);
+ struct i915_context *i915 = i915_render->i915;
+ struct i915_winsys *iws = i915->iws;
+
+ if (i915_render->vbo) {
+ i915->vbo = NULL;
+ iws->buffer_unmap(iws, i915_render->vbo);
+ iws->buffer_destroy(iws, i915_render->vbo);
+ }
+
FREE(i915_render);
}