On Tue, Aug 6, 2013 at 12:31 PM, Ian Romanick <[email protected]> wrote:
> On 08/06/2013 12:10 PM, mmueller wrote:Signed-off-by: mmueller < > [email protected]> > >> --- >> src/mesa/drivers/dri/i965/brw_**draw.c | 18 +++++++++--------- >> 1 file changed, 9 insertions(+), 9 deletions(-) >> >> diff --git a/src/mesa/drivers/dri/i965/**brw_draw.c >> b/src/mesa/drivers/dri/i965/**brw_draw.c >> index 6170d07..e11d0d8 100644 >> --- a/src/mesa/drivers/dri/i965/**brw_draw.c >> +++ b/src/mesa/drivers/dri/i965/**brw_draw.c >> @@ -367,6 +367,15 @@ static bool brw_try_draw_prims( struct gl_context >> *ctx, >> bool retval = true; >> GLuint i; >> bool fail_next = false; >> + enum { >> + estimated_max_prim_size = >> + 512 + /* batchbuffer commands */ >> + ((BRW_MAX_TEX_UNIT * (sizeof(struct brw_sampler_state) + >> sizeof(struct gen5_sampler_default_color)))) + >> + 1024 + /* gen6 VS push constants */ >> + 1024 + /* gen6 WM push constants */ >> + 512 /* misc. pad */ >> + }; >> + >> > > I think this would be better as 'const int estimated_max_prim_size = ...'. > Using an enum is mostly the same (but also enforces that it's a > compile-time constant), but it looks weird. :) > > OK. A new patch is on the way.... *sigh*, I knew this day was coming for the last 15 years, but I don't feel that was enough time to prepare. Now I'm forced to come out of the closet - I'm a lifelong member of PETA*. All too often I clearly communicate something to the compiler yet it still goes off and does something else. Before I started using enums to replace #defines and const PODs in my code, I too thought enums were weird and ugly. After time I came to realized that it was an effective means to get the compiler to do some useful things. After a while they don't look so weird. Obviously in this case it's of no concern. Cheers *PETA - Promoting Enums Through Awareness (www.PE.TA, not to be confused with People Eating Tasty Animals: PETA.org)
_______________________________________________ mesa-dev mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/mesa-dev
