gallivm: Fix bug in lp_build_one which would incorrectly return a vector for length 1.
authorJames Benton <jbenton@vmware.com>
Wed, 30 May 2012 13:36:44 +0000 (14:36 +0100)
committerJosé Fonseca <jfonseca@vmware.com>
Tue, 27 Nov 2012 16:23:04 +0000 (16:23 +0000)
Signed-off-by: José Fonseca <jfonseca@vmware.com>
src/gallium/auxiliary/gallivm/lp_bld_const.c

index 003901aabe66f3e24f85eb4720e1853cfc19de6e..24ed23adc35d326f8a571ea935e9a55a33f36af2 100644 (file)
@@ -269,7 +269,7 @@ lp_build_one(struct gallivm_state *gallivm, struct lp_type type)
    else {
       /* special case' -- 1.0 for normalized types is more easily attained if
        * we start with a vector consisting of all bits set */
-      LLVMTypeRef vec_type = LLVMVectorType(elem_type, type.length);
+      LLVMTypeRef vec_type = lp_build_vec_type(gallivm, type);
       LLVMValueRef vec = LLVMConstAllOnes(vec_type);
 
 #if 0