diff options
Diffstat (limited to 'src/mesa/state_tracker/st_cb_bufferobjects.c')
-rw-r--r-- | src/mesa/state_tracker/st_cb_bufferobjects.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/src/mesa/state_tracker/st_cb_bufferobjects.c b/src/mesa/state_tracker/st_cb_bufferobjects.c index 7021d73208..8c1fd5ce02 100644 --- a/src/mesa/state_tracker/st_cb_bufferobjects.c +++ b/src/mesa/state_tracker/st_cb_bufferobjects.c @@ -98,8 +98,10 @@ st_bufferobj_subdata(GLcontext *ctx, { struct st_buffer_object *st_obj = st_buffer_object(obj); - if (offset >= st_obj->size || size > (st_obj->size - offset)) - return; + /* we may be called from VBO code, so double-check params here */ + ASSERT(offset >= 0); + ASSERT(size >= 0); + ASSERT(offset + size <= obj->Size); st_cond_flush_pipe_buffer_write(st_context(ctx), st_obj->buffer, offset, size, data); @@ -118,8 +120,10 @@ st_bufferobj_get_subdata(GLcontext *ctx, { struct st_buffer_object *st_obj = st_buffer_object(obj); - if (offset >= st_obj->size || size > (st_obj->size - offset)) - return; + /* we may be called from VBO code, so double-check params here */ + ASSERT(offset >= 0); + ASSERT(size >= 0); + ASSERT(offset + size <= obj->Size); st_cond_flush_pipe_buffer_read(st_context(ctx), st_obj->buffer, offset, size, data); @@ -172,8 +176,6 @@ st_bufferobj_data(GLcontext *ctx, return; } - st_obj->size = size; - if (data) st_no_flush_pipe_buffer_write(st_context(ctx), st_obj->buffer, 0, size, data); @@ -234,6 +236,9 @@ st_bufferobj_map_range(GLcontext *ctx, GLenum target, if (access & GL_MAP_READ_BIT) flags |= PIPE_BUFFER_USAGE_CPU_READ; + if (access & GL_MAP_FLUSH_EXPLICIT_BIT) + flags |= PIPE_BUFFER_USAGE_FLUSH_EXPLICIT; + /* ... other flags ... */ |