From: Samuel Pitoiset Date: Wed, 13 Mar 2019 13:04:14 +0000 (+0100) Subject: ac: use the raw tbuffer version for 16-bit SSBO loads X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=cbf022cb316f1224f9afcc12ca414fc2d7d778a8;p=mesa.git ac: use the raw tbuffer version for 16-bit SSBO loads vindex is always 0. Signed-off-by: Samuel Pitoiset Reviewed-by: Bas Nieuwenhuizen --- diff --git a/src/amd/common/ac_llvm_build.c b/src/amd/common/ac_llvm_build.c index 2d873d79102..0cab4d4a9b5 100644 --- a/src/amd/common/ac_llvm_build.c +++ b/src/amd/common/ac_llvm_build.c @@ -1494,7 +1494,6 @@ ac_build_raw_tbuffer_load(struct ac_llvm_context *ctx, LLVMValueRef ac_build_tbuffer_load_short(struct ac_llvm_context *ctx, LLVMValueRef rsrc, - LLVMValueRef vindex, LLVMValueRef voffset, LLVMValueRef soffset, LLVMValueRef immoffset, @@ -1504,8 +1503,9 @@ ac_build_tbuffer_load_short(struct ac_llvm_context *ctx, unsigned nfmt = V_008F0C_BUF_NUM_FORMAT_UINT; LLVMValueRef res; - res = ac_build_tbuffer_load(ctx, rsrc, vindex, voffset, soffset, - immoffset, 1, dfmt, nfmt, glc, false, false, true); + res = ac_build_raw_tbuffer_load(ctx, rsrc, voffset, soffset, + immoffset, 1, dfmt, nfmt, glc, false, + false); return LLVMBuildTrunc(ctx->builder, res, ctx->i16, ""); } diff --git a/src/amd/common/ac_llvm_build.h b/src/amd/common/ac_llvm_build.h index c6475320990..55068169a34 100644 --- a/src/amd/common/ac_llvm_build.h +++ b/src/amd/common/ac_llvm_build.h @@ -300,7 +300,6 @@ LLVMValueRef ac_build_buffer_load_format_gfx9_safe(struct ac_llvm_context *ctx, LLVMValueRef ac_build_tbuffer_load_short(struct ac_llvm_context *ctx, LLVMValueRef rsrc, - LLVMValueRef vindex, LLVMValueRef voffset, LLVMValueRef soffset, LLVMValueRef immoffset, diff --git a/src/amd/common/ac_nir_to_llvm.c b/src/amd/common/ac_nir_to_llvm.c index a7b3fdf64aa..18297ed99b1 100644 --- a/src/amd/common/ac_nir_to_llvm.c +++ b/src/amd/common/ac_nir_to_llvm.c @@ -1712,7 +1712,6 @@ static LLVMValueRef visit_load_buffer(struct ac_nir_context *ctx, if (load_bytes == 2) { ret = ac_build_tbuffer_load_short(&ctx->ac, rsrc, - vindex, offset, ctx->ac.i32_0, immoffset, @@ -1783,7 +1782,6 @@ static LLVMValueRef visit_load_ubo_buffer(struct ac_nir_context *ctx, for (unsigned i = 0; i < num_components; ++i) { results[i] = ac_build_tbuffer_load_short(&ctx->ac, rsrc, - ctx->ac.i32_0, offset, ctx->ac.i32_0, LLVMConstInt(ctx->ac.i32, 2 * i, 0),