ac: use the raw tbuffer version for 16-bit SSBO loads

vindex is always 0.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
This commit is contained in:
Samuel Pitoiset 2019-03-13 14:04:14 +01:00
parent 045fae0f73
commit cbf022cb31
3 changed files with 3 additions and 6 deletions

View File

@ -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, "");
}

View File

@ -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,

View File

@ -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),