[Mesa-dev] [PATCH v2 01/23] glsl: Add parsing support for multi-stream output in geometry shaders.

Timothy Arceri t_arceri at yahoo.com.au
Fri Jun 20 20:17:02 PDT 2014


On Fri, 2014-06-20 at 10:46 -0700, Ian Romanick wrote:

> I care a lot less about "what is often done" than I do about "what
> should be done".  If there is an argument to be made that stand-alone
> comments (not on a line with other code) are better, that would be good
> data to have. 

Well I'm not sure how common a use case this is for Mesa devs but when
doing any coding on a laptop the less wasted lines the better.
Especially when the aspect ratio of all new laptops is suited to
watching dvds rather than any kind of document viewing/editing.
I personally do most of my Mesa contributions on the train travelling to
and from work.
For the same reason I've always wondered why the preferred width of
lines is 78 columns? Is this just a historical thing? Or does it make
sense to use this restriction e.g for debugging in the terminal? The
devinfo.html doesn't give an actual reason, and 78 columns seems rather
small considering the size and resolutions of modern screens.

>  Classically, Mesa has opted for more whitespace because
> it makes the code easier for humans to parse.  This is part of the
> reason we don't use //-style comments even in C++ code.
> 
> I would much rather read
> 
>         fields[i].sample = qual->flags.q.sample ? 1 : 0;
> 
>         /* Only save explicitly defined streams in block's field.
>          */
>         fields[i].stream = qual->flags.q.explicit_stream ? qual->stream : -1;
> 
> than
> 
>         fields[i].sample = qual->flags.q.sample ? 1 : 0;
>         /* Only save explicitly defined streams in block's field */
>         fields[i].stream = qual->flags.q.explicit_stream ? qual->stream : -1;
> 
> I'd also like to hear Brian's opinion, since most of Mesa style is his
> doing.



More information about the mesa-dev mailing list