Module: Mesa
Branch: main
Commit: 8abb612cba57bf6f5620cbe586615b7187b142bc
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=8abb612cba57bf6f5620cbe586615b7187b142bc

Author: Marek Olšák <[email protected]>
Date:   Fri Apr 15 00:11:10 2022 -0400

ac/llvm: remove immoffset parameter from ac_build_tbuffer_load

Reviewed-by: Mihai Preda <[email protected]>
Reviewed-by: Pierre-Eric Pelloux-Prayer <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15966>

---

 src/amd/llvm/ac_llvm_build.c      | 17 +++++++----------
 src/amd/llvm/ac_llvm_build.h      |  6 +++---
 src/amd/vulkan/radv_nir_to_llvm.c |  4 ++--
 3 files changed, 12 insertions(+), 15 deletions(-)

diff --git a/src/amd/llvm/ac_llvm_build.c b/src/amd/llvm/ac_llvm_build.c
index 68b81d3adf4..eb91f6620a4 100644
--- a/src/amd/llvm/ac_llvm_build.c
+++ b/src/amd/llvm/ac_llvm_build.c
@@ -1323,13 +1323,10 @@ LLVMValueRef ac_build_buffer_load_format(struct 
ac_llvm_context *ctx, LLVMValueR
 
 static LLVMValueRef ac_build_tbuffer_load(struct ac_llvm_context *ctx, 
LLVMValueRef rsrc,
                                           LLVMValueRef vindex, LLVMValueRef 
voffset,
-                                          LLVMValueRef soffset, LLVMValueRef 
immoffset,
-                                          unsigned num_channels, unsigned 
dfmt, unsigned nfmt,
-                                          unsigned cache_policy, bool 
can_speculate,
-                                          bool structurized)
+                                          LLVMValueRef soffset, unsigned 
num_channels,
+                                          unsigned dfmt, unsigned nfmt, 
unsigned cache_policy,
+                                          bool can_speculate, bool 
structurized)
 {
-   voffset = LLVMBuildAdd(ctx->builder, voffset, immoffset, "");
-
    LLVMValueRef args[6];
    int idx = 0;
    args[idx++] = LLVMBuildBitCast(ctx->builder, rsrc, ctx->v4i32, "");
@@ -1354,11 +1351,11 @@ static LLVMValueRef ac_build_tbuffer_load(struct 
ac_llvm_context *ctx, LLVMValue
 
 LLVMValueRef ac_build_struct_tbuffer_load(struct ac_llvm_context *ctx, 
LLVMValueRef rsrc,
                                           LLVMValueRef vindex, LLVMValueRef 
voffset,
-                                          LLVMValueRef soffset, LLVMValueRef 
immoffset,
-                                          unsigned num_channels, unsigned 
dfmt, unsigned nfmt,
-                                          unsigned cache_policy, bool 
can_speculate)
+                                          LLVMValueRef soffset, unsigned 
num_channels,
+                                          unsigned dfmt, unsigned nfmt, 
unsigned cache_policy,
+                                          bool can_speculate)
 {
-   return ac_build_tbuffer_load(ctx, rsrc, vindex, voffset, soffset, 
immoffset, num_channels, dfmt,
+   return ac_build_tbuffer_load(ctx, rsrc, vindex, voffset, soffset, 
num_channels, dfmt,
                                 nfmt, cache_policy, can_speculate, true);
 }
 
diff --git a/src/amd/llvm/ac_llvm_build.h b/src/amd/llvm/ac_llvm_build.h
index 51c70469427..89ebf23edb8 100644
--- a/src/amd/llvm/ac_llvm_build.h
+++ b/src/amd/llvm/ac_llvm_build.h
@@ -281,9 +281,9 @@ LLVMValueRef ac_build_tbuffer_load_byte(struct 
ac_llvm_context *ctx, LLVMValueRe
 
 LLVMValueRef ac_build_struct_tbuffer_load(struct ac_llvm_context *ctx, 
LLVMValueRef rsrc,
                                           LLVMValueRef vindex, LLVMValueRef 
voffset,
-                                          LLVMValueRef soffset, LLVMValueRef 
immoffset,
-                                          unsigned num_channels, unsigned 
dfmt, unsigned nfmt,
-                                          unsigned cache_policy, bool 
can_speculate);
+                                          LLVMValueRef soffset, unsigned 
num_channels,
+                                          unsigned dfmt, unsigned nfmt, 
unsigned cache_policy,
+                                          bool can_speculate);
 
 LLVMValueRef ac_build_raw_tbuffer_load(struct ac_llvm_context *ctx, 
LLVMValueRef rsrc,
                                        LLVMValueRef voffset, LLVMValueRef 
soffset,
diff --git a/src/amd/vulkan/radv_nir_to_llvm.c 
b/src/amd/vulkan/radv_nir_to_llvm.c
index 49b10ff910e..75de585cee2 100644
--- a/src/amd/vulkan/radv_nir_to_llvm.c
+++ b/src/amd/vulkan/radv_nir_to_llvm.c
@@ -515,7 +515,7 @@ load_vs_input(struct radv_shader_context *ctx, unsigned 
driver_location, LLVMTyp
 
          values[chan] = ac_build_struct_tbuffer_load(
             &ctx->ac, t_list, chan_index, LLVMConstInt(ctx->ac.i32, 
chan_offset, false),
-            ctx->ac.i32_0, ctx->ac.i32_0, 1, chan_format, num_format, 0, true);
+            ctx->ac.i32_0, 1, chan_format, num_format, 0, true);
       }
 
       input = ac_build_gather_values(&ctx->ac, values, num_channels);
@@ -531,7 +531,7 @@ load_vs_input(struct radv_shader_context *ctx, unsigned 
driver_location, LLVMTyp
 
       input = ac_build_struct_tbuffer_load(
          &ctx->ac, t_list, buffer_index, LLVMConstInt(ctx->ac.i32, 
attrib_offset, false),
-         ctx->ac.i32_0, ctx->ac.i32_0, num_channels, data_format, num_format, 
0, true);
+         ctx->ac.i32_0, num_channels, data_format, num_format, 0, true);
    }
 
    input = radv_fixup_vertex_input_fetches(ctx, input, num_channels, is_float);

Reply via email to