Changeset 52262 in vbox for trunk/src/VBox/Additions/common/crOpenGL/pack
- Timestamp:
- Aug 4, 2014 12:01:31 PM (11 years ago)
- svn:sync-xref-src-repo-rev:
- 95359
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/VBox-4.3 merged: 95354
- Property svn:mergeinfo changed
-
trunk/src/VBox
- Property svn:mergeinfo changed
/branches/VBox-4.3/src/VBox merged: 95354
- Property svn:mergeinfo changed
-
trunk/src/VBox/Additions/common/crOpenGL/pack/packspu.h
r51650 r52262 162 162 extern void packspuHuge( CROpcode opcode, void *buf ); 163 163 164 extern void packspuInitStrings(); 165 164 166 extern GLboolean packspuSyncOnFlushes(); 165 167 -
trunk/src/VBox/Additions/common/crOpenGL/pack/packspu_context.c
r51559 r52262 595 595 crPackMakeCurrent( window, nativeWindow, serverCtx ); 596 596 597 if (serverCtx) 598 { 599 packspuInitStrings(); 600 } 601 597 602 { 598 603 GET_THREAD(t); -
trunk/src/VBox/Additions/common/crOpenGL/pack/packspu_getstring.c
r42499 r52262 35 35 GetVersionString(void) 36 36 { 37 GLubyte return_value[100]; 38 GLfloat version; 39 40 GetString(GL_VERSION, return_value); 41 CRASSERT(crStrlen((char *)return_value) < 100); 42 43 version = crStrToFloat((char *) return_value); 44 version = crStateComputeVersion(version); 37 static GLboolean fInitialized = GL_FALSE; 38 static GLfloat version = 0.; 39 40 if (!fInitialized) 41 { 42 GLubyte return_value[100]; 43 44 GetString(GL_VERSION, return_value); 45 CRASSERT(crStrlen((char *)return_value) < 100); 46 47 version = crStrToFloat((char *) return_value); 48 version = crStateComputeVersion(version); 49 50 fInitialized = GL_TRUE; 51 } 45 52 46 53 return version; … … 50 57 GetExtensions(void) 51 58 { 52 GLubyte return_value[10*1000]; 53 const GLubyte *extensions, *ext; 54 GET_THREAD(thread); 55 int writeback = 1; 56 57 if (pack_spu.swap) 58 { 59 crPackGetStringSWAP( GL_EXTENSIONS, return_value, &writeback ); 60 } 61 else 62 { 63 crPackGetString( GL_EXTENSIONS, return_value, &writeback ); 64 } 65 packspuFlush( (void *) thread ); 66 67 CRPACKSPU_WRITEBACK_WAIT(thread, writeback); 68 69 CRASSERT(crStrlen((char *)return_value) < 10*1000); 70 71 /* OK, we got the result from the server. Now we have to 72 * intersect is with the set of extensions that Chromium understands 73 * and tack on the Chromium-specific extensions. 74 */ 75 extensions = return_value; 76 ext = crStateMergeExtensions(1, &extensions); 59 static GLboolean fInitialized = GL_FALSE; 60 if (!fInitialized) 61 { 62 GLubyte return_value[10*1000]; 63 const GLubyte *extensions, *ext; 64 GET_THREAD(thread); 65 int writeback = 1; 66 67 if (pack_spu.swap) 68 { 69 crPackGetStringSWAP( GL_EXTENSIONS, return_value, &writeback ); 70 } 71 else 72 { 73 crPackGetString( GL_EXTENSIONS, return_value, &writeback ); 74 } 75 packspuFlush( (void *) thread ); 76 77 CRPACKSPU_WRITEBACK_WAIT(thread, writeback); 78 79 CRASSERT(crStrlen((char *)return_value) < 10*1000); 80 81 /* OK, we got the result from the server. Now we have to 82 * intersect is with the set of extensions that Chromium understands 83 * and tack on the Chromium-specific extensions. 84 */ 85 extensions = return_value; 86 ext = crStateMergeExtensions(1, &extensions); 77 87 78 88 #ifdef Linux 79 /*@todo80 *That's a hack to allow running Unity, it uses libnux which is calling extension functions81 *without checking if it's being supported/exported.82 *glActiveStencilFaceEXT seems to be actually supported but the extension string isn't exported (for ex. on ATI HD4870),83 *which leads to libglew setting function pointer to NULL and crashing Unity.84 */85 sprintf((char*)gpszExtensions, "%s GL_EXT_stencil_two_side", ext);89 /*@todo 90 *That's a hack to allow running Unity, it uses libnux which is calling extension functions 91 *without checking if it's being supported/exported. 92 *glActiveStencilFaceEXT seems to be actually supported but the extension string isn't exported (for ex. on ATI HD4870), 93 *which leads to libglew setting function pointer to NULL and crashing Unity. 94 */ 95 sprintf((char*)gpszExtensions, "%s GL_EXT_stencil_two_side", ext); 86 96 #else 87 sprintf((char*)gpszExtensions, "%s", ext); 88 #endif 97 sprintf((char*)gpszExtensions, "%s", ext); 98 #endif 99 fInitialized = GL_TRUE; 100 } 89 101 90 102 return gpszExtensions; … … 161 173 #ifdef CR_OPENGL_VERSION_2_0 162 174 case GL_SHADING_LANGUAGE_VERSION: 163 GetString(GL_SHADING_LANGUAGE_VERSION, gpszShadingVersion); 175 { 176 static GLboolean fInitialized = GL_FALSE; 177 if (!fInitialized) 178 { 179 GetString(GL_SHADING_LANGUAGE_VERSION, gpszShadingVersion); 180 fInitialized = GL_TRUE; 181 } 164 182 return gpszShadingVersion; 183 } 165 184 #endif 166 185 #ifdef GL_CR_real_vendor_strings … … 179 198 } 180 199 } 200 201 void packspuInitStrings() 202 { 203 static GLboolean fInitialized = GL_FALSE; 204 205 if (!fInitialized) 206 { 207 packspu_GetString(GL_EXTENSIONS); 208 packspu_GetString(GL_VERSION); 209 fInitialized = GL_TRUE; 210 } 211 }
Note:
See TracChangeset
for help on using the changeset viewer.