[Mesa-dev] [PATCH 03/19] gallium: make pipe_box signed in order to represent flipped blits

Roland Scheidegger sroland at vmware.com
Tue Aug 14 15:10:27 PDT 2012


Am 12.08.2012 17:07, schrieb Marek Olšák:
> On Fri, Aug 10, 2012 at 1:42 AM, Roland Scheidegger <sroland at vmware.com> 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
> 



More information about the mesa-dev mailing list