summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Whitwell <keith@tungstengraphics.com>2007-07-13 11:27:57 +0100
committerKeith Whitwell <keith@tungstengraphics.com>2007-07-13 11:27:57 +0100
commit60a21f6c54788c0f22fd1cf4a4a13e1af389f3e6 (patch)
tree70e53ba36637f9b08da62eb3521e0578b4ccc0d0
parentf0f9a22609ccf2b8edc5760480f1a7a78cb504d7 (diff)
Simplify slightly.
Don't bother trying to save a small memcpy.
-rw-r--r--src/mesa/pipe/softpipe/sp_quad_bufloop.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/src/mesa/pipe/softpipe/sp_quad_bufloop.c b/src/mesa/pipe/softpipe/sp_quad_bufloop.c
index 76e7fd5889..be32d02a46 100644
--- a/src/mesa/pipe/softpipe/sp_quad_bufloop.c
+++ b/src/mesa/pipe/softpipe/sp_quad_bufloop.c
@@ -15,11 +15,11 @@ static void
cbuf_loop_quad(struct quad_stage *qs, struct quad_header *quad)
{
struct softpipe_context *softpipe = qs->softpipe;
- const GLuint sz = sizeof(quad->outputs.color);
GLfloat tmp[4][QUAD_SIZE];
GLuint i;
- assert(sz == sizeof(tmp));
+ assert(sizeof(quad->outputs.color) == sizeof(tmp));
+ assert(softpipe->framebuffer.num_cbufs <= PIPE_MAX_COLOR_BUFS);
/* make copy of original colors since they can get modified
* by blending and masking.
@@ -28,9 +28,7 @@ cbuf_loop_quad(struct quad_stage *qs, struct quad_header *quad)
* But if we emitted one color and glDrawBuffer(GL_FRONT_AND_BACK) is
* in effect, we need to save/restore colors like this.
*/
- memcpy(tmp, quad->outputs.color, sz);
-
- assert(softpipe->framebuffer.num_cbufs <= PIPE_MAX_COLOR_BUFS);
+ memcpy(tmp, quad->outputs.color, sizeof(tmp));
for (i = 0; i < softpipe->framebuffer.num_cbufs; i++) {
/* set current cbuffer */
@@ -39,10 +37,8 @@ cbuf_loop_quad(struct quad_stage *qs, struct quad_header *quad)
/* pass blended quad to next stage */
qs->next->run(qs->next, quad);
- if (i + 1 < softpipe->framebuffer.num_cbufs) {
- /* restore quad's colors for next buffer */
- memcpy(quad->outputs.color, tmp, sz);
- }
+ /* restore quad's colors for next buffer */
+ memcpy(quad->outputs.color, tmp, sizeof(tmp));
}
softpipe->cbuf = NULL; /* prevent accidental use */