- Timestamp:
- Nov 16, 2009 2:06:46 PM (15 years ago)
- Location:
- trunk/src/VBox
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/VBoxGLSupportInfo.cpp
r24188 r24694 525 525 { 526 526 /* error occurred while gl info initialization */ 527 VBOXQGLLOGREL(("2D not supported: gl version info not initialized properly\n")); 527 528 return false; 528 529 } … … 532 533 * no sense to report Video Acceleration supported */ 533 534 if(!mglInfo.isFragmentShaderSupported()) 535 { 536 VBOXQGLLOGREL(("2D not supported: fragment shader unsupported\n")); 534 537 return false; 538 } 535 539 #endif 536 540 if(mglInfo.getMultiTexNumSupported() < 2) 541 { 542 VBOXQGLLOGREL(("2D not supported: multitexture unsupported\n")); 537 543 return false; 544 } 538 545 539 546 /* color conversion now supported only GL_TEXTURE_RECTANGLE … … 541 548 * report as unsupported, TODO: probably should report as supported for stretch acceleration */ 542 549 if(!mglInfo.isTextureRectangleSupported()) 550 { 551 VBOXQGLLOGREL(("2D not supported: texture rectangle unsupported\n")); 543 552 return false; 544 553 } 554 555 VBOXQGLLOGREL(("2D is supported!\n")); 545 556 return true; 546 557 } -
trunk/src/VBox/Main/Makefile.kmk
r24577 r24694 476 476 VBoxTestOGL_DEFS += \ 477 477 $(if $(VBOX_WITH_CROGL), VBOX_WITH_CROGL,) \ 478 $(if $(VBOX_WITH_VIDEOHWACCEL), VBOX_WITH_VIDEOHWACCEL,) 478 $(if $(VBOX_WITH_VIDEOHWACCEL), VBOX_WITH_VIDEOHWACCEL,) \ 479 VBOX_BUILD_TARGET=\"$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH)\" \ 480 $(if $(VBOX_BLEEDING_EDGE),VBOX_BLEEDING_EDGE=\"$(VBOX_BLEEDING_EDGE)\",) 479 481 ifdef VBOX_WITH_VIDEOHWACCEL 480 482 VBoxTestOGL_QT_MODULES += Core Gui OpenGL -
trunk/src/VBox/Main/generic/OpenGLTestApp.cpp
r24339 r24694 37 37 #include <string.h> 38 38 39 #define VBOXGLTEST_WITH_LOGGING 40 41 #ifdef VBOXGLTEST_WITH_LOGGING 42 #include "package-generated.h" 43 44 #include <iprt/log.h> 45 #include <iprt/param.h> 46 #include <iprt/time.h> 47 #include <iprt/system.h> 48 #include <iprt/process.h> 49 #include <iprt/env.h> 50 51 #include <VBox/log.h> 52 #include <VBox/version.h> 53 #endif 54 39 55 #ifdef VBOX_WITH_CROGL 40 56 … … 48 64 static int vboxCheck3DAccelerationSupported() 49 65 { 66 LogRel(("Testing 3D Support:\n")); 50 67 void *spu = crSPULoad(NULL, 0, (char*)"render", NULL, NULL); 51 68 if (spu) 52 69 { 53 70 crSPUUnloadChain(spu); 71 LogRel(("Testing 3D Succeeded!\n")); 54 72 return 0; 55 73 } 74 LogRel(("Testing 3D Failed\n")); 56 75 return 1; 57 76 } … … 65 84 static int vboxCheck2DVideoAccelerationSupported() 66 85 { 86 LogRel(("Testing 2D Support:\n")); 67 87 static int dummyArgc = 1; 68 88 static char * dummyArgv = (char*)"GlTest"; … … 76 96 supportInfo.init(pContext); 77 97 if(supportInfo.isVHWASupported()) 98 { 99 LogRel(("Testing 2D Succeeded!\n")); 78 100 return 0; 79 } 101 } 102 } 103 else 104 { 105 LogRel(("Failed to create gl context\n")); 106 } 107 LogRel(("Testing 2D Failed\n")); 80 108 return 1; 81 109 } 82 83 #endif 84 85 int main(int argc, char **argv) 86 { 87 int rc = 0; 88 89 RTR3Init(); 90 110 #endif 111 112 #ifdef VBOXGLTEST_WITH_LOGGING 113 static int vboxInitLogging(const char *pszFilename) 114 { 115 PRTLOGGER loggerRelease; 116 static const char * const s_apszGroups[] = VBOX_LOGGROUP_NAMES; 117 RTUINT fFlags = RTLOGFLAGS_PREFIX_TIME_PROG; 118 #if defined(RT_OS_WINDOWS) || defined(RT_OS_OS2) 119 fFlags |= RTLOGFLAGS_USECRLF; 120 #endif 121 char szError[RTPATH_MAX + 128] = ""; 122 const char * pszFilenameFmt; 123 RTLOGDEST enmLogDest; 124 if(pszFilename) 125 { 126 pszFilenameFmt = "%s"; 127 enmLogDest = RTLOGDEST_FILE; 128 } 129 else 130 { 131 pszFilenameFmt = NULL; 132 enmLogDest = RTLOGDEST_STDOUT; 133 } 134 135 int vrc = RTLogCreateEx(&loggerRelease, fFlags, "all", 136 "VBOX_RELEASE_LOG", RT_ELEMENTS(s_apszGroups), s_apszGroups, 137 RTLOGDEST_FILE, szError, sizeof(szError), pszFilenameFmt, pszFilename); 138 if (RT_SUCCESS(vrc)) 139 { 140 /* some introductory information */ 141 RTTIMESPEC timeSpec; 142 char szTmp[256]; 143 RTTimeSpecToString(RTTimeNow(&timeSpec), szTmp, sizeof(szTmp)); 144 RTLogRelLogger(loggerRelease, 0, ~0U, 145 "VBoxTestGL %s r%u %s (%s %s) release log\n" 146 #ifdef VBOX_BLEEDING_EDGE 147 "EXPERIMENTAL build " VBOX_BLEEDING_EDGE "\n" 148 #endif 149 "Log opened %s\n", 150 VBOX_VERSION_STRING, RTBldCfgRevision(), VBOX_BUILD_TARGET, 151 __DATE__, __TIME__, szTmp); 152 153 vrc = RTSystemQueryOSInfo(RTSYSOSINFO_PRODUCT, szTmp, sizeof(szTmp)); 154 if (RT_SUCCESS(vrc) || vrc == VERR_BUFFER_OVERFLOW) 155 RTLogRelLogger(loggerRelease, 0, ~0U, "OS Product: %s\n", szTmp); 156 vrc = RTSystemQueryOSInfo(RTSYSOSINFO_RELEASE, szTmp, sizeof(szTmp)); 157 if (RT_SUCCESS(vrc) || vrc == VERR_BUFFER_OVERFLOW) 158 RTLogRelLogger(loggerRelease, 0, ~0U, "OS Release: %s\n", szTmp); 159 vrc = RTSystemQueryOSInfo(RTSYSOSINFO_VERSION, szTmp, sizeof(szTmp)); 160 if (RT_SUCCESS(vrc) || vrc == VERR_BUFFER_OVERFLOW) 161 RTLogRelLogger(loggerRelease, 0, ~0U, "OS Version: %s\n", szTmp); 162 vrc = RTSystemQueryOSInfo(RTSYSOSINFO_SERVICE_PACK, szTmp, sizeof(szTmp)); 163 if (RT_SUCCESS(vrc) || vrc == VERR_BUFFER_OVERFLOW) 164 RTLogRelLogger(loggerRelease, 0, ~0U, "OS Service Pack: %s\n", szTmp); 165 // RTLogRelLogger(loggerRelease, 0, ~0U, "Host RAM: %uMB RAM, available: %uMB\n", 166 // uHostRamMb, uHostRamAvailMb); 167 /* the package type is interesting for Linux distributions */ 168 char szExecName[RTPATH_MAX]; 169 char *pszExecName = RTProcGetExecutableName(szExecName, sizeof(szExecName)); 170 RTLogRelLogger(loggerRelease, 0, ~0U, 171 "Executable: %s\n" 172 "Process ID: %u\n" 173 "Package type: %s" 174 #ifdef VBOX_OSE 175 " (OSE)" 176 #endif 177 "\n", 178 pszExecName ? pszExecName : "unknown", 179 RTProcSelf(), 180 VBOX_PACKAGE_STRING); 181 182 /* register this logger as the release logger */ 183 RTLogRelSetDefaultInstance(loggerRelease); 184 } 185 186 return vrc; 187 } 188 #endif 189 190 static int vboxInitQuietMode() 191 { 91 192 #if !defined(RT_OS_WINDOWS) && !defined(RT_OS_OS2) 92 193 /* This small test application might crash on some hosts. Do never … … 101 202 dup2(fd, STDERR_FILENO); 102 203 #endif 204 return 0; 205 } 206 207 int main(int argc, char **argv) 208 { 209 int rc = 0; 210 211 RTR3Init(); 103 212 104 213 if(argc < 2) … … 115 224 { "--test", 't', RTGETOPT_REQ_STRING }, 116 225 { "-test", 't', RTGETOPT_REQ_STRING }, 226 #ifdef VBOXGLTEST_WITH_LOGGING 227 { "--log", 'l', RTGETOPT_REQ_STRING }, 228 #endif 117 229 { "--help", 'h', RTGETOPT_REQ_NOTHING }, 118 230 }; … … 121 233 rc = RTGetOptInit(&State, argc-1, argv+1, &s_aOptionDefs[0], RT_ELEMENTS(s_aOptionDefs), 0, 0); 122 234 AssertRCReturn(rc, 49); 235 236 #ifdef VBOX_WITH_VIDEOHWACCEL 237 bool bTest2D = false; 238 #endif 239 #ifdef VBOX_WITH_CROGL 240 bool bTest3D = false; 241 #endif 242 #ifdef VBOXGLTEST_WITH_LOGGING 243 bool bLog = false; 244 const char * pLog; 245 #endif 123 246 124 247 for (;;) … … 134 257 if (!strcmp(Val.psz, "3D") || !strcmp(Val.psz, "3d")) 135 258 { 136 rc = vboxCheck3DAccelerationSupported(); 259 bTest3D = true; 260 rc = 0; 137 261 break; 138 262 } … … 141 265 if (!strcmp(Val.psz, "2D") || !strcmp(Val.psz, "2d")) 142 266 { 143 rc = vboxCheck2DVideoAccelerationSupported(); 267 bTest2D = true; 268 rc = 0; 144 269 break; 145 270 } … … 147 272 rc = 1; 148 273 break; 149 274 #ifdef VBOXGLTEST_WITH_LOGGING 275 case 'l': 276 bLog = true; 277 pLog = Val.psz; 278 rc = 0; 279 break; 280 #endif 150 281 case 'h': 151 282 RTPrintf("VirtualBox Helper for testing 2D/3D OpenGL capabilities %u.%u.%u\n" … … 154 285 "\n" 155 286 "Parameters:\n" 156 " --test 2D test for 2D (video) OpenGL capabilities\n" 157 " --test 3D test for 3D OpenGL capabilities\n" 287 #ifdef VBOX_WITH_VIDEOHWACCEL 288 " --test 2D test for 2D (video) OpenGL capabilities\n" 289 #endif 290 #ifdef VBOX_WITH_CROGL 291 " --test 3D test for 3D OpenGL capabilities\n" 292 #endif 293 #ifdef VBOXGLTEST_WITH_LOGGING 294 " --log <log_file_name> log the GL test result to the given file\n" 295 "\n" 296 "Logging can alternatively be enabled by specifying the VBOXGLTEST_LOG=<log_file_name> env variable\n" 297 298 #endif 158 299 "\n", 159 300 RTBldCfgVersionMajor(), RTBldCfgVersionMinor(), RTBldCfgVersionBuild()); … … 171 312 break; 172 313 } 314 315 if(!rc) 316 { 317 #ifdef VBOXGLTEST_WITH_LOGGING 318 if(!bLog) 319 { 320 /* check the VBOXGLTEST_LOG env var */ 321 pLog = RTEnvGet("VBOXGLTEST_LOG"); 322 if(pLog) 323 bLog = true; 324 } 325 if(bLog) 326 rc = vboxInitLogging(pLog); 327 else 328 #endif 329 rc = vboxInitQuietMode(); 330 331 #ifdef VBOX_WITH_CROGL 332 if(!rc && bTest3D) 333 rc = vboxCheck3DAccelerationSupported(); 334 #endif 335 336 #ifdef VBOX_WITH_VIDEOHWACCEL 337 if(!rc && bTest2D) 338 rc = vboxCheck2DVideoAccelerationSupported(); 339 #endif 340 341 } 173 342 } 174 343
Note:
See TracChangeset
for help on using the changeset viewer.