From: Brian Paul Date: Fri, 19 Jun 2009 18:19:15 +0000 (-0600) Subject: st/mesa: remove redundant st_buffer_object::size field and error checks X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=9d029e0e200eb97993c1b9fb8ab9046172e703e8;p=mesa.git st/mesa: remove redundant st_buffer_object::size field and error checks Just use the gl_buffer_object::Size field. Remove unnecessary size/offset error checks. Core Mesa will have already done these checks before these functions are called. --- diff --git a/src/mesa/state_tracker/st_cb_bufferobjects.c b/src/mesa/state_tracker/st_cb_bufferobjects.c index 7021d732089..1ecf7bf7844 100644 --- a/src/mesa/state_tracker/st_cb_bufferobjects.c +++ b/src/mesa/state_tracker/st_cb_bufferobjects.c @@ -98,9 +98,6 @@ 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; - st_cond_flush_pipe_buffer_write(st_context(ctx), st_obj->buffer, offset, size, data); } @@ -118,9 +115,6 @@ 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; - st_cond_flush_pipe_buffer_read(st_context(ctx), st_obj->buffer, offset, size, data); } @@ -172,8 +166,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); diff --git a/src/mesa/state_tracker/st_cb_bufferobjects.h b/src/mesa/state_tracker/st_cb_bufferobjects.h index 0adda5d4604..fda6d05dd34 100644 --- a/src/mesa/state_tracker/st_cb_bufferobjects.h +++ b/src/mesa/state_tracker/st_cb_bufferobjects.h @@ -40,7 +40,6 @@ struct st_buffer_object { struct gl_buffer_object Base; struct pipe_buffer *buffer; - GLsizeiptrARB size; };