Show
Ignore:
Timestamp:
09/22/09 20:45:24 (5 years ago)
Author:
robert
Message:

Preliminary work on support for a texture object pool that is designed to help manage resources down the GPU more tightly.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • OpenSceneGraph/trunk/src/osg/DisplaySettings.cpp

    r10415 r10588  
    8181     
    8282    _application = vs._application; 
     83 
     84    _maxTexturePoolSize = vs._maxTexturePoolSize; 
     85    _maxVBOPoolSize = vs._maxVBOPoolSize; 
     86    _maxFBOPoolSize = vs._maxFBOPoolSize; 
    8387} 
    8488 
     
    104108 
    105109    if (_application.empty()) _application = vs._application; 
     110 
     111    if (vs._maxTexturePoolSize>_maxTexturePoolSize) _maxTexturePoolSize = vs._maxTexturePoolSize; 
     112    if (vs._maxVBOPoolSize>_maxVBOPoolSize) _maxVBOPoolSize = vs._maxVBOPoolSize; 
     113    if (vs._maxFBOPoolSize>_maxFBOPoolSize) _maxFBOPoolSize = vs._maxFBOPoolSize; 
    106114} 
    107115 
     
    148156    _numDatabaseThreadsHint = 2; 
    149157    _numHttpDatabaseThreadsHint = 1; 
     158 
     159    _maxTexturePoolSize = 0; 
     160    _maxVBOPoolSize = 0; 
     161    _maxFBOPoolSize = 0; 
    150162} 
    151163 
     
    187199static ApplicationUsageProxy DisplaySetting_e16(ApplicationUsage::ENVIRONMENTAL_VARIABLE,"OSG_NUM_HTTP_DATABASE_THREADS <int>","Set the hint for the total number of threads dedicated to http requests to set up in the DatabasePager."); 
    188200static ApplicationUsageProxy DisplaySetting_e17(ApplicationUsage::ENVIRONMENTAL_VARIABLE,"OSG_MULTI_SAMPLES <int>","Set the hint for the number of samples to use when multi-sampling."); 
     201static ApplicationUsageProxy DisplaySetting_e18(ApplicationUsage::ENVIRONMENTAL_VARIABLE,"OSG_TEXTURE_POOL_SIZE <int>","Set the hint size of texture pool to manage."); 
     202static ApplicationUsageProxy DisplaySetting_e19(ApplicationUsage::ENVIRONMENTAL_VARIABLE,"OSG_VBO_POOL_SIZE <int>","Set the hint size of vertex buffer object pool to manage."); 
     203static ApplicationUsageProxy DisplaySetting_e20(ApplicationUsage::ENVIRONMENTAL_VARIABLE,"OSG_FBO_POOL_SIZE <int>","Set the hint size of frame buffer object pool to manage."); 
    189204 
    190205void DisplaySettings::readEnvironmentalVariables() 
     
    382397    { 
    383398        _numMultiSamples = atoi(ptr); 
     399    } 
     400 
     401    if( (ptr = getenv("OSG_TEXTURE_POOL_SIZE")) != 0) 
     402    { 
     403        _maxTexturePoolSize = atoi(ptr); 
     404    } 
     405 
     406    if( (ptr = getenv("OSG_VBO_POOL_SIZE")) != 0) 
     407    { 
     408        _maxVBOPoolSize = atoi(ptr); 
     409    } 
     410 
     411    if( (ptr = getenv("OSG_FBO_POOL_SIZE")) != 0) 
     412    { 
     413        _maxFBOPoolSize = atoi(ptr); 
    384414    } 
    385415} 
     
    469499    while(arguments.read("--num-db-threads",_numDatabaseThreadsHint)) {} 
    470500    while(arguments.read("--num-http-threads",_numHttpDatabaseThreadsHint)) {} 
    471 } 
     501 
     502    while(arguments.read("--texture-pool-size",_maxTexturePoolSize)) {} 
     503    while(arguments.read("--vbo-pool-size",_maxVBOPoolSize)) {} 
     504    while(arguments.read("--fbo-pool-size",_maxFBOPoolSize)) {} 
     505 
     506} 
     507 
     508 
     509