From c4ce325f163cc100a94b2972e31255d5271fcfcb Mon Sep 17 00:00:00 2001 From: Dae Kim Date: Tue, 20 Feb 2018 13:37:39 +0000 Subject: [PATCH] Fix verification in robust buffer access tests Some buffer accesses to addresses less than 16 bytes away from the out of bounds address where not considered potentially out of bounds, even when there were out of bounds accesses in the same SPIR-V block. Affects: dEQP-VK.robustness.buffer_access.*: Components: Vulkan VK-GL-CTS issue: 1025 Change-Id: Ibcb61fb84cecc360d753ba5d3acc1f9d48169651 --- .../vulkan/robustness/vktRobustnessBufferAccessTests.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/external/vulkancts/modules/vulkan/robustness/vktRobustnessBufferAccessTests.cpp b/external/vulkancts/modules/vulkan/robustness/vktRobustnessBufferAccessTests.cpp index d4688ba..9e38cd7 100644 --- a/external/vulkancts/modules/vulkan/robustness/vktRobustnessBufferAccessTests.cpp +++ b/external/vulkancts/modules/vulkan/robustness/vktRobustnessBufferAccessTests.cpp @@ -1146,12 +1146,14 @@ bool BufferAccessInstance::verifyResult (void) logValue(logMsg, outValuePtr, m_bufferFormat, outValueSize); if (m_accessOutOfBackingMemory) + { isOutOfBoundsAccess = true; - - // Check if the shader operation accessed an operand located less than 16 bytes away - // from the out of bounds address. - if (!isOutOfBoundsAccess && distanceToOutOfBounds < 16) + } + else { + // Check if the shader operation accessed an operand located less than 16 bytes away + // from the out of bounds address. + deUint32 operandSize = 0; switch (m_shaderType) @@ -1176,7 +1178,8 @@ bool BufferAccessInstance::verifyResult (void) DE_ASSERT(false); } - isOutOfBoundsAccess = (((offsetInBytes / operandSize) + 1) * operandSize > maxAccessRange); + isOutOfBoundsAccess = (maxAccessRange < 16) + || (((offsetInBytes / operandSize + 1) * operandSize) > (maxAccessRange - 16)); } if (isOutOfBoundsAccess) -- 2.7.4