From: Brian Paul Date: Sat, 11 Feb 2012 01:40:02 +0000 (-0700) Subject: st/mesa: remove st_renderbuffer::stride X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=2e12b4cfef79b81a68597ec1320754989b1c1fa4;p=mesa.git st/mesa: remove st_renderbuffer::stride It was only used for software buffers and easily computed. Reviewed-by: Jose Fonseca --- diff --git a/src/mesa/state_tracker/st_cb_fbo.c b/src/mesa/state_tracker/st_cb_fbo.c index 85086bbd2a9..2e884a42619 100644 --- a/src/mesa/state_tracker/st_cb_fbo.c +++ b/src/mesa/state_tracker/st_cb_fbo.c @@ -105,8 +105,7 @@ st_renderbuffer_alloc_storage(struct gl_context * ctx, free(strb->data); - strb->stride = util_format_get_stride(format, width); - size = util_format_get_2d_size(format, strb->stride, height); + size = _mesa_format_image_size(strb->Base.Format, width, height, 1); strb->data = malloc(size); @@ -640,12 +639,12 @@ st_MapRenderbuffer(struct gl_context *ctx, if (strb->software) { /* software-allocated renderbuffer (probably an accum buffer) */ - GLubyte *map = (GLubyte *) strb->data; if (strb->data) { - map += strb->stride * y; - map += _mesa_get_format_bytes(strb->Base.Format) * x; - *mapOut = map; - *rowStrideOut = strb->stride; + GLint bpp = _mesa_get_format_bytes(strb->Base.Format); + GLint stride = _mesa_format_row_stride(strb->Base.Format, + strb->Base.Width); + *mapOut = (GLubyte *) strb->data + y * stride + x * bpp; + *rowStrideOut = stride; } else { *mapOut = NULL; diff --git a/src/mesa/state_tracker/st_cb_fbo.h b/src/mesa/state_tracker/st_cb_fbo.h index 7a2d4d8b157..506fd06d680 100644 --- a/src/mesa/state_tracker/st_cb_fbo.h +++ b/src/mesa/state_tracker/st_cb_fbo.h @@ -56,7 +56,6 @@ struct st_renderbuffer * Used only when hardware accumulation buffers are not supported. */ boolean software; - size_t stride; void *data; struct st_texture_object *rtt; /**< GL render to texture's texture */