Re: [Mesa-dev] [PATCH 03/19] gallium: make pipe_box signed in order to represent flipped blits
Am 12.08.2012 17:07, schrieb Marek Olšák: > On Fri, Aug 10, 2012 at 1:42 AM, Roland Scheidegger > wrote: >> Am 10.08.2012 00:37, schrieb Marek Olšák: >>> I'd like to have either signed pipe_box or a new struct for that purpose. >> It looks to me like conceptually what you want is more like a coordinate >> pair. I dunno though but negative width/height/depth just aren't very >> intuitive for a box. But maybe I'm the only one caring about that style :-). > > To me, both representations are equivalent because: > x1 + width = x2 (x1 is inclusive, while x2 is exclusive) Yes this is quite obviously true. But by using two coordinate pairs instead of width/height you avoid any confusion over the meaning of negative widths/heights. Though granted a coordinate pair where one coordinate is inclusive the other ecxlusive isn't really nice neither. In any case, it doesn't look like anyone else cares so I guess your suggestion is ok. Roland > > We could add checks into Galahad to make sure that pipe_box isn't > negative when it shouldn't be. IIRC, Jose said he planned to enable > Galahad by default on debug builds. > > Marek > ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 03/19] gallium: make pipe_box signed in order to represent flipped blits
On Fri, Aug 10, 2012 at 1:42 AM, Roland Scheidegger wrote: > Am 10.08.2012 00:37, schrieb Marek Olšák: >> I'd like to have either signed pipe_box or a new struct for that purpose. > It looks to me like conceptually what you want is more like a coordinate > pair. I dunno though but negative width/height/depth just aren't very > intuitive for a box. But maybe I'm the only one caring about that style :-). To me, both representations are equivalent because: x1 + width = x2 (x1 is inclusive, while x2 is exclusive) We could add checks into Galahad to make sure that pipe_box isn't negative when it shouldn't be. IIRC, Jose said he planned to enable Galahad by default on debug builds. Marek ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 03/19] gallium: make pipe_box signed in order to represent flipped blits
Am 10.08.2012 00:37, schrieb Marek Olšák: > I'd like to have either signed pipe_box or a new struct for that purpose. It looks to me like conceptually what you want is more like a coordinate pair. I dunno though but negative width/height/depth just aren't very intuitive for a box. But maybe I'm the only one caring about that style :-). > > I assume transfers and resource_copy_region will always be unsigned. > > x,y,z don't have to be signed, good point. More room for unsigned/signed arithmetic mistakes though if they aren't the same :-). Roland > > Marek > > On Thu, Aug 9, 2012 at 10:38 PM, Roland Scheidegger > wrote: >> I'm not convinced this is a good idea. >> That dilutes the meaning of a "box" quite a bit (and I don't think x/y/z >> can actually be negative?). There are presumably also quite a lot of >> uses of pipe_box which might not be able to deal with such boxes. >> >> Roland >> >> >> >> Am 09.08.2012 18:07, schrieb Marek Olšák: >>> This will be used by u_blitter. >>> --- >>> src/gallium/include/pipe/p_state.h | 12 ++-- >>> 1 file changed, 6 insertions(+), 6 deletions(-) >>> >>> diff --git a/src/gallium/include/pipe/p_state.h >>> b/src/gallium/include/pipe/p_state.h >>> index c828c80..76559ad 100644 >>> --- a/src/gallium/include/pipe/p_state.h >>> +++ b/src/gallium/include/pipe/p_state.h >>> @@ -387,12 +387,12 @@ struct pipe_sampler_view >>> */ >>> struct pipe_box >>> { >>> - unsigned x; >>> - unsigned y; >>> - unsigned z; >>> - unsigned width; >>> - unsigned height; >>> - unsigned depth; >>> + int x; >>> + int y; >>> + int z; >>> + int width; >>> + int height; >>> + int depth; >>> }; >>> >>> >>> >> >> ___ >> mesa-dev mailing list >> mesa-dev@lists.freedesktop.org >> http://lists.freedesktop.org/mailman/listinfo/mesa-dev ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 03/19] gallium: make pipe_box signed in order to represent flipped blits
I'd like to have either signed pipe_box or a new struct for that purpose. I assume transfers and resource_copy_region will always be unsigned. x,y,z don't have to be signed, good point. Marek On Thu, Aug 9, 2012 at 10:38 PM, Roland Scheidegger wrote: > I'm not convinced this is a good idea. > That dilutes the meaning of a "box" quite a bit (and I don't think x/y/z > can actually be negative?). There are presumably also quite a lot of > uses of pipe_box which might not be able to deal with such boxes. > > Roland > > > > Am 09.08.2012 18:07, schrieb Marek Olšák: >> This will be used by u_blitter. >> --- >> src/gallium/include/pipe/p_state.h | 12 ++-- >> 1 file changed, 6 insertions(+), 6 deletions(-) >> >> diff --git a/src/gallium/include/pipe/p_state.h >> b/src/gallium/include/pipe/p_state.h >> index c828c80..76559ad 100644 >> --- a/src/gallium/include/pipe/p_state.h >> +++ b/src/gallium/include/pipe/p_state.h >> @@ -387,12 +387,12 @@ struct pipe_sampler_view >> */ >> struct pipe_box >> { >> - unsigned x; >> - unsigned y; >> - unsigned z; >> - unsigned width; >> - unsigned height; >> - unsigned depth; >> + int x; >> + int y; >> + int z; >> + int width; >> + int height; >> + int depth; >> }; >> >> >> > > ___ > mesa-dev mailing list > mesa-dev@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/mesa-dev ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 03/19] gallium: make pipe_box signed in order to represent flipped blits
I'm not convinced this is a good idea. That dilutes the meaning of a "box" quite a bit (and I don't think x/y/z can actually be negative?). There are presumably also quite a lot of uses of pipe_box which might not be able to deal with such boxes. Roland Am 09.08.2012 18:07, schrieb Marek Olšák: > This will be used by u_blitter. > --- > src/gallium/include/pipe/p_state.h | 12 ++-- > 1 file changed, 6 insertions(+), 6 deletions(-) > > diff --git a/src/gallium/include/pipe/p_state.h > b/src/gallium/include/pipe/p_state.h > index c828c80..76559ad 100644 > --- a/src/gallium/include/pipe/p_state.h > +++ b/src/gallium/include/pipe/p_state.h > @@ -387,12 +387,12 @@ struct pipe_sampler_view > */ > struct pipe_box > { > - unsigned x; > - unsigned y; > - unsigned z; > - unsigned width; > - unsigned height; > - unsigned depth; > + int x; > + int y; > + int z; > + int width; > + int height; > + int depth; > }; > > > ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 03/19] gallium: make pipe_box signed in order to represent flipped blits
This will be used by u_blitter. --- src/gallium/include/pipe/p_state.h | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/gallium/include/pipe/p_state.h b/src/gallium/include/pipe/p_state.h index c828c80..76559ad 100644 --- a/src/gallium/include/pipe/p_state.h +++ b/src/gallium/include/pipe/p_state.h @@ -387,12 +387,12 @@ struct pipe_sampler_view */ struct pipe_box { - unsigned x; - unsigned y; - unsigned z; - unsigned width; - unsigned height; - unsigned depth; + int x; + int y; + int z; + int width; + int height; + int depth; }; -- 1.7.9.5 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev