summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/bufferobj.c
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2004-09-27 16:19:17 +0000
committerBrian Paul <[email protected]>2004-09-27 16:19:17 +0000
commit293ad985103ceab90c126236af2f75617fce6b2b (patch)
treed6093d3b648c2f0e8914c22de848384303641c8e /src/mesa/main/bufferobj.c
parente60c9311daeba49fcc221da82c29b35558ffc6ab (diff)
VBO RefCount fix (David Reveman)
Diffstat (limited to 'src/mesa/main/bufferobj.c')
-rw-r--r--src/mesa/main/bufferobj.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/mesa/main/bufferobj.c b/src/mesa/main/bufferobj.c
index 84af8158ad2..0d0e5f4bcfd 100644
--- a/src/mesa/main/bufferobj.c
+++ b/src/mesa/main/bufferobj.c
@@ -539,41 +539,50 @@ _mesa_DeleteBuffersARB(GLsizei n, const GLuint *ids)
if (ctx->Array.Vertex.BufferObj == bufObj) {
bufObj->RefCount--;
ctx->Array.Vertex.BufferObj = ctx->Array.NullBufferObj;
+ ctx->Array.NullBufferObj->RefCount++;
}
if (ctx->Array.Normal.BufferObj == bufObj) {
bufObj->RefCount--;
ctx->Array.Normal.BufferObj = ctx->Array.NullBufferObj;
+ ctx->Array.NullBufferObj->RefCount++;
}
if (ctx->Array.Color.BufferObj == bufObj) {
bufObj->RefCount--;
ctx->Array.Color.BufferObj = ctx->Array.NullBufferObj;
+ ctx->Array.NullBufferObj->RefCount++;
}
if (ctx->Array.SecondaryColor.BufferObj == bufObj) {
bufObj->RefCount--;
ctx->Array.SecondaryColor.BufferObj = ctx->Array.NullBufferObj;
+ ctx->Array.NullBufferObj->RefCount++;
}
if (ctx->Array.FogCoord.BufferObj == bufObj) {
bufObj->RefCount--;
ctx->Array.FogCoord.BufferObj = ctx->Array.NullBufferObj;
+ ctx->Array.NullBufferObj->RefCount++;
}
if (ctx->Array.Index.BufferObj == bufObj) {
bufObj->RefCount--;
ctx->Array.Index.BufferObj = ctx->Array.NullBufferObj;
+ ctx->Array.NullBufferObj->RefCount++;
}
if (ctx->Array.EdgeFlag.BufferObj == bufObj) {
bufObj->RefCount--;
ctx->Array.EdgeFlag.BufferObj = ctx->Array.NullBufferObj;
+ ctx->Array.NullBufferObj->RefCount++;
}
for (j = 0; j < MAX_TEXTURE_UNITS; j++) {
if (ctx->Array.TexCoord[j].BufferObj == bufObj) {
bufObj->RefCount--;
ctx->Array.TexCoord[j].BufferObj = ctx->Array.NullBufferObj;
+ ctx->Array.NullBufferObj->RefCount++;
}
}
for (j = 0; j < VERT_ATTRIB_MAX; j++) {
if (ctx->Array.VertexAttrib[j].BufferObj == bufObj) {
bufObj->RefCount--;
ctx->Array.VertexAttrib[j].BufferObj = ctx->Array.NullBufferObj;
+ ctx->Array.NullBufferObj->RefCount++;
}
}