diff options
| author | Joe Ludwig <[email protected]> | 2013-07-17 18:26:59 -0700 |
|---|---|---|
| committer | Joe Ludwig <[email protected]> | 2013-07-17 18:26:59 -0700 |
| commit | e16ea21dc8a710237ade8413207f58d403c616a3 (patch) | |
| tree | 85dcfbda9881e4e022dedafefbc2727e2fd2aa59 /mp/src/devtools/bin/shaderinfo.pl | |
| parent | Merge pull request #36 from AnAkIn1/fogplayerparams_fix (diff) | |
| download | source-sdk-2013-e16ea21dc8a710237ade8413207f58d403c616a3.tar.xz source-sdk-2013-e16ea21dc8a710237ade8413207f58d403c616a3.zip | |
* Added support for building shaders in your mod
* Added nav mesh support
* fixed many warnings and misc bugs
* Fixed the create*projects scripts in mp
* Added a bunch of stuff to .gitignore
Diffstat (limited to 'mp/src/devtools/bin/shaderinfo.pl')
| -rw-r--r-- | mp/src/devtools/bin/shaderinfo.pl | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/mp/src/devtools/bin/shaderinfo.pl b/mp/src/devtools/bin/shaderinfo.pl new file mode 100644 index 00000000..ae0b96c8 --- /dev/null +++ b/mp/src/devtools/bin/shaderinfo.pl @@ -0,0 +1,36 @@ +#! perl
+
+my $fname=shift || die "format is shaderinfo blah.vcs";
+
+open(SHADER, $fname) || die "can't open $fname";
+binmode SHADER;
+
+read(SHADER,$header,20);
+($ver,$ntotal,$ndynamic,$flags,$centroidmask)=unpack("LLLLL",$header);
+
+#print "Version $ver total combos=$ntotal, num dynamic combos=$ndynamic,\n flags=$flags, centroid mask=$centroidmask\n";
+
+read(SHADER,$refsize,4);
+$refsize=unpack("L",$refsize);
+#print "Size of reference shader for diffing=$refsize\n";
+
+seek(SHADER,$refsize,1);
+
+$nskipped_combos=0;
+for(1..$ntotal)
+ {
+ read(SHADER,$combodata,8);
+ ($ofs,$combosize)=unpack("LL",$combodata);
+ if ( $ofs == 0xffffffff)
+ {
+ $nskipped_combos++;
+ }
+ else
+ {
+ }
+ }
+#print "$nskipped_combos skipped, for an actual total of ",$ntotal-$nskipped_combos,"\n";
+#print "Real to skipped ratio = ",($ntotal-$nskipped_combos)/$ntotal,"\n";
+# csv output - name, real combos, virtual combos, dynamic combos
+my $real_combos=$ntotal-$nskipped_combos;
+print "$fname,$real_combos,$ntotal,$ndynamic\n";
|