diff options
Diffstat (limited to 'src/mesa/pipe/i965simple/brw_draw_upload.c')
-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 186a6274fa..b2168ab78b 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; |