Re: Reference counting...

New Message Reply Date view Thread view Subject view Author view

From: Yair Kurzion (yair++at++polygon.engr.sgi.com)
Date: 12/13/2001 14:21:13


Hello Yves !

> If I load the file 'esprit.flt' (Performer data example) and display the
> pfGeoStates' texture attributes I get the output that there are two
> pfGeoStates in the scene graph which reference textures. One references
> the texture 'license.rgb', the other one 'hubcap.rgb'. The reference
> count of both textures is two. Why is it two and not one? And what else
> is referencing the textures?
>
> Loading the file 'esprit.pfb' (also Performer data example) also leads
> to two pfGeoStates in the scene graph with the same textures as given
> above but the textures' reference counts are both 3. What is the reason
> for this?
>
> I thought that the textures' reference counts must be both one since
> each texture is only referenced by one pfGeoState!?

Your scene graph nodes reference your textures only once. However, some loaders
keep lists of loaded textures. They use these lists for sharing textures when
you load multiple models with the same texture. The pfb loader adds two
ref-counts to each texture.

For textures loaded by the pfb loader:

- You can disable texture sharing completely using
        pfdConverterMode_pfb(PFPFB_SHARE_GS_OBJECTS, PF_OFF).

- If you want your PFB loader to share textures, you can clean the internal
  PFB loader pfTexture list (and decrement the ref counts) by calling
  pfdCleanShare_pfb.

-yair

-- 
\_________  \_____  \__    \__  \_____        
\_________  \_____   \__   \__  \_____         Yair Kurzion
       \__     \__   \____\__      \__         yair++at++sgi.com
       \__          \__  \__                  (650) 933-6502
       \__          \__   \__          
       \__          \__    \__             


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Thu Dec 13 2001 - 14:21:48 PST

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