[Mesa-dev] [PATCH 3/5] Make sure that Gallium code always uses its own MAX_CLIPPED_VERTICES.
stereotype441 at gmail.com
Thu Sep 15 14:49:21 PDT 2011
On 14 September 2011 13:04, Brian Paul <brianp at vmware.com> wrote:
> On 09/14/2011 01:49 PM, Paul Berry wrote:
>> To support GLSL 1.30, we will need to increase MAX_CLIP_PLANES to 8,
>> and as a side effect this will increase the value of
>> MAX_CLIPPED_VERTICES defined in src/mesa/main/config.h. Gallium has
>> its own value of MAX_CLIPPED_VERTICES, defined in draw_pipe_clip.c,
>> but this value only takes effect if MAX_CLIPPED_VERTICES isn't already
>> defined, so whether it is used or not depends on what is included by
>> This patch ensures that draw_pipe_clip.c always uses its own
>> definition of MAX_CLIPPED_VERTICES, so Gallium drivers won't be
>> affected by increasing MAX_CLIP_PLANES to 8 until they're ready.
>> src/gallium/auxiliary/draw/**draw_pipe_clip.c | 6 ++++--
>> 1 files changed, 4 insertions(+), 2 deletions(-)
>> diff --git a/src/gallium/auxiliary/draw/**draw_pipe_clip.c
>> index b49502c..2dd8dee 100644
>> --- a/src/gallium/auxiliary/draw/**draw_pipe_clip.c
>> +++ b/src/gallium/auxiliary/draw/**draw_pipe_clip.c
>> @@ -49,9 +49,11 @@
>> #define DIFFERENT_SIGNS(x, y) ((x) * (y)<= 0.0F&& (x) - (y) != 0.0F)
>> -#ifndef MAX_CLIPPED_VERTICES
>> +/* Don't use the global MAX_CLIPPED_VERTICES (which may be larger for
>> + * drivers); use our own.
>> + */
>> +#undef MAX_CLIPPED_VERTICES
>> #define MAX_CLIPPED_VERTICES ((2 * (6 + PIPE_MAX_CLIP_PLANES))+1)
> I think the #ifndef checks around all those macros are unneeded nowadays.
> Early in the gallium development there was some mixing of mesa headers with
> gallium code. The #ifndef was probably used to work around that. I don't
> think we have that problem or need those #ifndefs anymore.
> I also think you can just bump PIPE_MAX_CLIP_PLANES to 8 while you're at
Ok, thanks. I'm not terribly familiar with the Gallium parts of the code
base, but from what research I've done I believe you are right. Consider
this patch NAKed and I'll send out a pair of followup patches making the
changes you suggest.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the mesa-dev