r200: Fix emit size prediction to account elt splitting.
authorPauli Nieminen <suokkos@gmail.com>
Sun, 21 Mar 2010 21:23:21 +0000 (23:23 +0200)
committerPauli Nieminen <suokkos@gmail.com>
Sun, 21 Mar 2010 21:39:55 +0000 (23:39 +0200)
Emit sizes prediction didn't account for render splitting in
hwtnl path.

src/mesa/drivers/dri/r200/r200_cmdbuf.c
src/mesa/drivers/dri/r200/r200_tcl.c

index 382ae0daa4fc2a0228094e388f596676c5a3a2b2..ad43a8ca9203e3fb4422c8833848ec241bb26ea7 100644 (file)
@@ -190,7 +190,7 @@ void r200FlushElts(GLcontext *ctx)
      radeonReturnDmaRegion(&rmesa->radeon, R200_ELT_BUF_SZ - elt_used);
 
    if (radeon_is_debug_enabled(RADEON_SYNC, RADEON_CRITICAL)
-       && !rmesa->radeon.radeonScreen->kernel_mm) {
+         && !rmesa->radeon.radeonScreen->kernel_mm) {
       radeon_print(RADEON_SYNC, RADEON_NORMAL, "%s: Syncing\n", __FUNCTION__);
       radeonFinish( rmesa->radeon.glCtx );
    }
index f52e4fe91770c3d69ae74cd2e75a9b885f570e74..d43e14581e931faa03cc3eb30bd398731e5ef78b 100644 (file)
@@ -404,8 +404,9 @@ static GLuint r200EnsureEmitSize( GLcontext * ctx , GLubyte* vimap_rev )
          rendering code may decide convert to elts.
         In that case we have to make pessimistic prediction.
         and use larger of 2 paths. */
-      const GLuint elts = ELTS_BUFSZ(nr_aos);
-      const GLuint index = INDEX_BUFSZ;
+      const GLuint elt_count =(VB->Primitive[i].count/GET_MAX_HW_ELTS() + 1);
+      const GLuint elts = ELTS_BUFSZ(nr_aos) * elt_count;
+      const GLuint index = INDEX_BUFSZ * elt_count;
       const GLuint vbuf = VBUF_BUFSZ;
       if ( (!VB->Elts && VB->Primitive[i].count >= MAX_CONVERSION_SIZE)
          || vbuf > index + elts)