summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/draw
diff options
context:
space:
mode:
authorOlivier Galibert <[email protected]>2012-06-19 20:51:20 +0200
committerBrian Paul <[email protected]>2012-06-19 14:40:44 -0600
commit46931ecf480e1d231bb6c2236d91b5390f2465ac (patch)
tree981e1903926b2b79f2c696d8a2a80470229dc2aa /src/gallium/auxiliary/draw
parent4625a9b1adf7a30c56e2bbeb41573fbba4465851 (diff)
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 <[email protected]> Reviewed-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/gallium/auxiliary/draw')
-rw-r--r--src/gallium/auxiliary/draw/draw_llvm.c10
1 files changed, 3 insertions, 7 deletions
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);