r200: fix off-by-one errors causing 6th texture unit to not work
authorRoland Scheidegger <sroland@vmware.com>
Wed, 5 Aug 2009 00:32:09 +0000 (02:32 +0200)
committerRoland Scheidegger <sroland@vmware.com>
Wed, 5 Aug 2009 00:33:34 +0000 (02:33 +0200)
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

index 35d874b..78a0697 100644 (file)
@@ -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