draw/llvm: index overflows if it's greater than elt max
authorZack Rusin <zackr@vmware.com>
Wed, 3 Jul 2013 01:52:55 +0000 (21:52 -0400)
committerZack Rusin <zackr@vmware.com>
Wed, 3 Jul 2013 13:06:24 +0000 (09:06 -0400)
The comparison, incorrectly, was greater-than-or-equal to
elt max.

Signed-off-by: Zack Rusin <zackr@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
src/gallium/auxiliary/draw/draw_llvm.c

index f9bcadc6cfa19e27d09c78a568b315b42fb4c2ee..79e7a9b6d12cff81125b98c48dfba7234ac98ca7 100644 (file)
@@ -1671,7 +1671,7 @@ draw_llvm_generate(struct draw_llvm *llvm, struct draw_llvm_variant *variant,
                   gallivm,
                   lp_build_vec_type(gallivm, lp_type_int(32)), "");
             struct lp_build_if_state if_ctx;
-            index_overflowed = LLVMBuildICmp(builder, LLVMIntUGE,
+            index_overflowed = LLVMBuildICmp(builder, LLVMIntUGT,
                                              true_index, fetch_elt_max,
                                              "index_overflowed");