Fix for 16 to 8-bit storage spirv_assembly tests
authorGary Sweet <gsweet@broadcom.com>
Thu, 24 Nov 2022 09:16:09 +0000 (09:16 +0000)
committerGary Sweet <gsweet@broadcom.com>
Thu, 24 Nov 2022 09:22:45 +0000 (09:22 +0000)
The output buffer was being made smaller than it was required to
hold all the results. Robust buffer accesss prevented the writes
from trampling memory after the buffer, but could mean that the
data in the valid part of the buffer was incorrectly written instead.

This change makes the output buffer large enough to prevent the
out-of-bounds writes.

Components: Vulkan

VK-GL-CTS issue: 4126

Affected tests:
dEQP-VK.spirv_assembly.instruction.graphics.8bit_storage.storagebuffer_int_16_to_8.*

Change-Id: I59145be8012f7a31037ee3fee4d7ac96a198bc00

external/vulkancts/modules/vulkan/spirv_assembly/vktSpvAsm8bitStorageTests.cpp

index 275e238..b54e1fc 100644 (file)
@@ -3659,7 +3659,7 @@ void addGraphics8BitStorageUniformInt16To8Group (tcu::TestCaseGroup* testGroup)
                resources.inputs.clear();
                resources.outputs.clear();
                vector<deInt16>                                         inputs  = getInt16s(rnd, ((arrayStrideInBytesUniform / static_cast<deUint32>(sizeof(deInt16))) * numDataPoints) / categories[catIdx].numElements);
-               vector<deInt8>                                          outputs (numDataPoints/ categories[catIdx].numElements);
+               vector<deInt8>                                          outputs (numDataPoints);
 
                switch (categories[catIdx].numElements)
                {