From a110789f3ecc883fbd0f39758c40a6adc5118aff Mon Sep 17 00:00:00 2001 From: Brian Date: Fri, 7 Dec 2007 20:58:01 -0700 Subject: [PATCH] shorten loops over color bufs --- src/mesa/pipe/softpipe/sp_clear.c | 2 +- src/mesa/pipe/softpipe/sp_context.c | 2 +- src/mesa/pipe/softpipe/sp_flush.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/mesa/pipe/softpipe/sp_clear.c b/src/mesa/pipe/softpipe/sp_clear.c index f32e834ac0e..5b3857145d6 100644 --- a/src/mesa/pipe/softpipe/sp_clear.c +++ b/src/mesa/pipe/softpipe/sp_clear.c @@ -59,7 +59,7 @@ softpipe_clear(struct pipe_context *pipe, struct pipe_surface *ps, return; } - for (i = 0; i < PIPE_MAX_COLOR_BUFS; i++) { + for (i = 0; i < softpipe->framebuffer.num_cbufs; i++) { if (ps == sp_tile_cache_get_surface(softpipe->cbuf_cache[i])) { sp_tile_cache_clear(softpipe->cbuf_cache[i], clearValue); return; diff --git a/src/mesa/pipe/softpipe/sp_context.c b/src/mesa/pipe/softpipe/sp_context.c index bdfd6228ef8..df4e0cbd5ae 100644 --- a/src/mesa/pipe/softpipe/sp_context.c +++ b/src/mesa/pipe/softpipe/sp_context.c @@ -94,7 +94,7 @@ softpipe_unmap_surfaces(struct softpipe_context *sp) struct pipe_surface *ps; uint i; - for (i = 0; i < PIPE_MAX_COLOR_BUFS; i++) + for (i = 0; i < sp->framebuffer.num_cbufs; i++) sp_flush_tile_cache(sp, sp->cbuf_cache[i]); sp_flush_tile_cache(sp, sp->zbuf_cache); sp_flush_tile_cache(sp, sp->sbuf_cache); diff --git a/src/mesa/pipe/softpipe/sp_flush.c b/src/mesa/pipe/softpipe/sp_flush.c index 1010924bf61..47b11803ce1 100644 --- a/src/mesa/pipe/softpipe/sp_flush.c +++ b/src/mesa/pipe/softpipe/sp_flush.c @@ -55,7 +55,7 @@ softpipe_flush( struct pipe_context *pipe, * - flush the render cache */ - for (i = 0; i < PIPE_MAX_COLOR_BUFS; i++) + for (i = 0; i < softpipe->framebuffer.num_cbufs; i++) if (softpipe->cbuf_cache[i]) sp_flush_tile_cache(softpipe, softpipe->cbuf_cache[i]); -- 2.30.2