From: Paolo Farinelli (paolo++at++sgi.com)
Date: 01/17/2006 02:39:08
Hi Georgios,
It should be possible to create any valid combination of
composited and single (plain) pipes.
From the code you posted, it is not exactly clear (to me)
how the problems you described are happening..
I would suggest you run some tests with the --compositor
and -M5 (or -M6) options in perfly. For example,
perfly --compositor 0,vs,p=0.2,p=:0.3,p=:0.4,p=:0.5 \
-M6,p=:0.0,c=0,p=0.1 tux.pfb
should set up a 3-pipe-panoramic display with pipe-0 on
the left, compositor-0 (set up with four input pipes) in
the middle, and pipe-1 on the right.
Assuming this works, you can look at perfly's source code
to see exactly how this is done. Essentially:
1. call pfMultipipe with the TOTAL number of pipes (ie all
single pipes plus all composited master and slave pipes)
2. Bear in mind that composited pipes will occupy the first
positions in performer's pipe-list, and all single pipes
will need to use the last pfPipes in performer's list.
3. Explicitely specify display targets by calling
pfPipe::setWSConnectionName on all single-pipes.
In the example I provided above, perfly will call
setWSConnectionName for the last two pipes only (pfGetPipe(4)
and pfGetPipe(5), corresponding to the two single-pipes),
and directing their output to displays ":0.0" and ":0.1"
respectively. pfPipes 0-3 should be automatically configured
by the pfCompositor class, during pfConfig.
The following snippet of code from generic.c seems to be
most relevant:
> else if( ViewState->numPanoramicElts > 0)
> {
> int i, n = ViewState->numPanoramicElts;
> int numCompPipes = pfGetNumCompositedPipes();
>
> for (i=0; i<n; i++)
> {
> PanoramicDisplayElt *elt = &(ViewState->panoramicDisplayElt[i]);
> if (elt->type == SINGLE_PIPE_DISPLAY_ELT)
> {
> ViewState->pipe[i] = pfGetPipe( numCompPipes + elt->id );
> pfPipeWSConnectionName(ViewState->pipe[i], elt->pipe_name);
> }
> else if (elt->type == HW_COMPOSITOR_DISPLAY_ELT)
> {
> pfCompositor* comp = elt->compositor;
> ViewState->pipe[i] = pfGetCompositorMasterPipe(comp);
>
> if (i == ViewState->master_pipe_index)
> pfCompositorChannelClipped(comp, 0, PF_OFF);
> }
> }
> }
Please let me know if you are seeing problems with composited perfly,
or if you need further help with compositor configuration in your app.
Best Regards,
Paolo
-- Paolo Farinelli <paolo++at++sgi.com> OpenGL|Performer - Silicon Graphics Inc.On Mon, 16 Jan 2006 16:45:14 +0200, Georgios Papaioannou <gepap++at++fhw.gr> wrote:
> We have the following Prism configuration: > > Output 0 -> Single pipe > Output 1 -> Single pipe > Output 2 -| > Output 3 -|-> Composited pipe (1 compositor, id 0, netid 0) > Output 4 -| > Output 5 -| > > When I setup Performer for multipipe operation without the compositor ( > pfMultipipe(6) ), I can get every pipe from 0 through 5 and open a window > and a channel normally. > > If I instantiate a pfCompositor object ( pfCompositor *cmp = new > pfCompositor() ), I cannot obtain any pipe other than 0, which seems to > correspond to the compositor, even though I have requested the pipe with > pfGetPipe(X) and not cmp->getMasterPipe(). > > pfMultipipe(6) reports pfPipe 4,5 has no screen (seems like it only > recognizes compositor pipes after the pfCompositor instantiation). > > For any id of a requested pipe greater than 0, I get a garbled output on > the > corresponding composited pipe and the application malfunctions > > The behavior is identical if I try to open 2 pipes, one composited > (through > pfCompositor->getMasterPipe() ) and one through pfGetPipe(X). > > Is it possible that composited outputs cannot coexist with normal > outputs? > > > Georgios Papaioannou, > VR engineer, > Foundation of the Hellenic World, Greece > > -------------------- > Here is the small initialization code fragment I have used for testing: > > #include <stdlib.h> > #include <Performer/pf.h> > #include <Performer/pfutil.h> > #include <Performer/pfdu.h> > > int > main (int argc, char *argv[]) > { > float t = 0.0f; > pfScene *scene; > pfNode *root; > pfPipe *p; > pfPipe *p2; > pfPipeWindow *pw; > pfPipeWindow *pw2; > pfChannel *chan; > pfChannel *chan2; > pfSphere bsphere; > int numofcomp=-1,compid=-1; > pfCompositor* compositor; > int cur_mode = -1; > int n,i; > > if (argc < 2) exit -1; > > pfInit(); > numofcomp = pfGetNumHWCompositors(); > compid = pfGetHWCompositorNetworkId(0); > > pfMultiprocess( PFMP_DEFAULT ); > pfdInitConverter(argv[1]); > pfMultipipe(6); > > compositor = pfNewCompositor(compid); > > pfConfig(); > > pfFilePath(".:/usr/share/Performer/data"); > root = pfdLoadFile(argv[1]); > scene = pfNewScene(); > pfAddChild(scene, root); > pfAddChild(scene, pfNewLSource()); > pfGetNodeBSphere (root, &bsphere); > > p = pfGetPipe(0); > // p = pfGetCompositorMasterPipe(compositor); > pw = pfNewPWin(p); > pfPWinType(pw, PFPWIN_TYPE_X); > pfPWinName(pw, "Composited?"); > pfPWinOriginSize(pw, 100,100,512,512); > pfOpenPWin(pw); > chan = pfNewChan(p); > pfChanScene(chan, scene); > pfChanFOV(chan, 45.0f, 0.0f); > pfChanStatsMode(chan, PFCSTATS_DRAW, PFSTATS_ALL); > pfChanNearFar(chan, 1.0f, 10.0f * bsphere.radius); > > /* > p2 = pfGetPipe(0); > pw2 = pfNewPWin(p2); > pfPWinType(pw2, PFPWIN_TYPE_X); > pfPWinName(pw2, "Plain"); > pfPWinOriginSize(pw2, 100,100,512,512); > pfOpenPWin(pw2); > chan2 = pfNewChan(p2); > pfChanScene(chan2, scene); > pfChanFOV(chan2, 45.0f, 0.0f); > pfChanStatsMode(chan2, PFCSTATS_DRAW, PFSTATS_ALL); > pfChanNearFar(chan2, 1.0f, 10.0f * bsphere.radius); > */ > > while (t < 10) > { > pfCoord view; > float s, c; > pfSync(); > pfFrame(); > t = pfGetTime(); > pfSinCos(45.0f*t, &s, &c); > pfSetVec3(view.hpr, 45.0f*t, -10.0f, 0); > pfSetVec3(view.xyz, 2.0f * bsphere.radius * s, -2.0f * > bsphere.radius *c, 0.5f * bsphere.radius); > pfChanView(chan, view.xyz, view.hpr); > // pfChanView(chan2, view.xyz, view.hpr); > } > > pfExit(); > return 0; > } >
This archive was generated by hypermail 2b29 : Tue Jan 17 2006 - 02:32:49 PST