diff options
author | Jerome Glisse <[email protected]> | 2009-08-17 12:46:34 +0200 |
---|---|---|
committer | Jerome Glisse <[email protected]> | 2009-08-17 12:50:27 +0200 |
commit | c952c1f109960a50aebf5a6d6bf3cf1e005e0729 (patch) | |
tree | c5a893641ce02a791e6fbbec6865c7096a332c68 /src/mesa | |
parent | 0204c7d8d712c1023b6d75f2f50b0e89d7777de8 (diff) |
r300: split vbo rendering with big drawarray case
Split vbo rendering when the number of elements requested
by drawarrays is bigger than 65536.
Diffstat (limited to 'src/mesa')
-rw-r--r-- | src/mesa/drivers/dri/r300/r300_render.c | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/src/mesa/drivers/dri/r300/r300_render.c b/src/mesa/drivers/dri/r300/r300_render.c index 369c3edcd09..45330cda3c1 100644 --- a/src/mesa/drivers/dri/r300/r300_render.c +++ b/src/mesa/drivers/dri/r300/r300_render.c @@ -394,12 +394,23 @@ void r300RunRenderPrimitive(GLcontext * ctx, int start, int end, int prim) } } else { - if (num_verts > 65535) { - WARN_ONCE("Fixme: can't handle more then 65535 vertices"); + GLuint first, incr, offset = 0; + + if (!split_prim_inplace(prim & PRIM_MODE_MASK, &first, &incr) && + num_verts > 65500) { + WARN_ONCE("Fixme: can't handle spliting prim %d\n", prim); return; } - r300EmitAOS(rmesa, rmesa->radeon.tcl.aos_count, start); - r300FireAOS(rmesa, num_verts, type); + r300_emit_scissor(rmesa->radeon.glCtx); + while (num_verts > 0) { + int nr; + nr = MIN2(num_verts, 65535); + nr -= (nr - first) % incr; + r300EmitAOS(rmesa, rmesa->radeon.tcl.aos_count, start + offset); + r300FireAOS(rmesa, nr, type); + num_verts -= nr; + offset += nr; + } } COMMIT_BATCH(); } |