nir/builder: set write mask if not provided

Zero isn't really a valid write mask. If it's provided, use a full write
mask.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14455>
This commit is contained in:
Rhys Perry
2022-01-06 17:52:15 +00:00
committed by Marge Bot
parent 275a18322d
commit e9e1a44872
+6 -2
View File
@@ -123,6 +123,10 @@ _nir_build_${name}(nir_builder *build${intrinsic_decl_list(opcode)})
% for i in range(opcode.num_srcs):
intrin->src[${i}] = nir_src_for_ssa(src${i});
% endfor
% if WRITE_MASK in opcode.indices and 0 in opcode.src_components:
if (!indices.write_mask)
indices.write_mask = BITFIELD_MASK(intrin->num_components);
% endif
% for index in opcode.indices:
nir_intrinsic_set_${index.name}(intrin, indices.${index.name});
% endfor
@@ -154,7 +158,7 @@ _nir_build_${name}(build${intrinsic_macro_list(opcode)}, (struct _nir_${name}_in
#endif /* _NIR_BUILDER_OPCODES_ */"""
from nir_opcodes import opcodes
from nir_intrinsics import INTR_OPCODES
from nir_intrinsics import INTR_OPCODES, WRITE_MASK
from mako.template import Template
print(Template(template).render(opcodes=opcodes, INTR_OPCODES=INTR_OPCODES))
print(Template(template).render(opcodes=opcodes, INTR_OPCODES=INTR_OPCODES, WRITE_MASK=WRITE_MASK))