summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/draw/draw_llvm.c
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2013-11-01 17:07:55 -0600
committerBrian Paul <brianp@vmware.com>2013-11-04 07:12:14 -0700
commit9fc41e2eeaad556810d68cc623a52ea551b9d907 (patch)
treefb7e313653c49f1339d1cfd0cdd4f58c31927037 /src/gallium/auxiliary/draw/draw_llvm.c
parent2f896627175384fd5943f21804700a155ba4e8a0 (diff)
downloadexternal_mesa3d-9fc41e2eeaad556810d68cc623a52ea551b9d907.zip
external_mesa3d-9fc41e2eeaad556810d68cc623a52ea551b9d907.tar.gz
external_mesa3d-9fc41e2eeaad556810d68cc623a52ea551b9d907.tar.bz2
draw: move type construction out of loop
We can create clip_ptr_type once instead of n times inside the loop. Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Diffstat (limited to 'src/gallium/auxiliary/draw/draw_llvm.c')
-rw-r--r--src/gallium/auxiliary/draw/draw_llvm.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/gallium/auxiliary/draw/draw_llvm.c b/src/gallium/auxiliary/draw/draw_llvm.c
index 03668d9..fe49b86 100644
--- a/src/gallium/auxiliary/draw/draw_llvm.c
+++ b/src/gallium/auxiliary/draw/draw_llvm.c
@@ -1036,6 +1036,9 @@ store_clip(struct gallivm_state *gallivm,
LLVMValueRef io_ptrs[LP_MAX_VECTOR_WIDTH / 32];
LLVMValueRef inds[LP_MAX_VECTOR_WIDTH / 32];
LLVMValueRef clip_ptrs[LP_MAX_VECTOR_WIDTH / 32];
+ LLVMTypeRef clip_ptr_type =
+ LLVMPointerType(LLVMVectorType(LLVMFloatTypeInContext(gallivm->context),
+ 4), 0);
int i, j;
indices[0] =
@@ -1070,7 +1073,6 @@ store_clip(struct gallivm_state *gallivm,
}
for (j = 0; j < vs_type.length; j++) {
- LLVMTypeRef clip_ptr_type = LLVMPointerType(LLVMVectorType(LLVMFloatTypeInContext(gallivm->context), 4), 0);
LLVMValueRef clip_ptr;
clip_ptr = LLVMBuildGEP(builder, clip_ptrs[j], indices, 2, "clipo");