[Mesa-dev] [PATCH] i965: Disallow fast blit paths for CopyTexImage with PixelTransfer ops

Chris Wilson chris at chris-wilson.co.uk
Tue Sep 8 12:58:27 PDT 2015


On Tue, Sep 08, 2015 at 12:33:05PM -0700, Anuj Phogat wrote:
> On Sun, Sep 6, 2015 at 9:37 AM, Chris Wilson <chris at chris-wilson.co.uk> wrote:
> > glCopyTexImage behaves similarly to glReadPixels with respect to the
> > pixel transfer operations. Therefore if any are set we cannot use the
> > simply blit fast paths.
> >
> > Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
> > Cc: Jason Ekstrand <jason.ekstrand at intel.com>
> > Cc: Kenneth Graunke <kenneth at whitecape.org>
> > ---
> >  src/mesa/drivers/dri/i965/brw_blorp_blit.cpp | 4 ++++
> >  src/mesa/drivers/dri/i965/intel_tex_copy.c   | 4 ++++
> >  2 files changed, 8 insertions(+)
> >
> > diff --git a/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp b/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp
> > index 205c905..ba11d3d 100644
> > --- a/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp
> > +++ b/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp
> > @@ -215,6 +215,10 @@ brw_blorp_copytexsubimage(struct brw_context *brw,
> >     struct intel_renderbuffer *src_irb = intel_renderbuffer(src_rb);
> >     struct intel_texture_image *intel_image = intel_texture_image(dst_image);
> >
> > +   /* No pixel transfer operations (zoom, bias, mapping), just a blit */
> > +   if (brw->ctx._ImageTransferState)
> > +      return false;
> > +
> >     /* Sync up the state of window system buffers.  We need to do this before
> >      * we go looking at the src renderbuffer's miptree.
> >      */
> > diff --git a/src/mesa/drivers/dri/i965/intel_tex_copy.c b/src/mesa/drivers/dri/i965/intel_tex_copy.c
> > index 4d8c82e..ecdd052 100644
> > --- a/src/mesa/drivers/dri/i965/intel_tex_copy.c
> > +++ b/src/mesa/drivers/dri/i965/intel_tex_copy.c
> > @@ -55,6 +55,10 @@ intel_copy_texsubimage(struct brw_context *brw,
> >     const GLenum internalFormat = intelImage->base.Base.InternalFormat;
> >     bool ret;
> >
> > +   /* No pixel transfer operations (zoom, bias, mapping), just a blit */
> > +   if (brw->ctx._ImageTransferState)
> > +      return false;
> > +
> I think we need a similar condition in copytexsubimage_using_blit_framebuffer()
> called from _mesa_meta_CopyTexSubImage().

Actually,  ImageTransferState doesn't encompass all the PixelTransfer
operations, so a few more checks are required along all the blit paths,
namely ctl->Pixel.Zoom[XY] != 1.f

Those latter we don't need along the meta path as Kenneth pointed out,
both meta (though the blit path will need to check for integer
coordinates after the transform) and blorp can handle zoom.

More work required. :|
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre


More information about the mesa-dev mailing list