diff options
author | marha <marha@users.sourceforge.net> | 2011-03-02 08:06:29 +0000 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2011-03-02 08:06:29 +0000 |
commit | 56950d7bed70ee82186f44f9333537cdbb33c448 (patch) | |
tree | 92082a5a1556b7ab903a0840cb97e34f23e05d71 /mesalib/src/mesa/vbo/vbo_exec_api.c | |
parent | a18769801e521ccb5a409c377ac0a6a1141f5776 (diff) | |
download | vcxsrv-56950d7bed70ee82186f44f9333537cdbb33c448.tar.gz vcxsrv-56950d7bed70ee82186f44f9333537cdbb33c448.tar.bz2 vcxsrv-56950d7bed70ee82186f44f9333537cdbb33c448.zip |
xkeyboard-config mesa git update 2 Mar 2011
Diffstat (limited to 'mesalib/src/mesa/vbo/vbo_exec_api.c')
-rw-r--r-- | mesalib/src/mesa/vbo/vbo_exec_api.c | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/mesalib/src/mesa/vbo/vbo_exec_api.c b/mesalib/src/mesa/vbo/vbo_exec_api.c index 2f9f3ec7c..fcd544de7 100644 --- a/mesalib/src/mesa/vbo/vbo_exec_api.c +++ b/mesalib/src/mesa/vbo/vbo_exec_api.c @@ -423,7 +423,7 @@ do { \ } while (0) -#define ERROR() _mesa_error( ctx, GL_INVALID_ENUM, __FUNCTION__ ) +#define ERROR(err) _mesa_error( ctx, err, __FUNCTION__ ) #define TAG(x) vbo_##x #include "vbo_attrib_tmp.h" @@ -839,6 +839,19 @@ void vbo_use_buffer_objects(struct gl_context *ctx) } +/** + * If this function is called, all VBO buffers will be unmapped when + * we flush. + * Otherwise, if a simple command like glColor3f() is called and we flush, + * the current VBO may be left mapped. + */ +void +vbo_always_unmap_buffers(struct gl_context *ctx) +{ + struct vbo_exec_context *exec = &vbo_context(ctx)->exec; + exec->begin_vertices_flags |= FLUSH_STORED_VERTICES; +} + void vbo_exec_vtx_init( struct vbo_exec_context *exec ) { @@ -894,6 +907,8 @@ void vbo_exec_vtx_init( struct vbo_exec_context *exec ) } exec->vtx.vertex_size = 0; + + exec->begin_vertices_flags = FLUSH_UPDATE_CURRENT; } @@ -942,7 +957,9 @@ void vbo_exec_BeginVertices( struct gl_context *ctx ) vbo_exec_vtx_map( exec ); assert((ctx->Driver.NeedFlush & FLUSH_UPDATE_CURRENT) == 0); - ctx->Driver.NeedFlush |= FLUSH_UPDATE_CURRENT; + assert(exec->begin_vertices_flags); + + ctx->Driver.NeedFlush |= exec->begin_vertices_flags; } @@ -1045,7 +1062,7 @@ VertexAttrib4f_nopos(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w) if (index < MAX_VERTEX_GENERIC_ATTRIBS) ATTR(VBO_ATTRIB_GENERIC0 + index, 4, x, y, z, w); else - ERROR(); + ERROR(GL_INVALID_VALUE); } void GLAPIENTRY |