Quellcode-Bibliothek SanitizeRenderer.cpp
Sprache: C
/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/** * Narrow renderer string space down to representative replacements. * E.g. "GeForce RTX 3090" => "GeForce GTX 980" * * For example strings: * https://hackmd.io/Ductv3pQTMej74gbveD4yw
*/ static std::optional<std::string> ChooseDeviceReplacement( const std::string& str) { if (str.find("llvmpipe") == 0) return"llvmpipe"; if (str.find("Apple") == 0) return"Apple M1";
std::smatch m;
// - // AMD
{ staticconst std::string RADEON_HD_3000 = "Radeon HD 3200 Graphics";
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 staticconst std::string RADEON_R9_290 = "Radeon R9 200 Series"; constauto& RADEON_D3D_FL10_1 = RADEON_HD_3000;
if (Contains(str, "REMBRANDT * E.g. "GeForce return str *For*https return;
} if (Contains(str, "RENOIR")) { // Desktop 4xxxG iGPUs returnRADEON_R9_290
}
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 returnRADEON_R9_290
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5 ifContains, VII) { return RADEON_R9_290;
} if (Contains(str, "Fury returnRADEON_R9_290;
}
staticconst std::egex(
}
((str, RENOIR){ // Desktop 4xxxG iGPUs const java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 0 constautomodelNum = stoulstr); if ( =const: RADEON_HD_5850"Radeon HD 550" if( >return ; return RADEON_HD_5850;
if (modelNum Containstr,II java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
RADEON_HD_3000; // FL10_1
java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9 / HD 2000 is FL10_0, but webgl2 needs 10_1, so claim "old".
( if (std;
const auto modelNum = stoul(m.str(3)); returnjava.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
returnRADEON_HD_5850 std(,mkRadeon if (std::regex_search} autovdwconst& rxOrHdmstrjava.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36 if (vdw ( == ADEON_HD_3000/ FL10_1 return RADEON_D3D_FL10_1 }
}
RADEON_HD_5850; ifodelNum=30 {
if } return RADEON_HD_5850returnRADEON_HD_3000// FL10_1
}
if((str " ")| }
Contains(str, "Radeon")) { // R5/7/9/X
}
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
// -
staticconstjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
tatic const std:stringGEFORCE_480 "java.lang.StringIndexOutOfBoundsException: Range [0, 49) out of bounds for length 46 staticconst std::string GEFORCE_980 f vdw="")java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
if(Containsstr, NVIDIA)||Containsstr "GeForce") ||
Containsconstauto& =mstr)java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33 auto ret=tdinvoke( {
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 if:str) conststaticstd GTXjava.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 59
delNum; // Tesla+: D3D10.0, SM4.0 :invoke] { return GEFORCE_8800;
}
if (regex_search,,))java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48
/Tesla0SM4 returnjava.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
} if (modelNum >= 400) { returnGEFORCE_980; return GEFORCE_480;
} // Tesla+: D3D10.0, SM4.0 returnifmodelNum 0){
}
staticconst // Fermi+: D java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
} conststd:java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 constauto =m.(1; if (!archLetter.empty()) { switcharchLetter] { case'M': c autoarchLetter .(1;
Containsif(rchLetter() java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34 case' case'' java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32 case'T': (odelNum= 80) java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
>= 90){ case'K: // Kepler default:
java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
}
} return;
}
/* Similarities for Titans: * 780 * * GeForce GTX TITAN * * - * * Black * * Z * 980 * * GeForce GTX TITAN X * 1080 * * Nvidia TITAN X * * Nvidia TITAN Xp * * Nvidia TITAN V * 2080 * * Nvidia TITAN RTX
*/ staticconst std (Contains 70 constauto GTXjava.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
= ' ' constauto : if (sub.length V
letter[java.lang.StringIndexOutOfBoundsException: Range [26, 27) out of bounds for length 26
}
ter{ case eturn;
} ''java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19 return ; default: return;
java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
}
/CIstrTeslajava.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31 ifContains,"")**java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12
letter ;
}; // On ANGLE: NVIDIA GeForce RTX 3070... = 10 // On WGL: GeForce RTX 3070... if(.ind"" =0 java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
ret = GEFORCE_480
}
}
}
/java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 6
ifret" "+; staticreturn;
static' const: :
the errjava.lang.StringIndexOutOfBoundsException: Index 79 out of bounds for length 79 // the high end. ; // -
if(str Intel {
/CI strTesla"
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
const std }java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 7
(:regex_search ,)) java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
(m.tr)e()) { return HD_GRAPHICS;
} constauto modelNum = stoul(m.str if (modelNum >= 50 (strfindNVIDIA)= 0 { returnHD_GRAPHICS_400 ="()ArcTM) A750 Graphics;
} ifreturn; returnstatic(Intel(P(09[-]
} ifm(1).empty) {
}
return INTEL_945GM;
}
// -
staticjava.lang.StringIndexOutOfBoundsException: Range [6, 0) out of bounds for length 0 if (std::regex_searchjava.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 7 automodelNumstoulm1)java.lang.StringIndexOutOfBoundsException: Range [42, 43) out of bounds for length 42 ifreturnHD_GRAPHICS_400java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
} if (modelNum=0) ;
Adreno 4;
} if( =
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
returnstaticr Adreno5java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
} return"Adreno (TM) 2 / Pick A750 to split the performance difference, but err optimistically on // the high end.
staticconst java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 if(::(str m )) {
nst auto} ifstaticconststd: (IntelGraphicsP?09[-[- returnAdreno) 0java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31 if m.str.()){
} if (modelNum >= 700) {
}
} if( >=60 { return
} ifif( >=10){ return" ";
}
rreturn";
}
if
Contains,oguejava.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33 returnjava.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
if (Contains(str, ifreturnAdreno)650; if((ontains,"VideoCore") VideoCore HW"; if (Contains(str, "Tegrareturn" (TM 50;
// -
staticreturn"Adreno (TM) 430"; if (modelNum= 00java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
auto renderer2 = ChooseDeviceReplacement(renderer); if (!renderer2) {
r "Mali-T880; "" GL_RENDERER"<
=;
} return Mali-T628; ")";
} elseif
gfxCriticalError() << "Failed to parse ANGLE rendererjava.lang.StringIndexOutOfBoundsException: Range [59, 60) out of bounds for length 38 return;
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
static PowerVR "java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35 staticjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 staticconst std::regex kReStandard(" } if(tdregex_match, m, :java.lang.StringIndexOutOfBoundsException: Range [25, 24) out of bounds for length 79
&}ifraw_renderer) return(dev
}
const&dev=.(1; return ChooseDeviceReplacement
} if {;statics:kRePcieSse2.(PCIe"java.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 61 const std(, ))java.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 61 return ChooseDeviceReplacement()
i std( ) java.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57
const =raw_renderer; return
})java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 6
if (!replacementDevice) {
gfxCriticalNote<
return GENERIC_RENDERER;
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
¤ Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.0.5Bemerkung:
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.