nir: add missed nir_cmp_imm-helpers

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>
This commit is contained in:
Erik Faye-Lund
2023-06-06 13:56:18 +02:00
committed by Marge Bot
parent 3a64e3425f
commit a593de7cf3
3 changed files with 4 additions and 5 deletions

View 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)) { if (gfx_level >= GFX10_3 && (has_depth || is_array)) {
nir_ssa_def *type = get_field(b, desc, 3, ~C_00A00C_TYPE); 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) if (has_depth)
depth = nir_bcsel(b, is_2d, nir_imm_int(b, 0), depth); depth = nir_bcsel(b, is_2d, nir_imm_int(b, 0), depth);

View 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); return nir_imm_true(b);
default: default:
return nir_ieq(b, hit->leaf_type, return nir_ieq_imm(b, hit->leaf_type,
nir_imm_int(b, BRW_RT_BVH_NODE_TYPE_PROCEDURAL)); BRW_RT_BVH_NODE_TYPE_PROCEDURAL);
} }
} }

View 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 *local_invocation_index = nir_build_load_local_invocation_index(b);
nir_ssa_def *cmp = nir_ieq(b, local_invocation_index, nir_ssa_def *cmp = nir_ieq_imm(b, local_invocation_index, 0);
nir_imm_int(b, 0));
nir_if *if_stmt = nir_push_if(b, cmp); nir_if *if_stmt = nir_push_if(b, cmp);
{ {
nir_deref_instr *prim_count_deref = nir_build_deref_var(b, primitive_count); nir_deref_instr *prim_count_deref = nir_build_deref_var(b, primitive_count);