ac/llvm: remove inst_offset parameter from ac_build_buffer_load

Reviewed-by: Mihai Preda <mhpreda@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15966>
This commit is contained in:
Marek Olšák
2022-04-15 01:25:32 -04:00
committed by Marge Bot
parent e3421ae8ff
commit c888e77dfc
7 changed files with 19 additions and 21 deletions

View File

@@ -1233,19 +1233,16 @@ static LLVMValueRef ac_build_buffer_load_common(struct ac_llvm_context *ctx, LLV
LLVMValueRef ac_build_buffer_load(struct ac_llvm_context *ctx, LLVMValueRef rsrc, int num_channels,
LLVMValueRef vindex, LLVMValueRef voffset, LLVMValueRef soffset,
unsigned inst_offset, LLVMTypeRef channel_type,
unsigned cache_policy, bool can_speculate, bool allow_smem)
LLVMTypeRef channel_type, unsigned cache_policy,
bool can_speculate, bool allow_smem)
{
LLVMValueRef offset = LLVMConstInt(ctx->i32, inst_offset, 0);
if (voffset)
offset = LLVMBuildAdd(ctx->builder, offset, voffset, "");
if (allow_smem && !(cache_policy & ac_slc) &&
(!(cache_policy & ac_glc) || ctx->chip_class >= GFX8)) {
assert(vindex == NULL);
LLVMValueRef result[8];
LLVMValueRef offset = voffset ? voffset : ctx->i32_0;
if (soffset)
offset = LLVMBuildAdd(ctx->builder, offset, soffset, "");
@@ -1269,7 +1266,7 @@ LLVMValueRef ac_build_buffer_load(struct ac_llvm_context *ctx, LLVMValueRef rsrc
return ac_build_gather_values(ctx, result, num_channels);
}
return ac_build_buffer_load_common(ctx, rsrc, vindex, offset, soffset, num_channels,
return ac_build_buffer_load_common(ctx, rsrc, vindex, voffset, soffset, num_channels,
channel_type, cache_policy, can_speculate, false, false);
}