From ec25a28945a4682349beca1224a4bd2c25723395 Mon Sep 17 00:00:00 2001 From: Graeme Leese Date: Wed, 22 Apr 2020 14:40:26 +0100 Subject: [PATCH] Fix verification in multisample image store tests The results were being verified for each sample but they were all being stored to the same pixel in the (single-sample) result image, meaning that only the last sample was actually checked. Have the shader calculate the correct result for the whole pixel before writing it out. Component: Vulkan VK-GL-CTS issue: 2310 Affects: dEQP-VK.pipeline.multisample_shader_builtin.image_write_sample.* Change-Id: Ibe1383d7922073af0661f818ebf8bfe9ab20b9fe --- .../vulkan/pipeline/vktPipelineMultisampleShaderBuiltInTests.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/external/vulkancts/modules/vulkan/pipeline/vktPipelineMultisampleShaderBuiltInTests.cpp b/external/vulkancts/modules/vulkan/pipeline/vktPipelineMultisampleShaderBuiltInTests.cpp index d788cf5..388e4bf 100644 --- a/external/vulkancts/modules/vulkan/pipeline/vktPipelineMultisampleShaderBuiltInTests.cpp +++ b/external/vulkancts/modules/vulkan/pipeline/vktPipelineMultisampleShaderBuiltInTests.cpp @@ -1254,14 +1254,16 @@ void WriteSampleTest::initPrograms (vk::SourceCollections& programCollection) co << " uvec2 ucoords = uvec2(gl_GlobalInvocationID.xy);\n" << " ivec2 icoords = ivec2(ucoords);\n" << " uint writeMask = ((ucoords.x << " << bpc << ") | ucoords.y);\n" + << " bool ok = true;\n" << " for (uint i = 0; i < " << count << "; ++i)\n" << " {\n" << " bool expectWrite = ((writeMask & (1 << i)) != 0);\n" << " vec4 sampleColor = imageLoad(writeImg, icoords, int(i));\n" << " vec4 wantedColor = (expectWrite ? wcolor : ccolor);\n" - << " vec4 resultColor = ((sampleColor == wantedColor) ? gcolor : bcolor);\n" - << " imageStore(verificationImg, icoords, resultColor);\n" + << " ok = ok && (sampleColor == wantedColor);\n" << " }\n" + << " vec4 resultColor = (ok ? gcolor : bcolor);\n" + << " imageStore(verificationImg, icoords, resultColor);\n" << "}\n" ; -- 2.7.4