radeonsi: implement TGSI_SEMANTIC_HELPER_INVOCATION
authorNicolai Hähnle <nicolai.haehnle@amd.com>
Sat, 16 Apr 2016 18:00:12 +0000 (13:00 -0500)
committerNicolai Hähnle <nicolai.haehnle@amd.com>
Fri, 22 Apr 2016 04:14:04 +0000 (23:14 -0500)
Depends on LLVM support introduced in r267102.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
docs/GL3.txt
src/gallium/drivers/radeonsi/si_shader.c

index 6214f8d307303b90cd6357c9e867f09ce865e1f3..be13b539b052db53f059a89e4cf3bdcd24068d6b 100644 (file)
@@ -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)
index e277c2f3914f470836eb9a15cf7cbec9ce3dbf37..c6efbc13774a08c7010011dbf64b7525e88494a3 100644 (file)
@@ -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;