diff options
author | Timothy Arceri <[email protected]> | 2018-03-08 09:46:42 +1100 |
---|---|---|
committer | Timothy Arceri <[email protected]> | 2018-03-08 11:28:37 +1100 |
commit | 0c90264da4139805d34f530485a678c53809932e (patch) | |
tree | c0e71e42ae1f83b5373f99493040f4f7f938a179 /src/amd/common | |
parent | 50cc97d98a5365b65988b2e6a827d744404f93ab (diff) |
ac/radeonsi: add emit_kill to the abi
This should fix a regression with Rocket League grass rendering
on the NIR backend.
Reviewed-by: Marek Olšák <[email protected]>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=104717
Diffstat (limited to 'src/amd/common')
-rw-r--r-- | src/amd/common/ac_nir_to_llvm.c | 9 | ||||
-rw-r--r-- | src/amd/common/ac_shader_abi.h | 2 |
2 files changed, 10 insertions, 1 deletions
diff --git a/src/amd/common/ac_nir_to_llvm.c b/src/amd/common/ac_nir_to_llvm.c index 29bffefd79e..c785244dcc4 100644 --- a/src/amd/common/ac_nir_to_llvm.c +++ b/src/amd/common/ac_nir_to_llvm.c @@ -3872,6 +3872,12 @@ static void emit_barrier(struct ac_llvm_context *ac, gl_shader_stage stage) ac->voidt, NULL, 0, AC_FUNC_ATTR_CONVERGENT); } +static void radv_emit_kill(struct ac_shader_abi *abi, LLVMValueRef visible) +{ + struct radv_shader_context *ctx = radv_shader_context_from_abi(abi); + ac_build_kill_if_false(&ctx->ac, visible); +} + static void emit_discard(struct ac_nir_context *ctx, const nir_intrinsic_instr *instr) { @@ -3886,7 +3892,7 @@ static void emit_discard(struct ac_nir_context *ctx, cond = LLVMConstInt(ctx->ac.i1, false, 0); } - ac_build_kill_if_false(&ctx->ac, cond); + ctx->abi->emit_kill(ctx->abi, cond); } static LLVMValueRef @@ -6955,6 +6961,7 @@ LLVMModuleRef ac_translate_nir_to_llvm(LLVMTargetMachineRef tm, ctx.abi.lookup_interp_param = lookup_interp_param; ctx.abi.load_sample_position = load_sample_position; ctx.abi.load_sample_mask_in = load_sample_mask_in; + ctx.abi.emit_kill = radv_emit_kill; } if (i) diff --git a/src/amd/common/ac_shader_abi.h b/src/amd/common/ac_shader_abi.h index 09fe32c1363..901e49b1f97 100644 --- a/src/amd/common/ac_shader_abi.h +++ b/src/amd/common/ac_shader_abi.h @@ -86,6 +86,8 @@ struct ac_shader_abi { void (*emit_primitive)(struct ac_shader_abi *abi, unsigned stream); + void (*emit_kill)(struct ac_shader_abi *abi, LLVMValueRef visible); + LLVMValueRef (*load_inputs)(struct ac_shader_abi *abi, unsigned location, unsigned driver_location, |