summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/draw/draw_llvm.c
diff options
context:
space:
mode:
authorJosé Fonseca <[email protected]>2012-01-11 18:10:43 +0000
committerJosé Fonseca <[email protected]>2012-01-11 18:11:28 +0000
commit1306644a67ad90c39c55f76e9b4734d943b6b5cc (patch)
tree89fdbfce59e2350b96171e7c32adf1d242c1787c /src/gallium/auxiliary/draw/draw_llvm.c
parent513d1feee46d05b71094c60ee09fa263867f25b7 (diff)
draw: Store the new pre_clip_pos member as well.
Again, not much testing nor peer review, but should be better than what's now.
Diffstat (limited to 'src/gallium/auxiliary/draw/draw_llvm.c')
-rw-r--r--src/gallium/auxiliary/draw/draw_llvm.c22
1 files changed, 16 insertions, 6 deletions
diff --git a/src/gallium/auxiliary/draw/draw_llvm.c b/src/gallium/auxiliary/draw/draw_llvm.c
index 50c7e254deb..e71c802696f 100644
--- a/src/gallium/auxiliary/draw/draw_llvm.c
+++ b/src/gallium/auxiliary/draw/draw_llvm.c
@@ -885,7 +885,8 @@ convert_to_aos(struct gallivm_state *gallivm,
static void
store_clip(struct gallivm_state *gallivm,
LLVMValueRef io_ptr,
- LLVMValueRef (*outputs)[NUM_CHANNELS])
+ LLVMValueRef (*outputs)[NUM_CHANNELS],
+ boolean pre_clip_pos)
{
LLVMBuilderRef builder = gallivm->builder;
LLVMValueRef out[4];
@@ -914,10 +915,18 @@ store_clip(struct gallivm_state *gallivm,
io2_ptr = LLVMBuildGEP(builder, io_ptr, &ind2, 1, "");
io3_ptr = LLVMBuildGEP(builder, io_ptr, &ind3, 1, "");
- clip_ptr0 = draw_jit_header_clip(gallivm, io0_ptr);
- clip_ptr1 = draw_jit_header_clip(gallivm, io1_ptr);
- clip_ptr2 = draw_jit_header_clip(gallivm, io2_ptr);
- clip_ptr3 = draw_jit_header_clip(gallivm, io3_ptr);
+ /* FIXME: this needs updating for clip vertex support */
+ if (!pre_clip_pos) {
+ clip_ptr0 = draw_jit_header_clip(gallivm, io0_ptr);
+ clip_ptr1 = draw_jit_header_clip(gallivm, io1_ptr);
+ clip_ptr2 = draw_jit_header_clip(gallivm, io2_ptr);
+ clip_ptr3 = draw_jit_header_clip(gallivm, io3_ptr);
+ } else {
+ clip_ptr0 = draw_jit_header_pre_clip_pos(gallivm, io0_ptr);
+ clip_ptr1 = draw_jit_header_pre_clip_pos(gallivm, io1_ptr);
+ clip_ptr2 = draw_jit_header_pre_clip_pos(gallivm, io2_ptr);
+ clip_ptr3 = draw_jit_header_pre_clip_pos(gallivm, io3_ptr);
+ }
for (i = 0; i<4; i++) {
clip0_ptr = LLVMBuildGEP(builder, clip_ptr0, indices, 2, ""); /* x0 */
@@ -1361,7 +1370,8 @@ draw_llvm_generate(struct draw_llvm *llvm, struct draw_llvm_variant *variant,
variant->key.clamp_vertex_color);
/* store original positions in clip before further manipulation */
- store_clip(gallivm, io, outputs);
+ store_clip(gallivm, io, outputs, 0);
+ store_clip(gallivm, io, outputs, 1);
/* do cliptest */
if (enable_cliptest) {