summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/radeonsi
diff options
context:
space:
mode:
authorNicolai Hähnle <[email protected]>2016-04-16 13:00:12 -0500
committerNicolai Hähnle <[email protected]>2016-04-21 23:14:04 -0500
commit39e9cf6cb18cc4e8ee828006107de42482668b81 (patch)
tree48609c82eae3dcb95b75b70c7eb4eb885cbe4929 /src/gallium/drivers/radeonsi
parent2bac561787a067da2100d495cb0ad9ee11c3ffff (diff)
radeonsi: implement TGSI_SEMANTIC_HELPER_INVOCATION
Depends on LLVM support introduced in r267102. Reviewed-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src/gallium/drivers/radeonsi')
-rw-r--r--src/gallium/drivers/radeonsi/si_shader.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/gallium/drivers/radeonsi/si_shader.c b/src/gallium/drivers/radeonsi/si_shader.c
index e277c2f3914..c6efbc13774 100644
--- a/src/gallium/drivers/radeonsi/si_shader.c
+++ b/src/gallium/drivers/radeonsi/si_shader.c
@@ -1333,6 +1333,17 @@ static void declare_system_value(
value = LLVMGetParam(radeon_bld->main_fn, SI_PARAM_THREAD_ID);
break;
+#if HAVE_LLVM >= 0x0309
+ case TGSI_SEMANTIC_HELPER_INVOCATION:
+ value = lp_build_intrinsic(gallivm->builder,
+ "llvm.amdgcn.ps.live",
+ ctx->i1, NULL, 0,
+ LLVMReadNoneAttribute | LLVMNoUnwindAttribute);
+ value = LLVMBuildNot(gallivm->builder, value, "");
+ value = LLVMBuildSExt(gallivm->builder, value, ctx->i32, "");
+ break;
+#endif
+
default:
assert(!"unknown system value");
return;