From: Hui Qi Tay Date: Sat, 16 Oct 2010 10:02:11 +0000 (+0100) Subject: draw: corrections for w coordinate X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=c1d6b318661de2acdee38254d3750ed8dfc09e8b;p=mesa.git draw: corrections for w coordinate --- diff --git a/src/gallium/auxiliary/draw/draw_llvm.c b/src/gallium/auxiliary/draw/draw_llvm.c index 1c18d907434..7afa37ba94c 100644 --- a/src/gallium/auxiliary/draw/draw_llvm.c +++ b/src/gallium/auxiliary/draw/draw_llvm.c @@ -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*/