[Mesa-dev] [PATCH 1/2] mesa: Fix region overlap conditions for rectangles with a shared edge
Jason Ekstrand
jason at jlekstrand.net
Fri Jun 10 20:45:13 UTC 2016
On Fri, Jun 10, 2016 at 1:30 PM, Anuj Phogat <anuj.phogat at gmail.com> wrote:
> On Fri, Jun 10, 2016 at 10:38 AM, Anuj Phogat <anuj.phogat at gmail.com>
> wrote:
> > On Fri, Jun 10, 2016 at 7:43 AM, Jason Ekstrand <jason at jlekstrand.net>
> wrote:
> >> Reviewed-by: Jason Ekstrand <jason at jlekstrand.net>
> >>
> >> Is there a test or bug this fixes? If so, that should be mentioned in
> the
> >> commit message and you should cc stable.
> >>
> > Looks like there is no test hitting this. So, I'll add a small piglit
> test
> > verifying the fix. I'll also put "Cc: 12.0 <
> mesa-stable at lists.freedesktop.org>"
> > tag on both the patches.
> >
> Returning overlap=true for shared edge cases is not causing any
> rendering issues, it just makes the driver choose a slower path.
> So, the patches don't need Cc to stable tag.
>
That makes sense. Thanks for looking into it.
--Jason
> >> On Dec 11, 2015 2:39 PM, "Anuj Phogat" <anuj.phogat at gmail.com> wrote:
> >>>
> >>> From OpenGL 4.0 spec, section 4.3.2 "Copying Pixels":
> >>> "The pixels corresponding to these buffers are copied from the source
> >>> rectangle bounded by the locations (srcX0, srcY 0) and (srcX1, srcY 1)
> >>> to the destination rectangle bounded by the locations (dstX0, dstY 0)
> >>> and (dstX1, dstY 1). The lower bounds of the rectangle are inclusive,
> >>> while the upper bounds are exclusive."
> >>>
> >>> So, the rectangles sharing just an edge shouldn't overlap.
> >>> -----------
> >>> | |
> >>> ------- ---
> >>> | | |
> >>> | | |
> >>> ------- ---
> >>>
> >>> Cc: Ian Romanick <ian.d.romanick at intel.com>
> >>> Cc: Matt Turner <mattst88 at gmail.com>
> >>> Signed-off-by: Anuj Phogat <anuj.phogat at gmail.com>
> >>> ---
> >>> src/mesa/main/blit.c | 8 ++++----
> >>> 1 file changed, 4 insertions(+), 4 deletions(-)
> >>>
> >>> diff --git a/src/mesa/main/blit.c b/src/mesa/main/blit.c
> >>> index a32f1a4..9c4c0f3 100644
> >>> --- a/src/mesa/main/blit.c
> >>> +++ b/src/mesa/main/blit.c
> >>> @@ -68,16 +68,16 @@ _mesa_regions_overlap(int srcX0, int srcY0,
> >>> int dstX0, int dstY0,
> >>> int dstX1, int dstY1)
> >>> {
> >>> - if (MAX2(srcX0, srcX1) < MIN2(dstX0, dstX1))
> >>> + if (MAX2(srcX0, srcX1) <= MIN2(dstX0, dstX1))
> >>> return false; /* dst completely right of src */
> >>>
> >>> - if (MAX2(dstX0, dstX1) < MIN2(srcX0, srcX1))
> >>> + if (MAX2(dstX0, dstX1) <= MIN2(srcX0, srcX1))
> >>> return false; /* dst completely left of src */
> >>>
> >>> - if (MAX2(srcY0, srcY1) < MIN2(dstY0, dstY1))
> >>> + if (MAX2(srcY0, srcY1) <= MIN2(dstY0, dstY1))
> >>> return false; /* dst completely above src */
> >>>
> >>> - if (MAX2(dstY0, dstY1) < MIN2(srcY0, srcY1))
> >>> + if (MAX2(dstY0, dstY1) <= MIN2(srcY0, srcY1))
> >>> return false; /* dst completely below src */
> >>>
> >>> return true; /* some overlap */
> >>> --
> >>> 2.5.0
> >>>
> >>> _______________________________________________
> >>> mesa-dev mailing list
> >>> mesa-dev at lists.freedesktop.org
> >>> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20160610/c0bcaa6f/attachment.html>
More information about the mesa-dev
mailing list