From: Brian Paul Date: Mon, 15 Jun 2009 22:42:42 +0000 (-0600) Subject: Merge branch 'arb_map_buffer_range' X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=70d247c69bcef4f40b640ae61e9fb9ebc5887bb6;p=mesa.git Merge branch 'arb_map_buffer_range' Conflicts: docs/relnotes-7.6.html src/mesa/main/mtypes.h --- 70d247c69bcef4f40b640ae61e9fb9ebc5887bb6 diff --cc docs/relnotes-7.6.html index f53428fe9fa,ff3ce6469b6..3086dd05672 --- a/docs/relnotes-7.6.html +++ b/docs/relnotes-7.6.html @@@ -38,9 -38,7 +38,10 @@@ tb This was written by Zack Rusin at Tungsten Graphics.
  • GL_APPLE_vertex_array_object for Gallium drivers and Intel DRI drivers.
  • GL_ARB_copy_buffer extension (supported in Gallium and swrast drivers) +
  • rewritten radeon/r200/r300 driver using a buffer manager +
  • radeon/r200/r300 EXT_framebuffer_object support when used with kernel memory manager +
  • r300 - support for EXT_vertex_array_bgra/EXT_texture_sRGB +
  • GL_ARB_map_buffer_range extension (supported in Gallium and software drivers) diff --cc src/mesa/main/bufferobj.c index c04fa691154,6b228810720..ba19e58cdb7 --- a/src/mesa/main/bufferobj.c +++ b/src/mesa/main/bufferobj.c @@@ -39,15 -39,10 +39,15 @@@ #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 @@@ -1168,24 -1208,8 +1231,24 @@@ _mesa_UnmapBufferARB(GLenum target 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;