Mesa (7.11): intel: fix the wrong code to detect null texture.

Ian Romanick idr at kemper.freedesktop.org
Mon Oct 24 22:54:49 UTC 2011


Module: Mesa
Branch: 7.11
Commit: eaad245418116143534b0e887e218040f3c0dab0
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=eaad245418116143534b0e887e218040f3c0dab0

Author: Yuanhan Liu <yuanhan.liu at linux.intel.com>
Date:   Fri Sep 23 13:34:26 2011 +0800

intel: fix the wrong code to detect null texture.

There is already comments show how to detect a null texture. Fix the
code to match the comments.

This would fix the oglc divzero(basic.texQOrWEqualsZero) and
divzero(basic.texTrivialPrim) test case fail.

Signed-off-by: Yuanhan Liu <yuanhan.liu at linux.intel.com>
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
Reviewed-by: Eric Anholt <eric at anholt.net>
(cherry picked from commit 1a662e7c18cab98f1b122f6766faf338725de673)

---

 src/mesa/drivers/dri/intel/intel_mipmap_tree.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/mesa/drivers/dri/intel/intel_mipmap_tree.c b/src/mesa/drivers/dri/intel/intel_mipmap_tree.c
index 4e711de..f7d96ab 100644
--- a/src/mesa/drivers/dri/intel/intel_mipmap_tree.c
+++ b/src/mesa/drivers/dri/intel/intel_mipmap_tree.c
@@ -137,7 +137,7 @@ intel_miptree_create(struct intel_context *intel,
    /*
     * pitch == 0 || height == 0  indicates the null texture
     */
-   if (!mt || !mt->total_height) {
+   if (!mt || !mt->total_width || !mt->total_height) {
       free(mt);
       return NULL;
    }




More information about the mesa-commit mailing list