From 8b9a5cfce0065d6e32d3a882b6ee9f94bf2634ff Mon Sep 17 00:00:00 2001
From: Roland Scheidegger <sroland@vmware.com>
Date: Wed, 5 Aug 2009 02:32:09 +0200
Subject: r200: fix off-by-one errors causing 6th texture unit to not work

both for normal and cube textures, this fixes demos/multiarb
(with 6 enabled texture units) and fixes #23142.
---
 src/mesa/drivers/dri/r200/r200_state_init.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

(limited to 'src')

diff --git a/src/mesa/drivers/dri/r200/r200_state_init.c b/src/mesa/drivers/dri/r200/r200_state_init.c
index 35d874bc09..78a0697a1b 100644
--- a/src/mesa/drivers/dri/r200/r200_state_init.c
+++ b/src/mesa/drivers/dri/r200/r200_state_init.c
@@ -772,7 +772,7 @@ void r200InitState( r200ContextPtr rmesa )
       ALLOC_STATE( afs[1], never, AFS_STATE_SIZE, "AFS/afsinst-1", 1 );
    }
 
-   for (i = 0; i < 5; i++)
+   for (i = 0; i < 6; i++)
       if (rmesa->radeon.radeonScreen->kernel_mm)
           rmesa->hw.tex[i].emit = tex_emit_cs;
       else
@@ -784,7 +784,7 @@ void r200InitState( r200ContextPtr rmesa )
       ALLOC_STATE( cube[3], tex_cube, CUBE_STATE_SIZE, "CUBE/tex-3", 3 );
       ALLOC_STATE( cube[4], tex_cube, CUBE_STATE_SIZE, "CUBE/tex-4", 4 );
       ALLOC_STATE( cube[5], tex_cube, CUBE_STATE_SIZE, "CUBE/tex-5", 5 );
-      for (i = 0; i < 5; i++)
+      for (i = 0; i < 6; i++)
           if (rmesa->radeon.radeonScreen->kernel_mm)
               rmesa->hw.cube[i].emit = cube_emit_cs;
           else
-- 
cgit v1.2.3