summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/svga/svga_pipe_misc.c
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2013-11-07 17:28:33 -0700
committerBrian Paul <brianp@vmware.com>2013-11-11 08:12:18 -0700
commit34ce1a850236b94186f73c24a7ddb0f18075eb94 (patch)
treeb5e450678aba1ab8d5ca47dc07ee5eda9b53f38e /src/gallium/drivers/svga/svga_pipe_misc.c
parent2182d2db28e9ae5c276dcbad1309cf3484a4476e (diff)
downloadexternal_mesa3d-34ce1a850236b94186f73c24a7ddb0f18075eb94.zip
external_mesa3d-34ce1a850236b94186f73c24a7ddb0f18075eb94.tar.gz
external_mesa3d-34ce1a850236b94186f73c24a7ddb0f18075eb94.tar.bz2
svga: improve loops over color buffers
Only loop over the actual number of color buffers supported, not PIPE_MAX_COLOR_BUFS. Reviewed-by: José Fonseca <jfonseca@vmware.com>
Diffstat (limited to 'src/gallium/drivers/svga/svga_pipe_misc.c')
-rw-r--r--src/gallium/drivers/svga/svga_pipe_misc.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/gallium/drivers/svga/svga_pipe_misc.c b/src/gallium/drivers/svga/svga_pipe_misc.c
index f1c007b..2c88e2a 100644
--- a/src/gallium/drivers/svga/svga_pipe_misc.c
+++ b/src/gallium/drivers/svga/svga_pipe_misc.c
@@ -28,6 +28,7 @@
#include "util/u_inlines.h"
#include "svga_context.h"
+#include "svga_screen.h"
#include "svga_surface.h"
@@ -52,11 +53,12 @@ static void svga_set_polygon_stipple( struct pipe_context *pipe,
void svga_cleanup_framebuffer(struct svga_context *svga)
{
+ struct svga_screen *svgascreen = svga_screen(svga->pipe.screen);
struct pipe_framebuffer_state *curr = &svga->curr.framebuffer;
struct pipe_framebuffer_state *hw = &svga->state.hw_clear.framebuffer;
- int i;
+ unsigned i;
- for (i = 0; i < PIPE_MAX_COLOR_BUFS; i++) {
+ for (i = 0; i < svgascreen->max_color_buffers; i++) {
pipe_surface_reference(&curr->cbufs[i], NULL);
pipe_surface_reference(&hw->cbufs[i], NULL);
}