mesa: fix incorrect default texture binding in unbind_texobj_from_texunits()
authorBrian Paul <brianp@vmware.com>
Fri, 2 Oct 2009 15:55:07 +0000 (09:55 -0600)
committerBrian Paul <brianp@vmware.com>
Fri, 2 Oct 2009 15:57:00 +0000 (09:57 -0600)
If we deleted a currently bound texture, we were always reverting the texture
binding to the default 1D texture rather than the proper default texture.

src/mesa/main/texobj.c

index d09c43925066d10b138294c8bb0cb2717eb1f3bc..da55ac8697d02f5e4a0e4ae82d9cd98a92aa4a5d 100644 (file)
@@ -863,7 +863,7 @@ unbind_texobj_from_texunits(GLcontext *ctx, struct gl_texture_object *texObj)
       for (tex = 0; tex < NUM_TEXTURE_TARGETS; tex++) {
          if (texObj == unit->CurrentTex[tex]) {
             _mesa_reference_texobj(&unit->CurrentTex[tex],
-                                   ctx->Shared->DefaultTex[TEXTURE_1D_INDEX]);
+                                   ctx->Shared->DefaultTex[tex]);
             ASSERT(unit->CurrentTex[tex]);
             break;
          }