st: clean up some if-statment code
authorBrian Paul <brianp@vmware.com>
Wed, 18 Mar 2009 16:21:05 +0000 (10:21 -0600)
committerBrian Paul <brianp@vmware.com>
Wed, 18 Mar 2009 16:24:19 +0000 (10:24 -0600)
src/mesa/state_tracker/st_cb_texture.c

index 71640d78f72810e8f9a5a2c64ea78a37343de4f3..f94713abd1dc3217de06f3ceddc703c842536e2e 100644 (file)
@@ -465,18 +465,17 @@ st_TexImage(GLcontext * ctx,
     * bmBufferData with NULL data to free the old block and avoid
     * waiting on any outstanding fences.
     */
-   if (stObj->pt &&
-       (stObj->teximage_realloc ||
-        (/*stObj->pt->first_level == level &&*/
-         stObj->pt->last_level == level &&
-         stObj->pt->target != PIPE_TEXTURE_CUBE &&
-         !st_texture_match_image(stObj->pt, &stImage->base,
-                                 stImage->face, stImage->level)))) {
-
-      DBG("release it\n");
-      pipe_texture_reference(&stObj->pt, NULL);
-      assert(!stObj->pt);
-      stObj->teximage_realloc = FALSE;
+   if (stObj->pt) {
+      if (stObj->teximage_realloc ||
+          (stObj->pt->last_level == level &&
+           stObj->pt->target != PIPE_TEXTURE_CUBE &&
+           !st_texture_match_image(stObj->pt, &stImage->base,
+                                   stImage->face, stImage->level))) {
+         DBG("release it\n");
+         pipe_texture_reference(&stObj->pt, NULL);
+         assert(!stObj->pt);
+         stObj->teximage_realloc = FALSE;
+      }
    }
 
    if (!stObj->pt) {