Re: Setting color of Geosets in MultiProcess mode??

New Message Reply Date view Thread view Subject view Author view

Angus Dorbie (dorbie++at++multipass)
Wed, 31 Dec 1997 09:52:16 -0800


On Dec 31, 11:39am, Scott Brabson wrote:
> Subject: Re: Re: Setting color of Geosets in MultiProcess mode??
> This is a multi-part message in MIME format.
>

> 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

New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:56:29 PDT

This message has been cleansed for anti-spam protection. Replace '++at++' in any mail addresses with the '@' symbol.