Wrong assumption in robustness tests
authorMarcin Kańtoch <marcin.kantoch@amd.com>
Thu, 16 Feb 2023 16:45:33 +0000 (17:45 +0100)
committerPiotr Byszewski <piotr.byszewski@mobica.com>
Thu, 9 Mar 2023 18:04:11 +0000 (18:04 +0000)
Accept cases, such as <0.0f, 123.0f>, <123.0f, 0.0f>
for out of bounds memory, as those can be correctly
generated by the compiler.

VK-GL-CTS issue: 4288

Components: Vulkan

Affects:
dEQP-VK.robustness.robustness2.*

Change-Id: If54aedf4277d93b404056274e397e7f73c05872b

external/vulkancts/modules/vulkan/robustness/vktRobustnessExtsTests.cpp

index af3a5ff..2727652 100644 (file)
@@ -1263,9 +1263,24 @@ void RobustnessExtsTestCase::initPrograms (SourceCollections& programCollection)
                                        checks << "    else if (temp == zzzo) temp = " << vecType << "(0);\n";
 
                                // non-volatile value replaced with stored value
-                               if (supportsStores(m_data.descriptorType) && !m_data.vol)
+                               if (supportsStores(m_data.descriptorType) && !m_data.vol) {
                                        checks << "    else if (temp == " << getStoreValue(m_data.descriptorType, numComponents, vecType, bufType) << ") temp = " << vecType << "(0);\n";
 
+                                       if (m_data.descriptorType == VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC || m_data.descriptorType == VK_DESCRIPTOR_TYPE_STORAGE_BUFFER) {
+
+                                               for (int mask = (numComponents*numComponents) - 2; mask > 0; mask--) {
+                                                       checks << "    else if (temp == " << vecType << "(";
+                                                       for (int vecIdx = 0; vecIdx < 4; vecIdx++) {
+                                                               if (mask & (1 << vecIdx)) checks << storeValue;
+                                                               else checks << "0";
+
+                                                               if (vecIdx != 3) checks << ",";
+                                                       }
+                                                       checks << ")) temp = " << vecType << "(0);\n";
+                                               }
+                                       }
+                               }
+
                                // value straddling the boundary, returning a partial vector
                                if (expectedOOB2 != expectedOOB)
                                        checks << "    else if (c == inboundcoords && temp == " << expectedOOB2 << ") temp = " << vecType << "(0);\n";