[ODE] Problem's when profiling graphics engine

Kyle Hubert khubert at gmail.com
Tue Dec 12 13:37:40 MST 2006


On 12/12/06, Jon Watte (ODE) <hplus-ode at mindcontrol.org> wrote:
> It has nothing to do with handedness; it has to do with in-memory
> representation (row major vs column major).
>
> If this takes 40% of your time, then you are memory bound. While there
> are transposed-matrix extensions, chances are, using those extensions
> will only push the problem elsewhere.

I must be memory bound then.

> Also: is this 40% of the SYSTEM performance, or 40% of your APP
> performance? If it's of your app, and the app takes 5% of the system
> (the rest being spent in, say, the GL driver), then even if this
> function ran infinitely fast, you would only gain 2% overall performance.

According to the profiling and the rdtsc tick counting, if this
function ran infinitely fast I would gain 5% overall performance. I
was talking about this taking 40% of my app time excluding ODE and GL,
this was just from listening to gprof. I'm trying to get that extra 5%
performance and give it all back to ODE.

Can ODE store matrices in memory in GL order instead of DirectX order?
Can we make a compile time option?

-Kyle









>
> Cheers,
>
>           / h+
>
>
> Andreas Fredriksson wrote:
> > On 12/12/06, Kyle Hubert <khubert at gmail.com> wrote:
> >
> >> I'm profiling my application and got interesting results. This is my
> >> worst funtion and eating 40% of my time:
> >>
> >> /* Convert ODE's rotation matrix and pos into a GL matrix */
> >> void convert_ode_to_gl(float *m, const float *p, const float *r) {
> >>   m[0] = r[0]; m[4] = r[1]; m[8]  = r[2];  m[12] = p[0];
> >>   m[1] = r[4]; m[5] = r[5]; m[9]  = r[6];  m[13] = p[1];
> >>   m[2] = r[8]; m[6] = r[9]; m[10] = r[10]; m[14] = p[2];
> >>   m[3] = 0;    m[7] = 0;    m[11] = 0;     m[15] = 1;
> >> }
> >>
> >>
> >
> > Looks like you're transposing ODE's matrices to change handedness
> > before uploading them to OpenGL? If so, I would recommend you look in
> > the the OpenGL extension (standard in 1.5 IIRC) that lets you upload
> > transposed matrices instead. Many GL drivers can do clever things with
> > that anyway so you don't have to :-)
> >
> > http://oss.sgi.com/projects/ogl-sample/registry/ARB/transpose_matrix.txt
> >
> > HTH, Andreas
> >
> >
>


More information about the ODE mailing list