Angus Dorbie (dorbie++at++multipass)
Wed, 31 Dec 1997 09:52:16 -0800
> Since I retrieve a pointer to geoset in the app process via a traverser
> I then set the color by making the following calls.
>
> {
> pfVec4 color;
Aha!
This creates the data off the stack, it is created when you make the
call and infact vanishes (well could be reused) when you leave the
routine unless you make it static, so the code is bad even for single
processing mode, it would be OK if this were from main, but here
you are quickly out of the scope of the data.
In MP mode it will never exist in the other processes and will
certainly have different contents. In fact the pointer passed to the
cull & draw is useless in MP mode.
>
> color.set(1.0f, 1.0f, 1.0f, 1.0f);
> geoset->setAttr(PFGS_COLOR4, PFGS_OVERALL,color, NULL);
>
> }
> What else could I do differently?
You need to do something like:
pfVec4 *color;
color = (pfVec4*) new(sizeof(pfVec4), pfGetSharedArena()) pfMemory;
color->set(1.0f, 1.0f, 1.0f, 1.0f);
geoset->setAttr(PFGS_COLOR4, PFGS_OVERALL,color, NULL);
You'd probably also be OK if you created the geoset before the
pfConfig call and never bothered with the pfGetSharedArena(),
if you get the memory off the heap.
>
> I attached the program if you want to run it.
Please, no more big executables :-)
Cheers,Angus.
--
=======================================================================
List Archives, FAQ, FTP: http://www.sgi.com/Technology/Performer/
Submissions: info-performer++at++sgi.com
Admin. requests: info-performer-request++at++sgi.com
This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:56:29 PDT