[Mesa-dev] [PATCH 04/12] i965/fs: Move brw_wm_compile::dispatch_width into fs_visitor.

Kenneth Graunke kenneth at whitecape.org
Mon Nov 26 19:33:07 PST 2012


On 11/26/2012 02:58 PM, Paul Berry wrote:
> On 20 November 2012 21:40, Kenneth Graunke <kenneth at whitecape.org
> <mailto:kenneth at whitecape.org>> wrote:
>
>     +   unsigned dispatch_width; /** 8 or 16 */
>     +
>
>
> While we're at it, why don't we make it const?  That will prevent us
> from accidentally modifying it at some inoppurtune time, and it *may*
> even cause the compiler to generate more efficient code.
>
> Note: if we do that we'll have to use the C++ "initialization list"
> syntax to initialize it, e.g.:
>
> fs_visitor::fs_visitor(...)
>     : dispatch_width(dispatch_width)
> {
>     ...
> }

Oh, good idea!  I didn't know you could do that.  For fs_visitor, it 
makes sense as it should never change.  After the split, I can't make it 
const in fs_generator, since I actually do modify it.

Consider it done.


More information about the mesa-dev mailing list