From 5533c41541f57774314517d893045eedfc5b2da1 Mon Sep 17 00:00:00 2001 From: Pierre-Eric Pelloux-Prayer Date: Tue, 24 Mar 2020 16:32:11 +0100 Subject: [PATCH] ac: fix ac_build_is_helper_invocation when postponed_kill is null MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit If there was no demote() in the shader, ac_build_is_helper_invocation behaves exactly the same as ac_build_load_helper_invocation, i.e. the helper lanes are the same as they were at the beginning of the shader. Fixes: de57ea2a3da ("amd/llvm: implement nir_intrinsic_demote(_if) and nir_intrinsic_is_helper_invocation") Reviewed-by: Daniel Schürmann Tested-by: Marge Bot Part-of: --- src/amd/llvm/ac_llvm_build.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/amd/llvm/ac_llvm_build.c b/src/amd/llvm/ac_llvm_build.c index 373eb77b4a0..f13baf792fc 100644 --- a/src/amd/llvm/ac_llvm_build.c +++ b/src/amd/llvm/ac_llvm_build.c @@ -4712,6 +4712,9 @@ ac_build_load_helper_invocation(struct ac_llvm_context *ctx) LLVMValueRef ac_build_is_helper_invocation(struct ac_llvm_context *ctx) { + if (!ctx->postponed_kill) + return ac_build_load_helper_invocation(ctx); + /* !(exact && postponed) */ LLVMValueRef exact = ac_build_intrinsic(ctx, "llvm.amdgcn.ps.live", ctx->i1, NULL, 0, -- 2.30.2