From c19f427ce152cc8bb806baa6877457380813a82b Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Wed, 10 Jul 2013 14:35:25 -0700 Subject: update tester for new gpu_table.txt format --- scripts/gpu_table_tester | 67 +++++++++++++++++++++++++++++++++--------------- 1 file changed, 46 insertions(+), 21 deletions(-) (limited to 'scripts') diff --git a/scripts/gpu_table_tester b/scripts/gpu_table_tester index 9bc958636d..339823246c 100755 --- a/scripts/gpu_table_tester +++ b/scripts/gpu_table_tester @@ -46,8 +46,8 @@ my $mini_HELP = " $MyName {--gpu-table|-g} {--diff|-d} [ ...] With the --diff option, the report compares the current results to , - which should be the output from a previous run without --diff. The report shows each - input value with the old result and the new result if it is different. + which should be the output from a previous run without --diff. The report shows + each input value with the old result and the new result if they are different. "; &GetOptions("help" => \$Help @@ -81,11 +81,15 @@ my %Recognizer; # name -> recognizer my %Class; # recognizer -> class my %Supported; # recognizer -> supported my @InOrder; # lowercased recognizers in file order - these are the ones really used to match +my %StatsBased; +my %ExpectedOpenGL; $Name{$NoMatch} = $NoMatch; $NameLine{$NoMatch} = '(hard-coded)'; # use this for error messages in table parsing $Class{$NoMatch} = ''; $Supported{$NoMatch} = ''; +$StatsBased{$NoMatch} = ''; +$ExpectedOpenGL{$NoMatch} = ''; while () { @@ -93,7 +97,7 @@ while () next if m|^\s*$|; # skip blank lines chomp; - my ($name, $regex, $class, $supported, $extra) = split('\t+'); + my ($name, $regex, $class, $supported, $stats_based, $expected_opengl, $extra) = split('\t+'); my $errsOnLine = $ErrorsSeen; if (!$name) { @@ -119,7 +123,7 @@ while () print STDERR " $INPUT_LINE_NUMBER: name '$name' " . ($supported ? "supported" : "unsupported") . " class $class - ignored\n"; $ErrorsSeen++; } - if ($class !~ m/[0123]/) + if ($class !~ m/[012345]/) { print STDERR "Invalid class value '$class' on $GpuTable line $INPUT_LINE_NUMBER\n"; $ErrorsSeen++; @@ -129,6 +133,16 @@ while () print STDERR "Invalid supported value '$supported' on $GpuTable line $INPUT_LINE_NUMBER\n"; $ErrorsSeen++; } + if ($stats_based !~ m/[01]/) + { + print STDERR "Invalid stats_based value '$stats_based' on $GpuTable line $INPUT_LINE_NUMBER\n"; + $ErrorsSeen++; + } + if ($expected_opengl !~ m/\d+(\.\d+)?/) + { + print STDERR "Invalid expected_opengl value '$expected_opengl' on $GpuTable line $INPUT_LINE_NUMBER\n"; + $ErrorsSeen++; + } if ($extra) { print STDERR "Extra data '$extra' on $GpuTable line $INPUT_LINE_NUMBER\n"; @@ -144,6 +158,8 @@ while () $Recognizer{$name} = $regex; $Class{$regex} = $class; $Supported{$regex} = $supported ? "supported" : "unsupported"; + $StatsBased{$regex} = $stats_based; + $ExpectedOpenGL{$regex} = $expected_opengl; } } @@ -174,27 +190,27 @@ while (<>) } format STDOUT_TOP = -GPU String Supported? Class Recognizer ------------------------------------------------------------------------------------------------------- ----------- ----- ------------------------------------ +GPU String Supported? Class Stats OpenGL Recognizer +------------------------------------------------------------------------------------------------------ ----------- ----- ----- ------ ------------------------------------ . format STDOUT = -@<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<... @<<<<<<<<<< @> @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<... -$_, $Supported{$RecognizedBy{$_}},$Class{$RecognizedBy{$_}},$Name{$RecognizedBy{$_}} +@<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<... @<<<<<<<<<< @> @> @<<<< @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<... +$_, $Supported{$RecognizedBy{$_}},$Class{$RecognizedBy{$_}},$StatsBased{$RecognizedBy{$_}},$ExpectedOpenGL{$RecognizedBy{$_}},$Name{$RecognizedBy{$_}} . -my $ReportLineTemplate = "A102xxxA12xxxAA*"; # MUST match the format STDOUT above +my $ReportLineTemplate = "A102xxxA12xxxA2xxxxA2xxxxA5A*"; # MUST match the format STDOUT above format DIFF_TOP = - ------ OLD ------ ------ NEW ------ -GPU String Supported? Class Supported? Class ------------------------------------------------------------------------------------------------------- ----------- ----- ----------- ----- + ------------- OLD ------------- ----------- NEW --------------- +GPU String Supported? Class Stats OpenGL Supported? Class Stats OpenGL +------------------------------------------------------------------------------------------------------ ----------- ----- ----- ------ ----------- ----- ----- ------ . my ( $oldSupported, $oldClass, $newSupported, $newClass ); format DIFF = -@<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<... @<<<<<<<<<< @> @<<<<<<<<<< @> -$_, $oldSupported, $oldClass, $newSupported, $newClass +@<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<... @<<<<<<<<<< @> @> @<<<< @<<<<<<<<<< @> @> @<<<< +$_, $oldSupported, $oldClass, $oldStatsBased, $oldExpectedOpenGL, $newSupported, $newClass, $newStatsBased, $newExpectedOpenGL . if ( ! $Diff ) @@ -215,12 +231,14 @@ else my $discard = 2; while ( ) { - if ( $discard > 0 ) + if ( $discard <= 0 ) { - my ( $gpu, $supported, $class ) = unpack $ReportLineTemplate; + my ( $gpu, $supported, $class, $stats, $opengl ) = unpack $ReportLineTemplate; $gpu =~ s/\s*$//; ( $OldSupported{$gpu} = $supported ) =~ s/\s*$//; ( $OldClass{$gpu} = $class ) =~ s/\s*$//; + ( $OldStatsBased{$gpu} = $stats ) =~ s/\s*$//; + ( $OldExpectedOpenGL{$gpu} = $opengl ) =~ s/\s*$//; } else { @@ -235,26 +253,33 @@ else { $newSupported = $Supported{$RecognizedBy{$_}} || $NoMatch; $newClass = $Class{$RecognizedBy{$_}}; + $newStatsBased = $StatsBased{$RecognizedBy{$_}}; + $newExpectedOpenGL = $ExpectedOpenGL{$RecognizedBy{$_}}; if ( ! defined $OldSupported{$_} ) { $oldSupported = 'NEW'; $oldClass = '-'; + $oldStatsBased = '-'; + $oldExpectedOpenGL = '-'; + write; } else { $oldSupported = $OldSupported{$_} || $NoMatch; $oldClass = $OldClass{$_}; + $oldStatsBased = $OldStatsBased{$_}; + $oldExpectedOpenGL = $OldExpectedOpenGL{$_}; - if ( ( $oldSupported eq $newSupported ) - && ( $oldClass eq $newClass ) + if ( ( $oldSupported ne $newSupported ) + || ( $oldClass ne $newClass ) + || ( $oldStatsBased ne $newStatsBased ) + || ( $oldExpectedOpenGL ne $newExpectedOpenGL ) ) { - $newSupported = ''; - $newClass = ''; + write; } } - write; $-++; # suppresses pagination } } -- cgit v1.3 From 4ae06c7e3340e09ffe6b54dccd4faeb210330d7e Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Wed, 7 Aug 2013 18:03:16 -0400 Subject: add line number of recognizer to diff report --- scripts/gpu_table_tester | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'scripts') diff --git a/scripts/gpu_table_tester b/scripts/gpu_table_tester index 339823246c..76994da1aa 100755 --- a/scripts/gpu_table_tester +++ b/scripts/gpu_table_tester @@ -201,16 +201,16 @@ $_, $Supported{$RecognizedBy{$_}},$Class{$RecognizedBy{$_}},$StatsBased{$Recogni my $ReportLineTemplate = "A102xxxA12xxxA2xxxxA2xxxxA5A*"; # MUST match the format STDOUT above format DIFF_TOP = - ------------- OLD ------------- ----------- NEW --------------- -GPU String Supported? Class Stats OpenGL Supported? Class Stats OpenGL ------------------------------------------------------------------------------------------------------- ----------- ----- ----- ------ ----------- ----- ----- ------ + ------------- OLD ------------- ----------- NEW -------------------- +GPU String Supported? Class Stats OpenGL Supported? Class Stats OpenGL Line +------------------------------------------------------------------------------------------------------ ----------- ----- ----- ------ ----------- ----- ----- ------ ----- . my ( $oldSupported, $oldClass, $newSupported, $newClass ); format DIFF = -@<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<... @<<<<<<<<<< @> @> @<<<< @<<<<<<<<<< @> @> @<<<< -$_, $oldSupported, $oldClass, $oldStatsBased, $oldExpectedOpenGL, $newSupported, $newClass, $newStatsBased, $newExpectedOpenGL +@<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<... @<<<<<<<<<< @> @> @<<<< @<<<<<<<<<< @> @> @<<<< @>>>> +$_, $oldSupported, $oldClass, $oldStatsBased, $oldExpectedOpenGL, $newSupported, $newClass, $newStatsBased, $newExpectedOpenGL, $newRecognizedLine . if ( ! $Diff ) @@ -255,6 +255,7 @@ else $newClass = $Class{$RecognizedBy{$_}}; $newStatsBased = $StatsBased{$RecognizedBy{$_}}; $newExpectedOpenGL = $ExpectedOpenGL{$RecognizedBy{$_}}; + $newRecognizedLine = $RecognizerLine{$RecognizedBy{$_}}; if ( ! defined $OldSupported{$_} ) { -- cgit v1.3 From e51e79c4d4147f89304a03ef5ee9ec4dfe886d52 Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Wed, 7 Aug 2013 18:04:03 -0400 Subject: truncate gpu id strings to 100 characters (avoids diff problems) --- scripts/gpu_table_tester | 1 + 1 file changed, 1 insertion(+) (limited to 'scripts') diff --git a/scripts/gpu_table_tester b/scripts/gpu_table_tester index 76994da1aa..6989e6f968 100755 --- a/scripts/gpu_table_tester +++ b/scripts/gpu_table_tester @@ -175,6 +175,7 @@ my %RecognizedBy; while (<>) { chomp; + $_ = substr($_,0,100); my $lcInput = lc $_; # the real gpu table parser lowercases the input string my $recognizer; $RecognizedBy{$_} = $NoMatch; -- cgit v1.3 From d5c9b7b8e5ea81ae6f3d7ca7f67d527c2f7e5ef4 Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Thu, 29 Aug 2013 09:56:44 -0400 Subject: fix header display for diff report --- scripts/gpu_table_tester | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'scripts') diff --git a/scripts/gpu_table_tester b/scripts/gpu_table_tester index 6989e6f968..4ce08e3005 100755 --- a/scripts/gpu_table_tester +++ b/scripts/gpu_table_tester @@ -195,30 +195,27 @@ GPU String ------------------------------------------------------------------------------------------------------ ----------- ----- ----- ------ ------------------------------------ . format STDOUT = -@<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<... @<<<<<<<<<< @> @> @<<<< @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<... +@<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< @<<<<<<<<<< @> @> @<<<< @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<... $_, $Supported{$RecognizedBy{$_}},$Class{$RecognizedBy{$_}},$StatsBased{$RecognizedBy{$_}},$ExpectedOpenGL{$RecognizedBy{$_}},$Name{$RecognizedBy{$_}} . -my $ReportLineTemplate = "A102xxxA12xxxA2xxxxA2xxxxA5A*"; # MUST match the format STDOUT above +my $ReportLineTemplate = "A102xxxA12xxxA2xxxxA2xxxxA5A*"; # Used to read a previous report - MUST match the format STDOUT above + +my ( $oldSupported, $oldClass, $newSupported, $newClass ); format DIFF_TOP = ------------- OLD ------------- ----------- NEW -------------------- GPU String Supported? Class Stats OpenGL Supported? Class Stats OpenGL Line ------------------------------------------------------------------------------------------------------ ----------- ----- ----- ------ ----------- ----- ----- ------ ----- -. - -my ( $oldSupported, $oldClass, $newSupported, $newClass ); - +. format DIFF = -@<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<... @<<<<<<<<<< @> @> @<<<< @<<<<<<<<<< @> @> @<<<< @>>>> -$_, $oldSupported, $oldClass, $oldStatsBased, $oldExpectedOpenGL, $newSupported, $newClass, $newStatsBased, $newExpectedOpenGL, $newRecognizedLine +@<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< @<<<<<<<<<< @> @> @<<<< @<<<<<<<<<< @> @> @<<<< @>>>> +$_, $oldSupported, $oldClass, $oldStatsBased, $oldExpectedOpenGL, $newSupported, $newClass, $newStatsBased, $newExpectedOpenGL, $newRecognizedLine . if ( ! $Diff ) { - ## Print results. - ## For each input, show supported or unsupported, the class, and the recognizer name - + ## Print results of testing each input line and how it was recognized. foreach ( sort keys %RecognizedBy ) { write if ! $UnMatchedOnly || $Name{$RecognizedBy{$_}} eq $NoMatch; @@ -227,6 +224,7 @@ if ( ! $Diff ) } else { + ## Print a comparison of how the recognition this time compared to the results from the $Diff file open OLD, "<$Diff" || die "Failed to open --diff file '$Diff'\n\t$!\n"; my $discard = 2; @@ -248,8 +246,8 @@ else } close OLD; - $FORMAT_TOP_NAME = DIFF_TOP; - $FORMAT_NAME = DIFF; + $FORMAT_TOP_NAME = 'DIFF_TOP'; + $FORMAT_NAME = 'DIFF'; foreach ( sort keys %RecognizedBy ) { $newSupported = $Supported{$RecognizedBy{$_}} || $NoMatch; @@ -265,6 +263,7 @@ else $oldStatsBased = '-'; $oldExpectedOpenGL = '-'; write; + $-++; # suppresses pagination } else { @@ -280,9 +279,10 @@ else ) { write; + $-++; # suppresses pagination } } - $-++; # suppresses pagination + } } -- cgit v1.3 From 980802e46859dc31f14d20e558a4e955e6976f48 Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Thu, 5 Sep 2013 22:06:16 -0400 Subject: STORM-1552: detect, ignore, and delete invalid feature and gpu table files --- indra/newview/gpu_table.txt | 1 + indra/newview/llfeaturemanager.cpp | 115 ++++++++++++++++++++++++++----------- indra/newview/llfeaturemanager.h | 15 +++-- scripts/gpu_table_tester | 4 ++ 4 files changed, 97 insertions(+), 38 deletions(-) (limited to 'scripts') diff --git a/indra/newview/gpu_table.txt b/indra/newview/gpu_table.txt index 122577b132..23a065caff 100755 --- a/indra/newview/gpu_table.txt +++ b/indra/newview/gpu_table.txt @@ -1,3 +1,4 @@ +//GPU_TABLE - that token on line 1 tags this as a gpu table file // // Categorizes graphics chips into various classes by name // diff --git a/indra/newview/llfeaturemanager.cpp b/indra/newview/llfeaturemanager.cpp index 9d292ce7bb..6158a778d3 100755 --- a/indra/newview/llfeaturemanager.cpp +++ b/indra/newview/llfeaturemanager.cpp @@ -261,7 +261,7 @@ BOOL LLFeatureManager::maskFeatures(const std::string& name) return maskList(*maskp); } -BOOL LLFeatureManager::loadFeatureTables() +bool LLFeatureManager::loadFeatureTables() { // *TODO - if I or anyone else adds something else to the skipped list // make this data driven. Put it in the feature table and parse it @@ -302,28 +302,36 @@ BOOL LLFeatureManager::loadFeatureTables() // use HTTP table if it exists std::string path; + bool parse_ok = false; if (gDirUtilp->fileExists(http_path)) { - path = http_path; + parse_ok = parseFeatureTable(http_path); + if (!parse_ok) + { + // the HTTP table failed to parse, so delete it + LLFile::remove(http_path); + LL_WARNS("RenderInit") << "Removed invalid feature table '" << http_path << "'" << LL_ENDL; + } } - else + + if (!parse_ok) { - path = app_path; + parse_ok = parseFeatureTable(app_path); } - - return parseFeatureTable(path); + return parse_ok; } -BOOL LLFeatureManager::parseFeatureTable(std::string filename) +bool LLFeatureManager::parseFeatureTable(std::string filename) { - llinfos << "Looking for feature table in " << filename << llendl; + LL_INFOS("RenderInit") << "Attempting to parse feature table from " << filename << LL_ENDL; llifstream file; std::string name; U32 version; + cleanupFeatureTables(); // in case an earlier attempt left partial results file.open(filename); /*Flawfinder: ignore*/ if (!file) @@ -338,13 +346,14 @@ BOOL LLFeatureManager::parseFeatureTable(std::string filename) if (name != "version") { LL_WARNS("RenderInit") << filename << " does not appear to be a valid feature table!" << LL_ENDL; - return FALSE; + return false; } mTableVersion = version; - + LLFeatureList *flp = NULL; - while (file >> name) + bool parse_ok = true; + while (file >> name && parse_ok) { char buffer[MAX_STRING]; /*Flawfinder: ignore*/ @@ -357,39 +366,58 @@ BOOL LLFeatureManager::parseFeatureTable(std::string filename) if (name == "list") { + LL_DEBUGS("RenderInit") << "Before new list" << std::endl; if (flp) { - //flp->dump(); + flp->dump(); } + else + { + LL_CONT << "No current list"; + } + LL_CONT << LL_ENDL; + // It's a new mask, create it. file >> name; - if (mMaskList.count(name)) + if (!mMaskList.count(name)) { - LL_ERRS("RenderInit") << "Overriding mask " << name << ", this is invalid!" << LL_ENDL; + flp = new LLFeatureList(name); + mMaskList[name] = flp; + } + else + { + LL_WARNS("RenderInit") << "Overriding mask " << name << ", this is invalid!" << LL_ENDL; + parse_ok = false; } - - flp = new LLFeatureList(name); - mMaskList[name] = flp; } else { if (!flp) { - LL_ERRS("RenderInit") << "Specified parameter before keyword!" << LL_ENDL; - return FALSE; + S32 available; + F32 recommended; + file >> available >> recommended; + flp->addFeature(name, available, recommended); + } + else + { + LL_WARNS("RenderInit") << "Specified parameter before keyword!" << LL_ENDL; + parse_ok = false; } - S32 available; - F32 recommended; - file >> available >> recommended; - flp->addFeature(name, available, recommended); } } file.close(); - return TRUE; + if (!parse_ok) + { + LL_WARNS("RenderInit") << "Discarding feature table data from " << filename << LL_ENDL; + cleanupFeatureTables(); + } + + return parse_ok; } -void LLFeatureManager::loadGPUClass() +bool LLFeatureManager::loadGPUClass() { // defaults mGPUClass = GPU_CLASS_UNKNOWN; @@ -407,29 +435,49 @@ void LLFeatureManager::loadGPUClass() // use HTTP table if it exists std::string path; + bool parse_ok = false; if (gDirUtilp->fileExists(http_path)) { - path = http_path; + parse_ok = parseGPUTable(http_path); + if (!parse_ok) + { + // the HTTP table failed to parse, so delete it + LLFile::remove(http_path); + LL_WARNS("RenderInit") << "Removed invalid gpu table '" << http_path << "'" << LL_ENDL; + } } - else + + if (!parse_ok) { - path = app_path; + parse_ok = parseGPUTable(app_path); } - parseGPUTable(path); + return parse_ok; // indicates that the file parsed correctly, not that the gpu was recognized } -void LLFeatureManager::parseGPUTable(std::string filename) +bool LLFeatureManager::parseGPUTable(std::string filename) { llifstream file; - + + LL_INFOS("RenderInit") << "Attempting to parse GPU table from " << filename << LL_ENDL; file.open(filename); - if (!file) + if (file) + { + const char recognizer[] = "//GPU_TABLE"; + char first_line[MAX_STRING]; + file.getline(first_line, MAX_STRING); + if (0 != strncmp(first_line, recognizer, strlen(recognizer))) + { + LL_WARNS("RenderInit") << "Invalid GPU table: " << filename << "!" << LL_ENDL; + return false; + } + } + else { LL_WARNS("RenderInit") << "Unable to open GPU table: " << filename << "!" << LL_ENDL; - return; + return false; } std::string rawRenderer = gGLManager.getRawGLString(); @@ -556,6 +604,7 @@ void LLFeatureManager::parseGPUTable(std::string filename) #if LL_DARWIN // never go over "Mid" settings by default on OS X mGPUClass = llmin(mGPUClass, GPU_CLASS_2); #endif + return true; } // responder saves table into file diff --git a/indra/newview/llfeaturemanager.h b/indra/newview/llfeaturemanager.h index 3b8d251236..95141b241d 100755 --- a/indra/newview/llfeaturemanager.h +++ b/indra/newview/llfeaturemanager.h @@ -75,7 +75,7 @@ public: void setFeatureAvailable(const std::string& name, const BOOL available); void setRecommendedLevel(const std::string& name, const F32 level); - BOOL loadFeatureList(LLFILE *fp); + bool loadFeatureList(LLFILE *fp); BOOL maskList(LLFeatureList &mask); @@ -114,7 +114,7 @@ public: void maskCurrentList(const std::string& name); // Mask the current feature list with the named list - BOOL loadFeatureTables(); + bool loadFeatureTables(); EGPUClass getGPUClass() { return mGPUClass; } std::string& getGPUString() { return mGPUString; } @@ -157,9 +157,14 @@ public: void fetchHTTPTables(); protected: - void loadGPUClass(); - BOOL parseFeatureTable(std::string filename); - void parseGPUTable(std::string filename); + bool loadGPUClass(); + + bool parseFeatureTable(std::string filename); + ///< @returns TRUE is file parsed correctly, FALSE if not + + bool parseGPUTable(std::string filename); + ///< @returns true if file parsed correctly, false if not - does not reflect whether or not the gpu was recognized + void initBaseMask(); diff --git a/scripts/gpu_table_tester b/scripts/gpu_table_tester index 9bc958636d..0fe3e9e8f7 100755 --- a/scripts/gpu_table_tester +++ b/scripts/gpu_table_tester @@ -73,6 +73,10 @@ die "Must specify a --gpu-table value" open(GPUS, "<$GpuTable") || die "Failed to open gpu table '$GpuTable':\n\t$!\n"; +my $FirstLine = ; +die "First line of gpu table does not begin with '//GPU_TABLE'" + unless $FirstLine =~ m|^//GPU_TABLE|; + # Parse the GPU table into these tables, indexed by the name my %NameLine; # name -> line number on which a given name was found (catches duplicate names) my %RecognizerLine; # name -> line number on which a given name was found (catches duplicate names) -- cgit v1.3