nir: add missed nir_cmp_imm-helpers
authorErik Faye-Lund <erik.faye-lund@collabora.com>
Tue, 6 Jun 2023 11:56:18 +0000 (13:56 +0200)
committerMarge Bot <emma+marge@anholt.net>
Thu, 15 Jun 2023 13:34:49 +0000 (13:34 +0000)
Seems I missed these in my previous round, let's fix them up now!

Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23461>

src/amd/common/ac_nir_lower_resinfo.c
src/intel/compiler/brw_nir_lower_rt_intrinsics.c
src/intel/vulkan/anv_pipeline.c

index 2ee014d..42925b9 100644 (file)
@@ -116,7 +116,7 @@ lower_query_size(nir_builder *b, nir_ssa_def *desc, nir_src *lod,
     */
    if (gfx_level >= GFX10_3 && (has_depth || is_array)) {
       nir_ssa_def *type = get_field(b, desc, 3, ~C_00A00C_TYPE);
-      nir_ssa_def *is_2d = nir_ieq(b, type, nir_imm_int(b, V_008F1C_SQ_RSRC_IMG_2D));
+      nir_ssa_def *is_2d = nir_ieq_imm(b, type, V_008F1C_SQ_RSRC_IMG_2D);
 
       if (has_depth)
          depth = nir_bcsel(b, is_2d, nir_imm_int(b, 0), depth);
index 9235033..aad14cf 100644 (file)
@@ -39,8 +39,8 @@ build_leaf_is_procedural(nir_builder *b, struct brw_nir_rt_mem_hit_defs *hit)
       return nir_imm_true(b);
 
    default:
-      return nir_ieq(b, hit->leaf_type,
-                        nir_imm_int(b, BRW_RT_BVH_NODE_TYPE_PROCEDURAL));
+      return nir_ieq_imm(b, hit->leaf_type,
+                            BRW_RT_BVH_NODE_TYPE_PROCEDURAL);
    }
 }
 
index 575ee28..75c510e 100644 (file)
@@ -64,8 +64,7 @@ anv_nir_prim_count_store(nir_builder *b, nir_ssa_def *val)
 
    nir_ssa_def *local_invocation_index = nir_build_load_local_invocation_index(b);
 
-   nir_ssa_def *cmp = nir_ieq(b, local_invocation_index,
-                                  nir_imm_int(b, 0));
+   nir_ssa_def *cmp = nir_ieq_imm(b, local_invocation_index, 0);
    nir_if *if_stmt = nir_push_if(b, cmp);
    {
       nir_deref_instr *prim_count_deref = nir_build_deref_var(b, primitive_count);