ac/llvm: accept primitives whose face culling determinant is Inf or NaN

Based on https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13299/diffs

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13380>
This commit is contained in:
Marek Olšák 2021-10-15 05:25:39 -04:00 committed by Marge Bot
parent efaab0ec50
commit 5ee2965283

View file

@ -109,6 +109,14 @@ static LLVMValueRef ac_cull_face(struct ac_llvm_context *ctx, LLVMValueRef pos[3
} else if (cull_zero_area) {
accepted = LLVMBuildFCmp(builder, LLVMRealONE, det, ctx->f32_0, "");
}
if (accepted) {
/* Don't reject NaN and +/-infinity, these are tricky.
* Just trust fixed-function HW to handle these cases correctly.
*/
accepted = LLVMBuildOr(builder, accepted, ac_build_is_inf_or_nan(ctx, det), "");
}
return accepted;
}