[Mesa-dev] [PATCH 3/5] Make sure that Gallium code always uses its own MAX_CLIPPED_VERTICES.

Brian Paul brianp at vmware.com
Wed Sep 14 13:04:51 PDT 2011


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
> draw_pipe_clip.c.
>
> 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 b/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)
>   #endif
>
> -#ifndef MAX_CLIPPED_VERTICES
> +/* Don't use the global MAX_CLIPPED_VERTICES (which may be larger for other
> + * drivers); use our own.
> + */
> +#undef MAX_CLIPPED_VERTICES
>   #define MAX_CLIPPED_VERTICES ((2 * (6 + PIPE_MAX_CLIP_PLANES))+1)
> -#endif
>

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 it.

-Brian


More information about the mesa-dev mailing list