diff options
author | Keith Whitwell <keith@tungstengraphics.com> | 2007-12-13 10:54:31 +0000 |
---|---|---|
committer | Keith Whitwell <keith@tungstengraphics.com> | 2007-12-13 15:37:18 +0000 |
commit | 4844b9fb9d24b119935d540dd345707dd81d9f4a (patch) | |
tree | e2867cc826f838e995a9df78731a4dde29610eac /src/mesa | |
parent | da89104c576b5b7a0c581a018a8b1c2d770e13c2 (diff) |
965: calculate nr enabled vbos on the fly
Diffstat (limited to 'src/mesa')
-rw-r--r-- | src/mesa/pipe/i965simple/brw_draw_upload.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/mesa/pipe/i965simple/brw_draw_upload.c b/src/mesa/pipe/i965simple/brw_draw_upload.c index 186a6274fa4..b2168ab78b9 100644 --- a/src/mesa/pipe/i965simple/brw_draw_upload.c +++ b/src/mesa/pipe/i965simple/brw_draw_upload.c @@ -207,18 +207,21 @@ static unsigned get_index_type(int type) boolean brw_upload_vertex_buffers( struct brw_context *brw ) { struct brw_array_state vbp; + unsigned nr_enabled = 0; unsigned i; - int nr_enabled = brw->vb.last_vb + 1; memset(&vbp, 0, sizeof(vbp)); /* This is a hardware limit: */ - if (nr_enabled >= BRW_VEP_MAX) - return FALSE; - for (i = 0; i < nr_enabled; i++) + for (i = 0; i < BRW_VEP_MAX; i++) { + if (brw->vb.vbo_array[i] == NULL) { + nr_enabled = i; + break; + } + vbp.vb[i].vb0.bits.pitch = brw->vb.vbo_array[i].pitch; vbp.vb[i].vb0.bits.pad = 0; vbp.vb[i].vb0.bits.access_type = BRW_VERTEXBUFFER_ACCESS_VERTEXDATA; |