draw: corrections for w coordinate
authorHui Qi Tay <tayhuiqithq@gmail.com>
Sat, 16 Oct 2010 10:02:11 +0000 (11:02 +0100)
committerKeith Whitwell <keithw@vmware.com>
Sun, 17 Oct 2010 17:57:43 +0000 (10:57 -0700)
src/gallium/auxiliary/draw/draw_llvm.c

index 1c18d9074346ddbe4ebaf30ebcb3e27db4c4d965..7afa37ba94c804ac664b54e96bf61000a49eabf5 100644 (file)
@@ -800,9 +800,10 @@ generate_viewport(struct draw_llvm *llvm,
    
    /* for 1/w convention*/
    out3 = LLVMBuildFDiv(builder, const1, out3, "");
-
+   LLVMBuildStore(builder, out3, outputs[0][3]);
+  
    /* Viewport Mapping */
-   for (i=0; i<4; i++){
+   for (i=0; i<3; i++){
       LLVMValueRef out = LLVMBuildLoad(builder, outputs[0][i], ""); /*x0 x1 x2 x3*/
       LLVMValueRef scale = lp_build_const_vec(f32_type, scaleA[i]); /*sx sx sx sx*/     
       LLVMValueRef trans = lp_build_const_vec(f32_type, transA[i]); /*tx tx tx tx*/