From 39e9cf6cb18cc4e8ee828006107de42482668b81 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Nicolai=20H=C3=A4hnle?= Date: Sat, 16 Apr 2016 13:00:12 -0500 Subject: [PATCH] radeonsi: implement TGSI_SEMANTIC_HELPER_INVOCATION MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Depends on LLVM support introduced in r267102. Reviewed-by: Marek Olšák --- docs/GL3.txt | 2 +- src/gallium/drivers/radeonsi/si_shader.c | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/docs/GL3.txt b/docs/GL3.txt index 6214f8d3073..be13b539b05 100644 --- a/docs/GL3.txt +++ b/docs/GL3.txt @@ -248,7 +248,7 @@ GLES3.1, GLSL ES 3.1 glMemoryBarrierByRegion DONE glGetTexLevelParameter[fi]v - needs updates DONE glGetBooleani_v - restrict to GLES enums - gl_HelperInvocation support DONE (i965, nvc0, r600) + gl_HelperInvocation support DONE (i965, nvc0, r600, radeonsi) GLES3.2, GLSL ES 3.2 GL_EXT_color_buffer_float DONE (all drivers) 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; -- 2.30.2