Re: [info-performer] Deleting model problem , continued.

Date view Thread view Subject view Author view

From: Paolo Farinelli (paolo++at++sgi.com)
Date: 10/17/2005 05:25:59


Hi Chris,

The pfb file format is the recommended format for geomerty
paging in Performer. It is faster to load than flt and most
other formats (if not all).

Regarding the problem you reported, I took a look at the pfb
loader source code (shipped in $PFROOT/src/lib/libpfdb/libpfpfb),
and found the following:

     PFPFB_DLLEXPORT int
     pfdCleanShare_pfb(void)
     {
        tex_list_t *last, *cur, *next;

        cur = tex_list;
        last = NULL;

        while (cur)
        {
            next = cur->next;
            /*
             * Note < 3 because one ref by pfb's texture list and one ref by
             * the pfdShare list.
             */
            if (pfGetRef(cur->tex) < 3)
            {
                pfUnref(cur->tex);
                if (last)
                    last->next = next;
                else
                    tex_list = next;
                free_tex_list_t(cur);
                cur = next;
            }
            else
            {
                last = cur;
                cur = next;
            }
        }

        return pfdCleanShare(pfdGetGlobalShare());
     }

Basically, the pfb loader appears to be adding an extra reference
to its shared textures, (which are also added to the global
pfdShare list).
In order to remove this extra reference, you should try calling
pfdCleanShare_pfb in your code (you will need to link your
program against the libpfpfb library).

However, this does not seem to account for the pfGeoStates you
are not seeing deleted. Please let me know how pfdCleanShare_pfb
affects your test results.

Best Regards,
Paolo

Dorosky, Christopher G <christopher.g.dorosky++at++lmco.com> wrote:

> Found out more about the model deletion problem.
>
> Does not matter if model is added to scene graph or not (ever).
> By converting to pfb, and doing same thing, stilll have texture and
> geostate delete problem.
> If I use the pfdConverterMode (PFPFB_SHARE_GS_OBJECTS, PF_OFF) in pfb
> mode, then everything works fine.
>
> It appears that something is being shared, that I can't get ahold of to
> delete / unshare . I don't want to run that mode, because it will reduce
> run-time performance.
>
> Looking in the global shared list, or channel gstate lists produces
> nothing.
>
> Any hints as to how I can either:
> 1. Override the behavior for flt files just like pfb (not optimal
> solution).
> 2. Figure out how to unshare and delete stuff when I delete the whole
> model.
>
> Thanks,
>
> Chris

-- 
Paolo Farinelli <paolo++at++sgi.com>
OpenGL|Performer - Silicon Graphics Inc.


Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Mon Oct 17 2005 - 05:21:07 PDT