mesa: call FLUSH_VERTICES() before deleting shaders, buffers, query objects

Need to flush rendering (or at least indicate that the rug might be getting
pulled out from underneath us) when a shader, buffer object or query object
is about to be deleted.

Also, this helps to tell the VBO module to unmap its current vertex buffer.
This commit is contained in:
Brian Paul
2011-03-11 09:25:21 -07:00
parent a4a5d7e0dd
commit 4293a12c7f
3 changed files with 5 additions and 0 deletions

View File

@@ -749,6 +749,7 @@ _mesa_DeleteBuffersARB(GLsizei n, const GLuint *ids)
GET_CURRENT_CONTEXT(ctx); GET_CURRENT_CONTEXT(ctx);
GLsizei i; GLsizei i;
ASSERT_OUTSIDE_BEGIN_END(ctx); ASSERT_OUTSIDE_BEGIN_END(ctx);
FLUSH_VERTICES(ctx, 0);
if (n < 0) { if (n < 0) {
_mesa_error(ctx, GL_INVALID_VALUE, "glDeleteBuffersARB(n)"); _mesa_error(ctx, GL_INVALID_VALUE, "glDeleteBuffersARB(n)");

View File

@@ -218,6 +218,7 @@ _mesa_DeleteQueriesARB(GLsizei n, const GLuint *ids)
GLint i; GLint i;
GET_CURRENT_CONTEXT(ctx); GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END(ctx); ASSERT_OUTSIDE_BEGIN_END(ctx);
FLUSH_VERTICES(ctx, 0);
if (MESA_VERBOSE & VERBOSE_API) if (MESA_VERBOSE & VERBOSE_API)
_mesa_debug(ctx, "glDeleeteQueries(%d)\n", n); _mesa_debug(ctx, "glDeleeteQueries(%d)\n", n);

View File

@@ -1236,6 +1236,7 @@ _mesa_DeleteObjectARB(GLhandleARB obj)
if (obj) { if (obj) {
GET_CURRENT_CONTEXT(ctx); GET_CURRENT_CONTEXT(ctx);
FLUSH_VERTICES(ctx, 0);
if (is_program(ctx, obj)) { if (is_program(ctx, obj)) {
delete_shader_program(ctx, obj); delete_shader_program(ctx, obj);
} }
@@ -1254,6 +1255,7 @@ _mesa_DeleteProgram(GLuint name)
{ {
if (name) { if (name) {
GET_CURRENT_CONTEXT(ctx); GET_CURRENT_CONTEXT(ctx);
FLUSH_VERTICES(ctx, 0);
delete_shader_program(ctx, name); delete_shader_program(ctx, name);
} }
} }
@@ -1264,6 +1266,7 @@ _mesa_DeleteShader(GLuint name)
{ {
if (name) { if (name) {
GET_CURRENT_CONTEXT(ctx); GET_CURRENT_CONTEXT(ctx);
FLUSH_VERTICES(ctx, 0);
delete_shader(ctx, name); delete_shader(ctx, name);
} }
} }