Disable BC7 mode 8 pattern generation
authorBoris Zanin <boris.zanin@mobica.com>
Tue, 1 Mar 2022 15:16:12 +0000 (16:16 +0100)
committerMatthew Netsch <quic_mnetsch@quicinc.com>
Thu, 10 Mar 2022 16:34:09 +0000 (16:34 +0000)
Due to BC7 is underspecified for mode 8 (LSB=0x00) tests
should avoid testing it. This commit avoids generation
mode 8 BC7 compressed blocks.

Affects tests:
 * dEQP-VK.*bc7*

Components: Framework, Vulkan

VK-GL-CTS issue: 3501

Change-Id: I222046f703fbead2bf5c64376defc6481989be24

external/vulkancts/modules/vulkan/pipeline/vktPipelineImageUtil.cpp

index 34c6eb4..67fe2ea 100644 (file)
@@ -961,6 +961,16 @@ void TestTexture::populateCompressedLevels (tcu::CompressedTexFormat format, con
                        if (format != tcu::COMPRESSEDTEXFORMAT_ETC1_RGB8)
                                for (int byteNdx = 0; byteNdx < compressedLevel->getDataSize(); byteNdx++)
                                        compressedData[byteNdx] = 0xFF & random.getUint32();
+
+                       // BC7 mode 8 (LSB==0x00) should not be tested as it is underspecified
+                       if (format == tcu::COMPRESSEDTEXFORMAT_BC7_UNORM_BLOCK || format == tcu::COMPRESSEDTEXFORMAT_BC7_SRGB_BLOCK)
+                       {
+                               const int blockSize = tcu::getBlockSize(format);
+
+                               for (int byteNdx = 0; byteNdx < compressedLevel->getDataSize(); byteNdx += blockSize)
+                                       while (compressedData[byteNdx] == 0x00)
+                                               compressedData[byteNdx] = 0xFF & random.getUint32();
+                       }
                }
 
                m_compressedLevels.push_back(compressedLevel);