mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-28 07:30:22 +01:00
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.
This commit is contained in:
parent
ffae82da4c
commit
fa5b81ea8b
1 changed files with 10 additions and 0 deletions
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue