summaryrefslogtreecommitdiff
path: root/src/mesa/state_tracker/st_cb_bufferobjects.c
diff options
context:
space:
mode:
authorJosé Fonseca <jfonseca@vmware.com>2009-03-04 11:59:00 +0000
committerJosé Fonseca <jfonseca@vmware.com>2009-03-04 11:59:00 +0000
commitcfd5298f240612ef69ae321aebbc425710a8d731 (patch)
tree2b201783f5df1fc2ba416a9ae9640354f2aac343 /src/mesa/state_tracker/st_cb_bufferobjects.c
parent004d8f11882c6c149a395cf2e86d5d5fb3fa114b (diff)
mesa: Implement and use FlushMappedBufferRange.
Diffstat (limited to 'src/mesa/state_tracker/st_cb_bufferobjects.c')
-rw-r--r--src/mesa/state_tracker/st_cb_bufferobjects.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/mesa/state_tracker/st_cb_bufferobjects.c b/src/mesa/state_tracker/st_cb_bufferobjects.c
index 526fc95873..2765ec24b7 100644
--- a/src/mesa/state_tracker/st_cb_bufferobjects.c
+++ b/src/mesa/state_tracker/st_cb_bufferobjects.c
@@ -233,14 +233,24 @@ st_bufferobj_map_range(GLcontext *ctx, GLenum target,
flags |= PIPE_BUFFER_USAGE_DONTBLOCK;
map = pipe_buffer_map_range(pipe->screen, st_obj->buffer, offset, length, flags);
- /* FIXME: some code expects this to point to the buffer start, which means that
- * the range might not be respected in all circumstances
+ /* this is expected to point to the buffer start, in order to calculate the
+ * vertices offsets
*/
obj->Pointer = map ? map - offset : NULL;
return map;
}
+static void
+st_bufferobj_flush_mapped_range(GLcontext *ctx, GLenum target,
+ GLintptr offset, GLsizeiptr length,
+ struct gl_buffer_object *obj)
+{
+ struct pipe_context *pipe = st_context(ctx)->pipe;
+ struct st_buffer_object *st_obj = st_buffer_object(obj);
+
+ pipe_buffer_flush_mapped_range(pipe->screen, st_obj->buffer, offset, length);
+}
/**
@@ -268,5 +278,6 @@ st_init_bufferobject_functions(struct dd_function_table *functions)
functions->GetBufferSubData = st_bufferobj_get_subdata;
functions->MapBuffer = st_bufferobj_map;
functions->MapBufferRange = st_bufferobj_map_range;
+ functions->FlushMappedBufferRange = st_bufferobj_flush_mapped_range;
functions->UnmapBuffer = st_bufferobj_unmap;
}