mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 22:38:05 +02:00
ac/llvm: use amdgpu-color-export/amdgpu-depth-export
These are necessary to use the correct export target on GFX11: https://reviews.llvm.org/D128185 Fixes artifacts on Lara in Rise of the Tomb Raider benchmark and hair in The Witcher 3 (classic). Signed-off-by: Rhys Perry <pendingchaos02@gmail.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20357>
This commit is contained in:
parent
d496f0b97d
commit
1174ab6d56
1 changed files with 15 additions and 0 deletions
|
|
@ -2028,6 +2028,15 @@ void ac_build_export(struct ac_llvm_context *ctx, struct ac_export_args *a)
|
||||||
|
|
||||||
ac_build_intrinsic(ctx, "llvm.amdgcn.exp.f32", ctx->voidt, args, 8, 0);
|
ac_build_intrinsic(ctx, "llvm.amdgcn.exp.f32", ctx->voidt, args, 8, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (LLVM_VERSION_MAJOR >= 15 && a->target == V_008DFC_SQ_EXP_MRTZ) {
|
||||||
|
LLVMAddTargetDependentFunctionAttr(ctx->main_function.value, "amdgpu-depth-export", "1");
|
||||||
|
} else if (LLVM_VERSION_MAJOR >= 15 && a->target <= V_008DFC_SQ_EXP_NULL) {
|
||||||
|
/* We need this attribute even for NULL targets, so that an export is created for full-wave
|
||||||
|
* discards on GFX10+.
|
||||||
|
*/
|
||||||
|
LLVMAddTargetDependentFunctionAttr(ctx->main_function.value, "amdgpu-color-export", "1");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ac_build_export_null(struct ac_llvm_context *ctx, bool uses_discard)
|
void ac_build_export_null(struct ac_llvm_context *ctx, bool uses_discard)
|
||||||
|
|
@ -4619,6 +4628,12 @@ struct ac_llvm_pointer ac_build_main(const struct ac_shader_args *args, struct a
|
||||||
/* Disable denormals for FP32: */
|
/* Disable denormals for FP32: */
|
||||||
LLVMAddTargetDependentFunctionAttr(main_function, "denormal-fp-math-f32",
|
LLVMAddTargetDependentFunctionAttr(main_function, "denormal-fp-math-f32",
|
||||||
"preserve-sign,preserve-sign");
|
"preserve-sign,preserve-sign");
|
||||||
|
|
||||||
|
if (LLVM_VERSION_MAJOR >= 15 && convention == AC_LLVM_AMDGPU_PS) {
|
||||||
|
LLVMAddTargetDependentFunctionAttr(main_function, "amdgpu-depth-export", "0");
|
||||||
|
LLVMAddTargetDependentFunctionAttr(main_function, "amdgpu-color-export", "0");
|
||||||
|
}
|
||||||
|
|
||||||
return ctx->main_function;
|
return ctx->main_function;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue