From 568f34d83809401182889866e3e2ff0db167aa1d Mon Sep 17 00:00:00 2001 From: castano Date: Mon, 21 Sep 2009 18:46:48 +0000 Subject: [PATCH] Fix color weighted compression for single color blocks. Fixes issue 96. --- 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 5d748cb..e829a7c 100644 --- a/src/nvtt/cuda/CompressKernel.cu +++ b/src/nvtt/cuda/CompressKernel.cu @@ -470,6 +470,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); __debugsync();