summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/gallivm
diff options
context:
space:
mode:
authorDave Airlie <[email protected]>2015-06-22 13:59:25 +1000
committerDave Airlie <[email protected]>2015-06-23 15:54:07 +1000
commit1a71fbe28ca0525b618f6fb9d7354f3a6589af2f (patch)
tree9b1ba492c69abd08667fde724ca9d77846ada0b9 /src/gallium/auxiliary/gallivm
parent40d225803ecfa805b4dea4ee0ebd04df00ca8827 (diff)
draw/gallivm: add invocation ID support for llvmpipe.
This extends the draw code to add support for invocations. Reviewed-by: Roland Scheidegger <[email protected]> Signed-off-by: Dave Airlie <[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 3f76b79b8d1..967373ccdae 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_tgsi.h
+++ b/src/gallium/auxiliary/gallivm/lp_bld_tgsi.h
@@ -165,6 +165,7 @@ struct lp_bld_tgsi_system_values {
LLVMValueRef vertex_id_nobase;
LLVMValueRef prim_id;
LLVMValueRef basevertex;
+ LLVMValueRef invocation_id;
};
diff --git a/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c b/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c
index 092bd18b361..268379e7d13 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c
+++ b/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c
@@ -1532,6 +1532,11 @@ emit_fetch_system_value(
atype = TGSI_TYPE_UNSIGNED;
break;
+ case TGSI_SEMANTIC_INVOCATIONID:
+ res = lp_build_broadcast_scalar(&bld_base->uint_bld, bld->system_values.invocation_id);
+ atype = TGSI_TYPE_UNSIGNED;
+ break;
+
default:
assert(!"unexpected semantic in emit_fetch_system_value");
res = bld_base->base.zero;