summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c
diff options
context:
space:
mode:
authorOlivier Galibert <galibert@pobox.com>2012-06-19 20:51:21 +0200
committerBrian Paul <brianp@vmware.com>2012-06-19 14:40:44 -0600
commitc790c2c7598dea2d5a5b0bfbe47732956e1e89a6 (patch)
tree76c69bbe525b74b870551c0863c10787583973de /src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c
parent46931ecf480e1d231bb6c2236d91b5390f2465ac (diff)
downloadexternal_mesa3d-c790c2c7598dea2d5a5b0bfbe47732956e1e89a6.zip
external_mesa3d-c790c2c7598dea2d5a5b0bfbe47732956e1e89a6.tar.gz
external_mesa3d-c790c2c7598dea2d5a5b0bfbe47732956e1e89a6.tar.bz2
llvmpipe: Add vertex id support.
Signed-off-by: Olivier Galibert <galibert@pobox.com> Reviewed-by: Brian Paul <brianp@vmware.com>
Diffstat (limited to 'src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c')
-rw-r--r--src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c b/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c
index 26be902..d9faaf2 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c
+++ b/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c
@@ -795,7 +795,12 @@ emit_fetch_system_value(
switch (info->system_value_semantic_name[reg->Register.Index]) {
case TGSI_SEMANTIC_INSTANCEID:
- res = lp_build_broadcast_scalar(&bld_base->uint_bld, bld->instance_id);
+ res = lp_build_broadcast_scalar(&bld_base->uint_bld, bld->system_values.instance_id);
+ atype = TGSI_TYPE_UNSIGNED;
+ break;
+
+ case TGSI_SEMANTIC_VERTEXID:
+ res = bld->system_values.vertex_id;
atype = TGSI_TYPE_UNSIGNED;
break;
@@ -1995,7 +2000,7 @@ lp_build_tgsi_soa(struct gallivm_state *gallivm,
struct lp_type type,
struct lp_build_mask_context *mask,
LLVMValueRef consts_ptr,
- LLVMValueRef instance_id,
+ const struct lp_bld_tgsi_system_values *system_values,
const LLVMValueRef *pos,
const LLVMValueRef (*inputs)[TGSI_NUM_CHANNELS],
LLVMValueRef (*outputs)[TGSI_NUM_CHANNELS],
@@ -2070,7 +2075,7 @@ lp_build_tgsi_soa(struct gallivm_state *gallivm,
lp_exec_mask_init(&bld.exec_mask, &bld.bld_base.base);
- bld.instance_id = instance_id;
+ bld.system_values = *system_values;
lp_build_tgsi_llvm(&bld.bld_base, tokens);