Browse Source

draw: fix incorrect instancing divisor in LLVM code

tags/mesa-7.9-rc1
Brian Paul 15 years ago
parent
commit
37692e5dc9
1 changed files with 6 additions and 3 deletions
  1. 6
    3
      src/gallium/auxiliary/draw/draw_llvm.c

+ 6
- 3
src/gallium/auxiliary/draw/draw_llvm.c View File

@@ -380,12 +380,15 @@ generate_fetch(LLVMBuilderRef builder,
LLVMValueRef cond;
LLVMValueRef stride;

cond = LLVMBuildICmp(builder, LLVMIntULE, index, vb_max_index, "");

if (velem->instance_divisor) {
index = instance_id;
/* array index = instance_id / instance_divisor */
index = LLVMBuildUDiv(builder, instance_id,
LLVMConstInt(LLVMInt32Type(), velem->instance_divisor, 0),
"instance_divisor");
}

/* limit index to min(inex, vb_max_index) */
cond = LLVMBuildICmp(builder, LLVMIntULE, index, vb_max_index, "");
index = LLVMBuildSelect(builder, cond, index, vb_max_index, "");

stride = LLVMBuildMul(builder, vb_stride, index, "");

Loading…
Cancel
Save