From 46931ecf480e1d231bb6c2236d91b5390f2465ac Mon Sep 17 00:00:00 2001 From: Olivier Galibert Date: Tue, 19 Jun 2012 20:51:20 +0200 Subject: llvmpipe: Simplify and fix system variables fetch. The system array values concept doesn't really because it expects the system values to be fixed per call, which is wrong for gl_VertexID and iffy for gl_SampleID. So this patch does two things: - kill the array, have emit_fetch_system_value directly pick the values it needs (only gl_InstanceID for now, as the previous code) - correctly handle the expected type in emit_fetch_system_value Signed-off-by: Olivier Galibert Reviewed-by: Brian Paul --- src/gallium/auxiliary/draw/draw_llvm.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'src/gallium/auxiliary/draw/draw_llvm.c') diff --git a/src/gallium/auxiliary/draw/draw_llvm.c b/src/gallium/auxiliary/draw/draw_llvm.c index e1df2f1c267..8e787c580db 100644 --- a/src/gallium/auxiliary/draw/draw_llvm.c +++ b/src/gallium/auxiliary/draw/draw_llvm.c @@ -459,7 +459,7 @@ generate_vs(struct draw_llvm *llvm, LLVMBuilderRef builder, LLVMValueRef (*outputs)[TGSI_NUM_CHANNELS], const LLVMValueRef (*inputs)[TGSI_NUM_CHANNELS], - LLVMValueRef system_values_array, + LLVMValueRef instance_id, LLVMValueRef context_ptr, struct lp_build_sampler_soa *draw_sampler, boolean clamp_vertex_color) @@ -491,7 +491,7 @@ generate_vs(struct draw_llvm *llvm, vs_type, NULL /*struct lp_build_mask_context *mask*/, consts_ptr, - system_values_array, + instance_id, NULL /*pos*/, inputs, outputs, @@ -1249,7 +1249,6 @@ draw_llvm_generate(struct draw_llvm *llvm, struct draw_llvm_variant *variant, LLVMValueRef stride, step, io_itr; LLVMValueRef io_ptr, vbuffers_ptr, vb_ptr; LLVMValueRef instance_id; - LLVMValueRef system_values_array; LLVMValueRef zero = lp_build_const_int32(gallivm, 0); LLVMValueRef one = lp_build_const_int32(gallivm, 1); struct draw_context *draw = llvm->draw; @@ -1340,9 +1339,6 @@ draw_llvm_generate(struct draw_llvm *llvm, struct draw_llvm_variant *variant, lp_build_context_init(&bld, gallivm, lp_type_int(32)); - system_values_array = lp_build_system_values_array(gallivm, vs_info, - instance_id, NULL); - /* function will return non-zero i32 value if any clipped vertices */ ret_ptr = lp_build_alloca(gallivm, int32_type, ""); LLVMBuildStore(builder, zero, ret_ptr); @@ -1418,7 +1414,7 @@ draw_llvm_generate(struct draw_llvm *llvm, struct draw_llvm_variant *variant, builder, outputs, ptr_aos, - system_values_array, + instance_id, context_ptr, sampler, variant->key.clamp_vertex_color); -- cgit v1.2.3