[Mesa-dev] [PATCH 4/5] i965: Add support for ARB_copy_image

Jason Ekstrand jason at jlekstrand.net
Fri Aug 8 10:56:56 PDT 2014


On Fri, Aug 8, 2014 at 4:05 AM, Neil Roberts <neil at linux.intel.com> wrote:

> Jason Ekstrand <jason at jlekstrand.net> writes:
>
> > +   if (src_mt == dst_mt && src_level == dst_level && src_z == dst_z) {
> > +      /* If we are on the same miptree, same level, and same slice, then
> > +       * intel_miptree_map won't let us map it twice.  We have to do a
> > +       * single map in read-write mode.
> > +       */
> > +
> > +      map_x1 = MIN2(src_x, dst_x);
> > +      map_y1 = MIN2(src_y, dst_y);
> > +      map_x2 = MAX2(src_x, dst_x) + src_width;
> > +      map_y2 = MAX2(src_y, dst_y) + src_height;
> > +
> > +      intel_miptree_map(brw, src_mt, src_level, src_z,
> > +                        map_x1, map_y1, map_x2 - map_x1, map_y2 -
> map_y1,
> > +                        GL_MAP_READ_BIT | GL_MAP_WRITE_BIT,
> > +                        (void **)&mapped, &src_stride);
> > +
> > +      dst_stride = src_stride;
> > +
> > +      /* Set the offsets here so we don't have to think about it later
> */
> > +      src_mapped = mapped + (src_y - map_y1) * src_stride +
> > +                            (src_x - map_x1) * cpp;
> > +      dst_mapped = mapped + (dst_y - map_y1) * dst_stride +
> > +                            (dst_x - map_x1) * cpp;
>
> This needs to take into account the block size of the format or it will
> offset to the wrong position. I guess that is quite important as this
> code path will only be used for compressed formats.
>

Yeah, you're right.  I'll get that patched up and update the tests to
exercise it.


>
> The commit message still mentions the maximum stride which is no longer
> valid.
>
> Regards,
> - Neil
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20140808/8d258be5/attachment.html>


More information about the mesa-dev mailing list