From 645dd21f3b009f1dc0475b7990126a952092a600 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marcin=20Ka=C5=84toch?= Date: Thu, 16 Feb 2023 17:45:33 +0100 Subject: [PATCH] Wrong assumption in robustness tests 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 --- .../vulkan/robustness/vktRobustnessExtsTests.cpp | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/external/vulkancts/modules/vulkan/robustness/vktRobustnessExtsTests.cpp b/external/vulkancts/modules/vulkan/robustness/vktRobustnessExtsTests.cpp index af3a5ff..2727652 100644 --- a/external/vulkancts/modules/vulkan/robustness/vktRobustnessExtsTests.cpp +++ b/external/vulkancts/modules/vulkan/robustness/vktRobustnessExtsTests.cpp @@ -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"; -- 2.7.4