summaryrefslogtreecommitdiffstats
path: root/src/mesa/vbo/vbo_save_api.c
diff options
context:
space:
mode:
authorAlan Hourihane <[email protected]>2008-09-11 17:32:18 +0100
committerAlan Hourihane <[email protected]>2008-09-11 17:32:18 +0100
commit47ad296a183929c2007c35c60d722b4ac680417d (patch)
tree62bcc7af01606d32d7f137ccf8f342c9b0a6774a /src/mesa/vbo/vbo_save_api.c
parentb6458225039ef4cf5c91080e7547ed73fb264c46 (diff)
parent4d42c5bebf8740ebfc15571d24b6c92f79e09263 (diff)
Merge branch 'master' of git+ssh://git.freedesktop.org/git/mesa/mesa into gallium-0.2
Conflicts: src/mesa/drivers/dri/i915/intel_ioctl.c src/mesa/main/texstore.c src/mesa/tnl/t_vp_build.c src/mesa/vbo/vbo_exec_draw.c
Diffstat (limited to 'src/mesa/vbo/vbo_save_api.c')
-rw-r--r--src/mesa/vbo/vbo_save_api.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/src/mesa/vbo/vbo_save_api.c b/src/mesa/vbo/vbo_save_api.c
index f62be5c14cf..88d573f1283 100644
--- a/src/mesa/vbo/vbo_save_api.c
+++ b/src/mesa/vbo/vbo_save_api.c
@@ -1,6 +1,6 @@
/**************************************************************************
-Copyright 2002 Tungsten Graphics Inc., Cedar Park, Texas.
+Copyright 2002-2008 Tungsten Graphics Inc., Cedar Park, Texas.
All Rights Reserved.
@@ -68,6 +68,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "main/glheader.h"
+#include "main/bufferobj.h"
#include "main/context.h"
#include "main/dlist.h"
#include "main/enums.h"
@@ -85,6 +86,10 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
#endif
+/* An interesting VBO number/name to help with debugging */
+#define VBO_BUF_ID 12345
+
+
/*
* NOTE: Old 'parity' issue is gone, but copying can still be
* wrong-footed on replay.
@@ -170,7 +175,9 @@ static struct vbo_save_vertex_store *alloc_vertex_store( GLcontext *ctx )
* user. Perhaps there could be a special number for internal
* buffers:
*/
- vertex_store->bufferobj = ctx->Driver.NewBufferObject(ctx, 1, GL_ARRAY_BUFFER_ARB);
+ vertex_store->bufferobj = ctx->Driver.NewBufferObject(ctx,
+ VBO_BUF_ID,
+ GL_ARRAY_BUFFER_ARB);
ctx->Driver.BufferData( ctx,
GL_ARRAY_BUFFER_ARB,
@@ -190,8 +197,9 @@ static void free_vertex_store( GLcontext *ctx, struct vbo_save_vertex_store *ver
{
assert(!vertex_store->buffer);
- if (vertex_store->bufferobj)
- ctx->Driver.DeleteBuffer( ctx, vertex_store->bufferobj );
+ if (vertex_store->bufferobj) {
+ _mesa_reference_buffer_object(ctx, &vertex_store->bufferobj, NULL);
+ }
FREE( vertex_store );
}
@@ -1139,6 +1147,7 @@ void vbo_save_api_init( struct vbo_save_context *save )
_save_vtxfmt_init( ctx );
_save_current_init( ctx );
+ /* These will actually get set again when binding/drawing */
for (i = 0; i < VBO_ATTRIB_MAX; i++)
save->inputs[i] = &save->arrays[i];