Mesa (master): mesa: Temporary hack to prevent stack overflow on windows
Jose Fonseca
jrfonseca at kemper.freedesktop.org
Thu Dec 2 20:31:12 UTC 2010
Module: Mesa
Branch: master
Commit: 64da9a1a04f5e3a0609be09a65a4c0419ebd43a5
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=64da9a1a04f5e3a0609be09a65a4c0419ebd43a5
Author: José Fonseca <jfonseca at vmware.com>
Date: Thu Dec 2 20:30:59 2010 +0000
mesa: Temporary hack to prevent stack overflow on windows
e.g. st_readpixels is trying to alloca() an huge ammount of memory from
the stack.
---
src/mesa/main/config.h | 17 +++++++++++++++++
1 files changed, 17 insertions(+), 0 deletions(-)
diff --git a/src/mesa/main/config.h b/src/mesa/main/config.h
index ff77bd0..fffb1a7 100644
--- a/src/mesa/main/config.h
+++ b/src/mesa/main/config.h
@@ -150,6 +150,23 @@
# define MAX_HEIGHT 16384
#endif
+/* XXX: hack to prevent stack overflow on windows until all temporary arrays
+ * [MAX_WIDTH] are allocated from the heap */
+#ifdef WIN32
+#undef MAX_TEXTURE_LEVELS
+#undef MAX_3D_TEXTURE_LEVELS
+#undef MAX_CUBE_TEXTURE_LEVELS
+#undef MAX_TEXTURE_RECT_SIZE
+#undef MAX_WIDTH
+#undef MAX_HEIGHT
+#define MAX_TEXTURE_LEVELS 13
+#define MAX_3D_TEXTURE_LEVELS 9
+#define MAX_CUBE_TEXTURE_LEVELS 13
+#define MAX_TEXTURE_RECT_SIZE 4096
+#define MAX_WIDTH 4096
+#define MAX_HEIGHT 4096
+#endif
+
/** Maxmimum size for CVA. May be overridden by the drivers. */
#define MAX_ARRAY_LOCK_SIZE 3000
More information about the mesa-commit
mailing list