This was written by Zack Rusin at Tungsten Graphics.
<li>GL_APPLE_vertex_array_object for Gallium drivers and Intel DRI drivers.
<li>GL_ARB_copy_buffer extension (supported in Gallium and swrast drivers)
+<li>rewritten radeon/r200/r300 driver using a buffer manager
+<li>radeon/r200/r300 EXT_framebuffer_object support when used with kernel memory manager
+<li>r300 - support for EXT_vertex_array_bgra/EXT_texture_sRGB
+ <LI>GL_ARB_map_buffer_range extension (supported in Gallium and software drivers)
</ul>
#include "bufferobj.h"
+/* Debug flags */
+/*#define VBO_DEBUG*/
+/*#define BOUNDS_CHECK*/
+
+
#ifdef FEATURE_OES_mapbuffer
- #define DEFAULT_ACCESS GL_WRITE_ONLY;
+ #define DEFAULT_ACCESS GL_MAP_WRITE_BIT
#else
- #define DEFAULT_ACCESS GL_READ_WRITE;
+ #define DEFAULT_ACCESS (GL_MAP_READ_BIT | GL_MAP_WRITE_BIT)
#endif
return GL_FALSE;
}
+#ifdef BOUNDS_CHECK
+ if (bufObj->Access != GL_READ_ONLY_ARB) {
+ GLubyte *buf = (GLubyte *) bufObj->Pointer;
+ GLuint i;
+ /* check that last 100 bytes are still = magic value */
+ for (i = 0; i < 100; i++) {
+ GLuint pos = bufObj->Size - i - 1;
+ if (buf[pos] != 123) {
+ _mesa_warning(ctx, "Out of bounds buffer object write detected"
+ " at position %d (value = %u)\n",
+ pos, buf[pos]);
+ }
+ }
+ }
+#endif
+
#ifdef VBO_DEBUG
- if (bufObj->Access == GL_WRITE_ONLY_ARB) {
+ if (bufObj->AccessFlags & GL_MAP_WRITE_BIT) {
GLuint i, unchanged = 0;
GLubyte *b = (GLubyte *) bufObj->Pointer;
GLint pos = -1;