On 14 September 2011 13:04, Brian Paul <span dir="ltr"><<a href="mailto:brianp@vmware.com">brianp@vmware.com</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div><div></div><div class="h5">On 09/14/2011 01:49 PM, Paul Berry wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
To support GLSL 1.30, we will need to increase MAX_CLIP_PLANES to 8,<br>
and as a side effect this will increase the value of<br>
MAX_CLIPPED_VERTICES defined in src/mesa/main/config.h. Gallium has<br>
its own value of MAX_CLIPPED_VERTICES, defined in draw_pipe_clip.c,<br>
but this value only takes effect if MAX_CLIPPED_VERTICES isn't already<br>
defined, so whether it is used or not depends on what is included by<br>
draw_pipe_clip.c.<br>
<br>
This patch ensures that draw_pipe_clip.c always uses its own<br>
definition of MAX_CLIPPED_VERTICES, so Gallium drivers won't be<br>
affected by increasing MAX_CLIP_PLANES to 8 until they're ready.<br>
---<br>
src/gallium/auxiliary/draw/<u></u>draw_pipe_clip.c | 6 ++++--<br>
1 files changed, 4 insertions(+), 2 deletions(-)<br>
<br>
diff --git a/src/gallium/auxiliary/draw/<u></u>draw_pipe_clip.c b/src/gallium/auxiliary/draw/<u></u>draw_pipe_clip.c<br>
index b49502c..2dd8dee 100644<br>
--- a/src/gallium/auxiliary/draw/<u></u>draw_pipe_clip.c<br>
+++ b/src/gallium/auxiliary/draw/<u></u>draw_pipe_clip.c<br>
@@ -49,9 +49,11 @@<br>
#define DIFFERENT_SIGNS(x, y) ((x) * (y)<= 0.0F&& (x) - (y) != 0.0F)<br>
#endif<br>
<br>
-#ifndef MAX_CLIPPED_VERTICES<br>
+/* Don't use the global MAX_CLIPPED_VERTICES (which may be larger for other<br>
+ * drivers); use our own.<br>
+ */<br>
+#undef MAX_CLIPPED_VERTICES<br>
#define MAX_CLIPPED_VERTICES ((2 * (6 + PIPE_MAX_CLIP_PLANES))+1)<br>
-#endif<br>
<br>
</blockquote>
<br></div></div>
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.<br>
<br>
I also think you can just bump PIPE_MAX_CLIP_PLANES to 8 while you're at it.<br><font color="#888888">
<br>
-Brian<br>
</font></blockquote></div><br>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.<br>