[info-performer] multiprocessed intersections

New Message Reply Date view Thread view Subject view Author view

From: acanesi++at++ais.it
Date: 06/13/2002 01:58:34


Hi all,
I've tried to use multiprocessed intersections with Performer 2.5.1 Linux,
but it seems that the intersection data allocated with pfAllocIsectData are
not shared between the Isect and the App process: data modified in the
Isect process cannot be read in the App process.
The code I use is based on the example reported in the pfIsectFunc man
page.

typedef struct {
      pfNode* scene;
      int numIntersections;
      pfSeg intersectingSeg;
      pfHits* hits[MAXINTERSECTIONS];
} IsectStuff

void isect(void*arg)
{
      IsectStuff* data = (IsectStuff*)arg;
      pfSegSet segset;

      segset.activeMask = 1;
      segset.isectMask = 0xffffffff;
      segset.discFunc = NULL;
      segset.mode = PFTRAV_IS_PRIM|PFTRAV_IS_NORM;
      segset.segs[0] = data->intersectingSeg;

      data->numIntersections = data->scene->isect(&segset, data->hits);
}

void main( )
{
 .........
      pfMultiprocess(PFMP_APP_CULL_DRAW | PFMP_FORK_ISECT);
      pfConfig();

      pfIsectFunc(isect);
      IsectData*intersections
= (IsectData*)pfAllocIsectData(sizeof(IsectData));
      // init IsectData struct
........
      while (....) {
            .....
            pfSync();
            pfPassIsectData( );

            pfFrame();

            // though in the Isect proc intersections->numIntersections !=
0, in the App proc intersections->numIntersections is never updated
            updateIntersections(intersections);
      }
}

Any suggestion?

Thank you for your help

Alessandra


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Thu Jun 13 2002 - 01:54:02 PDT

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