Use LDR mode in astc.block_size_remainder sRGB cases
authorPyry Haulos <phaulos@google.com>
Thu, 19 Jan 2017 17:07:03 +0000 (09:07 -0800)
committerPyry Haulos <phaulos@google.com>
Thu, 19 Jan 2017 17:07:03 +0000 (09:07 -0800)
Bug: 34129132
Change-Id: Ibf6d8bbdab1f105796510dda71333ceeb619b50a

modules/gles3/functional/es3fASTCDecompressionCases.cpp

index 8954449..af32ff2 100644 (file)
@@ -568,9 +568,12 @@ ASTCBlockSizeRemainderCase2D::IterateResult ASTCBlockSizeRemainderCase2D::iterat
 
        // Create texture and render.
 
-       Surface                 renderedFrame   (imageWidth, imageHeight);
-       Surface                 referenceFrame  (imageWidth, imageHeight);
-       glu::Texture2D  texture                 (renderCtx, m_context.getContextInfo(), 1, &compressed, tcu::TexDecompressionParams(m_renderer->getASTCSupport() == ASTCSUPPORTLEVEL_LDR ? tcu::TexDecompressionParams::ASTCMODE_LDR : tcu::TexDecompressionParams::ASTCMODE_HDR));
+       const tcu::TexDecompressionParams::AstcMode     decompressionMode       = (m_renderer->getASTCSupport() == ASTCSUPPORTLEVEL_LDR || tcu::isAstcSRGBFormat(m_format))
+                                                                                                                                       ? tcu::TexDecompressionParams::ASTCMODE_LDR
+                                                                                                                                       : tcu::TexDecompressionParams::ASTCMODE_HDR;
+       Surface                                                                         renderedFrame           (imageWidth, imageHeight);
+       Surface                                                                         referenceFrame          (imageWidth, imageHeight);
+       glu::Texture2D                                                          texture                         (renderCtx, m_context.getContextInfo(), 1, &compressed, tcu::TexDecompressionParams(decompressionMode));
 
        m_renderer->render(referenceFrame, renderedFrame, texture, getUncompressedFormat(compressed.getFormat()));