ac: use the raw tbuffer version for 16-bit SSBO loads
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Wed, 13 Mar 2019 13:04:14 +0000 (14:04 +0100)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Wed, 13 Mar 2019 13:16:14 +0000 (14:16 +0100)
vindex is always 0.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
src/amd/common/ac_llvm_build.c
src/amd/common/ac_llvm_build.h
src/amd/common/ac_nir_to_llvm.c

index 2d873d7910248643fb395035d311fef782164c54..0cab4d4a9b59d57cc10e1ef4a97fb36ed0323669 100644 (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, "");
 }
index c6475320990b04f4f9909791c24c05186f048c64..55068169a34f274cc8d14350e97a78c22532cfdc 100644 (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,
index a7b3fdf64aa6ef53e37b80fae52fd8b9badd34fa..18297ed99b16c6990d50bcfeae034d0fbd198b8d 100644 (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),