Don't access arrays out-of-bounds in robustness2 tests
authorConnor Abbott <cwabbott0@gmail.com>
Thu, 3 Dec 2020 14:05:30 +0000 (15:05 +0100)
committerAlexander Galazin <Alexander.Galazin@arm.com>
Thu, 7 Jan 2021 13:47:31 +0000 (13:47 +0000)
commit50f9a1f42e18926f049f9849fe6608a4439ea22c
treeb82389eba21faff57b80ddc9c8d65636ea496b34
parent527abc5dc3c1d537aa0bd1e7fb680e0112483341
Don't access arrays out-of-bounds in robustness2 tests

The SPIR-V spec says that indexing a pointer to an array with an
out-of-bounds index leads to undefined behavior. While
VK_EXT_robustness2 allows you to access outside the range of the
underlying descriptor, it doesn't change this fact, so we should be
careful to only access inside of the shader-declared array when testing
UBO's. For SSBO's we switch to using an unsized array to keep test
coverage of negative indices.

Affects:
dEQP-VK.robustness.robustness2.*

VK-GL-CTS Issue: 2649
Components: Vulkan

Change-Id: I60a4b80749278f4d81defdbe2abe116a1dcfa159
external/vulkancts/modules/vulkan/robustness/vktRobustnessExtsTests.cpp