Re: pfuTextureManager

New Message Reply Date view Thread view Subject view Author view

Don Burns (don_burns++at++peru.engr.sgi.com)
Mon, 26 Apr 1999 11:47:54 -0700 (PDT)


On Apr 20, 1:54pm, Dorosky, Christopher G wrote:
> Subject: pfuTextureManager
> Hello,
>
> I trying to find a way to reliably measure texture memory.
>
> Does pfuTextureManager work for:
> 1) Cliptextures
> 2) Textures not applied by the texture manager, but made known by
> pfuTextureManager->AddTexList? (spelling / capitalization may be wrong)
>
> I am trying to get an inventory of what is in texture memory. This seems to
> be a lot harder than it should be. All calls to pfuTextureManager show 0 or
> 64MB.
>
> I have tried pfuMakeSceneTexList, and pfuGetTexSize. What is the most
> reliable way of getting the TOTAL texture memory used?
>
> Chris Dorosky
> Lockheed Martin Vought Systems
> 972-603-2349
> -----------------------------------------------------------------------

Sorry for the delay in responding to this. Hope the response is still
relevant.

> Does pfuTextureManager work for:
> 1) Cliptextures

No it does not. pfuTextureManager manages lists of pfTextures and does not
have any notion of a ClipTexture.

> 2) Textures not applied by the texture manager, but made known by
> pfuTextureManager->AddTexList? (spelling / capitalization may be wrong)

By definition, texture not applied will not be resident in texture memory
(unless by accident - see note in pfuTextureManager man page referring to the
use of default textures).

> > I am trying to get an inventory of what is in texture memory. This seems to
> > be a lot harder than it should be. All calls to pfuTextureManager show 0 or
> > 64MB.

This is a bit confusing to me as I just tested this and it seemed to work fine.
 Perhaps there is something that is not understood in the usage.

Apply the following exercise. Copy the
/usr/share/Performer/src/pguide/libpfutil directory somewhere and make texman.
 Run with :

        % setenv PFPATH /usr/share/Performer/data
        % texman /usr/share/Performer/data/*.sv

The 'm' key will print a report of resident and non-resident textures that the
texture manager is managing. It also includes a total byte count and
percentage of texture memory used. The 'k' key will cycle through the various
models.

If you want to query these values directly, change lines reading:

    if( shared->reportLevel )
        {
                printf( "\033[0;0H PrintLevel %d\n\n", shared->reportLevel );
        shared->texMan->Print( shared->reportLevel );
        }

to:

    if( shared->reportLevel )
    {
        printf( "\033[0;0H PrintLevel %d\n\n", shared->reportLevel );
        //shared->texMan->Print( shared->reportLevel );
        printf( "Texture Memory available : %d bytes\n",
                              shared->texMan->getTextureMemoryAvailable() );
        printf( "Texture Memory used : %d bytes\n",
                              shared->texMan->getTextureMemoryUsed() );
        printf( "Texture Memory used : %8.4f %%\n",
                              shared->texMan->getTextureMemoryUsedPercent() );
    }

The expected values should print.

Barring all of that, if you just want to know if a texture is resident, just
call

        pfTexture->isLoaded().

-don


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b2 on Mon Apr 26 1999 - 11:48:29 PDT

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