src/video/cocoa/SDL_cocoaopengl.m
changeset 7108 732d2cac80c0
parent 7085 152cc7ddfa57
child 7152 e9ed46195235
equal deleted inserted replaced
7107:2fcf7bf1d2b2 7108:732d2cac80c0
   190         SDL_SetError ("Failed creating OpenGL context");
   190         SDL_SetError ("Failed creating OpenGL context");
   191         [pool release];
   191         [pool release];
   192         return NULL;
   192         return NULL;
   193     }
   193     }
   194 
   194 
   195     /*
       
   196      * Wisdom from Apple engineer in reference to UT2003's OpenGL performance:
       
   197      *  "You are blowing a couple of the internal OpenGL function caches. This
       
   198      *  appears to be happening in the VAO case.  You can tell OpenGL to up
       
   199      *  the cache size by issuing the following calls right after you create
       
   200      *  the OpenGL context.  The default cache size is 16."    --ryan.
       
   201      */
       
   202 
       
   203     #ifndef GLI_ARRAY_FUNC_CACHE_MAX
       
   204     #define GLI_ARRAY_FUNC_CACHE_MAX 284
       
   205     #endif
       
   206 
       
   207     #ifndef GLI_SUBMIT_FUNC_CACHE_MAX
       
   208     #define GLI_SUBMIT_FUNC_CACHE_MAX 280
       
   209     #endif
       
   210 
       
   211     {
       
   212         GLint cache_max = 64;
       
   213         CGLContextObj ctx = [context CGLContextObj];
       
   214         CGLSetParameter (ctx, GLI_SUBMIT_FUNC_CACHE_MAX, &cache_max);
       
   215         CGLSetParameter (ctx, GLI_ARRAY_FUNC_CACHE_MAX, &cache_max);
       
   216     }
       
   217 
       
   218     /* End Wisdom from Apple Engineer section. --ryan. */
       
   219 
       
   220     [pool release];
   195     [pool release];
   221 
   196 
   222     if ( Cocoa_GL_MakeCurrent(_this, window, context) < 0 ) {
   197     if ( Cocoa_GL_MakeCurrent(_this, window, context) < 0 ) {
   223         Cocoa_GL_DeleteContext(_this, context);
   198         Cocoa_GL_DeleteContext(_this, context);
   224         return NULL;
   199         return NULL;