From 112bf2c5c37086e8475c1a1d95a5f0ae1c41082a Mon Sep 17 00:00:00 2001 From: castano Date: Mon, 27 Oct 2008 07:49:32 +0000 Subject: [PATCH] Fix error in CUDA single color compressor. --- src/nvtt/cuda/CompressKernel.cu | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/nvtt/cuda/CompressKernel.cu b/src/nvtt/cuda/CompressKernel.cu index 916e3a3..ce332d0 100644 --- a/src/nvtt/cuda/CompressKernel.cu +++ b/src/nvtt/cuda/CompressKernel.cu @@ -191,6 +191,9 @@ __device__ void loadColorBlock(const uint * image, float3 colors[16], float3 sum *sameColor = (axis == make_float3(0, 0, 0)); + // Single color compressor needs unweighted colors. + if (*sameColor) colors[idx] = rawColors[idx]; + dps[idx] = dot(rawColors[idx], axis); #if __DEVICE_EMULATION__