[Mesa-dev] [PATCH] swrast: Fix the coordinates passed to _mesa_regions_overlap()
Cc: "11.1" Signed-off-by: Anuj Phogat --- src/mesa/swrast/s_copypix.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/mesa/swrast/s_copypix.c b/src/mesa/swrast/s_copypix.c index 0dbccc0..31e1d3d 100644 --- a/src/mesa/swrast/s_copypix.c +++ b/src/mesa/swrast/s_copypix.c @@ -53,8 +53,10 @@ regions_overlap(GLint srcx, GLint srcy, GLfloat zoomX, GLfloat zoomY) { if (zoomX == 1.0F && zoomY == 1.0F) { - return _mesa_regions_overlap(srcx, srcy, srcx + width, srcy + height, - dstx, dsty, dstx + width, dsty + height); + return _mesa_regions_overlap(srcx, srcy, + srcx + width - 1, srcy + height - 1, + dstx, dsty, + dstx + width - 1, dsty + height - 1); } else { /* add one pixel of slop when zooming, just to be safe */ -- 2.4.3 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH] swrast: Fix the coordinates passed to _mesa_regions_overlap()
On Mon, Nov 23, 2015 at 5:35 PM, Anuj Phogat wrote: > Cc: "11.1" > Signed-off-by: Anuj Phogat > --- > src/mesa/swrast/s_copypix.c | 6 -- > 1 file changed, 4 insertions(+), 2 deletions(-) > > diff --git a/src/mesa/swrast/s_copypix.c b/src/mesa/swrast/s_copypix.c > index 0dbccc0..31e1d3d 100644 > --- a/src/mesa/swrast/s_copypix.c > +++ b/src/mesa/swrast/s_copypix.c > @@ -53,8 +53,10 @@ regions_overlap(GLint srcx, GLint srcy, > GLfloat zoomX, GLfloat zoomY) > { > if (zoomX == 1.0F && zoomY == 1.0F) { > - return _mesa_regions_overlap(srcx, srcy, srcx + width, srcy + height, > - dstx, dsty, dstx + width, dsty + height); > + return _mesa_regions_overlap(srcx, srcy, > + srcx + width - 1, srcy + height - 1, > + dstx, dsty, > + dstx + width - 1, dsty + height - 1); > } What problem is this fixing? Reading the implementation of _mesa_regions_overlap(), it seems that the arguments are inclusive, so subtracting 1 shouldn't be necessary (or correct). The other two call sites (src/mesa/drivers/dri/i965/intel_blit.c and src/mesa/state_tracker/st_cb_drawpixels.c) also don't seem to subtract 1. ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH] swrast: Fix the coordinates passed to _mesa_regions_overlap()
On Mon, Nov 23, 2015 at 8:29 PM, Matt Turner wrote: > On Mon, Nov 23, 2015 at 5:35 PM, Anuj Phogat wrote: >> Cc: "11.1" >> Signed-off-by: Anuj Phogat >> --- >> src/mesa/swrast/s_copypix.c | 6 -- >> 1 file changed, 4 insertions(+), 2 deletions(-) >> >> diff --git a/src/mesa/swrast/s_copypix.c b/src/mesa/swrast/s_copypix.c >> index 0dbccc0..31e1d3d 100644 >> --- a/src/mesa/swrast/s_copypix.c >> +++ b/src/mesa/swrast/s_copypix.c >> @@ -53,8 +53,10 @@ regions_overlap(GLint srcx, GLint srcy, >> GLfloat zoomX, GLfloat zoomY) >> { >> if (zoomX == 1.0F && zoomY == 1.0F) { >> - return _mesa_regions_overlap(srcx, srcy, srcx + width, srcy + height, >> - dstx, dsty, dstx + width, dsty + height); >> + return _mesa_regions_overlap(srcx, srcy, >> + srcx + width - 1, srcy + height - 1, >> + dstx, dsty, >> + dstx + width - 1, dsty + height - 1); >> } > > What problem is this fixing? Reading the implementation of > _mesa_regions_overlap(), it seems that the arguments are inclusive, so > subtracting 1 shouldn't be necessary (or correct). > I realized the mistake. Dropping this patch. The problem is in the implementation of _mesa_regions_overlap() which returns true for the rectangles with shared edges. It makes the driver fall back to slower paths. > The other two call sites (src/mesa/drivers/dri/i965/intel_blit.c and > src/mesa/state_tracker/st_cb_drawpixels.c) also don't seem to subtract > 1. ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev