From e25e5bae909a4927a871bec07e74436f1f9e0c55 Mon Sep 17 00:00:00 2001 From: Pavel Krajcevski Date: Sat, 15 Sep 2012 10:29:36 -0400 Subject: [PATCH] Add flag to modify the number of compressions in order to take an average of the compression time. --- CLTool/src/clunix.cpp | 14 ++++++++++++++ Core/include/TexComp.h | 1 + 2 files changed, 15 insertions(+) diff --git a/CLTool/src/clunix.cpp b/CLTool/src/clunix.cpp index b6b5675..de081d1 100644 --- a/CLTool/src/clunix.cpp +++ b/CLTool/src/clunix.cpp @@ -18,11 +18,24 @@ int main(int argc, char **argv) { int quality = 50; int numThreads = 1; + int numCompressions = 1; bool bUseSIMD = false; bool knowArg = false; do { knowArg = false; + + if(strcmp(argv[fileArg], "-n") == 0) { + fileArg++; + + if(fileArg == argc || (numCompressions = atoi(argv[fileArg])) < 0) { + PrintUsage(); + exit(1); + } + + fileArg++; + knowArg = true; + } if(strcmp(argv[fileArg], "-s") == 0) { fileArg++; @@ -67,6 +80,7 @@ int main(int argc, char **argv) { settings.bUseSIMD = bUseSIMD; settings.iNumThreads = numThreads; settings.iQuality = quality; + settings.iNumCompressions = numCompressions; CompressedImage *ci = CompressImage(file, settings); diff --git a/Core/include/TexComp.h b/Core/include/TexComp.h index e10fac1..5b4598f 100644 --- a/Core/include/TexComp.h +++ b/Core/include/TexComp.h @@ -10,6 +10,7 @@ struct SCompressionSettings { bool bUseSIMD; int iNumThreads; int iQuality; + int iNumCompressions; }; extern CompressedImage * CompressImage(