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

Chad Versace chad.versace at intel.com
Fri May 29 12:33:10 PDT 2015


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.


More information about the mesa-dev mailing list