From: Ricardo Garcia Date: Mon, 23 May 2022 14:43:16 +0000 (+0200) Subject: Add threshold to rasterization order depth checks X-Git-Tag: upstream/1.3.5~274^2~5 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3a39741ff6e791d36d77e1c35899842083618651;p=platform%2Fupstream%2FVK-GL-CTS.git Add threshold to rasterization order depth checks These tests compared floating point depth values expecting exact matches, which was causing trouble for some implementations. This commit adds an error threshold to the check. Affected tests: dEQP-VK.rasterization.rasterization_order_attachment_access.depth.* Components: Vulkan VK-GL-CTS issue: 3711 Change-Id: If6798dfd473f57341775e83d68188e39bdf27caa --- diff --git a/external/vulkancts/modules/vulkan/rasterization/vktRasterizationOrderAttachmentAccessTests.cpp b/external/vulkancts/modules/vulkan/rasterization/vktRasterizationOrderAttachmentAccessTests.cpp index 1b4df33..263a487 100644 --- a/external/vulkancts/modules/vulkan/rasterization/vktRasterizationOrderAttachmentAccessTests.cpp +++ b/external/vulkancts/modules/vulkan/rasterization/vktRasterizationOrderAttachmentAccessTests.cpp @@ -559,22 +559,27 @@ void AttachmentAccessOrderDepthTestCase::addShadersInternal(SourceCollections& p << " out0.y = curIndex + 1 + gl_SampleID + zero;\n"; if (m_sampleCount != VK_SAMPLE_COUNT_1_BIT) { - fragShader << " gl_FragDepth = 0.125 * (float(curIndex) / float(total)) + gl_SampleID / 128.0;\n"; + fragShader << " gl_FragDepth = 0.125 * (float(curIndex) / float(total)) + gl_SampleID / 128.0;\n"; } fragShader << " }\n" - << " else if (ds.x == 0.125 * float(curIndex - 1) / float(total) + gl_SampleID / 128.0)\n" + << " else\n" << " {\n" - << " out0.x = color.x;\n" - << " out0.y = curIndex + 1 + gl_SampleID + zero;\n"; + << " const float expected = 0.125 * float(curIndex - 1) / float(total) + gl_SampleID / 128.0;\n" + << " const float threshold = 0.0000001;\n" + << " if (ds.x >= expected - threshold && ds.x <= expected + threshold)\n" + << " {\n" + << " out0.x = color.x;\n" + << " out0.y = curIndex + 1 + gl_SampleID + zero;\n"; if (m_sampleCount != VK_SAMPLE_COUNT_1_BIT) { - fragShader << " gl_FragDepth = 0.125 * (float(curIndex) / float(total)) + gl_SampleID / 128.0;\n"; + fragShader << " gl_FragDepth = 0.125 * (float(curIndex) / float(total)) + gl_SampleID / 128.0;\n"; } - fragShader << " }\n" - << " else\n" - << " {\n" - << " out0.y = 0;\n" - << " out0.x = 1u;\n" + fragShader << " }\n" + << " else\n" + << " {\n" + << " out0.y = 0;\n" + << " out0.x = 1u;\n" + << " }\n" << " }\n" << "}\n";