summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2009-06-19 14:42:37 -0600
committerBrian Paul <[email protected]>2009-06-19 14:43:55 -0600
commitfa5b81ea8bb3ff163543fe3a8907e7be69e99419 (patch)
treea11591348e27d80b36fcb90e3e545cb1f42c6d58 /src/mesa
parentffae82da4cf5a969d699c7f5bdcd4dae6c27a1ca (diff)
st/mesa: restore some parameter checking buffer object functions
These functions may be called from the VBO code (not just user GL calls) so do some parameter sanity checking.
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/state_tracker/st_cb_bufferobjects.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/mesa/state_tracker/st_cb_bufferobjects.c b/src/mesa/state_tracker/st_cb_bufferobjects.c
index 1ecf7bf7844..4d9ff01c776 100644
--- a/src/mesa/state_tracker/st_cb_bufferobjects.c
+++ b/src/mesa/state_tracker/st_cb_bufferobjects.c
@@ -98,6 +98,11 @@ st_bufferobj_subdata(GLcontext *ctx,
{
struct st_buffer_object *st_obj = st_buffer_object(obj);
+ /* 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);
}
@@ -115,6 +120,11 @@ st_bufferobj_get_subdata(GLcontext *ctx,
{
struct st_buffer_object *st_obj = st_buffer_object(obj);
+ /* 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);
}