summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicolai Hähnle <[email protected]>2017-06-24 18:38:38 +0200
committerNicolai Hähnle <[email protected]>2017-07-31 14:55:40 +0200
commit4ba201ee361a07a084665e022efd6b0d6df2ffd6 (patch)
tree42281aa942aa610e1e5d2360f98d67bfb5ea4173
parent41d4016e061eea2a4be4f9c64930b818b9572f00 (diff)
ac/nir: extract shader_info->fs.can_discard from NIR shader info
Reviewed-by: Marek Olšák <[email protected]>
-rw-r--r--src/amd/common/ac_nir_to_llvm.c4
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 3125ade3b3f..ecddb5e9b9b 100644
--- a/src/amd/common/ac_nir_to_llvm.c
+++ b/src/amd/common/ac_nir_to_llvm.c
@@ -3627,7 +3627,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]),
@@ -4086,7 +4085,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);
@@ -6234,6 +6232,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);