fix order of swizzle vs scale
authorJeff Bolz <jbolz@nvidia.com>
Sun, 13 Dec 2015 20:41:21 +0000 (20:41 +0000)
committerJeff Bolz <jbolz@nvidia.com>
Mon, 14 Dec 2015 01:45:00 +0000 (01:45 +0000)
external/vulkancts/modules/vulkan/pipeline/vktPipelineReferenceRenderer.hpp

index 519b8dc..2e5df87 100644 (file)
@@ -255,11 +255,11 @@ public:
                        {
                                const tcu::Vec4 vtxTexCoord     = rr::readVarying<float>(packet, context, 1, fragNdx);
                                const tcu::Vec4 texColor        = sampleTexture(m_texture, m_sampler, vtxTexCoord, m_lod);
-                               const tcu::Vec4 normColor       = texColor * m_textureFormatInfo.lookupScale + m_textureFormatInfo.lookupBias;
+                               const tcu::Vec4 swizColor       = swizzle(texColor, m_swizzle);
+                               const tcu::Vec4 normColor       = swizColor * m_textureFormatInfo.lookupScale + m_textureFormatInfo.lookupBias;
                                const tcu::Vec4 color           = (normColor - m_colorFormatInfo.lookupBias) / m_colorFormatInfo.lookupScale;
-                               const tcu::Vec4 outColor        = swizzle(color, m_swizzle);
 
-                               rr::writeFragmentOutput(context, packetNdx, fragNdx, 0, outColor);
+                               rr::writeFragmentOutput(context, packetNdx, fragNdx, 0, color);
                        }
                }
        }