diff options
author | Samuel Pitoiset <[email protected]> | 2019-03-13 15:55:42 +0100 |
---|---|---|
committer | Samuel Pitoiset <[email protected]> | 2019-03-21 09:02:14 +0100 |
commit | 104dbc64a5f7985d1b0d47db969ed3bb7b9e7b8d (patch) | |
tree | 1af19efbc7bc91749f949e493eab2cb641e8c527 | |
parent | 6e632eb24bbbf4142b092dd24d7b567bd974f2d2 (diff) |
ac: add ac_build_tbuffer_load_byte() helper
Signed-off-by: Samuel Pitoiset <[email protected]>
Reviewed-by: Bas Nieuwenhuizen <[email protected]>
-rw-r--r-- | src/amd/common/ac_llvm_build.c | 18 | ||||
-rw-r--r-- | src/amd/common/ac_llvm_build.h | 8 |
2 files changed, 26 insertions, 0 deletions
diff --git a/src/amd/common/ac_llvm_build.c b/src/amd/common/ac_llvm_build.c index 195fdcb224d..58e4ffaa2ed 100644 --- a/src/amd/common/ac_llvm_build.c +++ b/src/amd/common/ac_llvm_build.c @@ -1606,6 +1606,24 @@ ac_build_tbuffer_load_short(struct ac_llvm_context *ctx, return LLVMBuildTrunc(ctx->builder, res, ctx->i16, ""); } +LLVMValueRef +ac_build_tbuffer_load_byte(struct ac_llvm_context *ctx, + LLVMValueRef rsrc, + LLVMValueRef voffset, + LLVMValueRef soffset, + LLVMValueRef immoffset, + bool glc) +{ + unsigned dfmt = V_008F0C_BUF_DATA_FORMAT_8; + unsigned nfmt = V_008F0C_BUF_NUM_FORMAT_UINT; + LLVMValueRef res; + + res = ac_build_raw_tbuffer_load(ctx, rsrc, voffset, soffset, + immoffset, 1, dfmt, nfmt, glc, false, + false); + + return LLVMBuildTrunc(ctx->builder, res, ctx->i8, ""); +} static void ac_build_llvm8_tbuffer_store(struct ac_llvm_context *ctx, LLVMValueRef rsrc, diff --git a/src/amd/common/ac_llvm_build.h b/src/amd/common/ac_llvm_build.h index f6bf473f6a1..0162986e454 100644 --- a/src/amd/common/ac_llvm_build.h +++ b/src/amd/common/ac_llvm_build.h @@ -319,6 +319,14 @@ ac_build_tbuffer_load_short(struct ac_llvm_context *ctx, bool glc); LLVMValueRef +ac_build_tbuffer_load_byte(struct ac_llvm_context *ctx, + LLVMValueRef rsrc, + LLVMValueRef voffset, + LLVMValueRef soffset, + LLVMValueRef immoffset, + bool glc); + +LLVMValueRef ac_build_struct_tbuffer_load(struct ac_llvm_context *ctx, LLVMValueRef rsrc, LLVMValueRef vindex, |