Fix verification in robust buffer access tests
authorDae Kim <dae.kim@imgtec.com>
Tue, 20 Feb 2018 13:37:39 +0000 (13:37 +0000)
committerDae Kim <dae.kim@imgtec.com>
Fri, 23 Feb 2018 09:18:35 +0000 (09:18 +0000)
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

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

index d4688ba..9e38cd7 100644 (file)
@@ -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)