From 91ff256adf351919392c2967211da42d708fb1c7 Mon Sep 17 00:00:00 2001 From: castano Date: Mon, 4 Feb 2008 10:12:32 +0000 Subject: [PATCH] Do precomputation only when needed. --- src/nvtt/CompressDXT.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/nvtt/CompressDXT.cpp b/src/nvtt/CompressDXT.cpp index 46c1ad8..5287f13 100644 --- a/src/nvtt/CompressDXT.cpp +++ b/src/nvtt/CompressDXT.cpp @@ -36,9 +36,11 @@ // squish #include "squish/colourset.h" +//#include "squish/clusterfit.h" #include "squish/fastclusterfit.h" #include "squish/weightedclusterfit.h" + // s3_quant #if defined(HAVE_S3QUANT) #include "s3tc/s3_quant.h" @@ -217,8 +219,6 @@ void nv::compressDXT1(const Image * image, const OutputOptions::Private & output fit.SetColourSet(&colours, squish::kDxt1); fit.Compress(&block); - // @@ Use iterative cluster fit algorithm to improve error in production quality mode. - if (outputOptions.outputHandler != NULL) { outputOptions.outputHandler->writeData(&block, sizeof(block)); } @@ -235,8 +235,6 @@ void nv::compressDXT1a(const Image * image, const OutputOptions::Private & outpu ColorBlock rgba; BlockDXT1 block; - doPrecomputation(); - squish::WeightedClusterFit fit; fit.SetMetric(compressionOptions.colorWeight.x(), compressionOptions.colorWeight.y(), compressionOptions.colorWeight.z()); @@ -250,8 +248,6 @@ void nv::compressDXT1a(const Image * image, const OutputOptions::Private & outpu fit.SetColourSet(&colours, squish::kDxt1); fit.Compress(&block); - // @@ Use iterative cluster fit algorithm to improve error in highest quality mode. - if (outputOptions.outputHandler != NULL) { outputOptions.outputHandler->writeData(&block, sizeof(block)); }