X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fmesa%2Fvbo%2Fvbo_exec_draw.c;h=5bf3d836db57224b8bc11d45ccc12cdc2c613e93;hb=a7d9fde24cb8ecc59b0a6fc610135d851806295b;hp=7ec431a237694770771cb14768dbc6a994c330a8;hpb=a8d1521f30766b6a4707aa9966e1f2f9c0b3ac00;p=mesa.git diff --git a/src/mesa/vbo/vbo_exec_draw.c b/src/mesa/vbo/vbo_exec_draw.c index 7ec431a2376..5bf3d836db5 100644 --- a/src/mesa/vbo/vbo_exec_draw.c +++ b/src/mesa/vbo/vbo_exec_draw.c @@ -150,6 +150,7 @@ static void vbo_exec_bind_arrays( GLcontext *ctx ) GLubyte *data = exec->vtx.buffer_map; const GLuint *map; GLuint attr; + GLbitfield varying_inputs = 0x0; /* Install the default (ie Current) attributes first, then overlay * all active ones. @@ -200,7 +201,6 @@ static void vbo_exec_bind_arrays( GLcontext *ctx ) /* Ptr into ordinary app memory */ arrays[attr].Ptr = (void *) data; } - arrays[attr].Size = exec->vtx.attrsz[src]; arrays[attr].StrideB = exec->vtx.vertex_size * sizeof(GLfloat); arrays[attr].Stride = exec->vtx.vertex_size * sizeof(GLfloat); @@ -212,8 +212,11 @@ static void vbo_exec_bind_arrays( GLcontext *ctx ) arrays[attr]._MaxElement = count; /* ??? */ data += exec->vtx.attrsz[src] * sizeof(GLfloat); + varying_inputs |= 1<Driver.UnmapBuffer(ctx, target, exec->vtx.bufferobj); - exec->vtx.buffer_map = NULL; + if (ctx->NewState) + _mesa_update_state( ctx ); + + /* if using a real VBO, unmap it before drawing */ + if (exec->vtx.bufferobj->Name) { + ctx->Driver.UnmapBuffer(ctx, target, exec->vtx.bufferobj); + exec->vtx.buffer_map = NULL; + } vbo_context(ctx)->draw_prims( ctx, exec->vtx.inputs, @@ -254,11 +263,12 @@ void vbo_exec_vtx_flush( struct vbo_exec_context *exec ) 0, exec->vtx.vert_count - 1); - /* Get new data: - */ - ctx->Driver.BufferData(ctx, target, size, NULL, usage, exec->vtx.bufferobj); - exec->vtx.buffer_map - = ctx->Driver.MapBuffer(ctx, target, access, exec->vtx.bufferobj); + /* If using a real VBO, get new storage */ + if (exec->vtx.bufferobj->Name) { + ctx->Driver.BufferData(ctx, target, size, NULL, usage, exec->vtx.bufferobj); + exec->vtx.buffer_map = + ctx->Driver.MapBuffer(ctx, target, access, exec->vtx.bufferobj); + } } }