mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-23 19:50:11 +01:00
amd/common: use llvm.amdgcn.s.buffer.load for LLVM 8.0
llvm.SI.load.const is deprecated. Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
This commit is contained in:
parent
1c1ae6376c
commit
e4803ab7d2
1 changed files with 8 additions and 4 deletions
|
|
@ -1241,11 +1241,15 @@ ac_build_buffer_load(struct ac_llvm_context *ctx,
|
||||||
offset = LLVMBuildAdd(ctx->builder, offset,
|
offset = LLVMBuildAdd(ctx->builder, offset,
|
||||||
LLVMConstInt(ctx->i32, 4, 0), "");
|
LLVMConstInt(ctx->i32, 4, 0), "");
|
||||||
}
|
}
|
||||||
LLVMValueRef args[2] = {rsrc, offset};
|
const char *intrname =
|
||||||
result[i] = ac_build_intrinsic(ctx, "llvm.SI.load.const.v4i32",
|
HAVE_LLVM >= 0x0800 ? "llvm.amdgcn.s.buffer.load.f32"
|
||||||
ctx->f32, args, 2,
|
: "llvm.SI.load.const";
|
||||||
|
unsigned num_args = HAVE_LLVM >= 0x0800 ? 3 : 2;
|
||||||
|
LLVMValueRef args[3] = {rsrc, offset, ctx->i32_0};
|
||||||
|
result[i] = ac_build_intrinsic(ctx, intrname,
|
||||||
|
ctx->f32, args, num_args,
|
||||||
AC_FUNC_ATTR_READNONE |
|
AC_FUNC_ATTR_READNONE |
|
||||||
AC_FUNC_ATTR_LEGACY);
|
(HAVE_LLVM < 0x0800 ? AC_FUNC_ATTR_LEGACY : 0));
|
||||||
}
|
}
|
||||||
if (num_channels == 1)
|
if (num_channels == 1)
|
||||||
return result[0];
|
return result[0];
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue