summaryrefslogtreecommitdiff
path: root/src/gallium/auxiliary/draw
diff options
context:
space:
mode:
authorHui Qi Tay <tayhuiqithq@gmail.com>2010-10-16 11:02:11 +0100
committerKeith Whitwell <keithw@vmware.com>2010-10-17 10:57:43 -0700
commitc1d6b318661de2acdee38254d3750ed8dfc09e8b (patch)
treebc41325f436a0da74193908be3cf52e5b2fb109a /src/gallium/auxiliary/draw
parent26ff7523b69ddb377ade29296d20abfc46e69489 (diff)
draw: corrections for w coordinate
Diffstat (limited to 'src/gallium/auxiliary/draw')
-rw-r--r--src/gallium/auxiliary/draw/draw_llvm.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/gallium/auxiliary/draw/draw_llvm.c b/src/gallium/auxiliary/draw/draw_llvm.c
index 1c18d90743..7afa37ba94 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*/