diff options
author | Jacek Antonelli | 2008-08-15 23:44:50 -0500 |
---|---|---|
committer | Jacek Antonelli | 2008-08-15 23:44:50 -0500 |
commit | 89fe5dab825a62a0e3fd8d248cbc91c65eb2a426 (patch) | |
tree | bcff14b7888d04a2fec799c59369f6095224bd08 /linden/indra/newview/llfeaturemanager.cpp | |
parent | Second Life viewer sources 1.13.3.2 (diff) | |
download | meta-impy-89fe5dab825a62a0e3fd8d248cbc91c65eb2a426.zip meta-impy-89fe5dab825a62a0e3fd8d248cbc91c65eb2a426.tar.gz meta-impy-89fe5dab825a62a0e3fd8d248cbc91c65eb2a426.tar.bz2 meta-impy-89fe5dab825a62a0e3fd8d248cbc91c65eb2a426.tar.xz |
Second Life viewer sources 1.14.0.0
Diffstat (limited to '')
-rw-r--r-- | linden/indra/newview/llfeaturemanager.cpp | 343 |
1 files changed, 23 insertions, 320 deletions
diff --git a/linden/indra/newview/llfeaturemanager.cpp b/linden/indra/newview/llfeaturemanager.cpp index 061b343..c0fd96b 100644 --- a/linden/indra/newview/llfeaturemanager.cpp +++ b/linden/indra/newview/llfeaturemanager.cpp | |||
@@ -156,7 +156,7 @@ BOOL LLFeatureList::maskList(LLFeatureList &mask) | |||
156 | } | 156 | } |
157 | 157 | ||
158 | #if 0 && !LL_RELEASE_FOR_DOWNLOAD | 158 | #if 0 && !LL_RELEASE_FOR_DOWNLOAD |
159 | llinfos << "After appling mask " << mask.mName << llendl; | 159 | llinfos << "After applying mask " << mask.mName << llendl; |
160 | dump(); | 160 | dump(); |
161 | #endif | 161 | #endif |
162 | return TRUE; | 162 | return TRUE; |
@@ -208,12 +208,12 @@ BOOL LLFeatureManager::loadFeatureTables() | |||
208 | data_path += FEATURE_TABLE_FILENAME; | 208 | data_path += FEATURE_TABLE_FILENAME; |
209 | 209 | ||
210 | 210 | ||
211 | char name[MAX_STRING+1]; | 211 | char name[MAX_STRING+1]; /*Flawfinder: ignore*/ |
212 | 212 | ||
213 | llifstream file; | 213 | llifstream file; |
214 | U32 version; | 214 | U32 version; |
215 | 215 | ||
216 | file.open(data_path.c_str()); | 216 | file.open(data_path.c_str()); /*Flawfinder: ignore*/ |
217 | 217 | ||
218 | if (!file) | 218 | if (!file) |
219 | { | 219 | { |
@@ -235,12 +235,12 @@ BOOL LLFeatureManager::loadFeatureTables() | |||
235 | LLFeatureList *flp = NULL; | 235 | LLFeatureList *flp = NULL; |
236 | while (!file.eof()) | 236 | while (!file.eof()) |
237 | { | 237 | { |
238 | char buffer[MAX_STRING]; | 238 | char buffer[MAX_STRING]; /*Flawfinder: ignore*/ |
239 | name[0] = 0; | 239 | name[0] = 0; |
240 | 240 | ||
241 | file >> name; | 241 | file >> name; |
242 | 242 | ||
243 | if (strlen(name) >= 2 && | 243 | if (strlen(name) >= 2 && /*Flawfinder: ignore*/ |
244 | name[0] == '/' && | 244 | name[0] == '/' && |
245 | name[1] == '/') | 245 | name[1] == '/') |
246 | { | 246 | { |
@@ -249,7 +249,7 @@ BOOL LLFeatureManager::loadFeatureTables() | |||
249 | continue; | 249 | continue; |
250 | } | 250 | } |
251 | 251 | ||
252 | if (strlen(name) == 0) | 252 | if (strlen(name) == 0) /*Flawfinder: ignore*/ |
253 | { | 253 | { |
254 | // This is a blank line | 254 | // This is a blank line |
255 | file.getline(buffer, MAX_STRING); | 255 | file.getline(buffer, MAX_STRING); |
@@ -295,7 +295,6 @@ BOOL LLFeatureManager::loadFeatureTables() | |||
295 | } | 295 | } |
296 | } | 296 | } |
297 | file.close(); | 297 | file.close(); |
298 | //flp->dump(); | ||
299 | 298 | ||
300 | return TRUE; | 299 | return TRUE; |
301 | } | 300 | } |
@@ -314,7 +313,7 @@ void LLFeatureManager::loadGPUClass() | |||
314 | 313 | ||
315 | llifstream file; | 314 | llifstream file; |
316 | 315 | ||
317 | file.open(data_path.c_str()); | 316 | file.open(data_path.c_str()); /*Flawfinder: ignore*/ |
318 | 317 | ||
319 | if (!file) | 318 | if (!file) |
320 | { | 319 | { |
@@ -330,12 +329,12 @@ void LLFeatureManager::loadGPUClass() | |||
330 | 329 | ||
331 | while (!file.eof()) | 330 | while (!file.eof()) |
332 | { | 331 | { |
333 | char buffer[MAX_STRING]; | 332 | char buffer[MAX_STRING]; /*Flawfinder: ignore*/ |
334 | buffer[0] = 0; | 333 | buffer[0] = 0; |
335 | 334 | ||
336 | file.getline(buffer, MAX_STRING); | 335 | file.getline(buffer, MAX_STRING); |
337 | 336 | ||
338 | if (strlen(buffer) >= 2 && | 337 | if (strlen(buffer) >= 2 && /*Flawfinder: ignore*/ |
339 | buffer[0] == '/' && | 338 | buffer[0] == '/' && |
340 | buffer[1] == '/') | 339 | buffer[1] == '/') |
341 | { | 340 | { |
@@ -343,7 +342,7 @@ void LLFeatureManager::loadGPUClass() | |||
343 | continue; | 342 | continue; |
344 | } | 343 | } |
345 | 344 | ||
346 | if (strlen(buffer) == 0) | 345 | if (strlen(buffer) == 0) /*Flawfinder: ignore*/ |
347 | { | 346 | { |
348 | // This is a blank line | 347 | // This is a blank line |
349 | continue; | 348 | continue; |
@@ -360,7 +359,7 @@ void LLFeatureManager::loadGPUClass() | |||
360 | continue; | 359 | continue; |
361 | } | 360 | } |
362 | 361 | ||
363 | for (U32 i = 0; i < strlen(expr); i++) | 362 | for (U32 i = 0; i < strlen(expr); i++) /*Flawfinder: ignore*/ |
364 | { | 363 | { |
365 | expr[i] = tolower(expr[i]); | 364 | expr[i] = tolower(expr[i]); |
366 | } | 365 | } |
@@ -380,10 +379,11 @@ void LLFeatureManager::loadGPUClass() | |||
380 | llinfos << "GPU is " << label << llendl; | 379 | llinfos << "GPU is " << label << llendl; |
381 | mGPUString = label; | 380 | mGPUString = label; |
382 | mGPUClass = (S32) strtol(cls, NULL, 10); | 381 | mGPUClass = (S32) strtol(cls, NULL, 10); |
382 | file.close(); | ||
383 | return; | ||
383 | } | 384 | } |
384 | } | 385 | } |
385 | file.close(); | 386 | file.close(); |
386 | //flp->dump(); | ||
387 | 387 | ||
388 | llwarns << "Couldn't match GPU to a class: " << gGLManager.getRawGLString() << llendl; | 388 | llwarns << "Couldn't match GPU to a class: " << gGLManager.getRawGLString() << llendl; |
389 | } | 389 | } |
@@ -401,11 +401,7 @@ void LLFeatureManager::initCPUFeatureMasks() | |||
401 | { | 401 | { |
402 | maskFeatures("RAM256MB"); | 402 | maskFeatures("RAM256MB"); |
403 | } | 403 | } |
404 | else if (gSysMemory.getPhysicalMemory() <= 512*1024*1024) | 404 | |
405 | { | ||
406 | //maskFeatures("RAM512MB"); | ||
407 | } | ||
408 | |||
409 | if (gSysCPU.getMhz() < 1100) | 405 | if (gSysCPU.getMhz() < 1100) |
410 | { | 406 | { |
411 | maskFeatures("CPUSlow"); | 407 | maskFeatures("CPUSlow"); |
@@ -468,7 +464,11 @@ void LLFeatureManager::initGraphicsFeatureMasks() | |||
468 | } | 464 | } |
469 | if (gGLManager.mIsIntel) | 465 | if (gGLManager.mIsIntel) |
470 | { | 466 | { |
471 | maskFeatures("Brookdale"); | 467 | maskFeatures("Intel"); |
468 | } | ||
469 | if (gGLManager.mGLVersion < 1.5f) | ||
470 | { | ||
471 | maskFeatures("OpenGLPre15"); | ||
472 | } | 472 | } |
473 | 473 | ||
474 | if (gGLManager.mIsMobilityRadeon9000) | 474 | if (gGLManager.mIsMobilityRadeon9000) |
@@ -483,303 +483,6 @@ void LLFeatureManager::initGraphicsFeatureMasks() | |||
483 | 483 | ||
484 | extern LLOSInfo gSysOS; | 484 | extern LLOSInfo gSysOS; |
485 | 485 | ||
486 | |||
487 | BOOL bad_hardware_dialog(const LLString &info_str, const LLString &url) | ||
488 | { | ||
489 | if (!gSavedSettings.getWarning("AboutBadPCI")) | ||
490 | { | ||
491 | return FALSE; | ||
492 | } | ||
493 | |||
494 | // XUI:translate | ||
495 | std::string msg = llformat( | ||
496 | "[SECOND_LIFE] has detected that there may be a problem with.\n" | ||
497 | "hardware or drivers on your computer. Often resolving these\n" | ||
498 | "issues can result in enhanced stability and performance.\n" | ||
499 | " \n" | ||
500 | "%s\n" | ||
501 | " \n" | ||
502 | "Would you like to view a web page with more detailed\n" | ||
503 | "information on this problem?\n", info_str.c_str()); | ||
504 | |||
505 | // Warn them that runnin without DirectX 9 will | ||
506 | // not allow us to tell them about driver issues | ||
507 | S32 button = OSMessageBox(msg.c_str(), | ||
508 | "Warning", | ||
509 | OSMB_YESNO); | ||
510 | if (OSBTN_YES== button) | ||
511 | { | ||
512 | llinfos << "User quitting after detecting bad drivers" << llendl; | ||
513 | spawn_web_browser(url.c_str()); | ||
514 | return TRUE; | ||
515 | } | ||
516 | else | ||
517 | { | ||
518 | // Don't warn about bad PCI stuff again, they've clicked past it. | ||
519 | gSavedSettings.setWarning("AboutBadPCI", FALSE); | ||
520 | } | ||
521 | return FALSE; | ||
522 | } | ||
523 | |||
524 | BOOL LLFeatureManager::initPCIFeatureMasks() | ||
525 | { | ||
526 | #if LL_WINDOWS | ||
527 | BOOL exit_after_bad = FALSE; | ||
528 | |||
529 | BOOL is_2000 = FALSE; | ||
530 | BOOL is_xp = FALSE; | ||
531 | |||
532 | if (gSysOS.mMajorVer != 5) | ||
533 | { | ||
534 | // Unknown windows version number, exit!" | ||
535 | llwarns << "Unknown Windows major version " << gSysOS.mMajorVer << ", aborting detection!" << llendl; | ||
536 | return FALSE; | ||
537 | } | ||
538 | if (gSysOS.mMinorVer == 0) | ||
539 | { | ||
540 | is_2000 = TRUE; | ||
541 | } | ||
542 | else if (gSysOS.mMinorVer == 1) | ||
543 | { | ||
544 | is_xp = TRUE; | ||
545 | } | ||
546 | else | ||
547 | { | ||
548 | llwarns << "Unknown Windows minor version " << gSysOS.mMinorVer << ", aborting detection!" << llendl; | ||
549 | return FALSE; | ||
550 | } | ||
551 | |||
552 | // This only works on Win32, as it relies on DX9 hardware detection | ||
553 | // The PCI masks are actually the inverse of the normal masks | ||
554 | // We actually look through the masks,and see if any hardware matches it. | ||
555 | // This is because the masks encode logic about | ||
556 | |||
557 | // Check for the broken AMD AGP controllers (751, 761, 762) | ||
558 | |||
559 | // Horrible cruddy fixed lookup table. | ||
560 | // Figure out what OS we're on, the version numbers are different. Sigh... | ||
561 | |||
562 | LLDXDriverFile *dfilep = NULL; | ||
563 | LLDXDevice *devp = NULL; | ||
564 | |||
565 | // AMD(1022) AGP controllers | ||
566 | // 7007 AMD-751 AGP Controller | ||
567 | // 700F AMD-761 AGP Controller | ||
568 | // 700D AMD-762 AGP Controller | ||
569 | devp = gDXHardware.findDevice("VEN_1022", "DEV_7007|DEV_700F|DEV_700D"); | ||
570 | if (devp) | ||
571 | { | ||
572 | // We're just pretty much screwed here, there are big problems with this hardware | ||
573 | // We've got trouble with the most recent nVidia drivers. Check for this and warn. | ||
574 | |||
575 | // Note: Need to detect that we're running with older nVidia hardware, probably | ||
576 | exit_after_bad |= bad_hardware_dialog("AMD AGP Controller", | ||
577 | AMD_AGP_URL); | ||
578 | } | ||
579 | |||
580 | // VIA(1106) AGP Controllers | ||
581 | // These need upgrading on both Win2K and WinXP | ||
582 | // | ||
583 | // 8305 VT8363/8365 CPU to AGP - Apollo KT133/KM133 | ||
584 | // 8598 VT82C598MVP/694X CPU to AGP - Apollo MVP3/Pro133A | ||
585 | // 8605 VT8605 CPU to AGP - Apollo PM133 | ||
586 | // B091 VT8633 CPU to AGP - Apollo Pro 266 | ||
587 | // B099 VT8366/A/T CPU to AGP - Apollo KT266/A/333 | ||
588 | // B168 VT8235 CPU to AGP (AGP 2.0/3.0) - ProSavageDDR P4X333 chipset | ||
589 | // B188 VT8237 CPU to AGP (AGP 2.0/3.0) - K8T800 | ||
590 | // B198 VT8237 CPU to AGP (AGP 2.0/3.0) - ProSavageDDR P4X600 chipset | ||
591 | |||
592 | devp = gDXHardware.findDevice("VEN_1106", | ||
593 | "DEV_8305|DEV_8598|DEV_8605|DEV_B091|" | ||
594 | "DEV_B099|DEV_B168|DEV_B188|DEV_B198"); | ||
595 | if (devp) | ||
596 | { | ||
597 | BOOL out_of_date = FALSE; | ||
598 | // Wanted driver: VIAAGP1.SYS | ||
599 | // Version Format: M.mm.0000.vvvv | ||
600 | // M.mm - Major/minor OS version (5.0 for Win2000, 5.1 for WinXP) | ||
601 | // vvvv - driver version number | ||
602 | // | ||
603 | // Notes: | ||
604 | // 3442 is most recent as of 2/25/04, probably want at least 3430 (seems to be a common version) | ||
605 | |||
606 | // These are DELIBERATE assignments inside if statements, blech. | ||
607 | if (dfilep = devp->findDriver("pci.sys")) | ||
608 | { | ||
609 | // Old driver: pci.sys | ||
610 | // Version: 5.01.2600.xxxx | ||
611 | // | ||
612 | // Notes: | ||
613 | // Default WinXP driver for B168, B198? | ||
614 | |||
615 | // Old driver: pci.sys | ||
616 | // Version: 5.01.2195.xxxx | ||
617 | // | ||
618 | // Notes: | ||
619 | // Default Win2K driver for 8305? | ||
620 | |||
621 | llwarns << "Detected pci.sys" << llendl; | ||
622 | write_debug("Old driver (pci.sys) for VIA detected!"); | ||
623 | out_of_date = TRUE; | ||
624 | } | ||
625 | else if (dfilep = devp->findDriver("VIAAGP.SYS")) | ||
626 | { | ||
627 | // Old driver: VIAAGP.SYS | ||
628 | // Version: 5.01.2600.xxxx | ||
629 | // | ||
630 | // Notes: | ||
631 | // Default WinXP driver for B09x? | ||
632 | |||
633 | llwarns << "Detected VIAAGP.SYS" << llendl; | ||
634 | write_debug("Old driver (VIAAGP.SYS) for VIA detected!"); | ||
635 | out_of_date = TRUE; | ||
636 | } | ||
637 | else if (dfilep = devp->findDriver("VIAAGP1.SYS")) | ||
638 | { | ||
639 | if (dfilep->mVersion.getField(3) < 3430) | ||
640 | { | ||
641 | // They're using a pretty old version of the VIA AGP drivers | ||
642 | // Maybe they want to upgrade? | ||
643 | llwarns << "Detected VIAAGP1.SYS" << llendl; | ||
644 | write_debug("Old driver (VIAAGP1.SYS) for VIA detected!"); | ||
645 | out_of_date = TRUE; | ||
646 | } | ||
647 | } | ||
648 | if (out_of_date) | ||
649 | { | ||
650 | exit_after_bad |= bad_hardware_dialog("Out of date VIA AGP chipset driver", | ||
651 | VIA_URL); | ||
652 | } | ||
653 | } | ||
654 | |||
655 | // Intel(8086) AGP controllers (Win2K) | ||
656 | // These particular controllers only may need drivers on Win2K | ||
657 | // | ||
658 | // 1A31 82845[MP|MZ] Processor to AGP Controller | ||
659 | // 2532 82850/860 Processor to AGP Controller | ||
660 | if (is_2000) | ||
661 | { | ||
662 | devp = gDXHardware.findDevice("VEN_8086", | ||
663 | "DEV_1A31"); | ||
664 | if (devp) | ||
665 | { | ||
666 | if (dfilep = devp->findDriver("pci.sys")) | ||
667 | { | ||
668 | // Old driver: pci.sys | ||
669 | // Version 5.01.21[9|6]5.xxxx | ||
670 | // | ||
671 | // Notes: | ||
672 | // Default driver for Win2K? Not sure what the "correct" driver is - | ||
673 | // maybe some variant of AGP440.SYS? | ||
674 | llwarns << "Detected pci.sys" << llendl; | ||
675 | write_debug("Old driver (pci.sys) for Intel 82845/850 on Win2K detected!"); | ||
676 | exit_after_bad |= bad_hardware_dialog("Out of date Intel chipset driver", | ||
677 | INTEL_CHIPSET_URL); | ||
678 | } | ||
679 | } | ||
680 | } | ||
681 | |||
682 | /* Removed 4/3/2006 by JC | ||
683 | After talking with Doug, we don't know what the proper driver | ||
684 | and/or version number should be for Intel 865. Regardless, this | ||
685 | code would _always_ complain if you had that chipset. | ||
686 | |||
687 | // Intel(8086) AGP controllers (All) | ||
688 | // These particular controllers may need drivers on both Win2K and WinXP | ||
689 | // | ||
690 | // 2561 82845G/GL/GE/PE/GV Processor to AGP Controller | ||
691 | // 2571 82865G/PE/P/GV/28248P Processor to AGP Controller | ||
692 | devp = gDXHardware.findDevice("VEN_8086", | ||
693 | "DEV_2571"); | ||
694 | if (devp) | ||
695 | { | ||
696 | // Wanted driver: AGP440.SYS(?) | ||
697 | // | ||
698 | // Notes: | ||
699 | // Not sure, need to verify with an actual 82865/75 (Dell 8300?) | ||
700 | |||
701 | // Old driver: pci.sys | ||
702 | // Version 5.01.21[9|6]5.xxxx | ||
703 | // | ||
704 | // Notes: | ||
705 | // Default driver for Win2K? Not sure what the "correct" driver is - | ||
706 | // maybe some variant of AGP440.SYS? | ||
707 | exit_after_bad |= bad_hardware_dialog("Out of date Intel chipset driver", | ||
708 | INTEL_CHIPSET_URL); | ||
709 | } | ||
710 | */ | ||
711 | |||
712 | |||
713 | // SiS(1039) AGP controllers (All) | ||
714 | // These particular controllers may need drivers on both Win2K and WinXP | ||
715 | // | ||
716 | // 0001 SiS 530 | ||
717 | // 0002 SiS SG86C202(???) | ||
718 | // 0003 SiS 648FX | ||
719 | devp = gDXHardware.findDevice("VEN_1039", | ||
720 | "DEV_0001|DEV_0002|DEV_0003"); | ||
721 | if (devp) | ||
722 | { | ||
723 | BOOL out_of_date = FALSE; | ||
724 | // Wanted driver: SISAGPX.SYS | ||
725 | // | ||
726 | // Notes: | ||
727 | // Not sure, need to verify with an actual 82865/75 (Dell 8300?) | ||
728 | |||
729 | // Old driver: pci.sys | ||
730 | // Version 5.01.21[9|6]5.xxxx | ||
731 | // | ||
732 | // Notes: | ||
733 | // Default driver for Win2K? Not sure what the "correct" driver is - | ||
734 | // maybe some variant of AGP440.SYS? | ||
735 | if (dfilep = devp->findDriver("pci.sys")) | ||
736 | { | ||
737 | // Old driver: pci.sys | ||
738 | // Version 5.01.21[9|6]5.xxxx | ||
739 | // | ||
740 | llwarns << "Detected pci.sys" << llendl; | ||
741 | write_debug("Old driver (pci.sys) for SiS detected!"); | ||
742 | out_of_date = TRUE; | ||
743 | } | ||
744 | |||
745 | if (dfilep = devp->findDriver("sisagp.sys")) | ||
746 | { | ||
747 | // Old driver: pci.sys | ||
748 | // Version 5.01.21[9|6]5.xxxx | ||
749 | // | ||
750 | llwarns << "Detected sisagp.sys" << llendl; | ||
751 | write_debug("Old driver (sisagp.sys) for SiS detected!"); | ||
752 | out_of_date = TRUE; | ||
753 | } | ||
754 | |||
755 | if (dfilep = devp->findDriver("sisagpx.sys")) | ||
756 | { | ||
757 | // Old driver: pci.sys | ||
758 | // Version 7.02.0000.xxxx | ||
759 | // | ||
760 | // Notes: | ||
761 | // Default driver for Win2K? Not sure what the "correct" driver is - | ||
762 | // maybe some variant of AGP440.SYS? | ||
763 | if (dfilep->mVersion.getField(3) < 1160) | ||
764 | { | ||
765 | out_of_date = TRUE; | ||
766 | llwarns << "Detected sisagpx.sys" << llendl; | ||
767 | write_debug("Old driver (sisagpx.sys) for SiS detected!"); | ||
768 | } | ||
769 | } | ||
770 | if (out_of_date) | ||
771 | { | ||
772 | exit_after_bad |= bad_hardware_dialog("Out of date SiS chipset driver", | ||
773 | SIS_CHIPSET_URL); | ||
774 | } | ||
775 | } | ||
776 | |||
777 | return exit_after_bad; | ||
778 | #else | ||
779 | return TRUE; | ||
780 | #endif | ||
781 | } | ||
782 | |||
783 | void LLFeatureManager::applyRecommendedFeatures() | 486 | void LLFeatureManager::applyRecommendedFeatures() |
784 | { | 487 | { |
785 | // see featuretable.txt | 488 | // see featuretable.txt |
@@ -789,14 +492,14 @@ void LLFeatureManager::applyRecommendedFeatures() | |||
789 | dump(); | 492 | dump(); |
790 | #endif | 493 | #endif |
791 | 494 | ||
792 | // Enabling AGP | 495 | // Enabling VBO |
793 | if (getRecommendedLevel("RenderAGP")) | 496 | if (getRecommendedLevel("RenderVBO")) |
794 | { | 497 | { |
795 | gSavedSettings.setBOOL("RenderUseAGP", TRUE); | 498 | gSavedSettings.setBOOL("RenderVBOEnable", TRUE); |
796 | } | 499 | } |
797 | else | 500 | else |
798 | { | 501 | { |
799 | gSavedSettings.setBOOL("RenderUseAGP", FALSE); | 502 | gSavedSettings.setBOOL("RenderVBOEnable", FALSE); |
800 | } | 503 | } |
801 | 504 | ||
802 | // Anisotropic rendering | 505 | // Anisotropic rendering |