[osg-users] How to byte-align Vec4Array

2008-07-08 Thread David Spilling
Dear All, Is there an obvious way of aligning the contents of the Vec4Array to 16 byte boundaries? Can I also guarantee that each std::vector entry will be contiguous in memory? i.e. I would like to make sure that array[0].x(), array[1].x() etc. are all on consecutive 16 byte boundaries. (I'm usi

Re: [osg-users] How to byte-align Vec4Array

2008-07-08 Thread Thibault Genessay
Hi David On Tue, Jul 8, 2008 at 11:57 AM, David Spilling <[EMAIL PROTECTED]> wrote: > Dear All, > > Can I also guarantee that each std::vector entry will be > contiguous in memory? Yes, provided that your compiler follows the C++ standard. See http://www.parashift.com/c++-faq-lite/containers.html

Re: [osg-users] How to byte-align Vec4Array

2008-07-08 Thread Gordon Tomlinson
, 2008 5:57 AM To: OpenSceneGraph Users Subject: [osg-users] How to byte-align Vec4Array Dear All, Is there an obvious way of aligning the contents of the Vec4Array to 16 byte boundaries? Can I also guarantee that each std::vector entry will be contiguous in memory? i.e. I would like to make sure

Re: [osg-users] How to byte-align Vec4Array

2008-07-08 Thread David Spilling
Hi Gordon, Thibault, Thanks for the replies regarding the contiguity of the memory in a std::vector. That at least solves half of the problem. > > Use &yourvector[0] to get a float* pointer to the beginning of the > array. How do I define the vec4array so that &yourvector[0] is absolutely alig

Re: [osg-users] How to byte-align Vec4Array

2008-07-08 Thread Judd Tracy
You could use a STL allocator that would allow you to do the alignment, but the question is how do you get that to the vector. There is no way to pass an allocator to the current MixinVector so you are going to have to modify osg to try this. It would be nice if the new MixinVector class and

Re: [osg-users] How to byte-align Vec4Array

2008-07-08 Thread Mathias Fröhlich
Hi, On Tuesday 08 July 2008 11:57, David Spilling wrote: > Is there an obvious way of aligning the contents of the Vec4Array to 16 > byte boundaries? Can I also guarantee that each std::vector entry will be > contiguous in memory? i.e. I would like to make sure that array[0].x(), > array[1].x() e

Re: [osg-users] How to byte-align Vec4Array

2008-07-08 Thread David Spilling
All, I've been OSGing for long enough that perhaps I shouldn't be quite so surprised, but I'm still always a bit amazed about the ready availability of support: Q: "I need to defroogle my impfusculator. Can I do this in OSG?" A: "Yes - see examples/defroogleFusculator.cpp". (Although perhaps its

Re: [osg-users] How to byte-align Vec4Array

2008-07-08 Thread Robert Osfield
Hi Judd, The MixinVector did initially have allocator support, but I had to remove it because it was causing compile problems under one of our supported platforms. Arggg Robert. On Tue, Jul 8, 2008 at 2:34 PM, Judd Tracy <[EMAIL PROTECTED]> wrote: > You could use a STL allocator that would a

Re: [osg-users] How to byte-align Vec4Array

2008-07-08 Thread Mathias Fröhlich
Hi, On Tuesday 08 July 2008 18:48, Robert Osfield wrote: > The MixinVector did initially have allocator support, but I had to > remove it because it was causing compile problems under one of our > supported platforms. Arggg Hmm, put that back. I will try to make that work here. Greetings Ma