summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/gallivm
diff options
context:
space:
mode:
authorZack Rusin <[email protected]>2013-03-29 04:50:32 -0700
committerZack Rusin <[email protected]>2013-04-03 10:16:25 -0700
commitd8543bd7528de05e5ce3ac407838e7500428a93d (patch)
tree92a46903a64aefda058173b22ecbdd444ca1cba2 /src/gallium/auxiliary/gallivm
parentf6bfb62c500c059464e66a4246a2e6089752d3db (diff)
draw: Implement support for primitive id
We were largely ignoring primitive id. Signed-off-by: Zack Rusin <[email protected]> Reviewed-by: José Fonseca <[email protected]>
Diffstat (limited to 'src/gallium/auxiliary/gallivm')
-rw-r--r--src/gallium/auxiliary/gallivm/lp_bld_tgsi.h1
-rw-r--r--src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c5
2 files changed, 6 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/gallivm/lp_bld_tgsi.h b/src/gallium/auxiliary/gallivm/lp_bld_tgsi.h
index 5764847acb5..558a8dd7dd8 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_tgsi.h
+++ b/src/gallium/auxiliary/gallivm/lp_bld_tgsi.h
@@ -155,6 +155,7 @@ struct lp_tgsi_info
struct lp_bld_tgsi_system_values {
LLVMValueRef instance_id;
LLVMValueRef vertex_id;
+ LLVMValueRef prim_id;
};
diff --git a/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c b/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c
index 54f3fd9f8f8..e802d5b1b62 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c
+++ b/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c
@@ -929,6 +929,11 @@ emit_fetch_system_value(
atype = TGSI_TYPE_UNSIGNED;
break;
+ case TGSI_SEMANTIC_PRIMID:
+ res = bld->system_values.prim_id;
+ atype = TGSI_TYPE_UNSIGNED;
+ break;
+
default:
assert(!"unexpected semantic in emit_fetch_system_value");
res = bld_base->base.zero;