Brian Paul <bri...@vmware.com> writes:
> tom fogal wrote:
> > Is there interest in bumping [the MAX_WIDTH/HEIGHT] limit up?  Are
> > there issues we're not considering when we do this?
> >
> > Perhaps we could have [...] a --with-max-width=16384 [which] could
> > accomodate our case without inflating the standard buffer sizes.
>
> I should add this to the FAQ because I answer it every 6 months or
> so...
[snip]
> I'd be OK with modifying config.h to read:
>
> #ifndef MAX_WIDTH
> #define MAX_WIDTH 4096
> #endif
>
> Then allowing a config option like --with-max-width=16384 which
> defines MAX_WIDTH, MAX_HEIGHT.  Feel free to submit a patch.

Sure.  3 patches attached.

  1. aforementioned define change
  2. autoconf changes as described here + warning
  3. FAQ entry for this.

They apply cleanly to both master and mesa_7_5_branch.

Thanks,

-tom

From b63ce6b6ede7f97f8c2c5bf74e7efdd5630c3995 Mon Sep 17 00:00:00 2001
From: Tom Fogal <tfo...@alumni.unh.edu>
Date: Thu, 13 Aug 2009 19:23:54 -0600
Subject: [PATCH] Allow external settings of MAX_WIDTH/HEIGHT.

Conditionalize MAX_WIDTH / MAX_HEIGHT defines so that users can
set them via CFLAGS.
---
 src/mesa/main/config.h |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/mesa/main/config.h b/src/mesa/main/config.h
index f77a29a..e4995c3 100644
--- a/src/mesa/main/config.h
+++ b/src/mesa/main/config.h
@@ -138,9 +138,14 @@
 /** 
  * Maximum viewport/image width. Must accomodate all texture sizes too. 
  */
-#define MAX_WIDTH 4096
+
+#ifndef MAX_WIDTH
+#   define MAX_WIDTH 4096
+#endif
 /** Maximum viewport/image height */
-#define MAX_HEIGHT 4096
+#ifndef MAX_HEIGHT
+#   define MAX_HEIGHT 4096
+#endif
 
 /** Maxmimum size for CVA.  May be overridden by the drivers.  */
 #define MAX_ARRAY_LOCK_SIZE 3000
-- 
1.5.6.5

From 0c9173a432f157b482cdfeea16022f771599d4cc Mon Sep 17 00:00:00 2001
From: Tom Fogal <tfo...@alumni.unh.edu>
Date: Thu, 13 Aug 2009 19:40:30 -0600
Subject: [PATCH] Add configure options for MAX_WIDTH/HEIGHT.

This adds two --with configure options for setting defines for
MAX_WIDTH and MAX_HEIGHT.  It's conceivably just as easy to define
these in CFLAGS manually, but this way users don't need to know
about internal Mesa details.
---
 configure.ac |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/configure.ac b/configure.ac
index 9b65d96..0f50c6d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1159,6 +1159,21 @@ AC_ARG_WITH([xorg-driver-dir],
     [XORG_DRIVER_INSTALL_DIR="${libdir}/xorg/modules/drivers"])
 AC_SUBST([XORG_DRIVER_INSTALL_DIR])
 
+AC_ARG_WITH([max-width],
+    [AS_HELP_STRING([--with-max-width=N],
+                    [Maximum framebuffer width (4096)])],
+    [CFLAGS="${CFLAGS} -DMAX_WIDTH=${withval}";
+     AS_IF([test "${withval}" -gt "4096"],
+           [AC_MSG_WARN([Large framebuffer: see s_tritemp.h comments.])])]
+)
+AC_ARG_WITH([max-height],
+    [AS_HELP_STRING([--with-max-height=N],
+                    [Maximum framebuffer height (4096)])],
+    [CFLAGS="${CFLAGS} -DMAX_HEIGHT=${withval}";
+     AS_IF([test "${withval}" -gt "4096"],
+           [AC_MSG_WARN([Large framebuffer: see s_tritemp.h comments.])])]
+)
+
 dnl
 dnl Gallium Intel configuration
 dnl
-- 
1.5.6.5

From 26a80fb75601b9790f63fa4c6d3510601527f1a2 Mon Sep 17 00:00:00 2001
From: Tom Fogal <tfo...@alumni.unh.edu>
Date: Thu, 13 Aug 2009 19:51:57 -0600
Subject: [PATCH] Add a FAQ about internal buffer sizes.

---
 docs/faq.html |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/docs/faq.html b/docs/faq.html
index 11b5d43..65e279a 100644
--- a/docs/faq.html
+++ b/docs/faq.html
@@ -316,6 +316,19 @@ Basically, applying a translation of (0.375, 0.375, 0.0) to your coordinates
 will fix the problem.
 </p>
 
+<h2>3.6 How can I change the maximum framebuffer size in Mesa's
+<tt>swrast</tt> backend?</h2>
+<p>
+These can be overridden by using the <tt>--with-max-width</tt> and
+<tt>--with-max-height</tt> options.  The two need not be equal.
+</p><p>
+Do note that Mesa uses these values to size some internal buffers,
+so increasing these sizes will cause Mesa to require additional
+memory.  Furthermore, increasing these limits beyond <tt>4096</tt>
+may introduce rasterization artifacts; see the leading comments in
+<tt>src/mesa/swrast/s_tritemp.h</tt>.
+</p>
+
 <br>
 <br>
 
-- 
1.5.6.5

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Mesa3d-dev mailing list
Mesa3d-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mesa3d-dev

Reply via email to