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

Paul Berry stereotype441 at gmail.com
Wed Sep 14 12:49:32 PDT 2011

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 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)
+/* Don't use the global MAX_CLIPPED_VERTICES (which may be larger for other
+ * drivers); use our own.
+ */

More information about the mesa-dev mailing list