}
return ac_build_gather_values(ctx, result, 4);
}
+
+LLVMValueRef
+ac_build_load_helper_invocation(struct ac_llvm_context *ctx)
+{
+ LLVMValueRef result = ac_build_intrinsic(ctx, "llvm.amdgcn.ps.live",
+ ctx->i1, NULL, 0,
+ AC_FUNC_ATTR_READNONE);
+ result = LLVMBuildNot(ctx->builder, result, "");
+ return LLVMBuildSExt(ctx->builder, result, ctx->i32, "");
+}
LLVMValueRef
ac_build_ddxy_interp(struct ac_llvm_context *ctx, LLVMValueRef interp_ij);
+LLVMValueRef
+ac_build_load_helper_invocation(struct ac_llvm_context *ctx);
+
#ifdef __cplusplus
}
#endif
ctx->abi->emit_kill(ctx->abi, cond);
}
-static LLVMValueRef
-visit_load_helper_invocation(struct ac_nir_context *ctx)
-{
- LLVMValueRef result = ac_build_intrinsic(&ctx->ac,
- "llvm.amdgcn.ps.live",
- ctx->ac.i1, NULL, 0,
- AC_FUNC_ATTR_READNONE);
- result = LLVMBuildNot(ctx->ac.builder, result, "");
- return LLVMBuildSExt(ctx->ac.builder, result, ctx->ac.i32, "");
-}
-
static LLVMValueRef
visit_load_local_invocation_index(struct ac_nir_context *ctx)
{
result = ctx->abi->front_face;
break;
case nir_intrinsic_load_helper_invocation:
- result = visit_load_helper_invocation(ctx);
+ result = ac_build_load_helper_invocation(&ctx->ac);
break;
case nir_intrinsic_load_instance_id:
result = ctx->abi->instance_id;
break;
case TGSI_SEMANTIC_HELPER_INVOCATION:
- value = ac_build_intrinsic(&ctx->ac,
- "llvm.amdgcn.ps.live",
- ctx->i1, NULL, 0,
- AC_FUNC_ATTR_READNONE);
- value = LLVMBuildNot(ctx->ac.builder, value, "");
- value = LLVMBuildSExt(ctx->ac.builder, value, ctx->i32, "");
+ value = ac_build_load_helper_invocation(&ctx->ac);
break;
case TGSI_SEMANTIC_SUBGROUP_SIZE: