[Mesa-dev] [PATCH 1/6] i965: Consolidate certain miptree params to flags

Kenneth Graunke kenneth at whitecape.org
Fri May 29 17:26:57 PDT 2015


On Friday, May 29, 2015 12:33:10 PM Chad Versace wrote:
> On Fri 29 May 2015, Matt Turner wrote:
> > On Thu, May 28, 2015 at 10:21 AM, Ben Widawsky
> > > @@ -286,7 +284,7 @@ intel_miptree_create_layout(struct brw_context *brw,
> > >     mt->logical_height0 = height0;
> > >     mt->logical_depth0 = depth0;
> > >     mt->fast_clear_state = INTEL_FAST_CLEAR_STATE_NO_MCS;
> > > -   mt->disable_aux_buffers = disable_aux_buffers;
> > > +   mt->disable_aux_buffers = !!(layout_flags & MIPTREE_LAYOUT_DISABLE_AUX);
> > 
> > FWIW, I much prefer (x & y) != 0 to !!(x & y).
> 
> Matt, in the C code you've encountered in the wild, do you feel that
> `(x & y) != 0` is more prevalent than `!!(x & y)`? I'm curious, because
> we should probably choose the idiom which is more recognizable.
> 
> For the record, I slightly prefer !! because I've encountered it often
> in idiomatic Python, but it really doesn't matter to me. I suspect that
> != 0 may be the more common idiom in C.

I prefer != 0 as well.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20150529/f1aee313/attachment.sig>


More information about the mesa-dev mailing list