mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-21 20:10:14 +01:00
nir: Use nir_test_mask instead of i2b(iand)
Signed-off-by: Konstantin Seurer <konstantin.seurer@gmail.com> Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17242>
This commit is contained in:
parent
e83bd87ee9
commit
4676b3d3dd
3 changed files with 5 additions and 7 deletions
|
|
@ -742,7 +742,7 @@ lower_subgroups_instr(nir_builder *b, nir_instr *instr, void *_options)
|
||||||
nir_udiv_imm(b, idx, int_val->bit_size));
|
nir_udiv_imm(b, idx, int_val->bit_size));
|
||||||
}
|
}
|
||||||
|
|
||||||
return nir_i2b(b, nir_iand_imm(b, nir_ushr(b, int_val, idx), 1));
|
return nir_test_mask(b, nir_ushr(b, int_val, idx), 1);
|
||||||
}
|
}
|
||||||
case nir_intrinsic_ballot_bit_count_reduce:
|
case nir_intrinsic_ballot_bit_count_reduce:
|
||||||
return vec_bit_count(b, int_val);
|
return vec_bit_count(b, int_val);
|
||||||
|
|
|
||||||
|
|
@ -123,8 +123,7 @@ nir_lower_texcoord_replace_impl(nir_function_impl *impl,
|
||||||
nir_ishl(&b, nir_imm_int(&b, 1),
|
nir_ishl(&b, nir_imm_int(&b, 1),
|
||||||
nir_iadd_imm(&b, index, base));
|
nir_iadd_imm(&b, index, base));
|
||||||
|
|
||||||
nir_ssa_def *cond =
|
nir_ssa_def *cond = nir_test_mask(&b, mask, coord_replace);
|
||||||
nir_i2b(&b, nir_iand_imm(&b, mask, coord_replace));
|
|
||||||
nir_ssa_def *result = nir_bcsel(&b, cond, new_coord,
|
nir_ssa_def *result = nir_bcsel(&b, cond, new_coord,
|
||||||
&intrin->dest.ssa);
|
&intrin->dest.ssa);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -142,8 +142,7 @@ nir_lower_ubo_vec4_lower(nir_builder *b, nir_instr *instr, void *data)
|
||||||
BITSET_MASK(intr->num_components) << (align_chan_offset);
|
BITSET_MASK(intr->num_components) << (align_chan_offset);
|
||||||
nir_component_mask_t high_channels =
|
nir_component_mask_t high_channels =
|
||||||
low_channels << (8 / chan_size_bytes);
|
low_channels << (8 / chan_size_bytes);
|
||||||
result = nir_bcsel(b,
|
result = nir_bcsel(b, nir_test_mask(b, byte_offset, 8),
|
||||||
nir_i2b(b, nir_iand_imm(b, byte_offset, 8)),
|
|
||||||
nir_channels(b, result, high_channels),
|
nir_channels(b, result, high_channels),
|
||||||
nir_channels(b, result, low_channels));
|
nir_channels(b, result, low_channels));
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue