summaryrefslogtreecommitdiffstats
path: root/src/mesa/state_tracker/st_cb_fbo.c
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2012-02-10 18:34:25 -0700
committerBrian Paul <brianp@vmware.com>2012-02-15 14:07:43 -0700
commitd765c8ee8c761bb73d634bb274cfc5061892c9a8 (patch)
treeca1a56fc62d483226c55c2903435d01bbdbf48b6 /src/mesa/state_tracker/st_cb_fbo.c
parentdbe88515c55bd067bc2036345b30e65686a49cf2 (diff)
downloadexternal_mesa3d-d765c8ee8c761bb73d634bb274cfc5061892c9a8.zip
external_mesa3d-d765c8ee8c761bb73d634bb274cfc5061892c9a8.tar.gz
external_mesa3d-d765c8ee8c761bb73d634bb274cfc5061892c9a8.tar.bz2
st/mesa: remove st_renderbuffer::format
We only used it in a few places that can implemented differently. Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Diffstat (limited to 'src/mesa/state_tracker/st_cb_fbo.c')
-rw-r--r--src/mesa/state_tracker/st_cb_fbo.c13
1 files changed, 3 insertions, 10 deletions
diff --git a/src/mesa/state_tracker/st_cb_fbo.c b/src/mesa/state_tracker/st_cb_fbo.c
index 1cbc0d6..85086bb 100644
--- a/src/mesa/state_tracker/st_cb_fbo.c
+++ b/src/mesa/state_tracker/st_cb_fbo.c
@@ -97,7 +97,6 @@ st_renderbuffer_alloc_storage(struct gl_context * ctx,
strb->Base.Height = height;
strb->Base.Format = st_pipe_format_to_mesa_format(format);
strb->Base._BaseFormat = _mesa_base_fbo_format(ctx, internalFormat);
- strb->format = format;
strb->defined = GL_FALSE; /* undefined contents now */
@@ -106,10 +105,8 @@ st_renderbuffer_alloc_storage(struct gl_context * ctx,
free(strb->data);
- assert(strb->format != PIPE_FORMAT_NONE);
-
- strb->stride = util_format_get_stride(strb->format, width);
- size = util_format_get_2d_size(strb->format, strb->stride, height);
+ strb->stride = util_format_get_stride(format, width);
+ size = util_format_get_2d_size(format, strb->stride, height);
strb->data = malloc(size);
@@ -206,7 +203,6 @@ st_new_renderbuffer(struct gl_context *ctx, GLuint name)
_mesa_init_renderbuffer(&strb->Base, name);
strb->Base.Delete = st_renderbuffer_delete;
strb->Base.AllocStorage = st_renderbuffer_alloc_storage;
- strb->format = PIPE_FORMAT_NONE;
return &strb->Base;
}
return NULL;
@@ -233,7 +229,6 @@ st_new_renderbuffer_fb(enum pipe_format format, int samples, boolean sw)
strb->Base.NumSamples = samples;
strb->Base.Format = st_pipe_format_to_mesa_format(format);
strb->Base._BaseFormat = _mesa_get_format_base_format(strb->Base.Format);
- strb->format = format;
strb->software = sw;
switch (format) {
@@ -401,8 +396,6 @@ st_render_texture(struct gl_context *ctx,
strb->texture,
&surf_tmpl);
- strb->format = pt->format;
-
strb->Base.Format = st_pipe_format_to_mesa_format(pt->format);
/*
@@ -650,7 +643,7 @@ st_MapRenderbuffer(struct gl_context *ctx,
GLubyte *map = (GLubyte *) strb->data;
if (strb->data) {
map += strb->stride * y;
- map += util_format_get_blocksize(strb->format) * x;
+ map += _mesa_get_format_bytes(strb->Base.Format) * x;
*mapOut = map;
*rowStrideOut = strb->stride;
}