On Thu, Nov 8, 2018 at 7:22 AM Alejandro Piñeiro <[email protected]> wrote:
> The offset compute was working fine for the case of attrib_slots=1, > and updating the offset for the following varying. > > But in the case of attrib_slots=2 (so dvec3/4), we are basically > splitting the comp_slots needed in two outputs. In that case we can't > add to the offset the full size of the type. > --- > src/compiler/nir/nir_gather_xfb_info.c | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) > > diff --git a/src/compiler/nir/nir_gather_xfb_info.c > b/src/compiler/nir/nir_gather_xfb_info.c > index f5d831c6567..01fc2b26624 100644 > --- a/src/compiler/nir/nir_gather_xfb_info.c > +++ b/src/compiler/nir/nir_gather_xfb_info.c > @@ -81,7 +81,11 @@ add_var_xfb_outputs(nir_xfb_info *xfb, > output->component_mask = (comp_mask >> (s * 4)) & 0xf; > > (*location)++; > - *offset += comp_slots * 4; > + /* attrib_slots would be only > 1 for doubles. On that case > + * comp_slots will be a multiple of 2, so the following doesn't > need > + * to use DIV_ROUND_UP or similar > + */ > + *offset += comp_slots / attrib_slots * 4; > Mind adding an assert(comp_slots % attrib_slots == 0)? Also, can we make that "(comp_slots / attrib_slots) * 4"? I don't like thinking about precedence at that detail. > } > } > } > -- > 2.14.1 > >
_______________________________________________ mesa-dev mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/mesa-dev
