[Mesa-dev] [PATCH] radeonsi: implement TGSI_SEMANTIC_HELPER_INVOCATION
Marek Olšák
maraeo at gmail.com
Sun Apr 17 19:34:33 UTC 2016
Reviewed-by: Marek Olšák <marek.olsak at amd.com>
Marek
On Sat, Apr 16, 2016 at 8:06 PM, Nicolai Hähnle <nhaehnle at gmail.com> wrote:
> From: Nicolai Hähnle <nicolai.haehnle at amd.com>
>
> ---
> We will soon claim GLES 3.1 support, which requires gl_HelperInvocation,
> so now is the time to do this.
>
> This depends on LLVM support: http://reviews.llvm.org/D19191
>
> 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 6b5e016..d36c187 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 de4c45c..dcbdde3 100644
> --- a/src/gallium/drivers/radeonsi/si_shader.c
> +++ b/src/gallium/drivers/radeonsi/si_shader.c
> @@ -1314,6 +1314,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.5.0
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
More information about the mesa-dev
mailing list