summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorHui Qi Tay <[email protected]>2010-10-18 18:48:18 +0100
committerKeith Whitwell <[email protected]>2010-10-19 21:34:42 -0700
commitab2e1edd1fc6fbfd4f7d1949aa0d40cdb7142bd6 (patch)
tree5f2d73653b48862318c960007b1e4c39b9f6a6a2 /src
parentb5236f3da482665567a9d53264e6203092120c31 (diff)
draw: corrections to allow for different cliptest cases
Diffstat (limited to 'src')
-rw-r--r--src/gallium/auxiliary/draw/draw_llvm.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/gallium/auxiliary/draw/draw_llvm.c b/src/gallium/auxiliary/draw/draw_llvm.c
index ebd8b9d4ad3..622250e7f73 100644
--- a/src/gallium/auxiliary/draw/draw_llvm.c
+++ b/src/gallium/auxiliary/draw/draw_llvm.c
@@ -861,9 +861,11 @@ generate_clipmask(LLVMBuilderRef builder,
struct lp_type f32_type = lp_type_float_vec(32);
+ mask = lp_build_const_int_vec(lp_type_int_vec(32), 0);
+ temp = lp_build_const_int_vec(lp_type_int_vec(32), 0);
zero = lp_build_const_vec(f32_type, 0); /* 0.0f 0.0f 0.0f 0.0f */
shift = lp_build_const_int_vec(lp_type_int_vec(32), 1); /* 1 1 1 1 */
-
+
/* Assuming position stored at output[0] */
pos_x = LLVMBuildLoad(builder, outputs[0][0], ""); /*x0 x1 x2 x3*/
pos_y = LLVMBuildLoad(builder, outputs[0][1], ""); /*y0 y1 y2 y3*/
@@ -900,10 +902,10 @@ generate_clipmask(LLVMBuilderRef builder,
}
if (clip_z){
+ temp = lp_build_const_int_vec(lp_type_int_vec(32), 16);
if (clip_halfz){
/* plane 5 */
test = lp_build_compare(builder, f32_type, PIPE_FUNC_GREATER, zero, pos_z);
- temp = LLVMBuildShl(builder, temp, shift, "");
test = LLVMBuildAnd(builder, test, temp, "");
mask = LLVMBuildOr(builder, mask, test, "");
}
@@ -911,7 +913,6 @@ generate_clipmask(LLVMBuilderRef builder,
/* plane 5 */
test = LLVMBuildFAdd(builder, pos_z, pos_w, "");
test = lp_build_compare(builder, f32_type, PIPE_FUNC_GREATER, zero, test);
- temp = LLVMBuildShl(builder, temp, shift, "");
test = LLVMBuildAnd(builder, test, temp, "");
mask = LLVMBuildOr(builder, mask, test, "");
}
@@ -925,6 +926,7 @@ generate_clipmask(LLVMBuilderRef builder,
if (clip_user){
LLVMValueRef planes_ptr = draw_jit_context_planes(builder, context_ptr);
LLVMValueRef indices[3];
+ temp = lp_build_const_int_vec(lp_type_int_vec(32), 32);
/* userclip planes */
for (i = 6; i < nr; i++) {