On Thu, Mar 31, 2011 at 12:37 PM, Julian Adams <joo...@gmail.com> wrote: > inline... > > On 31 March 2011 12:07, Henri Verbeet <hverb...@gmail.com> wrote: >> On 30 March 2011 23:43, Julian Adams <joo...@gmail.com> wrote: >>> --- >>> src/gallium/drivers/r600/r600_state.c | 22 +++++++++++++--------- >>> 1 files changed, 13 insertions(+), 9 deletions(-) >>> >> Evergreen probably needs the same fix. > > Yes, the matching function there looks similar. I can update it, but > can't test it. > >> >>> + for (int i = 0, j = 0; i < 8; i++) { >>> + /* state->rt entries > 0 only written if independent >>> blending */ >>> + if (state->independent_blend_enable) >>> + j = i; >> Not sure about declaring "j" inside the for. I don't think it exactly >> helps readability, but otoh it doesn't bother me a lot either. >> > > I copied that style from a function up the call stack, which was fixed > in a similar way in commit: a476ca1fd1b4e76e31c9babfd7fb2a54a09f21d3. > Mostly I write C++ so probably I'd be inclined to do this: > > for (int i = 0; i < 8; i++) { > /* state->rt entries > 0 only written if independent blending > */ > const int j = state->independent_blend_enable ? i : 0; > > Let me know if you want the Evergreen fixes, and how "j" is declared and set.
Using for(int loopcountuer;;) construct is a good thing it helps the compiler to make good decision but gcc is already good on its own to figure this kind of things by itself. Cheers, Jerome _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev