From 133db92180dd10041221e61bb051956711493746 Mon Sep 17 00:00:00 2001 From: Piers Daniell Date: Wed, 26 Aug 2020 16:36:10 -0600 Subject: [PATCH] Ignore helper pixel invocations with atomic operations tests The extra helper pixel invocations caused the test to access array elements that were out of bounds. The fix is to just ignore those invocations since they aren't part of the expected test results anyway. Affects: dEQP-VK.glsl.atomic_operations.* Components: Vulkan VK-GL-CTS issue: 2563 Change-Id: I1b700c007489dbe72db8bbeda0ca327aac3d055f --- .../shaderexecutor/vktAtomicOperationTests.cpp | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/external/vulkancts/modules/vulkan/shaderexecutor/vktAtomicOperationTests.cpp b/external/vulkancts/modules/vulkan/shaderexecutor/vktAtomicOperationTests.cpp index 85f4d85..b45b561 100644 --- a/external/vulkancts/modules/vulkan/shaderexecutor/vktAtomicOperationTests.cpp +++ b/external/vulkancts/modules/vulkan/shaderexecutor/vktAtomicOperationTests.cpp @@ -1083,10 +1083,22 @@ void AtomicOperationCase::createShaderSpec (void) ; } - nonVertexShaderTemplateStream - << "int idx = atomicAdd(buf.data.index, 1);\n" - << "buf.data.outputValues[idx] = ${ATOMICOP}(buf.data.inoutValues[idx % (${N}/2)], ${COMPARE_ARG}buf.data.inputValues[idx]);\n" - ; + if (m_shaderType.getType() == glu::SHADERTYPE_FRAGMENT) + { + nonVertexShaderTemplateStream + << "if (!gl_HelperInvocation) {\n" + << " int idx = atomicAdd(buf.data.index, 1);\n" + << " buf.data.outputValues[idx] = ${ATOMICOP}(buf.data.inoutValues[idx % (${N}/2)], ${COMPARE_ARG}buf.data.inputValues[idx]);\n" + << "}\n" + ; + } + else + { + nonVertexShaderTemplateStream + << "int idx = atomicAdd(buf.data.index, 1);\n" + << "buf.data.outputValues[idx] = ${ATOMICOP}(buf.data.inoutValues[idx % (${N}/2)], ${COMPARE_ARG}buf.data.inputValues[idx]);\n" + ; + } if (memoryType == AtomicMemoryType::SHARED) { -- 2.7.4