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]),
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);
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);