I managed to get the vtxfmt path enabled and fixed a small problem that
didn't show up when vtxfmt wasn't enabled. Flightgear performance
increased only marginally since it draws most of its geometry using
vertex arrays which is a vtxfmt fallback. I was able improve the
situation by not installing radeon_fallback_DrawArrays but
_tnl_DrawArrays in the radeon vtxfmt api. This way, the tnl function is
used for submitting the vertex array, but the data is submitted through
the still installed radeon vtxfmt api. Now the frame rate in CPU bounded
situations (--visibility=100000 --geometry=640x480) has almost doubled.
:)

I attached a patch (mostly a hack).

Now there is still a bad interaction with the save API that I havn't
tracked down yet. You get a failed assertion with tuxracer or torcs for
example:

tuxracer: t_save_api.c:1182: _save_NotifyBegin: Assertion `i < tnl->save.prim_max' 
failed.
 
Program received signal SIGABRT, Aborted.
[Switching to Thread 16384 (LWP 20472)]
0x40480a51 in kill () from /lib/libc.so.6
(gdb) bt
#0  0x40480a51 in kill () from /lib/libc.so.6
#1  0x4027c24b in pthread_kill () from /lib/libpthread.so.0
#2  0x4027c521 in raise () from /lib/libpthread.so.0
#3  0x40481986 in abort () from /lib/libc.so.6
#4  0x4047aae9 in __assert_fail () from /lib/libc.so.6
#5  0x408e5b69 in _save_NotifyBegin (ctx=0x82c96c8, mode=6)
    at t_save_api.c:1193
#6  0x4082aaf2 in save_Begin (mode=6) at dlist.c:4876

Any ideas?

Regards,
  Felix

On Wed, 31 Dec 2003 11:59:10 +0100
Felix K�hling <[EMAIL PROTECTED]> wrote:

> On Wed, 31 Dec 2003 00:00:17 +0100
> Jacek Pop <[EMAIL PROTECTED]> wrote:
> 
> > On Tue, Dec 30, 2003 at 09:38:21PM +0100, Felix K�hling wrote:
> > > And I found out that apperently the entire vtxfmt code path is not working. 
> > 
> > Was it working before "newmesa"?
> 
> I'm not sure. Looking at an old config-0-0-1-branch working copy I still
> have lying around here it seems that Driver.NotifyBegin was called with
> older versions of mesa:
> 
> [EMAIL PROTECTED]:[...]/extras/Mesa/src/tnl$ grep Driver.NotifyBegin *.c
> t_eval_api.c:      NotifyBegin = tnl->Driver.NotifyBegin;
> t_eval_api.c:      tnl->Driver.NotifyBegin = 0;
> t_eval_api.c:      tnl->Driver.NotifyBegin = NotifyBegin;
> t_eval_api.c:      NotifyBegin = tnl->Driver.NotifyBegin;
> t_eval_api.c:      tnl->Driver.NotifyBegin = 0;
> t_eval_api.c:      tnl->Driver.NotifyBegin = NotifyBegin;
> t_imm_api.c:      tnl->Driver.NotifyBegin &&
> t_imm_api.c:      tnl->Driver.NotifyBegin( ctx, mode )) {
> 
> Maybe this would give us an idea where to call this driver hook in
> newmesa. In newmesa a recursive grep for Driver.NotifyBegin doesn't
> find anything.
> 
> > 
> > -- 
> > Free Software - find interesting programs and change them
> > NetHack - meet interesting creatures, kill them and eat their bodies
> > Usenet - meet interesting people from all over the world and flame them
> > Decopter - unrealistic helicopter simulator, get it from http://decopter.sf.net
> 
> 
> ------------    __\|/__    ___     ___       -------------------------
>  Felix       ___\_e -_/___/ __\___/ __\_____   You can do anything,
>    K�hling  (_____\�/____/ /_____/ /________)  just not everything
>  [EMAIL PROTECTED]       \___/   \___/   U        at the same time.
> 
> 
> -------------------------------------------------------
> This SF.net email is sponsored by: IBM Linux Tutorials.
> Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
> Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
> Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
> --
> _______________________________________________
> Dri-devel mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/dri-devel
> 


------------    __\|/__    ___     ___       -------------------------
 Felix       ___\_e -_/___/ __\___/ __\_____   You can do anything,
   K�hling  (_____\�/____/ /_____/ /________)  just not everything
 [EMAIL PROTECTED]       \___/   \___/   U        at the same time.

--- ./radeon_vtxfmt.c.~1.4.~    2003-11-24 16:21:16.000000000 +0100
+++ ./radeon_vtxfmt.c   2004-01-02 02:46:46.000000000 +0100
@@ -711,7 +711,7 @@
 }
 
 
-static void radeonVtxfmtValidate( GLcontext *ctx )
+void radeonVtxfmtValidate( GLcontext *ctx )
 {
    radeonContextPtr rmesa = RADEON_CONTEXT( ctx );
 
@@ -962,7 +962,8 @@
     * These should call NotifyBegin(), as should _tnl_EvalMesh, to allow
     * a driver-hook.
     */
-   vfmt->DrawArrays = radeon_fallback_DrawArrays;
+   /*vfmt->DrawArrays = radeon_fallback_DrawArrays;*/
+   vfmt->DrawArrays = _tnl_DrawArrays;
    vfmt->DrawElements = radeon_fallback_DrawElements;
    vfmt->DrawRangeElements = radeon_fallback_DrawRangeElements; 
 
@@ -999,6 +1000,14 @@
    vfmt->MultiTexCoord4fvARB = radeon_fallback_MultiTexCoord4fvARB;
    vfmt->Vertex4f = radeon_fallback_Vertex4f;
    vfmt->Vertex4fv = radeon_fallback_Vertex4fv;
+   vfmt->VertexAttrib1fNV  = radeon_fallback_VertexAttrib1fNV;
+   vfmt->VertexAttrib1fvNV = radeon_fallback_VertexAttrib1fvNV;
+   vfmt->VertexAttrib2fNV  = radeon_fallback_VertexAttrib2fNV;
+   vfmt->VertexAttrib2fvNV = radeon_fallback_VertexAttrib2fvNV;
+   vfmt->VertexAttrib3fNV  = radeon_fallback_VertexAttrib3fNV;
+   vfmt->VertexAttrib3fvNV = radeon_fallback_VertexAttrib3fvNV;
+   vfmt->VertexAttrib4fNV  = radeon_fallback_VertexAttrib4fNV;
+   vfmt->VertexAttrib4fvNV = radeon_fallback_VertexAttrib4fvNV;
 
    (void)radeon_fallback_vtxfmt;
 
--- ./radeon_state.c.~1.6.~     2003-12-28 16:03:34.000000000 +0100
+++ ./radeon_state.c    2004-01-02 02:58:38.000000000 +0100
@@ -2107,6 +2107,7 @@
 }
 
 
+void radeonVtxfmtValidate( GLcontext *ctx );
 static void radeonInvalidateState( GLcontext *ctx, GLuint new_state )
 {
    _swrast_InvalidateState( ctx, new_state );
@@ -2116,6 +2117,8 @@
    _ae_invalidate_state( ctx, new_state );
    RADEON_CONTEXT(ctx)->NewGLState |= new_state;
    radeonVtxfmtInvalidate( ctx );
+   if (RADEON_CONTEXT(ctx)->vb.vtxfmt.Begin)
+       radeonVtxfmtValidate( ctx );
 }
 
 

Reply via email to