Iago Toral Quiroga <ito...@igalia.com> writes: > From: Connor Abbott <connor.w.abb...@intel.com> > > --- > src/mesa/drivers/dri/i965/brw_vec4_nir.cpp | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > > diff --git a/src/mesa/drivers/dri/i965/brw_vec4_nir.cpp > b/src/mesa/drivers/dri/i965/brw_vec4_nir.cpp > index 6662a1e..1f8fa80 100644 > --- a/src/mesa/drivers/dri/i965/brw_vec4_nir.cpp > +++ b/src/mesa/drivers/dri/i965/brw_vec4_nir.cpp > @@ -141,6 +141,9 @@ vec4_visitor::nir_emit_impl(nir_function_impl *impl) > unsigned array_elems = > reg->num_array_elems == 0 ? 1 : reg->num_array_elems; > > + if (reg->bit_size == 64) > + array_elems *= 2; > + > nir_locals[reg->index] = dst_reg(VGRF, alloc.allocate(array_elems));
Shouldn't this just be 'array_elems * DIV_ROUND_UP(bit_size, 32)'? Seems like a saner long-term plan than special-casing every possible bit size in every place that cares about the bit size of a variable. > } > > @@ -270,7 +273,7 @@ dst_reg > vec4_visitor::get_nir_dest(const nir_dest &dest) > { > if (dest.is_ssa) { > - dst_reg dst = dst_reg(VGRF, alloc.allocate(1)); > + dst_reg dst = dst_reg(VGRF, alloc.allocate(dest.ssa.bit_size / 32)); Using DIV_ROUND_UP instead of plain integer division would have the advantage that it won't leave things so badly broken for sub-32-bit types. > nir_ssa_values[dest.ssa.index] = dst; > return dst; > } else { > -- > 2.7.4 > > _______________________________________________ > mesa-dev mailing list > mesa-dev@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/mesa-dev
signature.asc
Description: PGP signature
_______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev