mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-07 08:40:11 +01:00
ac/llvm: add support for device clock on GFX11
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19267>
This commit is contained in:
parent
1c005e72f4
commit
3a3df9acda
1 changed files with 7 additions and 0 deletions
|
|
@ -473,6 +473,13 @@ void ac_build_optimization_barrier(struct ac_llvm_context *ctx, LLVMValueRef *pg
|
|||
|
||||
LLVMValueRef ac_build_shader_clock(struct ac_llvm_context *ctx, nir_scope scope)
|
||||
{
|
||||
if (ctx->gfx_level >= GFX11 && scope == NIR_SCOPE_DEVICE) {
|
||||
const char *name = "llvm.amdgcn.s.sendmsg.rtn.i64";
|
||||
LLVMValueRef arg = LLVMConstInt(ctx->i32, 0x83 /* realtime */, 0);
|
||||
LLVMValueRef tmp = ac_build_intrinsic(ctx, name, ctx->i64, &arg, 1, 0);
|
||||
return LLVMBuildBitCast(ctx->builder, tmp, ctx->v2i32, "");
|
||||
}
|
||||
|
||||
const char *subgroup = "llvm.readcyclecounter";
|
||||
const char *name = scope == NIR_SCOPE_DEVICE ? "llvm.amdgcn.s.memrealtime" : subgroup;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue