From ff18e8f33e788c731c97ebdfd42427dbf43100a5 Mon Sep 17 00:00:00 2001 From: Pavel Krajcevski Date: Sat, 30 Mar 2013 11:16:32 -0400 Subject: [PATCH] Bug fix When the compressor recognized that a shape was a single color, it determines an optimal encoding for that color. However, only the error in the single pixel was returned as the error for the overall shape. This caused problems with modes that do not support alpha and shapes that do have alpha. --- BPTCEncoder/src/BC7Compressor.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BPTCEncoder/src/BC7Compressor.cpp b/BPTCEncoder/src/BC7Compressor.cpp index cd1bf32..e6a0c2e 100755 --- a/BPTCEncoder/src/BC7Compressor.cpp +++ b/BPTCEncoder/src/BC7Compressor.cpp @@ -985,7 +985,7 @@ double BC7CompressionMode::CompressCluster(const RGBACluster &cluster, RGBAVecto bestIndices[i] = 1; } - return bestErr; + return cluster.GetNumPoints() * bestErr; } const uint32 nBuckets = (1 << GetNumberOfBitsPerIndex());