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

Author: Samuel Pitoiset <[email protected]>
Date:   Wed Aug 23 16:48:49 2023 +0200

radv: use info->uses_view_index directly when declaring shader arguments

No need for a separate variable.

Signed-off-by: Samuel Pitoiset <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24697>

---

 src/amd/vulkan/radv_shader_args.c | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/src/amd/vulkan/radv_shader_args.c 
b/src/amd/vulkan/radv_shader_args.c
index 8bce2050d0f..841e1f9bd34 100644
--- a/src/amd/vulkan/radv_shader_args.c
+++ b/src/amd/vulkan/radv_shader_args.c
@@ -389,7 +389,6 @@ declare_shader_args(const struct radv_device *device, const 
struct radv_pipeline
                     struct radv_shader_args *args, struct user_sgpr_info 
*user_sgpr_info)
 {
    const enum amd_gfx_level gfx_level = 
device->physical_device->rad_info.gfx_level;
-   bool needs_view_index = info->uses_view_index;
    bool has_shader_query = info->has_prim_query || info->has_xfb_query ||
                            (stage == MESA_SHADER_GEOMETRY && 
info->gs.has_pipeline_stat_query);
    bool has_ngg_provoking_vtx =
@@ -478,7 +477,7 @@ declare_shader_args(const struct radv_device *device, const 
struct radv_pipeline
 
       declare_global_input_sgprs(info, user_sgpr_info, args);
 
-      if (needs_view_index) {
+      if (info->uses_view_index) {
          add_ud_arg(args, 1, AC_ARG_INT, &args->ac.view_index, 
AC_UD_VIEW_INDEX);
       }
 
@@ -520,7 +519,7 @@ declare_shader_args(const struct radv_device *device, const 
struct radv_pipeline
 
          declare_global_input_sgprs(info, user_sgpr_info, args);
 
-         if (needs_view_index) {
+         if (info->uses_view_index) {
             add_ud_arg(args, 1, AC_ARG_INT, &args->ac.view_index, 
AC_UD_VIEW_INDEX);
          }
 
@@ -539,7 +538,7 @@ declare_shader_args(const struct radv_device *device, const 
struct radv_pipeline
       } else {
          declare_global_input_sgprs(info, user_sgpr_info, args);
 
-         if (needs_view_index) {
+         if (info->uses_view_index) {
             add_ud_arg(args, 1, AC_ARG_INT, &args->ac.view_index, 
AC_UD_VIEW_INDEX);
          }
 
@@ -566,7 +565,7 @@ declare_shader_args(const struct radv_device *device, const 
struct radv_pipeline
 
       declare_global_input_sgprs(info, user_sgpr_info, args);
 
-      if (needs_view_index)
+      if (info->uses_view_index)
          add_ud_arg(args, 1, AC_ARG_INT, &args->ac.view_index, 
AC_UD_VIEW_INDEX);
 
       if (radv_tes_needs_state_sgpr(info))
@@ -614,7 +613,7 @@ declare_shader_args(const struct radv_device *device, const 
struct radv_pipeline
 
          declare_global_input_sgprs(info, user_sgpr_info, args);
 
-         if (needs_view_index) {
+         if (info->uses_view_index) {
             add_ud_arg(args, 1, AC_ARG_INT, &args->ac.view_index, 
AC_UD_VIEW_INDEX);
          }
 
@@ -652,7 +651,7 @@ declare_shader_args(const struct radv_device *device, const 
struct radv_pipeline
       } else {
          declare_global_input_sgprs(info, user_sgpr_info, args);
 
-         if (needs_view_index) {
+         if (info->uses_view_index) {
             add_ud_arg(args, 1, AC_ARG_INT, &args->ac.view_index, 
AC_UD_VIEW_INDEX);
          }
 

Reply via email to