On Mar 25, 2006, at 5:06 PM, Frank Condello wrote:
so all 3 floats have the same operation performed? so vecb
{xa1,ya1,za1,xa2,ya2,za3,...} + veca{xb1,yb1,zb1,xb2,yb2,zb2} =
{xa1+xb1,ya1+yb1,za1+zb1,xa2+xb2,ya2+yb2,za2+zb2} ?
Yup.
if so, option 2 will likely be *much* faster than scalar math in
rb loops.
I'm talking about plugin code exclusively - we've already given up
on vector array math in Rb ;)
sure, it might not be much faster than a plugin, but it will still
likely be on par. my time tests on similar vectorized code
usually shows a 10x speed increase.
This may be worth investigating further in that case...
What I envision are generic memoryblock extensions that can be
mapped to vDSP functions where appropriate e.g.:
blockResult.VecAdd( blockA, blockB, vecSize, [start], [end] )
This VecAdd extension would add each member of blockA and blockB
and store the result in blockResult. vecSize would be the number of
members in each vector, and start/end would be optional byte
offsets within the blocks (if end is omitted then sized blocks are
expected, and will be processed from start to block.Size-1).
These methods would assume each member is a 4 byte float. Given
this, the plugin can check if vecSize is 4 members and pass the
data to vDSP wholesale, or decide to work on a padded copy, or just
do the math itself.
VecAdd, VecSub, and VecMult (vec*scalar) methods would be enough to
be useful, but more exotic combinations (VecAddMult) and Matrix
methods (VecMultMat4x4) plus Double precision versions (VecAddD)
would help flesh it out ;)
I intended to do this myself at some point but my current game
project doesn't use mesh animation so it's not an immediate
concern. I'd certainly be happy to see someone else take this on in
the meantime.
well, i've done exactly this for mac osx. does anyone have a simple
test doing this the old scalar way that they can send me? i'll shoe
horn my vdsp classes in, and we can get some quantifiable numbers.
prefereably some simple example where we can compare fps between the
two methods. (i'm not up enough on rb3d to do this, otherwise i
might take a crack at it, but i'd love to show you guys what i've
been doing with veclib).
mike
--
Mike Woodworth
mike at divergentmedia dot com
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>
|