Re: Sharing Texture memory

New Message Reply Date view Thread view Subject view Author view

Sharon Clay (src++at++rose.asd.sgi.com)
Sat, 7 Dec 1996 13:01:27 -0800


+>---- On Dec 3, 6:23pm, Chehayeb, Nassouh wrote:
> Subject: Sharing Texture memory
->X-Mailer: Microsoft Exchange Server Internet Mail Connector Version 4.0.837.3
->
->Hi Performer's,
->
-> I use one pipeline (pfPipe) and two pfPipeWindow to draw the same scene
->(pfScene). I download the scene texture list on each window
->sequentially. It seems that the latest textures override the first one.
->
-> I would like to know how I can share the hardware texture memory
->between the windows.

As Steve Baker pointed out, you can do this. OpenGL lets you share texture
objects and GL display lists between graphics contexts (and windows)
in a process share group (meaning the windows have to be of the same pfPipe
as you are doing). We did not have windows of a pfPipe share these states
by default in Performer 2.0 or 2.1 but probably will in the future.

This sharing of GL objects must be declared at the time that a graphics
context is created (ie. when a window is opened).

Add this line of code to your window creation section for each window (before
pfPWinConfig():

    pfPWinShare(pwin[i], PFWIN_SHARE_GL_CXT | PFWIN_SHARE_STATE_BIT | PFWIN_SHARE_GL_OBJS);
if (i)
    pfAttachPWin(pwin[0], pwin[i]);

Also, on IMPACT, you will need the latest IMPACT patch (1447)
for state sharing to work. Maybe Guy can confirm that I have this correct.

Given all this, let me point out that there will still be some penalty paid
(probaby on the order of 1 msec) for switching between the multiple windows
as you draw so be sure you want the functionality that you are paying for and
can't get away with using multiple viewports in a single window.
A common reason for using multiple windows is for GUI - in which case,
it is worth it to have extra logic to not update a window if it is not dirty.
If the window is managed by Performer and drawn with a pfChannel, you will need
to turn off the channel draw traversal mask (pfChanTravMask()) to make sure that we
don't touch the window.

src.

-- 
-----{-----{---++at++   -----{----{---++at++   -----{----{---++at++   -----{----{---++at++
Sharon Rose Clay (Fischler) - Silicon Graphics, Advanced Systems Dev.
src++at++sgi.com  (415) 933 - 1002  FAX: (415) 965 - 2658  MS 8U-590
-----{-----{---++at++   -----{----{---++at++   -----{----{---++at++   -----{----{---++at++
=======================================================================
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:54:06 PDT

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