egl: bump up MAX_ATTRIBS, added assertion
authorBrian Paul <brian.paul@tungstengraphics.com>
Mon, 7 Jul 2008 20:34:30 +0000 (14:34 -0600)
committerBrian Paul <brian.paul@tungstengraphics.com>
Mon, 7 Jul 2008 20:34:30 +0000 (14:34 -0600)
src/egl/main/eglconfig.h

index d12f66245c0a2bb1011709aa8a62193f1b3fcd11..db1c4c10e088210e9f9c13200625a16b7e89257c 100644 (file)
@@ -6,7 +6,7 @@
 #include <GLES/gl.h>
 
 
-#define MAX_ATTRIBS 100
+#define MAX_ATTRIBS 128
 #define FIRST_ATTRIB EGL_BUFFER_SIZE
 
 
@@ -17,7 +17,11 @@ struct _egl_config
 };
 
 
-#define SET_CONFIG_ATTRIB(CONF, ATTR, VAL) ((CONF)->Attrib[(ATTR) - FIRST_ATTRIB] = VAL)
+#define SET_CONFIG_ATTRIB(CONF, ATTR, VAL) \
+   assert((ATTR) - FIRST_ATTRIB < MAX_ATTRIBS); \
+   ((CONF)->Attrib[(ATTR) - FIRST_ATTRIB] = VAL)
+
+
 #define GET_CONFIG_ATTRIB(CONF, ATTR) ((CONF)->Attrib[(ATTR) - FIRST_ATTRIB])