radv: fixes -Werror,-Wunused-but-set-variable for clang-15 in radv_shader_args.c
authorYonggang Luo <luoyonggang@gmail.com>
Fri, 4 Nov 2022 13:40:31 +0000 (21:40 +0800)
committerMarge Bot <emma+marge@anholt.net>
Thu, 17 Nov 2022 23:17:40 +0000 (23:17 +0000)
error message:
../../src/amd/vulkan/radv_shader_args.c:457:16: error: variable 'arg_count' set but not used [-Werror,-Wunused-but-set-variable]
      unsigned arg_count = 0;
               ^

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19527>

src/amd/vulkan/radv_shader_args.c

index 8d91a0a..d6dd453 100644 (file)
@@ -456,10 +456,8 @@ declare_ps_input_vgprs(const struct radv_shader_info *info, struct radv_shader_a
        * communicates the results back via the ELF binary. Mirror what LLVM does by re-mapping the
        * VGPR arguments here.
        */
-      unsigned arg_count = 0;
       for (unsigned i = 0, vgpr_arg = 0, vgpr_reg = 0; i < args->ac.arg_count; i++) {
          if (args->ac.args[i].file != AC_ARG_VGPR) {
-            arg_count++;
             continue;
          }
 
@@ -468,7 +466,6 @@ declare_ps_input_vgprs(const struct radv_shader_info *info, struct radv_shader_a
          } else {
             args->ac.args[i].offset = vgpr_reg;
             vgpr_reg += args->ac.args[i].size;
-            arg_count++;
          }
          vgpr_arg++;
       }