From 4844b9fb9d24b119935d540dd345707dd81d9f4a Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Thu, 13 Dec 2007 10:54:31 +0000 Subject: [PATCH] 965: calculate nr enabled vbos on the fly --- src/mesa/pipe/i965simple/brw_draw_upload.c | 11 +++++++---- 1 file 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; -- 2.30.2