diff options
author | Daniel Schürmann <[email protected]> | 2018-02-07 19:40:43 +0100 |
---|---|---|
committer | Bas Nieuwenhuizen <[email protected]> | 2018-07-23 23:16:25 +0200 |
commit | a6a21e651d2cc17ce35394e2ea38b28127da1b84 (patch) | |
tree | 76ac9bf0d4846aec9fdff6c8f9ad123d5ead158e /src/amd/common/ac_llvm_build.c | |
parent | 3109c5257b71391b841ffe8f9e66c017f7ee4dea (diff) |
ac: add support for 16bit UBO loads
Reviewed-by: Bas Nieuwenhuizen <[email protected]>
Diffstat (limited to 'src/amd/common/ac_llvm_build.c')
-rw-r--r-- | src/amd/common/ac_llvm_build.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/amd/common/ac_llvm_build.c b/src/amd/common/ac_llvm_build.c index 4078b005e54..54b7e987015 100644 --- a/src/amd/common/ac_llvm_build.c +++ b/src/amd/common/ac_llvm_build.c @@ -1103,6 +1103,31 @@ LLVMValueRef ac_build_buffer_load_format_gfx9_safe(struct ac_llvm_context *ctx, can_speculate, true); } +LLVMValueRef +ac_build_tbuffer_load_short(struct ac_llvm_context *ctx, + LLVMValueRef rsrc, + LLVMValueRef vindex, + LLVMValueRef voffset, + LLVMValueRef soffset, + LLVMValueRef immoffset) +{ + const char *name = "llvm.amdgcn.tbuffer.load.i32"; + LLVMTypeRef type = ctx->i32; + LLVMValueRef params[] = { + rsrc, + vindex, + voffset, + soffset, + immoffset, + LLVMConstInt(ctx->i32, V_008F0C_BUF_DATA_FORMAT_16, false), + LLVMConstInt(ctx->i32, V_008F0C_BUF_NUM_FORMAT_UINT, false), + ctx->i1false, + ctx->i1false, + }; + LLVMValueRef res = ac_build_intrinsic(ctx, name, type, params, 9, 0); + return LLVMBuildTrunc(ctx->builder, res, ctx->i16, ""); +} + /** * Set range metadata on an instruction. This can only be used on load and * call instructions. If you know an instruction can only produce the values |