Paul Berry <stereotype...@gmail.com> writes:

>[...]
> In v2 of this patch, you add the following code to
> fs_visitor::try_copy_propagate():
>
> +   /* Bail if the result of composing both strides cannot be expressed
> +    * as another stride.
> +    */
> +   if (entry->src.stride != 1 &&
> +       (inst->src[arg].stride *
> +        type_sz(inst->src[arg].type)) % type_sz(entry->src.type) != 0)
>        return false;
>
> I don't understand.  It seems like this is trying to make sure that
> (src_stride * src_type_sz) / entry_type_sz is an integer so we can later
> use the factor (src_type_sz / entry_type_sz) as a multiplicative factor to
> correct the stride without creating a fractional result.  But I don't see
> us applying this correction factor anywhere.  Is there some code missing?

That isn't exactly the purpose of that check.

The problem arises when you are trying to compose two regions of
different base types.  If the stride in bytes of 'inst->src[arg]' is not
a multiple of the element size of 'entry->src' you end up with an
inhomogeneous stride that can only be expressed as a two-dimensional
region.  Instead of adding support for two-dimensional regions (which
would be hard, not very useful, and only a partial solution because then
we would need to handle composition of two-dimensional regions that
yield three- and four-dimensional regions as a result) I disallowed
copy-propagation in that case.

Thanks.

Attachment: pgpWR8LOCAYGd.pgp
Description: PGP signature

_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to