swr: [rasterizer jitter] don't bother quantizing unused channels
authorIlia Mirkin <imirkin@alum.mit.edu>
Sat, 12 Nov 2016 18:17:27 +0000 (13:17 -0500)
committerIlia Mirkin <imirkin@alum.mit.edu>
Wed, 16 Nov 2016 01:24:50 +0000 (20:24 -0500)
In a BGR10X2 or BGR5X1 situation, there's no need to try to quantize the
X channel - the default will have the proper quantization required.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Bruce Cherniak <bruce.cherniak@intel.com>
src/gallium/drivers/swr/rasterizer/jitter/blend_jit.cpp

index b5b21c0d33293da2769cd9133ee572a4e251195f..ad809c4e149f33c725f46dee9410a736052d5b17 100644 (file)
@@ -220,7 +220,7 @@ struct BlendJit : public Builder
         const SWR_FORMAT_INFO& info = GetFormatInfo(format);
         for (uint32_t c = 0; c < info.numComps; ++c)
         {
-            if (info.bpc[c] <= QUANTIZE_THRESHOLD)
+            if (info.bpc[c] <= QUANTIZE_THRESHOLD && info.type[c] != SWR_TYPE_UNUSED)
             {
                 uint32_t swizComp = info.swizzle[c];
                 float factor = (float)((1 << info.bpc[c]) - 1);