hasvk: use imm-helpers
authorErik Faye-Lund <erik.faye-lund@collabora.com>
Fri, 16 Jun 2023 13:48:48 +0000 (15:48 +0200)
committerMarge Bot <emma+marge@anholt.net>
Thu, 29 Jun 2023 07:08:19 +0000 (07:08 +0000)
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23855>

src/intel/vulkan_hasvk/anv_nir_lower_multiview.c

index 576439d..6c9a545 100644 (file)
@@ -109,7 +109,7 @@ build_view_index(struct lower_multiview_state *state)
                remap |= (uint64_t)bit << (i++ * 4);
             }
 
-            nir_ssa_def *shift = nir_imul(b, compacted, nir_imm_int(b, 4));
+            nir_ssa_def *shift = nir_imul_imm(b, compacted, 4);
 
             /* One of these days, when we have int64 everywhere, this will be
              * easier.
@@ -122,11 +122,11 @@ build_view_index(struct lower_multiview_state *state)
                   nir_ushr(b, nir_imm_int(b, remap), shift);
                nir_ssa_def *shifted_high =
                   nir_ushr(b, nir_imm_int(b, remap >> 32),
-                              nir_isub(b, shift, nir_imm_int(b, 32)));
+                              nir_iadd_imm(b, shift, -32));
                shifted = nir_bcsel(b, nir_ilt_imm(b, shift, 32),
                                       shifted_low, shifted_high);
             }
-            state->view_index = nir_iand(b, shifted, nir_imm_int(b, 0xf));
+            state->view_index = nir_iand_imm(b, shifted, 0xf);
          }
       } else {
          const struct glsl_type *type = glsl_int_type();