mesa: use _mesa_reference_texobj() when setting texUnit->Current pointer
authorBrian Paul <brianp@vmware.com>
Mon, 2 Mar 2009 21:27:16 +0000 (14:27 -0700)
committerBrian Paul <brianp@vmware.com>
Mon, 2 Mar 2009 21:29:37 +0000 (14:29 -0700)
Fixes piglit copytexsubimage regression.

src/mesa/main/texstate.c

index 5d53e3591071565f8861eb8864605c4a30f537ad..672a125bf1ba66dc715a0aa988e7432f078360bf 100644 (file)
@@ -554,7 +554,6 @@ update_texture_state( GLcontext *ctx )
          continue;
       }
 
-      texUnit->_Current = NULL;
       texUnit->_ReallyEnabled = 0x0;
 
       /* Look for the highest priority texture target that's enabled (or used
@@ -571,7 +570,7 @@ update_texture_state( GLcontext *ctx )
             }
             if (texObj->_Complete) {
                texUnit->_ReallyEnabled = 1 << texIndex;
-               texUnit->_Current = texObj;
+               _mesa_reference_texobj(&texUnit->_Current, texObj);
                break;
             }
          }