mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-23 22:00:13 +01:00
radeonsi: use new function ac_build_umin for edgeflag clamping
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
This commit is contained in:
parent
0f9e32519b
commit
a69afb68c9
3 changed files with 9 additions and 1 deletions
|
|
@ -908,6 +908,13 @@ ac_build_umsb(struct ac_llvm_context *ctx,
|
||||||
LLVMConstInt(ctx->i32, -1, true), msb, "");
|
LLVMConstInt(ctx->i32, -1, true), msb, "");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
LLVMValueRef ac_build_umin(struct ac_llvm_context *ctx, LLVMValueRef a,
|
||||||
|
LLVMValueRef b)
|
||||||
|
{
|
||||||
|
LLVMValueRef cmp = LLVMBuildICmp(ctx->builder, LLVMIntULE, a, b, "");
|
||||||
|
return LLVMBuildSelect(ctx->builder, cmp, a, b, "");
|
||||||
|
}
|
||||||
|
|
||||||
LLVMValueRef ac_build_clamp(struct ac_llvm_context *ctx, LLVMValueRef value)
|
LLVMValueRef ac_build_clamp(struct ac_llvm_context *ctx, LLVMValueRef value)
|
||||||
{
|
{
|
||||||
if (HAVE_LLVM >= 0x0500) {
|
if (HAVE_LLVM >= 0x0500) {
|
||||||
|
|
|
||||||
|
|
@ -197,6 +197,7 @@ LLVMValueRef ac_build_umsb(struct ac_llvm_context *ctx,
|
||||||
LLVMValueRef arg,
|
LLVMValueRef arg,
|
||||||
LLVMTypeRef dst_type);
|
LLVMTypeRef dst_type);
|
||||||
|
|
||||||
|
LLVMValueRef ac_build_umin(struct ac_llvm_context *ctx, LLVMValueRef a, LLVMValueRef b);
|
||||||
LLVMValueRef ac_build_clamp(struct ac_llvm_context *ctx, LLVMValueRef value);
|
LLVMValueRef ac_build_clamp(struct ac_llvm_context *ctx, LLVMValueRef value);
|
||||||
|
|
||||||
struct ac_export_args {
|
struct ac_export_args {
|
||||||
|
|
|
||||||
|
|
@ -2502,7 +2502,7 @@ static void si_llvm_export_vs(struct lp_build_tgsi_context *bld_base,
|
||||||
edgeflag_value = LLVMBuildFPToUI(ctx->gallivm.builder,
|
edgeflag_value = LLVMBuildFPToUI(ctx->gallivm.builder,
|
||||||
edgeflag_value,
|
edgeflag_value,
|
||||||
ctx->i32, "");
|
ctx->i32, "");
|
||||||
edgeflag_value = lp_build_min(&bld_base->int_bld,
|
edgeflag_value = ac_build_umin(&ctx->ac,
|
||||||
edgeflag_value,
|
edgeflag_value,
|
||||||
ctx->i32_1);
|
ctx->i32_1);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue