diff options
author | Keith Whitwell <keith@tungstengraphics.com> | 2007-02-16 20:06:45 +0000 |
---|---|---|
committer | Keith Whitwell <keith@tungstengraphics.com> | 2007-02-16 20:06:45 +0000 |
commit | 682fdd9462485562e3534293a12ccebc41d3c3ed (patch) | |
tree | 3de0f898602a68db9f5cf9dc7a72eff9fcd21287 | |
parent | 8f128b2f34539051a2925cee7c023578946c015b (diff) |
Fix thinko trying to remap buffer objects immediately after use.
Would like a way to keep a buffer object mapped in the situation where
it is being stuffed with vertices incrementally.
-rw-r--r-- | src/mesa/drivers/dri/i915tex/intel_idx_render.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/mesa/drivers/dri/i915tex/intel_idx_render.c b/src/mesa/drivers/dri/i915tex/intel_idx_render.c index decd5d98f7..b5b57c399f 100644 --- a/src/mesa/drivers/dri/i915tex/intel_idx_render.c +++ b/src/mesa/drivers/dri/i915tex/intel_idx_render.c @@ -54,7 +54,7 @@ -#define MAX_VBO 16 /* XXX: make dynamic */ +#define MAX_VBO 32 /* XXX: make dynamic */ #define VBO_SIZE (128*1024) @@ -236,9 +236,9 @@ static void *get_space( struct intel_vb *vb, GLuint nr, GLuint vertex_size ) void *ptr; GLuint space = nr * vertex_size * 4; - DBG("%s %d %d\n", __FUNCTION__, nr, vertex_size); + DBG("%s %d*%d, vbo %d\n", __FUNCTION__, nr, vertex_size, vb->nr_vbo); - if (vb->current_vbo_used + space > vb->current_vbo_size) + if (vb->current_vbo_used + space > vb->current_vbo_size || !vb->current_vbo_ptr) get_next_vbo( vb, space ); if (vb->vertex_size != vertex_size) { @@ -248,6 +248,8 @@ static void *get_space( struct intel_vb *vb, GLuint nr, GLuint vertex_size ) } if (!vb->current_vbo_ptr) { + DBG("%s map vbo %d\n", __FUNCTION__, vb->nr_vbo); + /* Map the vbo now, will be unmapped in release_current_vbo, above. */ vb->current_vbo_ptr = ctx->Driver.MapBuffer( ctx, @@ -366,11 +368,12 @@ static void emit_prims( GLcontext *ctx, OUT_BATCH( (offset + indices[start+j]) ); ADVANCE_BATCH(); + + /* This won't fail, but only because of the wierd emit above: + */ + assert(!vb->dirty); } - /* This won't fail, but only because of the wierd emit above: - */ - assert(!vb->dirty); DBG("%s - done\n", __FUNCTION__); } |