diff options
author | Nicolai Hähnle <nicolai.haehnle@amd.com> | 2017-06-24 18:38:38 +0200 |
---|---|---|
committer | Nicolai Hähnle <nicolai.haehnle@amd.com> | 2017-07-05 12:33:56 +0200 |
commit | c6ac4f4bb922eaf0b85021634b134794cd05e92b (patch) | |
tree | e3bf3de0e01038ecf3b9afd7e042780fb2ab0000 | |
parent | ed37fd493277473871a6c6fd9c023f9fe177c3b7 (diff) |
ac/nir: extract shader_info->fs.can_discard from NIR shader info
-rw-r--r-- | src/amd/common/ac_nir_to_llvm.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/amd/common/ac_nir_to_llvm.c b/src/amd/common/ac_nir_to_llvm.c index 16729a8a3c..d20b0fa794 100644 --- a/src/amd/common/ac_nir_to_llvm.c +++ b/src/amd/common/ac_nir_to_llvm.c @@ -3600,7 +3600,6 @@ static void emit_discard_if(struct nir_to_llvm_context *ctx, const nir_intrinsic_instr *instr) { LLVMValueRef cond; - ctx->shader_info->fs.can_discard = true; cond = LLVMBuildICmp(ctx->builder, LLVMIntNE, get_src(ctx->nir, instr->src[0]), @@ -4060,7 +4059,6 @@ static void visit_intrinsic(struct ac_nir_context *ctx, result = visit_image_size(ctx, instr); break; case nir_intrinsic_discard: - ctx->nctx->shader_info->fs.can_discard = true; ac_build_intrinsic(&ctx->ac, "llvm.AMDGPU.kilp", LLVMVoidTypeInContext(ctx->ac.context), NULL, 0, AC_FUNC_ATTR_LEGACY); @@ -6157,6 +6155,8 @@ LLVMModuleRef ac_translate_nir_to_llvm(LLVMTargetMachineRef tm, ctx.shader_info->vs.vgpr_comp_cnt = MAX2(3, ctx.shader_info->vs.vgpr_comp_cnt); } + } else if (nir->stage == MESA_SHADER_FRAGMENT) { + shader_info->fs.can_discard = nir->info.fs.uses_discard; } ac_setup_rings(&ctx); |